Class DefaultSignatureStateProcessor

java.lang.Object
se.idsec.signservice.integration.state.impl.DefaultSignatureStateProcessor
All Implemented Interfaces:
SignatureStateProcessor

public class DefaultSignatureStateProcessor extends Object implements SignatureStateProcessor
Default implementation for signature state processing.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • 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 the stateless flag is false also adds the state to the state cache (see SignatureStateProcessor.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 to SignRequestProcessor.preProcess(SignRequestInput, IntegrationServiceConfiguration, String).

      Specified by:
      createSignatureState in interface SignatureStateProcessor
      Parameters:
      requestInput - a fully populated sign request input
      signRequest - the SignRequest that is passed to the signature service
      stateless - tells whether this service is running is stateless mode or not
      ownerId - 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 a SignResponse 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 calling SignatureStateProcessor.createSignatureState(SignRequestInput, SignRequestWrapper, boolean, String).

      Specified by:
      getSignatureState in interface SignatureStateProcessor
      Parameters:
      inputState - the state received from the caller
      requesterId - the requesting actor's id (may be null)
      Returns:
      a fully populated signature session state
      Throws:
      StateException - for state errors
      se.idsec.signservice.integration.core.error.NoAccessException - if the state belongs to someone else (than requesterId)
    • getStateCache

      public IntegrationServiceStateCache getStateCache()
      Gets the state cache instance that is used by the processor.
      Specified by:
      getStateCache in interface SignatureStateProcessor
      Returns:
      the IntegrationServiceStateCache instance
    • setStateCache

      public void setStateCache(IntegrationServiceStateCache stateCache)
      Assigns the state cache.
      Parameters:
      stateCache - the state cache
    • setConfigurationManager

      public void setConfigurationManager(ConfigurationManager configurationManager)
      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

      @PostConstruct public void afterPropertiesSet() throws Exception
      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