Class AuthorizationPayloadParser
- java.lang.Object
-
- org.certificateservices.messages.csmessages.BasePayloadParser
-
- org.certificateservices.messages.authorization.AuthorizationPayloadParser
-
- All Implemented Interfaces:
PayloadParser
public class AuthorizationPayloadParser extends BasePayloadParser
Payload Parser for generating Authorization messages according to authorization2_0.xsd
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTHORIZATION_XSD_SCHEMA_2_0_RESOURCE_LOCATIONstatic java.lang.StringAUTHORIZATION_XSD_SCHEMA_2_1_RESOURCE_LOCATIONstatic java.lang.StringAUTHORIZATION_XSD_SCHEMA_2_2_RESOURCE_LOCATIONstatic java.lang.StringAUTHORIZATION_XSD_SCHEMA_2_3_RESOURCE_LOCATIONstatic java.lang.StringNAMESPACE-
Fields inherited from class org.certificateservices.messages.csmessages.BasePayloadParser
config, csMessageObjectFactory, customCSMessageParser, payloadVersion, secProv
-
-
Constructor Summary
Constructors Constructor Description AuthorizationPayloadParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]genGetRequesterRolesRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.util.List<java.lang.String> tokenTypeQuery, Credential originator, java.util.List<java.lang.Object> assertions)Method to create a GetRequesterRolesRequest message with a list of token type permission queries..byte[]genGetRequesterRolesRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, Credential originator, java.util.List<java.lang.Object> assertions)Method to create a GetRequesterRolesRequest message without any token type query.CSMessageResponseDatagenGetRequesterRolesResponse(java.lang.String relatedEndEntity, CSMessage request, java.util.List<java.lang.String> roles, java.util.Collection<TokenTypePermission> tokenTypePermissions, java.util.List<java.lang.Object> assertions)Method to a GetRequesterRolesResponse message and populating it with the all requesters authorized roles.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
-
AUTHORIZATION_XSD_SCHEMA_2_0_RESOURCE_LOCATION
public static final java.lang.String AUTHORIZATION_XSD_SCHEMA_2_0_RESOURCE_LOCATION
- See Also:
- Constant Field Values
-
AUTHORIZATION_XSD_SCHEMA_2_1_RESOURCE_LOCATION
public static final java.lang.String AUTHORIZATION_XSD_SCHEMA_2_1_RESOURCE_LOCATION
- See Also:
- Constant Field Values
-
AUTHORIZATION_XSD_SCHEMA_2_2_RESOURCE_LOCATION
public static final java.lang.String AUTHORIZATION_XSD_SCHEMA_2_2_RESOURCE_LOCATION
- See Also:
- Constant Field Values
-
AUTHORIZATION_XSD_SCHEMA_2_3_RESOURCE_LOCATION
public static final java.lang.String AUTHORIZATION_XSD_SCHEMA_2_3_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()
-
genGetRequesterRolesRequest
public byte[] genGetRequesterRolesRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod to create a GetRequesterRolesRequest message without any token type query.- Parameters:
requestId- the id of the requestdestinationId- the destinationId used in the CSMessage.organisation- the related organisationoriginator- 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
-
genGetRequesterRolesRequest
public byte[] genGetRequesterRolesRequest(java.lang.String requestId, java.lang.String destinationId, java.lang.String organisation, java.util.List<java.lang.String> tokenTypeQuery, Credential originator, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingExceptionMethod to create a GetRequesterRolesRequest message with a list of token type permission queries..- Parameters:
requestId- the id of the requestdestinationId- the destinationId used in the CSMessage.organisation- the related organisationtokenTypeQuery- a list of token types that should be checked for authorization.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
-
genGetRequesterRolesResponse
public CSMessageResponseData genGetRequesterRolesResponse(java.lang.String relatedEndEntity, CSMessage request, java.util.List<java.lang.String> roles, java.util.Collection<TokenTypePermission> tokenTypePermissions, java.util.List<java.lang.Object> assertions) throws MessageContentException, MessageProcessingException
Method to a GetRequesterRolesResponse message and populating it with the all requesters authorized roles.- Parameters:
relatedEndEntity- the name of the related end entity (such as username of the related user)request- the request to populate the response withroles- the authorized roles of the requester.assertions- a list of related authorization assertions, or null if no authorization assertions is available.- 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
-
-