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 TypeMethodDescriptionvoid
Ensures that all required properties have been assigned.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 thestateless
flag isfalse
also 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 aSignResponse
message.Gets the state cache instance that is used by the processor.void
setBase64Encoded
(boolean base64Encoded) Tells whether we should Base64 encode the state objects if running in a stateless mode.void
setConfigurationManager
(ConfigurationManager configurationManager) Assigns the policy configuration manager bean.void
setStateCache
(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 thestateless
flag isfalse
also adds the state to the state cache (seeSignatureStateProcessor.getStateCache()
).The
requestInput
parameter 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:
createSignatureState
in 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 aSignResponse
message.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:
getSignatureState
in 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:
getStateCache
in 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
-