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​(java.lang.String aInstanceId)
        Specified by:
        setInstanceId in interface org.refcodes.mixin.InstanceIdAccessor.InstanceIdMutator
      • getInstanceId

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

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

        public java.lang.String getHost​()
        Specified by:
        getHost in interface org.refcodes.net.HostAccessor
      • getVirtualHost

        public java.lang.String getVirtualHost​()
        Specified by:
        getVirtualHost in interface org.refcodes.net.VirtualHostAccessor
      • setVirtualHost

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

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

        public void setIpAddress​(int[] aIpAddress)
        Specified by:
        setIpAddress in interface org.refcodes.net.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 aStoreDescriptor)
        Specified by:
        setTrustStoreDescriptor in interface org.refcodes.security.TrustStoreDescriptorAccessor.TrustStoreDescriptorMutator
      • getHttpRegistryUrl

        public org.refcodes.net.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.net.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 java.lang.String getAlias​()
        Specified by:
        getAlias in interface org.refcodes.mixin.AliasAccessor
      • setAlias

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

        public java.lang.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​(java.lang.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 java.lang.String toHost​(java.lang.String aHost)
                                   throws java.net.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:
        java.net.UnknownHostException - thrown in case the local machine's host cannot be resolved when the provided host is null.
      • toVirtualHost

        protected java.lang.String toVirtualHost​(java.lang.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 java.io.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:
        java.io.IOException - thrown in case the local machine's IP-Address cannot be resolved when the provided IP-Address is null.
      • toAlias

        protected java.lang.String toAlias​(java.lang.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 java.lang.String toInstanceId​(java.lang.String aInstanceId,
                                                java.lang.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 ID is null.
        Returns:
        The value when not null, else the value of this instance's property.
      • toPingPath

        protected java.lang.String toPingPath​(java.lang.String aPingPath,
                                              java.lang.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.net.Url toHttpRegistryUrl​(org.refcodes.net.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 RestRequestObserver toPingObserver​(RestRequestObserver 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.