Class EmailLookupGenerator

    • Field Detail

      • localPart

        public final java.lang.String localPart
      • numId

        protected final java.lang.String numId
      • appContext

        protected final AppContext appContext
      • branch

        protected java.lang.String branch
      • domain

        protected java.lang.String domain
    • Constructor Detail

      • EmailLookupGenerator

        public EmailLookupGenerator​(AppContext appContext,
                                    @NonNull
                                    @NonNull java.lang.String numId)
    • Method Detail

      • getDistributedIndependentLocation

        public java.lang.String getDistributedIndependentLocation​(java.lang.String moduleId,
                                                                  int levels)
      • getDistributedHostedLocation

        public java.lang.String getDistributedHostedLocation​(java.lang.String moduleId,
                                                             int levels)
      • normaliseDomainName

        protected static java.lang.String normaliseDomainName​(@NonNull
                                                              @NonNull java.lang.String numId)
        Convert a domain name or URL into a normalised name by removing 'www.' and any trailing '.'.
        Parameters:
        numId - java.lang.String The Not Null domain name string or URL.
        Returns:
        A normalised java.lang.String domain name.
      • normalisePath

        protected static java.lang.String normalisePath​(java.lang.String path)
        Accept the 'path' part of a URL and convert it to a format for use in NUM Protocol Queries. I.e. split by '/' and '.', reverse the results and join with '.', prefix with an underscore and replace all spaces by underscores.
        Parameters:
        path - java.lang.String the path part of the URL - i.e. the result of URL.getPath()
        Returns:
        java.lang.String the normalised path.
      • transformBranch

        protected java.lang.String transformBranch​(java.lang.String s)
        Convert "foo/bar" into "bar.foo"
        Parameters:
        s - the branch part of a location specifier
        Returns:
        the transformed branch part