public final class KgssManager extends Object implements SessionServiceWithCache
Modifier and Type | Field and Description |
---|---|
static String |
PROP_KGSS_IDENTIFIER_APPLICATIONID
Property to specify the applicationId used by the KGSS
|
Modifier and Type | Method and Description |
---|---|
void |
add(List<CredentialType> allowedReaders,
byte[] myEtk)
Requests a new key from KGSS and adds it to the cache
|
void |
add(String cacheId,
List<CredentialType> allowedReaders,
byte[] myEtk)
Requests a new key from KGSS and adds it to the cache
|
boolean |
containsKey(String key)
Check if the KeyCache contains a certain key, based on the KeyCache ID KeyCache ID's are formatted either: - "(" + keyId + ")" -
normal caching - "(" + patientId + "#" + prescriptionType + ")" - prepare prescription keys
|
void |
flushCache()
Flush cache.
|
KeyResult |
get(String keyId,
byte[] myEtk)
Gets a key from the KeyCache, if the key is not present in the cache it will be retrieved from the KGSS Web Service and added to the
KeyCache.
|
static KgssManager |
getInstance()
Gets the single instance of KeyCacheManager.
|
static KgssManager |
getInstance(KgssService kgssService)
Gets the single instance of KeyCacheManager.
|
KeyResult |
getNewKeyFromKgss(List<CredentialType> allowedReaders,
byte[] myEtk)
Retrieves a new key from the KGSS Web Service and returns it.
|
KeyResult |
remove(String key)
Removes the mapping for a key from this map if it is present (optional operation).
|
void |
setKgssService(KgssService service) |
public static final String PROP_KGSS_IDENTIFIER_APPLICATIONID
Default value: KGSS
public static KgssManager getInstance()
public static KgssManager getInstance(KgssService kgssService)
public KeyResult get(String keyId, byte[] myEtk) throws TechnicalConnectorException
keyId
- The KeyIdentifiermyEtk
- The ETK of the applicationTechnicalConnectorException
- When a technical exception occurspublic void add(List<CredentialType> allowedReaders, byte[] myEtk) throws TechnicalConnectorException
allowedReaders
- the allowed readersmyEtk
- the my etkTechnicalConnectorException
- the technical connector exceptionpublic void add(String cacheId, List<CredentialType> allowedReaders, byte[] myEtk) throws TechnicalConnectorException
cacheId
- the cache idallowedReaders
- the allowed readersmyEtk
- the my etkTechnicalConnectorException
- the technical connector exceptionpublic KeyResult remove(String key)
(key==null ? k==null : key.equals(k))
, that mapping is removed. (The map
can contain at most one such mapping.)
Returns the value to which this map previously associated the key, or null if the map contained no mapping for the key.
If this map permits null values, then a return value of null does not necessarily indicate that the map contained no mapping for the key; it's also possible that the map explicitly mapped the key to null.
The map will not contain a mapping for the specified key once the call returns.
key
- key whose mapping is to be removed from the mappublic boolean containsKey(String key)
Returns true if this map contains a mapping for the specified key. More formally, returns true if and only if this map contains a mapping for a key k such that (key==null ? k==null : key.equals(k)). (There can be at most one such mapping.)
key
- the KeyCacheIdpublic KeyResult getNewKeyFromKgss(List<CredentialType> allowedReaders, byte[] myEtk) throws TechnicalConnectorException
allowedReaders
- the allowed readersmyEtk
- The ETK of the applicationTechnicalConnectorException
- the technical connector exceptionpublic void flushCache()
flushCache
in interface SessionServiceWithCache
public void setKgssService(KgssService service)
service
- the service to set
Connector Packaging TECHNICAL 4.1.2 API
Copyright © {inceptionYear}-2022 eHealth. All Rights Reserved.