be.ehealth.technicalconnector.utils

## Class SessionUtil

- java.lang.Object
- - be.ehealth.technicalconnector.utils.SessionUtil

-     public final class SessionUtil
      extends Object

  Utility class that helps to find and verify some properties such as the nihii,inss number of the connected person.

- - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SessionItem` | `checkAndRetrieveSession()`
    `static boolean` | `containsCaseInsensitive(String strToCompare, List<String> list)`
    `static IdentifierType` | `createIdentifierType(String identifier, String type)` Creates the identifier type.
    `static Credential` | `getCredentail(CryptoType type, Credential defaultCredential)`
    `static Crypto` | `getCrypto(CryptoType type, Crypto defaultCrypto)`
    `static Credential` | `getEncryptionCredential()` checks the session and the presence of the encryption credential and returns it.
    `static Crypto` | `getEncryptionCrypto()` validates if the session and the encryption crypto is present, and returns the encryption Crypto.
    `static String` | `getFirstname()`
    `static String` | `getFullName()` Get the fullName based on the properties.
    `static Credential` | `getHolderOfKeyCredential()` checks the session and the presence of the 'holder of key' credential and returns it.
    `static Crypto` | `getHolderOfKeyCrypto()` validates if the session and the 'holder of key' crypto is present, and returns the 'holder of key' Crypto.
    `static String` | `getLastname()`
    `static Map<String,List<String>>` | `getMatchingAttributes(String attributeNamePattern)` Deprecated.
    `static Map<String,List<String>>` | `getMatchingAttributes(String namespacePattern, String attributeNamePattern)`
    `static String` | `getNihii()` retrieves the NIHII of the user using the application.
    `static String` | `getNihii11()` retrieves the NIHII of the user using the application.
    `static String` | `getNiss()` retrieves the NIHII of the user using the application.

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

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

- - ### Method Detail

    - #### getCrypto

          public static Crypto getCrypto(CryptoType type,
                                         Crypto defaultCrypto)
                                  throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### getCredentail

          public static Credential getCredentail(CryptoType type,
                                                 Credential defaultCredential)
                                          throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### getEncryptionCrypto

          public static Crypto getEncryptionCrypto()
                                            throws TechnicalConnectorException

      validates if the session and the encryption crypto is present, and returns the encryption Crypto.
      Returns:
        `Crypto` the encryption crypto
      Throws:
        `TechnicalConnectorException`

    - #### getHolderOfKeyCrypto

          public static Crypto getHolderOfKeyCrypto()
                                             throws TechnicalConnectorException

      validates if the session and the 'holder of key' crypto is present, and returns the 'holder of key' Crypto.
      Returns:
        `Crypto` the 'holder of key' crypto
      Throws:
        `TechnicalConnectorException`

    - #### getHolderOfKeyCredential

          public static Credential getHolderOfKeyCredential()
                                                     throws TechnicalConnectorException

      checks the session and the presence of the 'holder of key' credential and returns it.
      Returns:
        `Credential` the 'holder of key' credential
      Throws:
        `TechnicalConnectorException`

    - #### getEncryptionCredential

          public static Credential getEncryptionCredential()
                                                    throws TechnicalConnectorException

      checks the session and the presence of the encryption credential and returns it.
      Returns:
        `Credential` the encryption credential
      Throws:
        `TechnicalConnectorException`

    - #### checkAndRetrieveSession

          public static SessionItem checkAndRetrieveSession()
                                                     throws TechnicalConnectorException

      Returns:
      Throws:
        `TechnicalConnectorException`

    - #### getNihii11

          public static String getNihii11()
                                   throws TechnicalConnectorException

      retrieves the NIHII of the user using the application. First checks the config if a user has been configured there (config property "user.inss"), and verifies if there is a session if the configured nihii number is the same as the recieved one. If there is a difference an exception thrown.
      Returns:
        the nihii
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### getNihii

          public static String getNihii()
                                 throws TechnicalConnectorException

      retrieves the NIHII of the user using the application. First checks the config if a user has been configured there (config property "user.nihii"), and verifies if there is a session if the configured nihii number is the same as the recieved one. If there is a difference an exception thrown.
      Returns:
        the nihii
      Throws:
        `TechnicalConnectorException` - the technical connector exception

    - #### getNiss

          public static String getNiss()
                                throws TechnicalConnectorException

      retrieves the NIHII of the user using the application. First checks the config if a user has been configured there (config property "user.inss").
      Throws:
        `TechnicalConnectorException`

    - #### createIdentifierType

          public static IdentifierType createIdentifierType(String identifier,
                                                            String type)

      Creates the identifier type.

    - #### getFullName

          public static String getFullName()

      Get the fullName based on the properties.

    - #### getFirstname

          public static String getFirstname()

      Returns:
        the userFirstname

    - #### getLastname

          public static String getLastname()

      Returns:
        the userLastname

    - #### containsCaseInsensitive

          public static boolean containsCaseInsensitive(String strToCompare,
                                                        List<String> list)

    - #### getMatchingAttributes

          public static Map<String,List<String>> getMatchingAttributes(String namespacePattern,
                                                                       String attributeNamePattern)
                                                                throws TechnicalConnectorException

      Throws:
        `TechnicalConnectorException`

    - #### getMatchingAttributes

          @Deprecated
          public static Map<String,List<String>> getMatchingAttributes(String attributeNamePattern)
                                                                             throws TechnicalConnectorException

      Deprecated.
      Throws:
        `TechnicalConnectorException`

Connector Packaging PERSAUDIOLOGIST 4.3.0-beta-3 API
Copyright © {inceptionYear}-2022 eHealth. All Rights Reserved.