be.ehealth.technicalconnector.session.impl

## Class SessionManagerImpl

- java.lang.Object
- - be.ehealth.technicalconnector.session.impl.SessionManagerImpl

- All Implemented Interfaces:
    SessionManager

      public final class SessionManagerImpl
      extends Object
      implements SessionManager

  Implementation of `SessionManager`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROP_FETCH_ETK` Configuration to (des)activate the fetch of an Encryption Token linked to the session.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SessionItem` | `createFallbackSession(String hokPwd)` Creates a fallback session using a eHealth certificate stored on the computer.
    `SessionItem` | `createFallbackSession(String hokPwd, String encryptionPwd)` Creates a fallback session using a eHealth certificate stored on the computer.
    `SessionItem` | `createFallbackSession(String idnetPwd, String hokPwd, String encryptionPwd)` Creates a fallback session using a eHealth certificate stored on the computer.
    `SessionItem` | `createSession(String hokPwd)` Creates a session using the certificate on the eID of the user and an holder of key certificate stored on the computer.
    `SessionItem` | `createSession(String hokPwd, String encryptionPwd)` Creates a session using the certificate on the eID of the user and an holder of key certificate stored on the computer.
    `SessionItem` | `createSessionEidOnly()` Creates a session only based on eid card.
    `static SessionManagerImpl` | `getInstance()`
    `SessionItem` | `getSession()` Gets the current session.
    `boolean` | `hasValidSession()` Checks for valid session.
    `void` | `loadEncryptionKeys(String encryptionPwd)`
    `void` | `loadSession(SAMLToken token, String hokPwd)` Load a session using a previously stored SAML token.
    `void` | `loadSession(SAMLToken token, String hokPwd, String encryptionPwd)` Load a session using a previously stored SAML token with the associated eHealth Encryption Certificates, needed for sealing and unsealing messages.
    `void` | `registerSessionService(SessionServiceWithCache serviceWithCache)` This method will register all the session service with a cache.
    `void` | `setKeyStore(Map<String,KeyStore> keystores)` Method to set the keyStores that the sessionManagment should use.
    `void` | `unloadSession()` Unload the current session.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_FETCH_ETK

          public static final String PROP_FETCH_ETK

      Configuration to (des)activate the fetch of an Encryption Token linked to the session. Default: true
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getInstance

          public static SessionManagerImpl getInstance()

    - #### loadSession

          public void loadSession(SAMLToken token,
                                  String hokPwd)
                           throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Load a session using a previously stored SAML token.
      Specified by:
        `loadSession` in interface `SessionManager`
      Parameters:
        `token` - the token to load
        `hokPwd` - the holder of key password
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### loadSession

          public void loadSession(SAMLToken token,
                                  String hokPwd,
                                  String encryptionPwd)
                           throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Load a session using a previously stored SAML token with the associated eHealth Encryption Certificates, needed for sealing and unsealing messages.
      Specified by:
        `loadSession` in interface `SessionManager`
      Parameters:
        `token` - the token to load
        `hokPwd` - the holder of key password
        `encryptionPwd` - the encryption of key password
      Throws:
        `TechnicalConnectorException`

    - #### createSessionEidOnly

          public SessionItem createSessionEidOnly()
                                           throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a session only based on eid card. The eID is used for identifcation, holder of key verification and sealing.
      Specified by:
        `createSessionEidOnly` in interface `SessionManager`
      Returns:
        `SessionItem` not usable for encryption
      Throws:
        `TechnicalConnectorException`

    - #### createSession

          public SessionItem createSession(String hokPwd)
                                    throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a session using the certificate on the eID of the user and an holder of key certificate stored on the computer. If you want to create a new session, unload your previous session first via the unloadSession method.
      Specified by:
        `createSession` in interface `SessionManager`
      Parameters:
        `hokPwd` - the holder of key password
      Returns:
        the session item
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### createSession

          public SessionItem createSession(String hokPwd,
                                           String encryptionPwd)
                                    throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a session using the certificate on the eID of the user and an holder of key certificate stored on the computer. If you want to create a new session, unload your previous session first via the unloadSession method. The session also loads in your Encryption eHealth Certificates, needed for sealing and unsealing messages. *
      Specified by:
        `createSession` in interface `SessionManager`
      Parameters:
        `hokPwd` - the holder of key password
        `encryptionPwd` - the encryption of key password
      Returns:
        the session item
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### createFallbackSession

          public SessionItem createFallbackSession(String hokPwd)
                                            throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a fallback session using a eHealth certificate stored on the computer. If you want to create a new session, unload your previous session first via the unloadSession method
      Specified by:
        `createFallbackSession` in interface `SessionManager`
      Parameters:
        `hokPwd` - the holder of key password
      Returns:
        the session item
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### createFallbackSession

          public SessionItem createFallbackSession(String hokPwd,
                                                   String encryptionPwd)
                                            throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a fallback session using a eHealth certificate stored on the computer. If you want to create a new session, unload your previous session first via the unloadSession method The session also loads in your Encryption eHealth Certificates, needed for sealing and unsealing messages. *
      Specified by:
        `createFallbackSession` in interface `SessionManager`
      Parameters:
        `hokPwd` - the holder of key password
        `encryptionPwd` - the encryption of key password
      Returns:
        the session item
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### createFallbackSession

          public SessionItem createFallbackSession(String idnetPwd,
                                                   String hokPwd,
                                                   String encryptionPwd)
                                            throws TechnicalConnectorException

      Description copied from interface: `SessionManager`
      Creates a fallback session using a eHealth certificate stored on the computer. If you want to create a new session, unload your previous session first via the unloadSession method The session also loads in your Encryption eHealth Certificates, needed for sealing and unsealing messages. *
      Specified by:
        `createFallbackSession` in interface `SessionManager`
      Parameters:
        `idnetPwd` - the identification pwd
        `hokPwd` - the holder of key password
        `encryptionPwd` - the encryption of key password
      Returns:
        the session item
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### getSession

          public SessionItem getSession()

      Description copied from interface: `SessionManager`
      Gets the current session.
      Specified by:
        `getSession` in interface `SessionManager`
      Returns:
        the session

    - #### unloadSession

          public void unloadSession()

      Description copied from interface: `SessionManager`
      Unload the current session.
      Specified by:
        `unloadSession` in interface `SessionManager`

    - #### hasValidSession

          public boolean hasValidSession()
                                  throws SessionManagementException

      Description copied from interface: `SessionManager`
      Checks for valid session.
      Specified by:
        `hasValidSession` in interface `SessionManager`
      Returns:
        true, if successful
      Throws:
        `SessionManagementException`

    - #### loadEncryptionKeys

          public void loadEncryptionKeys(String encryptionPwd)
                                  throws TechnicalConnectorException

      Specified by:
        `loadEncryptionKeys` in interface `SessionManager`
      Parameters:
        `encryptionPwd` - the encryption of key password
      Throws:
        `TechnicalConnectorException`

    - #### registerSessionService

          public void registerSessionService(SessionServiceWithCache serviceWithCache)

      Description copied from interface: `SessionManager`
      This method will register all the session service with a cache. When the unload session is invoke all those services will be 'cl
      Specified by:
        `registerSessionService` in interface `SessionManager`
      See Also:
        `be.ehealth.technicalconnector.session.SessionManager#registreCacheCleaner(be.ehealth.businessconnector.CleanUpCache)`

    - #### setKeyStore

          public void setKeyStore(Map<String,KeyStore> keystores)

      Description copied from interface: `SessionManager`
      Method to set the keyStores that the sessionManagment should use.
      There are 3 supported store types:

    - identification
    - holderofkey
    - encryption

Specified by:
  `setKeyStore` in interface `SessionManager`

Connector Packaging TRUSSMAKER 4.8.4 API
Copyright © {inceptionYear}-2025 eHealth. All Rights Reserved.