Interface PSNManagerWithNotification
-
Method Summary
Modifier and TypeMethodDescriptionvoid
anonymiseAllEntriesForValue
(String notificationClientID, String value, String domainName) Anonymises all pseudonyms for the given value in the specified domain (replacing each "value" with "###_anonym_###_randString_###_anonym_###").anonymiseAllEntriesForValues
(String notificationClientID, Set<String> values, String domainName) Returns SUCCESS, NOT_FOUND, ALREADY_ANONYMISED for the values depending on the result of anonymising all pseudonyms for each value.anonymiseEntries
(String notificationClientID, Set<String> values, String domainName) Returns SUCCESS, NOT_FOUND, ALREADY_ANONYMISED, or ERROR for the values depending on the result of anonymising them (replacing each "value" with "###_anonym_###_randString_###_anonym_###").void
anonymiseEntry
(String notificationClientID, String value, String domainName) Anonymises a single pseudonym for the given value in the specified domain, replacing "value" with "###_anonym_###_randString_###_anonym_###".void
anonymisePseudonym
(String notificationClientID, String psn, String domainName) Anonymises the given pseudonym in the specified domain.anonymisePseudonyms
(String notificationClientID, Set<String> psns, String domainName) Returns SUCCESS, NOT_FOUND, or ALREADY_ANONYMISED for the pseudonyms depending on the result of anonymising them.createPseudonymFor
(String notificationClientID, String value, String domainName) Returns a new pseudonym for the given value in the specified domain.createPseudonymForList
(String notificationClientID, Set<String> values, String domainName) Returns a new pseudonym for each of the given values in the specified domain.createPseudonymsFor
(String notificationClientID, String value, String domainName, int number) Returns the specified number of new pseudonyms for the given value in the specified multi-PSN domain.createPseudonymsForList
(String notificationClientID, Set<String> values, String domainName, int number) Returns the specified number of new pseudonyms for each of the given values in the specified multi-PSN domain.void
deleteAllEntriesForValue
(String notificationClientID, String value, String domainName) Deletes all pseudonyms for the given value in the specified domain.deleteAllEntriesForValues
(String notificationClientID, Set<String> values, String domainName) Returns SUCCESS, NOT_FOUND for the values depending on the result of deleting all pseudonyms for each value.deleteEntries
(String notificationClientID, Set<String> values, String domainName) Returns SUCCESS, NOT_FOUND, or ERROR for the given values depending on the result of deleting all their pseudonyms.void
deleteEntry
(String notificationClientID, String value, String domainName) Deletes a single pseudonym for the given value in the specified domain.void
deletePseudonym
(String notificationClientID, String psn, String domainName) Deletes the pseudonym in the specified domain.deletePseudonyms
(String notificationClientID, Set<String> psns, String domainName) Returns SUCCESS or NOT_FOUND for the given pseudonyms depending on the result of deleting pseudonyms.getOrCreatePseudonymFor
(String notificationClientID, String value, String domainName) Returns the pseudonym for the given value in the specified domain, or create a new one if there is no such pseudonym, yet.getOrCreatePseudonymForList
(String notificationClientID, Set<String> values, String domainName) Returns pseudonyms for the given values in the specified domain, or create a new ones if there are no such pseudonyms, yet.getOrCreatePseudonymsFor
(String notificationClientID, String value, String domainName, int minNumber) Returns all pseudonyms for the given value in the specified domain, and ensures that at leastminNumber
pseudonyms for the value, creating new ones as needed.getOrCreatePseudonymsForList
(String notificationClientID, Set<String> values, String domainName, int minNumber) Returns all pseudonyms for each of the given values in the specified domain, and ensures that at leastminNumber
pseudonyms exist per value, creating new ones as needed.void
insertValuePseudonymPair
(String notificationClientID, String value, String pseudonym, String domainName) insert a value - pseudonym pair
value is expected to be a valid pseudonyminsertValuePseudonymPairs
(String notificationClientID, List<StringPair> pairs, String domainName) insert value - pseudonym pairs
values within the map are expected to be valid pseudonyms
-
Method Details
-
createPseudonymFor
String createPseudonymFor(String notificationClientID, String value, String domainName) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns a new pseudonym for the given value in the specified domain.Note that an exception will be thrown if there are already pseudonyms for the value in a single-PSN domain (inconsistent data).
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value to create a pseudonym fordomainName
- the name of the domain- Returns:
- a new pseudonym for the given value in the specified domain
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
createPseudonymsFor
List<String> createPseudonymsFor(String notificationClientID, String value, String domainName, int number) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns the specified number of new pseudonyms for the given value in the specified multi-PSN domain.Note that an exception will be thrown if the number is greater than 1 or if there are already pseudonyms for the value in a single-PSN domain (inconsistent data).
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value to create a pseudonym fordomainName
- the name of the domainnumber
- the number of new pseudonyms to create- Returns:
- the specified number of new pseudonyms for the given value in the specified multi-PSN domain
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
createPseudonymForList
Map<String,String> createPseudonymForList(String notificationClientID, Set<String> values, String domainName) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns a new pseudonym for each of the given values in the specified domain.Note that an exception will be thrown if there are already pseudonyms for the value in a single-PSN domain.
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values to create a pseudonym fordomainName
- the name of the domain- Returns:
- a new pseudonym for each of the given values in the specified domain
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if there are already pseudonyms for the value in a single-PSN domainUnknownDomainException
- if the given domain is not found
-
createPseudonymsForList
Map<String,List<String>> createPseudonymsForList(String notificationClientID, Set<String> values, String domainName, int number) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns the specified number of new pseudonyms for each of the given values in the specified multi-PSN domain.Note that an exception will be thrown if the number is greater than 1 or if there are already pseudonyms for the value in a single-PSN domain.
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values to create a pseudonym fordomainName
- the name of the domainnumber
- the number of new pseudonyms to create- Returns:
- the specified number of new pseudonyms for each of the given values in the specified multi-PSN domain
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if the number is greater than 1 or if there are already pseudonyms for the value in a single-PSN domainUnknownDomainException
- if the given domain is not found
-
getOrCreatePseudonymFor
String getOrCreatePseudonymFor(String notificationClientID, String value, String domainName) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns the pseudonym for the given value in the specified domain, or create a new one if there is no such pseudonym, yet.Note that an exception will be thrown if there are multiple pseudonyms for a value in a single-PSN domain (inconsistent data), but also for a multi-PSN domain, as multiple pseudonyms cannot be returned as a single string (invalid parameter).
Preferably to be used for single-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value to get or create a pseudonym fordomainName
- the name of the domain- Returns:
- the pseudonym for the given value in the specified domain, or create a new one if there is no such pseudonym, yet
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
getOrCreatePseudonymsFor
List<String> getOrCreatePseudonymsFor(String notificationClientID, String value, String domainName, int minNumber) throws InvalidParameterException, DomainIsFullException, UnknownDomainException Returns all pseudonyms for the given value in the specified domain, and ensures that at leastminNumber
pseudonyms for the value, creating new ones as needed.Note that an exception will be thrown if there are multiple pseudonyms for a value in a single-PSN domain (inconsistent data).
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value to get or create a pseudonym fordomainName
- the name of the domainminNumber
- the minimum number of pseudonyms for the given value- Returns:
- all pseudonyms for the given value in the specified domain,
and ensures that at least
minNumber
pseudonyms for the value, creating new ones as needed - Throws:
InvalidParameterException
- if one of the required parameters is not setDomainIsFullException
- if the domain is fullUnknownDomainException
- if the domain is unknown
-
getOrCreatePseudonymForList
Map<String,String> getOrCreatePseudonymForList(String notificationClientID, Set<String> values, String domainName) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns pseudonyms for the given values in the specified domain, or create a new ones if there are no such pseudonyms, yet.Note that an exception will be thrown if there are multiple pseudonyms for a value in a single-PSN domain (inconsistent data), but also for a multi-PSN domain, as multiple pseudonyms cannot be returned as a single string (invalid parameter).
Preferably to be used for single-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values to get or create a pseudonym fordomainName
- the name of the domain- Returns:
- pseudonyms for the given values in the specified domain, or create a new ones if there are no such pseudonyms, yet
- Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if there exist more than one pseudonym for value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
getOrCreatePseudonymsForList
Map<String,List<String>> getOrCreatePseudonymsForList(String notificationClientID, Set<String> values, String domainName, int minNumber) throws DomainIsFullException, InvalidParameterException, UnknownDomainException Returns all pseudonyms for each of the given values in the specified domain, and ensures that at leastminNumber
pseudonyms exist per value, creating new ones as needed.Note that an exception will be thrown if there are multiple pseudonyms for a value in a single-PSN domain (inconsistent data).
Preferably to be used for multi-PSN domains.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the value to get or create a pseudonym fordomainName
- the name of the domainminNumber
- the minimum number of pseudonyms for the given values- Returns:
- all pseudonyms for each of the given values in the specified domain,
and ensures that at least
minNumber
pseudonyms exist per value, creating new ones as needed - Throws:
DomainIsFullException
- if the domain is fullInvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the domain is unknown
-
anonymiseEntry
void anonymiseEntry(String notificationClientID, String value, String domainName) throws DBException, InvalidParameterException, UnknownDomainException, UnknownValueException, ValueIsAnonymisedException Anonymises a single pseudonym for the given value in the specified domain, replacing "value" with "###_anonym_###_randString_###_anonym_###". Throws an exception if there is not exactly one pseudonym for the value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value which should be anonymiseddomainName
- the name of the domain- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- e.g. if there exist more than one pseudonym for a value in a multi-PSN domainUnknownDomainException
- if the domain is unknownUnknownValueException
- if there are no pseudonyms for the given value in the specified domainValueIsAnonymisedException
- if the value cannot be anonymised
-
anonymiseEntries
Map<String,AnonymisationResult> anonymiseEntries(String notificationClientID, Set<String> values, String domainName) throws DBException, InvalidParameterException, UnknownDomainException Returns SUCCESS, NOT_FOUND, ALREADY_ANONYMISED, or ERROR for the values depending on the result of anonymising them (replacing each "value" with "###_anonym_###_randString_###_anonym_###"). In particular, anAnonymisationResult.ERROR
is returned for values with multiple pseudonyms associated.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values which should be anonymiseddomainName
- the name of the domain- Returns:
- SUCCESS, NOT_FOUND, ALREADY_ANONYMISED, or ERROR for the values depending on the result of anonymising them (replacing each "value" with "###_anonym_###_randString_###_anonym_###")
- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-
anonymiseAllEntriesForValue
void anonymiseAllEntriesForValue(String notificationClientID, String value, String domainName) throws DBException, InvalidParameterException, UnknownDomainException, UnknownValueException, ValueIsAnonymisedException Anonymises all pseudonyms for the given value in the specified domain (replacing each "value" with "###_anonym_###_randString_###_anonym_###"). Throws an exception if there is no pseudonym for the value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value for which all entries should be anonymiseddomainName
- the name of the domain- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- e.g. if there exist more than one pseudonym for a value in a multi-PSN domainUnknownDomainException
- if the given domain is not foundUnknownValueException
- if there are no pseudonyms for the given value in the specified domainValueIsAnonymisedException
- if the value cannot be anonymised
-
anonymiseAllEntriesForValues
Map<String,AnonymisationResult> anonymiseAllEntriesForValues(String notificationClientID, Set<String> values, String domainName) throws DBException, InvalidParameterException, UnknownDomainException Returns SUCCESS, NOT_FOUND, ALREADY_ANONYMISED for the values depending on the result of anonymising all pseudonyms for each value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values for which all entries should be anonymiseddomainName
- the name of the domain- Returns:
- SUCCESS, NOT_FOUND, ALREADY_ANONYMISED for the values depending on the result of anonymising all pseudonyms for each value
- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-
anonymisePseudonym
void anonymisePseudonym(String notificationClientID, String psn, String domainName) throws DBException, InvalidParameterException, UnknownDomainException, InvalidPSNException, PSNNotFoundException Anonymises the given pseudonym in the specified domain.- Parameters:
notificationClientID
- the client ID for notifications or nullpsn
- the pseudonym to anonymisedomainName
- the name of the domain- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundInvalidPSNException
PSNNotFoundException
-
anonymisePseudonyms
Map<String,AnonymisationResult> anonymisePseudonyms(String notificationClientID, Set<String> psns, String domainName) throws DBException, InvalidParameterException, UnknownDomainException Returns SUCCESS, NOT_FOUND, or ALREADY_ANONYMISED for the pseudonyms depending on the result of anonymising them.- Parameters:
notificationClientID
- the client ID for notifications or nullpsns
- the pseudonyms to anonymisedomainName
- the name of the domain- Returns:
- SUCCESS, NOT_FOUND, or ALREADY_ANONYMISED for the pseudonyms depending on the result of anonymising them
- Throws:
DBException
- e.g. if there exist more than one pseudonym for a value in a single-PSN domainInvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-
deleteEntry
void deleteEntry(String notificationClientID, String value, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException, UnknownValueException Deletes a single pseudonym for the given value in the specified domain. Throws an exception if there is not exactly one pseudonym for the value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value which should be deleteddomainName
- the name of the domain- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundUnknownValueException
- if there are no pseudonyms for the given value in the specified domainDeletionForbiddenException
-
deleteEntries
Map<String,DeletionResult> deleteEntries(String notificationClientID, Set<String> values, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException Returns SUCCESS, NOT_FOUND, or ERROR for the given values depending on the result of deleting all their pseudonyms. In particular, anDeletionResult.ERROR
is returned for values with multiple pseudonyms associated.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values which should be deleteddomainName
- the name of the domain- Returns:
- SUCCESS, NOT_FOUND, or ERROR for the given values depending on the result of deleting all their pseudonyms
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundDeletionForbiddenException
-
deleteAllEntriesForValue
void deleteAllEntriesForValue(String notificationClientID, String value, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException, UnknownValueException Deletes all pseudonyms for the given value in the specified domain. Throws an exception if there is no pseudonym for the value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalue
- the value for which all entries should be deleteddomainName
- the name of the domain- Throws:
InvalidParameterException
- e.g. if there exist more than one pseudonym for a value in a multi-PSN domainUnknownDomainException
- if the given domain is not foundUnknownValueException
- if there are no pseudonyms for the given value in the specified domainDeletionForbiddenException
-
deleteAllEntriesForValues
Map<String,DeletionResult> deleteAllEntriesForValues(String notificationClientID, Set<String> values, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException Returns SUCCESS, NOT_FOUND for the values depending on the result of deleting all pseudonyms for each value.- Parameters:
notificationClientID
- the client ID for notifications or nullvalues
- the values for which all entries should be deleteddomainName
- the name of the domain- Returns:
- SUCCESS, NOT_FOUND for the values depending on the result of deleting all pseudonyms for each value
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundDeletionForbiddenException
-
deletePseudonym
void deletePseudonym(String notificationClientID, String psn, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException, UnknownValueException, InvalidPSNException, PSNNotFoundException Deletes the pseudonym in the specified domain.- Parameters:
notificationClientID
- the client ID for notifications or nullpsn
- the pseudonym to deletedomainName
- the name of the domain- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundUnknownValueException
- if there are no pseudonyms for the given value in the specified domainDeletionForbiddenException
InvalidPSNException
PSNNotFoundException
-
deletePseudonyms
Map<String,DeletionResult> deletePseudonyms(String notificationClientID, Set<String> psns, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException Returns SUCCESS or NOT_FOUND for the given pseudonyms depending on the result of deleting pseudonyms.- Parameters:
notificationClientID
- the client ID for notifications or nullpsns
- the pseudonyms to deletedomainName
- the name of the domain- Returns:
- SUCCESS or NOT_FOUND for the given pseudonyms depending on the result of deleting pseudonyms
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not foundDeletionForbiddenException
-
insertValuePseudonymPair
void insertValuePseudonymPair(String notificationClientID, String value, String pseudonym, String domainName) throws InsertPairException, InvalidParameterException, UnknownDomainException insert a value - pseudonym pair
value is expected to be a valid pseudonym- Parameters:
value
- the value for which the pseudonym should be insertedpseudonym
- the pseudonym which should be inserted for the given valuedomainName
- for which domain should the given pairs be stored- Throws:
InsertPairException
- if an error occurred while persisting the given pair (seeInsertPairError
)InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-
insertValuePseudonymPairs
List<InsertPairExceptionDTO> insertValuePseudonymPairs(String notificationClientID, List<StringPair> pairs, String domainName) throws InvalidParameterException, UnknownDomainException insert value - pseudonym pairs
values within the map are expected to be valid pseudonyms- Parameters:
pairs
- map of pairs which should be storeddomainName
- for which domain should the given pairs be stored- Returns:
- a list with all occurred exceptions, see
InsertPairExceptionDTO
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-