Interface PSNManager
-
Method Summary
Modifier and TypeMethodDescriptionvoid
anonymiseAllEntriesForValue
(String value, String domainName) Anonymises all pseudonyms for the given value in the specified domain (replacing each "value" with "###_anonym_###_randString_###_anonym_###").anonymiseAllEntriesForValues
(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
(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 value, String domainName) Anonymises a single pseudonym for the given value in the specified domain, replacing "value" with "###_anonym_###_randString_###_anonym_###".void
anonymisePseudonym
(String psn, String domainName) Anonymises the given pseudonym in the specified domain.anonymisePseudonyms
(Set<String> psns, String domainName) Returns SUCCESS, NOT_FOUND, or ALREADY_ANONYMISED for the pseudonyms depending on the result of anonymising them.createPseudonymFor
(String value, String domainName) Returns a new pseudonym for the given value in the specified domain.createPseudonymForList
(Set<String> values, String domainName) Returns a new pseudonym for each of the given values in the specified domain.createPseudonymsFor
(String value, String domainName, int number) Returns the specified number of new pseudonyms for the given value in the specified multi-PSN domain.createPseudonymsForList
(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 value, String domainName) Deletes all pseudonyms for the given value in the specified domain.deleteAllEntriesForValues
(Set<String> values, String domainName) Returns SUCCESS, NOT_FOUND for the values depending on the result of deleting all pseudonyms for each value.deleteEntries
(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 value, String domainName) Deletes a single pseudonym for the given value in the specified domain.void
deletePseudonym
(String psn, String domainName) Deletes the pseudonym in the specified domain.deletePseudonyms
(Set<String> psns, String domainName) Returns SUCCESS or NOT_FOUND for the given pseudonyms depending on the result of deleting pseudonyms.getOrCreatePseudonymFor
(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
(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 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
(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.getPseudonymFor
(String value, String domainName) Returns the pseudonym for the given value in the specified domain or throw an exception if there is no such pseudonym.getPseudonymForList
(Set<String> values, String domainName) Returns the pseudonyms for the given values in the specified domain or throw an exception if there is no such pseudonym.getPseudonymForValuePrefix
(String valuePrefix, String domainName) Returns the pseudonyms for all values which starts with the given prefix in the specified domain.getPseudonymsFor
(String value, String domainName) Returns the pseudonyms for the given value in the specified domain.getPseudonymsForList
(Set<String> values, String domainName) Returns the pseudonyms for the given values in the specified domain.getPseudonymsForValuePrefix
(String valuePrefix, String domainName) Returns all pseudonyms for each value which starts with the given prefix in the specified domain.getPSNNetFor
(String valueOrPSN) create psn net
with all values that are somehow linked to the given psngetPSNTreeForPSN
(String psn, String domainName) create psn tree
with all values that are somehow linked to the given psngetValueFor
(String psn, String domainName) searches the value for the given psn and domain; calls checkPSN(psn, domainName) before searching the valuegetValueForList
(Set<String> psnList, String domainName) list version ofgetValueFor(String, String)
returns a map<psn, value> (with value="*** PSN NOT FOUND ***" for each given psn which is unknown for the given domain)void
insertValuePseudonymPair
(String value, String pseudonym, String domainName) insert a value - pseudonym pair
value is expected to be a valid pseudonyminsertValuePseudonymPairs
(List<StringPair> pairs, String domainName) insert value - pseudonym pairs
values within the map are expected to be valid pseudonymsboolean
is the given value an anonym?boolean
isAnonymised
(String psn, String domainName) is the given psn anonymised?void
validatePSN
(String psn, String domainName) checks if the given string is a valid pseudonym
-
Method Details
-
createPseudonymFor
String createPseudonymFor(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:
value
- 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 are already pseudonyms for the value in a single-PSN domainUnknownDomainException
- if the domain is unknown
-
createPseudonymsFor
List<String> createPseudonymsFor(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:
value
- 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 are already pseudonyms for the value in a single-PSN domainUnknownDomainException
- if the domain is unknown
-
createPseudonymForList
Map<String,String> createPseudonymForList(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:
values
- 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(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:
values
- 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 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:
value
- 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 value, String domainName, int minNumber) throws DomainIsFullException, InvalidParameterException, 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:
value
- 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(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:
values
- 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(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:
values
- 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
-
getPseudonymFor
String getPseudonymFor(String value, String domainName) throws InvalidParameterException, UnknownDomainException, UnknownValueException Returns the pseudonym for the given value in the specified domain or throw an exception if there is no such pseudonym.Note that also an exception will be thrown if there are multiple pseudonyms for the value in a single-PSN domain (inconsistent data), but also for a multi-PSN domain, as they all cannot be returned as a single string (invalid parameter).
Preferably to be used for single-PSN domains.- Parameters:
value
- the value to get a pseudonym fordomainName
- the name of the domain- Returns:
- the pseudonym for the given value in the specified domain or throw an exception if there is no such pseudonym
- Throws:
InvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknownUnknownValueException
-
getPseudonymsFor
List<String> getPseudonymsFor(String value, String domainName) throws InvalidParameterException, UnknownDomainException, UnknownValueException Returns the pseudonyms for the given value in the specified domain.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:
value
- the value to get pseudonyms fordomainName
- the name of the domain- Returns:
- the pseudonyms for the given value in the specified domain
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the domain is unknownUnknownValueException
-
getPseudonymForList
Map<String,String> getPseudonymForList(Set<String> values, String domainName) throws InvalidParameterException, UnknownDomainException Returns the pseudonyms for the given values in the specified domain or throw an exception if there is no such pseudonym.Note that also an exception will be thrown if there are multiple pseudonyms for the value in a single-PSN domain (inconsistent data), but also for a multi-PSN domain, as they all cannot be returned as a single string (invalid parameter).
Preferably to be used for single-PSN domains.- Parameters:
values
- the value to get pseudonyms fordomainName
- the name of the domain- Returns:
- the pseudonyms for the given values in the specified domain or throw an exception if there is no such pseudonym
- Throws:
InvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
getPseudonymsForList
Map<String,List<String>> getPseudonymsForList(Set<String> values, String domainName) throws InvalidParameterException, UnknownDomainException Returns the pseudonyms for the given values in the specified domain.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:
values
- the value to get pseudonyms fordomainName
- the name of the domain- Returns:
- the pseudonyms for the given values in the specified domain
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the domain is unknown
-
getPseudonymForValuePrefix
Map<String,String> getPseudonymForValuePrefix(String valuePrefix, String domainName) throws InvalidParameterException, UnknownDomainException Returns the pseudonyms for all values which starts with the given prefix in the specified domain.Note that also an exception will be thrown if there are multiple pseudonyms for the value in a single-PSN domain (inconsistent data), but also for a multi-PSN domain, as they all cannot be returned as a single string (invalid parameter).
Preferably to be used for single-PSN domains.- Parameters:
valuePrefix
- the prefix of all values for which the pseudonyms should be retrieveddomainName
- the name of the domain- Returns:
- the pseudonyms for all values which starts with the given prefix in the specified domain
- Throws:
InvalidParameterException
- if there exist more than one pseudonym for the value in a multi-PSN domainUnknownDomainException
- if the domain is unknown
-
getPseudonymsForValuePrefix
Map<String,List<String>> getPseudonymsForValuePrefix(String valuePrefix, String domainName) throws InvalidParameterException, UnknownDomainException Returns all pseudonyms for each value which starts with the given prefix in the specified domain.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:
valuePrefix
- the prefix of all values for which the pseudonyms should be retrieveddomainName
- the name of the domain- Returns:
- all pseudonyms for each value which starts with the given prefix in the specified domain
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the domain is unknown
-
anonymiseEntry
void anonymiseEntry(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:
value
- 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(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:
values
- 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 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:
value
- 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(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:
values
- 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 psn, String domainName) throws DBException, InvalidParameterException, UnknownDomainException, InvalidPSNException, PSNNotFoundException Anonymises the given pseudonym in the specified domain.- Parameters:
psn
- 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(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:
psns
- 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
-
isAnonym
is the given value an anonym?- Parameters:
value
- the value which should be tested- Returns:
- true if the given value is an anonym, false else
- Throws:
InvalidParameterException
- if one of the required parameters is not set
-
isAnonymised
boolean isAnonymised(String psn, String domainName) throws InvalidParameterException, InvalidPSNException, UnknownDomainException, PSNNotFoundException is the given psn anonymised?- Parameters:
psn
- the psn which should be testeddomainName
- for which domain the given psn should be tested- Returns:
- true if the given psn is anonymised, false else
- Throws:
InvalidParameterException
- if one of the required parameters is not setInvalidPSNException
- if the given PSN is not validUnknownDomainException
- if the given domain is not foundPSNNotFoundException
- if the psn is not found within the given domain
-
deleteEntry
void deleteEntry(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:
value
- 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(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:
values
- 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 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:
value
- 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(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:
values
- 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 psn, String domainName) throws DeletionForbiddenException, InvalidParameterException, UnknownDomainException, UnknownValueException, InvalidPSNException, PSNNotFoundException Deletes the pseudonym in the specified domain.- Parameters:
psn
- 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(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:
psns
- 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
-
validatePSN
void validatePSN(String psn, String domainName) throws InvalidParameterException, InvalidPSNException, UnknownDomainException checks if the given string is a valid pseudonym- Parameters:
psn
- the pseudonym which should be checkeddomainName
- for which domain should the given pseudonym be checked- Throws:
InvalidParameterException
- if one of the required parameters is not setInvalidPSNException
- if the given PSN is not validUnknownDomainException
- if the given domain is not found
-
getValueFor
String getValueFor(String psn, String domainName) throws InvalidParameterException, InvalidPSNException, PSNNotFoundException, UnknownDomainException, ValueIsAnonymisedException searches the value for the given psn and domain; calls checkPSN(psn, domainName) before searching the value- Parameters:
psn
- for which pseudonym should the original value be retrieveddomainName
- for which domain should the original value to the given pseudonym be retrieved- Returns:
- the original value
- Throws:
InvalidParameterException
- if one of the required parameters is not setInvalidPSNException
- if the given PSN is not validPSNNotFoundException
- if the given PSN is not found within the db for that domainUnknownDomainException
- if the given domain is not foundValueIsAnonymisedException
- if pseudonym is anonymised
-
getValueForList
Map<String,String> getValueForList(Set<String> psnList, String domainName) throws InvalidParameterException, UnknownDomainException list version ofgetValueFor(String, String)
returns a map<psn, value> (with value="*** PSN NOT FOUND ***" for each given psn which is unknown for the given domain)- Parameters:
psnList
- list of pseudonyms for which the original values should be retrieveddomainName
- for which domain should the original value to the given pseudonym be retrieved- Returns:
- a map with pairs pseudonym -> original value
- Throws:
InvalidParameterException
- if one of the required parameters is not setUnknownDomainException
- if the given domain is not found
-
insertValuePseudonymPair
void insertValuePseudonymPair(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(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
-
getPSNTreeForPSN
PSNTreeDTO getPSNTreeForPSN(String psn, String domainName) throws InvalidParameterException, InvalidPSNException, PSNNotFoundException, UnknownDomainException, ValueIsAnonymisedException create psn tree
with all values that are somehow linked to the given psn- Parameters:
psn
- pseudonym that should be used to create the psn treedomainName
- name of the domain for the given pseudonym- Returns:
- a psn tree object with all psn connected to the given psn
- Throws:
InvalidParameterException
- if one of the required parameters is not setInvalidPSNException
- if the given PSN is not validPSNNotFoundException
- if the given PSN is not found within the db for that domainUnknownDomainException
- if the given domain is not foundValueIsAnonymisedException
- if the value is already anonymised
-
getPSNNetFor
create psn net
with all values that are somehow linked to the given psn- Parameters:
valueOrPSN
- value or pseudonym that should be used to create the psn net- Returns:
- a psn net object with all psn connected to the given psn / value
- Throws:
InvalidParameterException
- if one of the required parameters is not set
-