Class DomainConfig

java.lang.Object
org.emau.icmvc.ganimed.ttp.psn.config.DomainConfig
All Implemented Interfaces:
Serializable

public class DomainConfig extends Object implements Serializable
See Also:
  • 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

  • Method Details

    • getMaxDetectedErrors

      public int getMaxDetectedErrors()
    • setMaxDetectedErrors

      public void setMaxDetectedErrors(int maxDetectedErrors) throws InvalidParameterException
      Parameters:
      maxDetectedErrors - numbers of check digits for
      invalid 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

      public void setPsnLength(int psnLength) throws InvalidParameterException
      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

      public String getPsnPrefix()
    • setPsnPrefix

      public void setPsnPrefix(String psnPrefix) throws InvalidParameterException
      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

      public String getPsnSuffix()
    • setPsnSuffix

      public void setPsnSuffix(String psnSuffix) throws InvalidParameterException
      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_DELETE ignores this config entry
      default false
    • getForceCache

      public ForceCache getForceCache()
    • setForceCache

      public void setForceCache(ForceCache forceCache) throws InvalidParameterException
      Parameters:
      forceCache - should a cache be used for faster psn generation, see ForceCache
      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
      default ForceCache.DEFAULT if 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

      public ValidateViaParents getValidateValuesViaParents()
    • setValidateValuesViaParents

      public void setValidateValuesViaParents(ValidateViaParents validateValuesViaParents)
      Parameters:
      validateValuesViaParents - should the values in this domain be validated against the rules of their parent domains, see ValidateViaParents
      throws an InvalidParameterException if there's no parent domain set
      default ValidateViaParents.OFF
    • isSendNotificationsWeb

      public boolean isSendNotificationsWeb()
    • setSendNotificationsWeb

      public void setSendNotificationsWeb(boolean sendNotificationsWeb)
    • isMultiPsnDomain

      public boolean isMultiPsnDomain()
    • setMultiPsnDomain

      public void setMultiPsnDomain(boolean multiPsnDomain)
    • getPropertiesString

      public String 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()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object