Class AbstractHttpRegistryRestServerDecorator<DESC extends HttpServerDescriptor,​B extends HttpRegistryRestServer<DESC,​B>>

    • Field Detail

      • _lifeCycleAutomaton

        protected org.refcodes.component.LifeCycleAutomatonImpl.ManualLifeCycleAutomatonImpl _lifeCycleAutomaton
    • Constructor Detail

      • AbstractHttpRegistryRestServerDecorator

        public AbstractHttpRegistryRestServerDecorator​(HttpRestServer aServer)
        Decorates the given HttpRestServer with discovery functionality.
        Parameters:
        aServer - The HttpRestServer to be decorated.
    • Method Detail

      • isRunning

        public boolean isRunning()
        Specified by:
        isRunning in interface org.refcodes.component.RunningAccessor
      • isInitialized

        public boolean isInitialized()
        Specified by:
        isInitialized in interface org.refcodes.component.InitializedAccessor
      • getLifeCycleStatus

        public org.refcodes.component.LifeCycleStatus getLifeCycleStatus()
        Specified by:
        getLifeCycleStatus in interface org.refcodes.component.LifeCycleStatusAccessor
      • initialize

        public void initialize()
                        throws org.refcodes.component.InitializeException
        Initializes the HttpRegistry by registering it at the service registry with a status such as "starting" or "initializing" or "not-ready-yet".
        Specified by:
        initialize in interface HttpRegistry<DESC extends HttpServerDescriptor,​B extends HttpRegistryRestServer<DESC,​B>>
        Specified by:
        initialize in interface org.refcodes.component.Initializable
        Throws:
        org.refcodes.component.InitializeException
      • isStoppable

        public boolean isStoppable()
        Specified by:
        isStoppable in interface org.refcodes.component.Stoppable.StopAutomaton
      • isPausable

        public boolean isPausable()
        Specified by:
        isPausable in interface org.refcodes.component.Pausable.PauseAutomaton
      • isStartable

        public boolean isStartable()
        Specified by:
        isStartable in interface org.refcodes.component.Startable.StartAutomaton
      • isResumable

        public boolean isResumable()
        Specified by:
        isResumable in interface org.refcodes.component.Resumable.ResumeAutomaton
      • isStopped

        public boolean isStopped()
        Specified by:
        isStopped in interface org.refcodes.component.Stoppable.StopAutomaton
      • isPaused

        public boolean isPaused()
        Specified by:
        isPaused in interface org.refcodes.component.Pausable.PauseAutomaton
      • isInitalizable

        public boolean isInitalizable()
        Specified by:
        isInitalizable in interface org.refcodes.component.Initializable.InitializeAutomaton
      • isDestroyable

        public boolean isDestroyable()
        Specified by:
        isDestroyable in interface org.refcodes.component.Destroyable.DestroyAutomaton
      • isDestroyed

        public boolean isDestroyed()
        Specified by:
        isDestroyed in interface org.refcodes.component.Destroyable.DestroyAutomaton
      • setInstanceId

        public void setInstanceId​(String aInstanceId)
        Specified by:
        setInstanceId in interface org.refcodes.mixin.InstanceIdAccessor.InstanceIdMutator
      • getInstanceId

        public String getInstanceId()
        Specified by:
        getInstanceId in interface org.refcodes.mixin.InstanceIdAccessor
      • setHost

        public void setHost​(String aHost)
        Specified by:
        setHost in interface org.refcodes.web.HostAccessor.HostMutator
      • getHost

        public String getHost()
        Specified by:
        getHost in interface org.refcodes.web.HostAccessor
      • getVirtualHost

        public String getVirtualHost()
        Specified by:
        getVirtualHost in interface org.refcodes.web.VirtualHostAccessor
      • setVirtualHost

        public void setVirtualHost​(String aVirtualHost)
        Specified by:
        setVirtualHost in interface org.refcodes.web.VirtualHostAccessor.VirtualHostMutator
      • getIpAddress

        public int[] getIpAddress()
        Specified by:
        getIpAddress in interface org.refcodes.web.IpAddressAccessor
      • setIpAddress

        public void setIpAddress​(int[] aIpAddress)
        Specified by:
        setIpAddress in interface org.refcodes.web.IpAddressAccessor.IpAddressMutator
      • getTrustStoreDescriptor

        public org.refcodes.security.TrustStoreDescriptor getTrustStoreDescriptor()
        Specified by:
        getTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor
      • setTrustStoreDescriptor

        public void setTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aTrustStoreDescriptor)
        Specified by:
        setTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
      • getHttpRegistryUrl

        public org.refcodes.web.Url getHttpRegistryUrl()
        Retrieves the URL from the URL property locating the service registry registry.
        Specified by:
        getHttpRegistryUrl in interface HttpRegistryUrlAccessor
        Returns:
        The URL stored by the URL property.
      • setHttpRegistryUrl

        public void setHttpRegistryUrl​(org.refcodes.web.Url aRegistryUrl)
        Sets the URL for the URL property locating the service registry registry.
        Specified by:
        setHttpRegistryUrl in interface HttpRegistryUrlAccessor.HttpRegistryUrlMutator
        Parameters:
        aRegistryUrl - The service registry registry URL to be stored by the URL property.
      • getAlias

        public String getAlias()
        Specified by:
        getAlias in interface org.refcodes.mixin.AliasAccessor
      • setAlias

        public void setAlias​(String aAlias)
        Specified by:
        setAlias in interface org.refcodes.mixin.AliasAccessor.AliasMutator
      • getPingPath

        public String getPingPath()
        Retrieves the ping path from the ping path property.
        Specified by:
        getPingPath in interface PingPathAccessor
        Returns:
        The ping path stored by the ping path property.
      • setPingPath

        public void setPingPath​(String aPingPath)
        Sets the ping path for the ping path property.
        Specified by:
        setPingPath in interface PingPathAccessor.PingPathMutator
        Parameters:
        aPingPath - The ping path to be stored by the ping path property.
      • toHost

        protected String toHost​(String aHost)
                         throws UnknownHostException
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aHost - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
        Throws:
        UnknownHostException - thrown in case the local machine's host cannot be resolved when the provided host is null.
      • toVirtualHost

        protected String toVirtualHost​(String aVirtualHost)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aVirtualHost - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toIpAddress

        protected int[] toIpAddress​(int[] aIpAddress)
                             throws IOException
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aIpAddress - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
        Throws:
        IOException - thrown in case the local machine's IP-Address cannot be resolved when the provided IP-Address is null.
      • toAlias

        protected String toAlias​(String aAlias)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aAlias - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toScheme

        protected org.refcodes.data.Scheme toScheme​(org.refcodes.data.Scheme aScheme)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aScheme - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toPort

        protected int toPort​(int aPort)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aPort - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toInstanceId

        protected String toInstanceId​(String aInstanceId,
                                      String aHost)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aInstanceId - The value to be used when not null.
        aHost - The value to be used when instance TID is null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toPingPath

        protected String toPingPath​(String aPingPath,
                                    String aDefaultPingPath)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aPingPath - The value to be used when not null.
        aDefaultPingPath - The value to be used when the ping path is null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toTrustStoreDescriptor

        protected org.refcodes.security.TrustStoreDescriptor toTrustStoreDescriptor​(org.refcodes.security.TrustStoreDescriptor aStoreDescriptor)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aStoreDescriptor - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toHttpRegistryUrl

        protected org.refcodes.web.Url toHttpRegistryUrl​(org.refcodes.web.Url aRegistryUrl)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aRegistryUrl - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toHttpServerDescriptor

        protected DESC toHttpServerDescriptor​(DESC aServerDescriptor)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aServerDescriptor - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toPingObserver

        protected RestRequestConsumer toPingObserver​(RestRequestConsumer aPingRequestObserver)
        Resolves the property from the provided value and the this instance's property and the and sets the property in case the provided value is not null.
        Parameters:
        aPingRequestObserver - The value to be used when not null.
        Returns:
        The value when not null, else the value of this instance's property.