Class CSAgentProtocolPayloadParser
- java.lang.Object
-
- org.certificateservices.messages.csmessages.BasePayloadParser
-
- org.certificateservices.messages.csagent.CSAgentProtocolPayloadParser
-
- All Implemented Interfaces:
PayloadParser
public class CSAgentProtocolPayloadParser extends BasePayloadParser
Payload Parser for generating CS Agent Protocol messages according to cs_agent_protocol_schema2_0.xsd
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCS_AGENT_PROTOCOL_XSD_SCHEMA_2_0_RESOURCE_LOCATIONstatic java.lang.StringNAMESPACE-
Fields inherited from class org.certificateservices.messages.csmessages.BasePayloadParser
config, csMessageObjectFactory, customCSMessageParser, payloadVersion, secProv
-
-
Constructor Summary
Constructors Constructor Description CSAgentProtocolPayloadParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]genDiscoveredCredentialDataRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String agentId, java.lang.String scanId, java.util.Date scanTimeStamp, java.util.List<DiscoveredCredentialData> discoveredCredentialDataList, Credential originator, java.util.List<java.lang.Object> assertions)Method to create a DiscoveredCredentialsRequest to report all found credentials found to get a list of credential hashes of certificates not known centrally.CSMessageResponseDatagenDiscoveredCredentialDataResponse(java.lang.String relatedEndEntity, CSMessage request)Method to create a DiscoveredCredentialDataResponse sent after successful processing of request.byte[]genDiscoveredCredentialsRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String agentId, java.lang.String scanId, java.util.Date scanTimeStamp, java.util.List<DiscoveredCredential> discoveredCredentials, Credential originator, java.util.List<java.lang.Object> assertions)Method to create a DiscoveredCredentialsRequest to report all found credentials found to get a list of credential hashes of certificates not known centrally.CSMessageResponseDatagenDiscoveredCredentialsResponse(java.lang.String relatedEndEntity, CSMessage request, java.util.List<java.lang.String> hashValues)Method to create a DiscoveredCredentialsResponse containing the hashes of all centrally unknown certificates.protected java.lang.StringgetDefaultPayloadVersion()java.lang.StringgetJAXBPackage()Method that returns the JAXBPackage Name for the package name containing the JAXB classes.java.lang.StringgetNameSpace()java.io.InputStreamgetSchemaAsInputStream(java.lang.String payLoadVersion)Method that should return the location of the schema for a given payLoadVersion, it should be accessable as a class resource using getClass().getResourceAsStream()protected java.lang.String[]getSupportedVersions()-
Methods inherited from class org.certificateservices.messages.csmessages.BasePayloadParser
generateGetApprovalRequest, generateIsApprovedRequest, getAssertions, getCSMessageParser, getPayload, getPayloadVersion, getRelatedSchemas, getResponseStatus, init, init, isPayloadVersionSupported, parseMessage, parseMessage, parseMessage, setPayloadVersion
-
-
-
-
Field Detail
-
NAMESPACE
public static java.lang.String NAMESPACE
-
CS_AGENT_PROTOCOL_XSD_SCHEMA_2_0_RESOURCE_LOCATION
public static final java.lang.String CS_AGENT_PROTOCOL_XSD_SCHEMA_2_0_RESOURCE_LOCATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getJAXBPackage
public java.lang.String getJAXBPackage()
Description copied from interface:PayloadParserMethod that returns the JAXBPackage Name for the package name containing the JAXB classes. For multiple package names use a ':' without spaces.- See Also:
PayloadParser.getJAXBPackage()
-
getNameSpace
public java.lang.String getNameSpace()
- Returns:
- the related pay load elements unique name space.
- See Also:
PayloadParser.getNameSpace()
-
getSchemaAsInputStream
public java.io.InputStream getSchemaAsInputStream(java.lang.String payLoadVersion) throws MessageContentException, MessageProcessingExceptionDescription copied from interface:PayloadParserMethod that should return the location of the schema for a given payLoadVersion, it should be accessable as a class resource using getClass().getResourceAsStream()- Throws:
MessageContentException- if given version isn't supported.MessageProcessingException- if problems occurred setting up the stream.- See Also:
PayloadParser.getSchemaAsInputStream(String)
-
getSupportedVersions
protected java.lang.String[] getSupportedVersions()
- Specified by:
getSupportedVersionsin classBasePayloadParser- Returns:
- an array of version numbers of payload that is supported by this parser.
- See Also:
BasePayloadParser.getSupportedVersions()
-
getDefaultPayloadVersion
protected java.lang.String getDefaultPayloadVersion()
- Specified by:
getDefaultPayloadVersionin classBasePayloadParser- Returns:
- returns the payload version used by default when generating request messages.
- See Also:
BasePayloadParser.getDefaultPayloadVersion()
-
genDiscoveredCredentialsRequest
public byte[] genDiscoveredCredentialsRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String agentId, java.lang.String scanId, java.util.Date scanTimeStamp, java.util.List<DiscoveredCredential> discoveredCredentials, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod to create a DiscoveredCredentialsRequest to report all found credentials found to get a list of credential hashes of certificates not known centrally.- Parameters:
requestId- the id of the requestdestinationId- the destinationId used in the CSMessage.organisation- the related organisationagentId- The id of this agent sending in requests. (Required)scanId- The id of this scanning session. (Required)scanTimeStamp- The time the scan was sent in. (Required)discoveredCredentials- Contains a list between 1 and 100 DiscoveredCredential of all credentials found on the network.originator- the original requester of a message, null if not applicableassertions- a list of related authorization assertions, or null if no authorization assertions is available.- Returns:
- generated and signed CSMessage in byte[] format.
- Throws:
MessageContentException- if CS message contained invalid data not conforming to the standard.MessageProcessingException- if internal state occurred when processing the CSMessage
-
genDiscoveredCredentialsResponse
public CSMessageResponseData genDiscoveredCredentialsResponse(java.lang.String relatedEndEntity, CSMessage request, java.util.List<java.lang.String> hashValues) throws MessageContentException, MessageProcessingException
Method to create a DiscoveredCredentialsResponse containing the hashes of all centrally unknown certificates.- Parameters:
relatedEndEntity- the name of the related end entity (such as username of the related user)request- the request to populate the response withhashValues- Contains a list of 0 to 100 of unknown credential hashes.- Returns:
- a generated message.
- Throws:
MessageContentException- if CS message contained invalid data not conforming to the standard.MessageProcessingException- if internal state occurred when processing the CSMessage
-
genDiscoveredCredentialDataRequest
public byte[] genDiscoveredCredentialDataRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.lang.String agentId, java.lang.String scanId, java.util.Date scanTimeStamp, java.util.List<DiscoveredCredentialData> discoveredCredentialDataList, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod to create a DiscoveredCredentialsRequest to report all found credentials found to get a list of credential hashes of certificates not known centrally.- Parameters:
requestId- the id of the requestdestinationId- the destinationId used in the CSMessage.organisation- the related organisationagentId- The id of this agent sending in requests. (Required)scanId- The id of this scanning session. (Required)scanTimeStamp- The time the scan was sent in. (Required)discoveredCredentialDataList- Contains a list between 1 and 100 DiscoveredCredentialData of all credentials found on the network.originator- the original requester of a message, null if not applicableassertions- a list of related authorization assertions, or null if no authorization assertions is available.- Returns:
- generated and signed CSMessage in byte[] format.
- Throws:
MessageContentException- if CS message contained invalid data not conforming to the standard.MessageProcessingException- if internal state occurred when processing the CSMessage
-
genDiscoveredCredentialDataResponse
public CSMessageResponseData genDiscoveredCredentialDataResponse(java.lang.String relatedEndEntity, CSMessage request) throws MessageContentException, MessageProcessingException
Method to create a DiscoveredCredentialDataResponse sent after successful processing of request.- Parameters:
relatedEndEntity- the name of the related end entity (such as username of the related user)request- the request to populate the response with- Returns:
- a generated message.
- Throws:
MessageContentException- if CS message contained invalid data not conforming to the standard.MessageProcessingException- if internal state occurred when processing the CSMessage
-
-