Class DomainConfig
java.lang.Object
org.emau.icmvc.ganimed.ttp.psn.config.DomainConfig
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionDomainConfig(String properties) Creates the domain config from a character delimited properties string as used for DB persistence.DomainConfig(DomainConfig config) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckPsnLength(String psnPrefix, String psnSuffix, int psnLength) static voidcheckPsnLength(String psnPrefix, String psnSuffix, int psnLength, CheckDigits checkDigits) booleanintstatic intReturns the maximum number of (UTF8) characters that a fully qualified PSN including prefix, suffix, and check digits may consist of so that it can be stored in a database field (configured with UTF8MB4).Returns the domain config as delimited properties string for DB persistence.intintinthashCode()booleanbooleanbooleanbooleanbooleanvoidvoidsetForceCache(ForceCache forceCache) voidsetIncludePrefixInCheckDigitCalculation(boolean includePrefixInCheckDigitCalculation) voidsetIncludeSuffixInCheckDigitCalculation(boolean includeSuffixInCheckDigitCalculation) voidsetMaxDetectedErrors(int maxDetectedErrors) voidsetMultiPsnDomain(boolean multiPsnDomain) voidsetPsnLength(int psnLength) voidsetPsnPrefix(String psnPrefix) voidsetPsnPrefixSuffixAndLength(String psnPrefix, String psnSuffix, int psnLength) voidsetPsnsDeletable(boolean psnsDeletable) voidsetPsnSuffix(String psnSuffix) voidsetSendNotificationsWeb(boolean sendNotificationsWeb) voidsetUseLastCharAsDelimiterAfterXChars(int useLastCharAsDelimiterAfterXChars) voidsetValidateValuesViaParents(ValidateViaParents validateValuesViaParents) toString()
-
Field Details
-
DEFAULT_PSN_LENGTH
public static final int DEFAULT_PSN_LENGTH- See Also:
-
MAX_PSEUDONYMS_FOR_DEFAULT_CACHE_ON
public static final long MAX_PSEUDONYMS_FOR_DEFAULT_CACHE_ON- See Also:
-
-
Constructor Details
-
DomainConfig
public DomainConfig() -
DomainConfig
- Throws:
InvalidParameterException
-
DomainConfig
Creates the domain config from a character delimited properties string as used for DB persistence.- Parameters:
properties- the properties string- Throws:
InvalidParameterException
-
-
Method Details
-
getMaxDetectedErrors
public int getMaxDetectedErrors() -
setMaxDetectedErrors
- Parameters:
maxDetectedErrors- numbers of check digits forinvalid reference
org.emau.icmvc.ganimed.ttp.psn.generator.ReedSolomonLagrange
default 2- Throws:
InvalidParameterException- if maxDetectedErrors is less than 1 or greater than 9
-
getPsnLength
public int getPsnLength() -
setPsnLength
- Parameters:
psnLength- length of the generated pseudonym
default 8- Throws:
InvalidParameterException- if the summed up length of prefix, psn, and suffix exceeds the maximum number of characters in fully qualified PSN
-
getPsnPrefix
-
setPsnPrefix
- Parameters:
psnPrefix- additional prefix
default ""- Throws:
InvalidParameterException- if the summed up length of prefix, psn, and suffix exceeds the maximum number of characters in fully qualified PSN
-
getPsnSuffix
-
setPsnSuffix
- Parameters:
psnSuffix- additional suffix
default ""- Throws:
InvalidParameterException- if the summed up length of prefix, psn, and suffix exceeds the maximum number of characters in fully qualified PSN
-
setPsnPrefixSuffixAndLength
public void setPsnPrefixSuffixAndLength(String psnPrefix, String psnSuffix, int psnLength) throws InvalidParameterException - Throws:
InvalidParameterException
-
resetPsnPrefixSuffixAndLength
public void resetPsnPrefixSuffixAndLength() -
isIncludePrefixInCheckDigitCalculation
public boolean isIncludePrefixInCheckDigitCalculation() -
setIncludePrefixInCheckDigitCalculation
public void setIncludePrefixInCheckDigitCalculation(boolean includePrefixInCheckDigitCalculation) - Parameters:
includePrefixInCheckDigitCalculation- should the prefix be used to calculate the check digit(s)
default false
-
isIncludeSuffixInCheckDigitCalculation
public boolean isIncludeSuffixInCheckDigitCalculation() -
setIncludeSuffixInCheckDigitCalculation
public void setIncludeSuffixInCheckDigitCalculation(boolean includeSuffixInCheckDigitCalculation) - Parameters:
includeSuffixInCheckDigitCalculation- should the suffix be used to calculate the check digit(s)
default false
-
getUseLastCharAsDelimiterAfterXChars
public int getUseLastCharAsDelimiterAfterXChars() -
setUseLastCharAsDelimiterAfterXChars
public void setUseLastCharAsDelimiterAfterXChars(int useLastCharAsDelimiterAfterXChars) throws InvalidParameterException - Parameters:
useLastCharAsDelimiterAfterXChars- use last char of the given alphabet as delimiter symbol after the given number of other chars within the pseudonym
e.g. 123.456.789 or abcd-efgh-ijkl
default 0 (which means don't use ...)- Throws:
InvalidParameterException- for invalid values
-
isPsnsDeletable
public boolean isPsnsDeletable() -
setPsnsDeletable
public void setPsnsDeletable(boolean psnsDeletable) - Parameters:
psnsDeletable- is it allowed to delete entries within this project
attention!ValidateViaParents.CASCADE_DELETEignores this config entry
default false
-
getForceCache
-
setForceCache
- Parameters:
forceCache- should a cache be used for faster psn generation, seeForceCache
memory consumption is one bit per possible pseudonym: mem_for_cache = alphabet_length ^ pseudonym_length / 8 / 1024 / 1024 MB
e.g. alphabet = numbers, length = 8 -> mem_for_cache = 10 ^ 8 / (8 * 1024 * 1024) = 11.92 MB
defaultForceCache.DEFAULTif memory consumption invalid input: '<' 120 MB (pseudonym_length = 9, alphabet_length = 10) then use cache, else don't- Throws:
InvalidParameterException- if forceCache is null
-
getValidateValuesViaParents
-
setValidateValuesViaParents
- Parameters:
validateValuesViaParents- should the values in this domain be validated against the rules of their parent domains, seeValidateViaParents
throws anInvalidParameterExceptionif there's no parent domain set
defaultValidateViaParents.OFF
-
isSendNotificationsWeb
public boolean isSendNotificationsWeb() -
setSendNotificationsWeb
public void setSendNotificationsWeb(boolean sendNotificationsWeb) -
isMultiPsnDomain
public boolean isMultiPsnDomain() -
setMultiPsnDomain
public void setMultiPsnDomain(boolean multiPsnDomain) -
getPropertiesString
Returns the domain config as delimited properties string for DB persistence.- Returns:
- the domain config as delimited properties string for DB persistence
-
getMaxNumberOfCharactersInFullyQualifiedPsn
public static int getMaxNumberOfCharactersInFullyQualifiedPsn()Returns the maximum number of (UTF8) characters that a fully qualified PSN including prefix, suffix, and check digits may consist of so that it can be stored in a database field (configured with UTF8MB4). Even though an UTF8 character could need up to 4 bytes to be encoded in UTF9MB4, there is no need to convert between byte and character count. Since MySQL 4.1 the number N in 'varchar(N)' explicitly means the number of characters, not the number of bytes, so that e.g. 'varchar(N)' could take up to 1020 bytes. See also 32 Byte Lange Pseudonyme erlauben (RKI) and MySQL VARCHAR Lengths and UTF-8.- Returns:
- the maximum number of (UTF8) characters that a fully qualified PSN may consist of
-
checkPsnLength
public static void checkPsnLength(String psnPrefix, String psnSuffix, int psnLength) throws InvalidParameterException - Throws:
InvalidParameterException
-
checkPsnLength
public static void checkPsnLength(String psnPrefix, String psnSuffix, int psnLength, CheckDigits checkDigits) throws InvalidParameterException - Throws:
InvalidParameterException
-
hashCode
public int hashCode() -
equals
-
toString
-