Class DefaultSignatureStateProcessor
- All Implemented Interfaces:
SignatureStateProcessor
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidEnsures that all required properties have been assigned.se.idsec.signservice.integration.core.SignatureStatecreateSignatureState(se.idsec.signservice.integration.SignRequestInput requestInput, SignRequestWrapper signRequest, boolean stateless, String ownerId) Creates a signature state, and if thestatelessflag isfalsealso adds the state to the state cache (seeSignatureStateProcessor.getStateCache()).getSignatureState(se.idsec.signservice.integration.core.SignatureState inputState, String requesterId) Should be called during processing of aSignResponsemessage.Gets the state cache instance that is used by the processor.voidsetBase64Encoded(boolean base64Encoded) Tells whether we should Base64 encode the state objects if running in a stateless mode.voidsetConfigurationManager(ConfigurationManager configurationManager) Assigns the policy configuration manager bean.voidsetStateCache(IntegrationServiceStateCache stateCache) Assigns the state cache.
-
Constructor Details
-
DefaultSignatureStateProcessor
public DefaultSignatureStateProcessor()
-
-
Method Details
-
createSignatureState
public se.idsec.signservice.integration.core.SignatureState createSignatureState(se.idsec.signservice.integration.SignRequestInput requestInput, SignRequestWrapper signRequest, boolean stateless, String ownerId) Creates a signature state, and if thestatelessflag isfalsealso adds the state to the state cache (seeSignatureStateProcessor.getStateCache()).The
requestInputparameter that is passed must be a "complete" input object, meaning that the instance that is passed must be the instance that is obtained from a call toSignRequestProcessor.preProcess(SignRequestInput, IntegrationServiceConfiguration, String).- Specified by:
createSignatureStatein interfaceSignatureStateProcessor- Parameters:
requestInput- a fully populated sign request inputsignRequest- the SignRequest that is passed to the signature servicestateless- tells whether this service is running is stateless mode or notownerId- the ID for the caller (optional)- Returns:
- a SignatureState
-
getSignatureState
public SignatureSessionState getSignatureState(se.idsec.signservice.integration.core.SignatureState inputState, String requesterId) throws StateException, se.idsec.signservice.integration.core.error.NoAccessException Should be called during processing of aSignResponsemessage.In the call to
SignServiceIntegrationService.processSignResponse(String, String, SignatureState, se.idsec.signservice.integration.SignResponseProcessingParameters)that state is supplied by the caller. The state that is supplied should be the same state as received from callingSignatureStateProcessor.createSignatureState(SignRequestInput, SignRequestWrapper, boolean, String).- Specified by:
getSignatureStatein interfaceSignatureStateProcessor- Parameters:
inputState- the state received from the callerrequesterId- the requesting actor's id (may be null)- Returns:
- a fully populated signature session state
- Throws:
StateException- for state errorsse.idsec.signservice.integration.core.error.NoAccessException- if the state belongs to someone else (than requesterId)
-
getStateCache
Gets the state cache instance that is used by the processor.- Specified by:
getStateCachein interfaceSignatureStateProcessor- Returns:
- the IntegrationServiceStateCache instance
-
setStateCache
Assigns the state cache.- Parameters:
stateCache- the state cache
-
setConfigurationManager
Assigns the policy configuration manager bean.- Parameters:
configurationManager- the policy configuration manager
-
setBase64Encoded
public void setBase64Encoded(boolean base64Encoded) Tells whether we should Base64 encode the state objects if running in a stateless mode.- Parameters:
base64Encoded- true if objects should be encoded
-
afterPropertiesSet
Ensures that all required properties have been assigned.Note: If executing in a Spring Framework environment this method is automatically invoked after all properties have been assigned. Otherwise it should be explicitly invoked.
- Throws:
Exception- if not all settings are correct
-