GW2FileSessionStatus
GW2FileSessionStatus 함수는 제공된 세션에서 마지막으로 처리된 파일에 대해 수행된 처리를 상위 수준에서 설명하는 문자열을 제공합니다.
- C++
- C#
- Java
- Python
- JavaScript
#include "glasswall.core2.api.h"
int GW2FileSessionStatus(
Session session,
int *glasswallSessionStatus,
char **statusMsgBuffer,
size_t *statusBufferLength);
매개변수
session GW2OpenSession에서 반환된 세션의 ID
glasswallSessionStatus An integer output parameter describing the return status of the session as it relates to the last file that was processed. See the Return Types table for an explanation of glasswallSessionStatus.
statusMsgBuffer 세션에서 마지막으로 처리된 파일에 수행된 처리 내용을 상위 수준에서 설명하는 문자열 포인터 출력 매개변수입니다. 예: "Sanitisation Applied, Remedies Applied". 이 포인터에 사용된 메모리는 사용자가 해제할 필요가 없습니다.
statusBufferLength statusMsgBuffer가 가리키는 메모리의 크기(바이트 단위)로 채워지는 출력 매개변수입니다.
반환값
함수 호출이 성공했는지를 나타내는 정수를 반환합니다. 음수는 실패를 나타냅니다. 반환 코드에 대한 설명은 Return Types 표를 참조하세요. session이 유효하지 않으면 glasswallSessionStatus, statusMsgBuffer 및 statusBufferLength는 정의되지 않습니다.
개요
/// <param name="session">Current open Glasswall session</param>
/// <param name="gwSessionStatus">Session status value</param>
/// <param name="outputBuffer">String that describes, at a high level, the processing carried out on the last document </param>
/// <param name="bufferLength">Size of the outputBuffer</param>
public int FileSessionStatus(
int session,
out IntPtr gwSessionStatus,
out IntPtr outputBuffer,
ref UIntPtr bufferLength)
반환값
session이 유효하지 않으면 -1을 반환합니다. session이 유효하면 함수는 0을 반환하고 gwSessionStatus, outputBuffer 및 bufferLength가 채워집니다.
개요
import com.glasswall.core2javabridge.*;
public FileSessionStatus GW2FileSessionStatusResult(int session) throws GlasswallException
참고
이 기능은 이전에는 ID 데이터를 가져오기 위해 세 번의 개별 함수 호출이 필요했습니다. 이제는 설정을 FileSessionStatus 객체로 반환하도록 간소화되었습니다. 기존의 세 함수는 더 이상 사용되지 않습니다.
반환값
The GW2FileSessionStatusResult function returns a FileSessionStatus object containing the session summary status, and the session summary description.
FileSessionStatus 객체에는 함수가 호출되는 시점의 session 상태를 설명하는 두 개의 변수가 포함되어 있습니다. 다음과 같습니다:
| 변수 | 설명 |
|---|---|
int summaryStatus | 수행된 전체 작업을 나타내는 상태 |
String summaryDescription | 수행된 전체 작업에 대한 설명 |
GlasswallException 예외는 session이 유효하지 않거나 세션 상태 정보를 가져올 수 없는 경우 발생합니다.
개요 - 지원 중단된 함수
import com.glasswall.core2javabridge.*;
(Deprecated)
public int GW2FileSessionStatus(int session) throws GlasswallException
public int GetFileSessionStatusInt(int session) throws GlasswallException
public byte[] GetStatusBuffer(int session) throws GlasswallException
설명
GW2FileSessionStatus 함수는 session으로 지정된 세션에 대해 세션 상태 정보를 가져올 수 있었는지를 나타내는 상태를 반환합니다.
GetFileSessionStatusInt 함수를 사용하여 세션 요약 상태를 가져옵니다.
GetStatusBuffer 함수를 사용하여 세션 요약 상태 데이터를 가져옵니다.
반환값 - 지원 중단된 함수
GW2FileSessionStatus 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하세요.
GetStatusBuffer 함수는 지정된 세션에 대한 요약 설명이 포함된 바이트 배열 버퍼를 반환합니다. GW2FileSessionStatus가 호출되지 않은 경우 이는 null입니다.
GetFileSessionStatusInt 함수는 수행된 전체 작업을 나타내는 상태를 반환합니다.
GlasswallException 예외는 session이 유효하지 않거나 session 상태 정보를 가져올 수 없는 경우 발생합니다.
개요
Glasswall 세션 상태 메시지를 가져옵니다. 수행된 처리에 대한 상위 수준의 표시를 제공합니다.
def file_session_status_message(self, session: int, raise_unsupported: bool = True) -> str:
""" Retrieves the Glasswall session status message. Gives a high level indication of the processing that was carried out.
Args:
session (int): The session integer.
raise_unsupported (bool, optional): Default True. Raise exceptions when Glasswall encounters an error. Fail silently if False.
Returns:
result.message (str):The file session status message.
"""
반환값
문자열 형식의 파일 세션 상태 메시지입니다.
개요
/**
* This function retrieves the Glasswall Session Status. This status gives a high level indication of the processing
* that was carried out on the last document processed by the library
*/
GW2FileSessionStatus(session,
glasswallSessionStatus,
statusMsgBuffer,
statusBufferLength)
반환값
session이 유효하지 않으면 -1을 반환하며 glasswallSessionStatus, statusMsgBuffer, statusBufferLength는 정의되지 않습니다. session이 유효하면 함수는 0을 반환하며 glasswallSessionStatus, statusMsgBuffer, statusBufferLength가 채워집니다.
예제
function getFileSessionStatus(session_id, gw) {
/*
Glasswall API signature:
int GW2FileSessionStatus(
Session session,
int *glasswallSessionStatus,
char **statusMsgBuffer,
size_t *statusBufferLength
);
*/
// allocate space to store the session status; use .deref() to extract it
let glasswallSessionStatus = ref.alloc('int');
let CString_ptr = ref.refType(ref.types.CString);
let statusMsgBuffer = ref.alloc(CString_ptr);
// allocate space to store the buffer length; use .deref() to extract it
let statusBufferLength = ref.alloc('size_t');
let rv = gw.GW2FileSessionStatus(session_id, glasswallSessionStatus, statusMsgBuffer, statusBufferLength);
arr_buf = buffer_to_array(statusMsgBuffer, statusBufferLength)
// console.log(arr_buf.toString());
let message = `\n GW2FileSessionStatus:return=${rv}`;
message += "\n glasswallSessionStatus = " + glasswallSessionStatus.deref();
message += "\n statusMsgBuffer = \"" + arr_buf.toString() + '"';
message += "\n statusBufferLength = " + statusBufferLength.deref();
return message;
}