Package com.protegrity.ap.java
Class CoreproviderAdapter
java.lang.Object
com.protegrity.ap.java.CoreproviderAdapter
Adapter for communication with Protegrity Core Provider services.
This class handles low-level HTTP communication with the Protegrity API for data protection operations. It manages data type conversions, encoding/decoding, and request/response handling.
- Since:
- 1.0.1
-
Constructor Summary
ConstructorsConstructorDescriptionCoreproviderAdapter(SessionHandler sessionHandler) Constructs a new CoreproviderAdapter with the specified session handler. -
Method Summary
Modifier and TypeMethodDescriptionbuildProtectPayload(String user, String dataElementName, String[] input, byte[] externalIv, String encodingType) buildReprotectPayload(String user, String newDataElementName, String oldDataElementName, String[] input, byte[] newExternalIv, byte[] oldExternalIv, String encodingType) byte[][]convertToByteArray(Object input, String encoding) String[]convertToStringArray(Object input) Converts various array types to String array.String[]decodeBase64ToUtf8Strings(String[] base64Input) Decodes Base64-encoded strings to UTF-8 strings.voidflush()parseResultsToOutput(SessionObject sessionObj, String jsonResponse, Class<?> targetType, String encodingType) sendApiRequest(String operationType, String jwtToken, String apiKey, String jsonPayload)
-
Constructor Details
-
CoreproviderAdapter
Constructs a new CoreproviderAdapter with the specified session handler.- Parameters:
sessionHandler- the session handler for managing user sessions- Throws:
ProtectorException- if initialization fails
-
-
Method Details
-
convertToStringArray
Converts various array types to String array.Supports conversion from primitive arrays (short[], int[], long[], float[], double[]), char[][], byte[][], and Date[] to String[].
- Parameters:
input- the input array to convert- Returns:
- String array representation of the input
- Throws:
IllegalArgumentException- if the input type is not supported
-
decodeBase64ToUtf8Strings
Decodes Base64-encoded strings to UTF-8 strings.- Parameters:
base64Input- array of Base64-encoded strings- Returns:
- array of decoded UTF-8 strings
-
sendApiRequest
public String sendApiRequest(String operationType, String jwtToken, String apiKey, String jsonPayload) throws ProtectorException - Throws:
ProtectorException
-
buildProtectPayload
public String buildProtectPayload(String user, String dataElementName, String[] input, byte[] externalIv, String encodingType) throws ProtectorException - Throws:
ProtectorException
-
buildReprotectPayload
public String buildReprotectPayload(String user, String newDataElementName, String oldDataElementName, String[] input, byte[] newExternalIv, byte[] oldExternalIv, String encodingType) throws ProtectorException - Throws:
ProtectorException
-
parseResultsToOutput
public ParseResult parseResultsToOutput(SessionObject sessionObj, String jsonResponse, Class<?> targetType, String encodingType) throws ProtectorException - Throws:
ProtectorException
-
getVersion
-
getCoreVersion
-
flush
- Throws:
ProtectorException
-
convertToByteArray
-