Package org.emau.icmvc.ganimed.ttp.psn
Interface DomainManager
public interface DomainManager
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDomain
(DomainInDTO domainDTO) adds a new domainboolean
arePSNDeletable
(String domainName) Returns true if the propertyDomainProperties.PSNS_DELETABLE
is set.long
countPSNs
(String domainName, PaginationConfig config) counts matching for the given domain w.r.t.long
countPSNsForDomains
(List<String> domainNames, PaginationConfig config) counts matching for the given domain w.r.t.void
deleteDomain
(String domainName) deletes the given domainvoid
deleteDomainWithPSNs
(String domainName) deletes the given domain with all pseudonyms - be sure you know, what you're doinggetAlphabet
(String alphabetName) Returns the alphabet for the given name.returns all information for the given domaingetDomainsForPrefix
(String prefix) getDomainsForSuffix
(String suffix) getRestrictionForCheckDigitClass
(String checkDigitClass) gives the restriction for the number of chars within the alphabet for the given check digit classlistPSNsForDomainsPaginated
(List<String> domainNames, PaginationConfig config) lists all matching psns for the given domains paginated w.r.t.listPSNsPaginated
(String domainName, PaginationConfig config) lists all matching psns for the given domain paginated w.r.t.void
updateDomain
(DomainInDTO domainDTO) updates a existing domainvoid
updateDomainInUse
(String domainName, String label, String comment, List<String> parentDomainNames, boolean sendNotificationsWeb, boolean psnsDeletable) updates a existing domain which is in use (contains psns)
-
Method Details
-
addDomain
void addDomain(DomainInDTO domainDTO) throws DomainInUseException, InvalidAlphabetException, InvalidCheckDigitClassException, InvalidGeneratorException, InvalidParameterException, InvalidParentDomainException, UnknownDomainException adds a new domain- Parameters:
domainDTO
- seeDomainInDTO
- Throws:
DomainInUseException
- if the given domain already existsInvalidAlphabetException
- if the given alphabet name (attribute of the given domain) is not a valid alphabet or the length of the alphabet is not valid for the given check digit classInvalidCheckDigitClassException
- if the given check digit class name (attribute of the given domain) is not a valid check digit classInvalidGeneratorException
- if the generator can't be instantiatedInvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given parentDomain can't be foundInvalidParentDomainException
-
updateDomain
void updateDomain(DomainInDTO domainDTO) throws DomainInUseException, InvalidAlphabetException, InvalidCheckDigitClassException, InvalidGeneratorException, InvalidParameterException, UnknownDomainException, InvalidParentDomainException, InvalidUpdateInUseOperationException updates a existing domain- Parameters:
domainDTO
- seeDomainInDTO
- Throws:
DomainInUseException
- if there's at least one pseudonym within that domainInvalidAlphabetException
- if the given alphabet name (attribute of the given domain) is not a valid alphabet or the length of the alphabet is not valid for the given check digit classInvalidCheckDigitClassException
- if the given check digit class name (attribute of the given domain) is not a valid check digit classInvalidGeneratorException
- if the generator can't be instantiatedInvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain or parentDomain doesn't existsInvalidParentDomainException
InvalidUpdateInUseOperationException
-
updateDomainInUse
void updateDomainInUse(String domainName, String label, String comment, List<String> parentDomainNames, boolean sendNotificationsWeb, boolean psnsDeletable) throws InvalidParameterException, UnknownDomainException, InvalidGeneratorException, InvalidAlphabetException, InvalidParentDomainException, InvalidCheckDigitClassException, InvalidUpdateInUseOperationException updates a existing domain which is in use (contains psns)- Parameters:
domainName
- the name of the domainlabel
- the new labelcomment
- the new commentparentDomainNames
- list of parent domain namessendNotificationsWeb
- whether the web should send notifications to external systemspsnsDeletable
- whether psns should be deleteable- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain or parentDomain doesn't existsInvalidGeneratorException
InvalidAlphabetException
InvalidParentDomainException
InvalidCheckDigitClassException
InvalidUpdateInUseOperationException
-
deleteDomain
void deleteDomain(String domainName) throws DomainInUseException, InvalidParameterException, UnknownDomainException deletes the given domain- Parameters:
domainName
- identifier- Throws:
DomainInUseException
- if there's at least one pseudonym within that domain or that domain is a parent domainInvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
deleteDomainWithPSNs
void deleteDomainWithPSNs(String domainName) throws DomainInUseException, InvalidParameterException, UnknownDomainException deletes the given domain with all pseudonyms - be sure you know, what you're doing- Parameters:
domainName
- identifier- Throws:
DomainInUseException
- if that domain is a parent domainInvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
getDomain
returns all information for the given domain- Parameters:
domainName
- the name of the domain- Returns:
- see
DomainOutDTO
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
listDomains
List<DomainOutDTO> listDomains()- Returns:
- list of all domains within the database; see
DomainOutDTO
-
getDomainsForPrefix
- Parameters:
prefix
- the domain prefix- Returns:
- list of all domains with the given prefix; see
DomainOutDTO
- Throws:
InvalidParameterException
- if prefix is null or empty
-
getDomainsForSuffix
- Parameters:
suffix
- the domain suffix- Returns:
- list of all domains with the given suffix; see
DomainOutDTO
- Throws:
InvalidParameterException
- if suffix is null or empty
-
listPSNs
- Parameters:
domainName
- domain for which all pseudonyms should be retrieved- Returns:
- all pseudonyms for that domain
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
listPSNsPaginated
List<PSNDTO> listPSNsPaginated(String domainName, PaginationConfig config) throws InvalidParameterException, UnknownDomainException lists all matching psns for the given domain paginated w.r.t. the filter in the pagination config- Parameters:
domainName
- domain for which all pseudonyms should be retrievedconfig
- seePaginationConfig
- Returns:
- all pseudonyms for that domain
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
countPSNs
long countPSNs(String domainName, PaginationConfig config) throws InvalidParameterException, UnknownDomainException counts matching for the given domain w.r.t. the filter in the pagination config- Parameters:
domainName
- domain for which all pseudonyms should be retrievedconfig
- seePaginationConfig
(page size and first entry will be ignored)- Returns:
- the number of all matching pseudonyms for that domain
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
listPSNsForDomainsPaginated
List<PSNDTO> listPSNsForDomainsPaginated(List<String> domainNames, PaginationConfig config) throws InvalidParameterException, UnknownDomainException lists all matching psns for the given domains paginated w.r.t. the filter in the pagination config- Parameters:
domainNames
- domains for which all pseudonyms should be retrievedconfig
- seePaginationConfig
- Returns:
- all pseudonyms for that domain
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
countPSNsForDomains
long countPSNsForDomains(List<String> domainNames, PaginationConfig config) throws InvalidParameterException, UnknownDomainException counts matching for the given domain w.r.t. the filter in the pagination config- Parameters:
domainNames
- domain for which all pseudonyms should be retrievedconfig
- seePaginationConfig
(page size and first entry will be ignored)- Returns:
- the number of all matching pseudonyms for that domain
- Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
getRestrictionForCheckDigitClass
GeneratorAlphabetRestriction getRestrictionForCheckDigitClass(String checkDigitClass) throws InvalidCheckDigitClassException, InvalidParameterException gives the restriction for the number of chars within the alphabet for the given check digit class- Throws:
InvalidCheckDigitClassException
- if the given check digit class name (attribute of the given domain) is not a valid check digit classInvalidParameterException
- if domainName is null or empty
-
arePSNDeletable
Returns true if the propertyDomainProperties.PSNS_DELETABLE
is set.- Parameters:
domainName
- the name of the domain- Returns:
- true if the property
DomainProperties.PSNS_DELETABLE
is set - Throws:
InvalidParameterException
- if domainName is null or emptyUnknownDomainException
- if the given domain is not found
-
getAlphabet
Alphabet getAlphabet(String alphabetName) throws InvalidParameterException, InvalidAlphabetException Returns the alphabet for the given name. If you have access to the common API of gPAS in particular toAlphabets
you should prefer usingAlphabets.createAlphabet(String)
instead of calling the service.- Parameters:
alphabetName
- the alphabet string, either a class name, a comma-separated list of characters, or a single character- Returns:
- the alphabet for the given name
- Throws:
InvalidParameterException
- for an invalid alphabet name (e.g. null or empty)InvalidAlphabetException
- for an invalid alphabet
-