Module swim.server
Package swim.server

Class ServerPlane

  • All Implemented Interfaces:
    swim.api.downlink.DownlinkFactory, swim.api.plane.PlaneContext, swim.api.ref.SwimRef, swim.linker.AuthenticatorContext, swim.runtime.CellContext, swim.runtime.RootContext, swim.runtime.TierBinding, swim.runtime.TierContext, swim.util.Log

    public class ServerPlane
    extends swim.runtime.AbstractTierBinding
    implements swim.runtime.RootContext, swim.api.plane.PlaneContext, swim.linker.AuthenticatorContext
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected swim.io.http.HttpEndpoint endpoint  
      protected swim.api.plane.Plane plane  
      protected swim.runtime.RootBinding root  
      protected swim.concurrent.Theater stage  
      protected swim.store.StoreBinding store  
      protected swim.io.warp.WarpSettings warpSettings  
      • Fields inherited from class swim.runtime.AbstractTierBinding

        CLOSED_PHASE, CLOSED_STATE, CLOSING_STATE, FAILED_STATE, FAILING_STATE, LOADED_PHASE, LOADED_STATE, LOADING_STATE, OPENED_PHASE, OPENED_STATE, OPENING_STATE, PHASE_MASK, PHASE_SHIFT, RECOVERING_STATE, STARTED_PHASE, STARTED_STATE, STARTING_STATE, STATE_MASK, status, STATUS, STOPPING_STATE, UNLOADING_STATE
    • Constructor Summary

      Constructors 
      Constructor Description
      ServerPlane​(swim.concurrent.Theater stage, swim.store.StoreBinding store, swim.io.http.HttpEndpoint endpoint, swim.runtime.RootBinding root)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAgentRoute​(String pattern, swim.api.agent.AgentType<?> agentType)  
      void addAgentRoute​(swim.uri.UriPattern pattern, swim.api.agent.AgentType<?> agentType)  
      void addAgentType​(String name, swim.api.agent.AgentType<?> agentType)  
      void addAuthenticator​(swim.api.auth.Authenticator authenticator)  
      <S extends swim.api.agent.Agent>
      swim.api.agent.AgentType<S>
      agentClass​(Class<? extends S> agentClass)  
      swim.api.policy.PolicyDirective<swim.api.auth.Identity> authenticate​(swim.api.auth.Credentials credentials)  
      swim.collections.FingerTrieSeq<swim.api.auth.Authenticator> authenticators()  
      swim.io.ServiceRef bind​(String address, int port)  
      swim.io.ServiceRef bind​(String address, int port, swim.io.warp.WarpSettings warpSettings)  
      swim.io.ServiceRef bind​(swim.linker.ServiceDef serviceDef)  
      swim.runtime.LinkBinding bindDownlink​(swim.api.downlink.Downlink downlink)  
      void closeDownlink​(swim.runtime.LinkBinding link)  
      swim.runtime.HostBinding createHost​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.uri.Uri hostUri)  
      swim.runtime.MeshBinding createMesh​(swim.uri.Uri meshUri)  
      swim.runtime.NodeBinding createNode​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.uri.Uri hostUri, swim.uri.Uri nodeUri)  
      swim.runtime.PartBinding createPart​(swim.uri.Uri meshUri, swim.structure.Value partKey)  
      void debug​(Object message)  
      void didClose()  
      void didFail​(Throwable error)  
      void didLoad()  
      void didOpen()  
      void didStart()  
      void didStop()  
      void didUnload()  
      swim.io.http.HttpEndpoint endpoint()  
      void error​(Object message)  
      <S extends swim.api.agent.Agent>
      swim.api.agent.AgentType<S>
      getAgentRoute​(swim.uri.Uri nodeUri)  
      <S extends swim.api.agent.Agent>
      swim.api.agent.AgentType<S>
      getAgentType​(String name)  
      swim.api.plane.Plane getPlane()  
      ServerPart getServerPart​(swim.structure.Value partKey)  
      boolean hasAgentType​(String name)  
      void httpDownlink​(swim.runtime.HttpBinding http)  
      void info​(Object message)  
      swim.runtime.HostBinding injectHost​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.uri.Uri hostUri, swim.runtime.HostBinding host)  
      swim.runtime.LaneBinding injectLane​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.uri.Uri hostUri, swim.uri.Uri nodeUri, swim.uri.Uri laneUri, swim.runtime.LaneBinding lane)  
      swim.runtime.MeshBinding injectMesh​(swim.uri.Uri meshUri, swim.runtime.MeshBinding mesh)  
      swim.runtime.NodeBinding injectNode​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.uri.Uri hostUri, swim.uri.Uri nodeUri, swim.runtime.NodeBinding node)  
      swim.runtime.PartBinding injectPart​(swim.uri.Uri meshUri, swim.structure.Value partKey, swim.runtime.PartBinding part)  
      void materialize​(Class<? extends swim.api.plane.Plane> planeClass)  
      ServerPlane materialize​(Class<? extends swim.api.plane.Plane> planeClass, swim.linker.PlaneDef planeDef)  
      ServerPlane materialize​(swim.linker.PlaneDef planeDef)  
      swim.uri.Uri meshUri()  
      void openDownlink​(swim.runtime.LinkBinding link)  
      swim.api.policy.PlanePolicy planePolicy()  
      swim.api.policy.Policy policy()  
      void pushDown​(swim.runtime.PushRequest pushRequest)  
      void removeAgentRoute​(swim.uri.UriPattern pattern)  
      void removeAgentType​(String name)  
      swim.runtime.RootBinding root()  
      swim.concurrent.Schedule schedule()  
      void setAuthenticators​(swim.collections.FingerTrieSeq<swim.api.auth.Authenticator> authenticators)  
      void setPlane​(swim.api.plane.Plane plane)  
      void setPlanePolicy​(swim.api.policy.PlanePolicy policy)  
      void setWarpSettings​(swim.io.warp.WarpSettings warpSettings)  
      swim.concurrent.Stage stage()  
      swim.store.StoreBinding store()  
      swim.runtime.TierContext tierContext()  
      void trace​(Object message)  
      void warn​(Object message)  
      swim.io.warp.WarpSettings warpSettings()  
      void willClose()  
      void willLoad()  
      void willOpen()  
      void willStart()  
      void willStop()  
      void willUnload()  
      • Methods inherited from class swim.runtime.AbstractTierBinding

        activate, close, isClosed, isLoaded, isOpened, isStarted, load, open, start, stop, unload
      • Methods inherited from class swim.runtime.AbstractSwimRef

        command, command, command, command, command, command, command, command, downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
      • Methods inherited from interface swim.api.downlink.DownlinkFactory

        downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue
      • Methods inherited from interface swim.api.ref.SwimRef

        close, command, command, command, command, command, command, command, command, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
      • Methods inherited from interface swim.runtime.TierContext

        close
    • Field Detail

      • stage

        protected final swim.concurrent.Theater stage
      • store

        protected final swim.store.StoreBinding store
      • endpoint

        protected final swim.io.http.HttpEndpoint endpoint
      • root

        protected final swim.runtime.RootBinding root
      • plane

        protected swim.api.plane.Plane plane
      • warpSettings

        protected swim.io.warp.WarpSettings warpSettings
    • Constructor Detail

      • ServerPlane

        public ServerPlane​(swim.concurrent.Theater stage,
                           swim.store.StoreBinding store,
                           swim.io.http.HttpEndpoint endpoint,
                           swim.runtime.RootBinding root)
    • Method Detail

      • tierContext

        public swim.runtime.TierContext tierContext()
        Specified by:
        tierContext in interface swim.runtime.TierBinding
        Specified by:
        tierContext in class swim.runtime.AbstractTierBinding
      • meshUri

        public swim.uri.Uri meshUri()
        Specified by:
        meshUri in interface swim.runtime.CellContext
      • policy

        public swim.api.policy.Policy policy()
        Specified by:
        policy in interface swim.runtime.CellContext
      • schedule

        public swim.concurrent.Schedule schedule()
        Specified by:
        schedule in interface swim.linker.AuthenticatorContext
        Specified by:
        schedule in interface swim.runtime.CellContext
        Specified by:
        schedule in interface swim.api.plane.PlaneContext
      • stage

        public final swim.concurrent.Stage stage()
        Specified by:
        stage in interface swim.runtime.CellContext
        Specified by:
        stage in interface swim.api.plane.PlaneContext
      • store

        public swim.store.StoreBinding store()
        Specified by:
        store in interface swim.runtime.CellContext
      • endpoint

        public swim.io.http.HttpEndpoint endpoint()
        Specified by:
        endpoint in interface swim.linker.AuthenticatorContext
      • root

        public swim.runtime.RootBinding root()
      • getPlane

        public swim.api.plane.Plane getPlane()
      • setPlane

        public void setPlane​(swim.api.plane.Plane plane)
      • warpSettings

        public swim.io.warp.WarpSettings warpSettings()
      • setWarpSettings

        public void setWarpSettings​(swim.io.warp.WarpSettings warpSettings)
      • materialize

        public void materialize​(Class<? extends swim.api.plane.Plane> planeClass)
      • materialize

        public ServerPlane materialize​(swim.linker.PlaneDef planeDef)
      • materialize

        public ServerPlane materialize​(Class<? extends swim.api.plane.Plane> planeClass,
                                       swim.linker.PlaneDef planeDef)
      • bind

        public swim.io.ServiceRef bind​(swim.linker.ServiceDef serviceDef)
      • bind

        public swim.io.ServiceRef bind​(String address,
                                       int port)
      • bind

        public swim.io.ServiceRef bind​(String address,
                                       int port,
                                       swim.io.warp.WarpSettings warpSettings)
      • planePolicy

        public swim.api.policy.PlanePolicy planePolicy()
        Specified by:
        planePolicy in interface swim.api.plane.PlaneContext
      • setPlanePolicy

        public void setPlanePolicy​(swim.api.policy.PlanePolicy policy)
        Specified by:
        setPlanePolicy in interface swim.api.plane.PlaneContext
      • authenticators

        public swim.collections.FingerTrieSeq<swim.api.auth.Authenticator> authenticators()
        Specified by:
        authenticators in interface swim.api.plane.PlaneContext
      • setAuthenticators

        public void setAuthenticators​(swim.collections.FingerTrieSeq<swim.api.auth.Authenticator> authenticators)
        Specified by:
        setAuthenticators in interface swim.api.plane.PlaneContext
      • addAuthenticator

        public void addAuthenticator​(swim.api.auth.Authenticator authenticator)
        Specified by:
        addAuthenticator in interface swim.api.plane.PlaneContext
      • agentClass

        public <S extends swim.api.agent.Agent> swim.api.agent.AgentType<S> agentClass​(Class<? extends S> agentClass)
        Specified by:
        agentClass in interface swim.api.plane.PlaneContext
      • hasAgentType

        public boolean hasAgentType​(String name)
        Specified by:
        hasAgentType in interface swim.api.plane.PlaneContext
      • getAgentType

        public <S extends swim.api.agent.Agent> swim.api.agent.AgentType<S> getAgentType​(String name)
        Specified by:
        getAgentType in interface swim.api.plane.PlaneContext
      • addAgentType

        public void addAgentType​(String name,
                                 swim.api.agent.AgentType<?> agentType)
        Specified by:
        addAgentType in interface swim.api.plane.PlaneContext
      • removeAgentType

        public void removeAgentType​(String name)
        Specified by:
        removeAgentType in interface swim.api.plane.PlaneContext
      • getAgentRoute

        public <S extends swim.api.agent.Agent> swim.api.agent.AgentType<S> getAgentRoute​(swim.uri.Uri nodeUri)
        Specified by:
        getAgentRoute in interface swim.api.plane.PlaneContext
      • addAgentRoute

        public void addAgentRoute​(swim.uri.UriPattern pattern,
                                  swim.api.agent.AgentType<?> agentType)
        Specified by:
        addAgentRoute in interface swim.api.plane.PlaneContext
      • addAgentRoute

        public void addAgentRoute​(String pattern,
                                  swim.api.agent.AgentType<?> agentType)
        Specified by:
        addAgentRoute in interface swim.api.plane.PlaneContext
      • removeAgentRoute

        public void removeAgentRoute​(swim.uri.UriPattern pattern)
        Specified by:
        removeAgentRoute in interface swim.api.plane.PlaneContext
      • createMesh

        public swim.runtime.MeshBinding createMesh​(swim.uri.Uri meshUri)
        Specified by:
        createMesh in interface swim.runtime.RootContext
      • injectMesh

        public swim.runtime.MeshBinding injectMesh​(swim.uri.Uri meshUri,
                                                   swim.runtime.MeshBinding mesh)
        Specified by:
        injectMesh in interface swim.runtime.RootContext
      • createPart

        public swim.runtime.PartBinding createPart​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey)
        Specified by:
        createPart in interface swim.runtime.RootContext
      • injectPart

        public swim.runtime.PartBinding injectPart​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.runtime.PartBinding part)
        Specified by:
        injectPart in interface swim.runtime.RootContext
      • createHost

        public swim.runtime.HostBinding createHost​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.uri.Uri hostUri)
        Specified by:
        createHost in interface swim.runtime.RootContext
      • injectHost

        public swim.runtime.HostBinding injectHost​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.uri.Uri hostUri,
                                                   swim.runtime.HostBinding host)
        Specified by:
        injectHost in interface swim.runtime.RootContext
      • createNode

        public swim.runtime.NodeBinding createNode​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.uri.Uri hostUri,
                                                   swim.uri.Uri nodeUri)
        Specified by:
        createNode in interface swim.runtime.RootContext
      • getServerPart

        public ServerPart getServerPart​(swim.structure.Value partKey)
      • injectNode

        public swim.runtime.NodeBinding injectNode​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.uri.Uri hostUri,
                                                   swim.uri.Uri nodeUri,
                                                   swim.runtime.NodeBinding node)
        Specified by:
        injectNode in interface swim.runtime.RootContext
      • injectLane

        public swim.runtime.LaneBinding injectLane​(swim.uri.Uri meshUri,
                                                   swim.structure.Value partKey,
                                                   swim.uri.Uri hostUri,
                                                   swim.uri.Uri nodeUri,
                                                   swim.uri.Uri laneUri,
                                                   swim.runtime.LaneBinding lane)
        Specified by:
        injectLane in interface swim.runtime.RootContext
      • authenticate

        public swim.api.policy.PolicyDirective<swim.api.auth.Identity> authenticate​(swim.api.auth.Credentials credentials)
        Specified by:
        authenticate in interface swim.runtime.RootContext
      • bindDownlink

        public swim.runtime.LinkBinding bindDownlink​(swim.api.downlink.Downlink downlink)
        Specified by:
        bindDownlink in interface swim.runtime.CellContext
      • openDownlink

        public void openDownlink​(swim.runtime.LinkBinding link)
        Specified by:
        openDownlink in interface swim.runtime.CellContext
      • closeDownlink

        public void closeDownlink​(swim.runtime.LinkBinding link)
        Specified by:
        closeDownlink in interface swim.runtime.CellContext
      • httpDownlink

        public void httpDownlink​(swim.runtime.HttpBinding http)
        Specified by:
        httpDownlink in interface swim.runtime.CellContext
      • pushDown

        public void pushDown​(swim.runtime.PushRequest pushRequest)
        Specified by:
        pushDown in interface swim.runtime.CellContext
      • trace

        public void trace​(Object message)
        Specified by:
        trace in interface swim.util.Log
      • debug

        public void debug​(Object message)
        Specified by:
        debug in interface swim.util.Log
      • info

        public void info​(Object message)
        Specified by:
        info in interface swim.util.Log
      • warn

        public void warn​(Object message)
        Specified by:
        warn in interface swim.util.Log
      • error

        public void error​(Object message)
        Specified by:
        error in interface swim.util.Log
      • willOpen

        public void willOpen()
        Specified by:
        willOpen in interface swim.runtime.TierContext
        Overrides:
        willOpen in class swim.runtime.AbstractTierBinding
      • didOpen

        public void didOpen()
        Specified by:
        didOpen in interface swim.runtime.TierContext
        Overrides:
        didOpen in class swim.runtime.AbstractTierBinding
      • willLoad

        public void willLoad()
        Specified by:
        willLoad in interface swim.runtime.TierContext
        Overrides:
        willLoad in class swim.runtime.AbstractTierBinding
      • didLoad

        public void didLoad()
        Specified by:
        didLoad in interface swim.runtime.TierContext
        Overrides:
        didLoad in class swim.runtime.AbstractTierBinding
      • willStart

        public void willStart()
        Specified by:
        willStart in interface swim.runtime.TierContext
        Overrides:
        willStart in class swim.runtime.AbstractTierBinding
      • didStart

        public void didStart()
        Specified by:
        didStart in interface swim.runtime.TierContext
        Overrides:
        didStart in class swim.runtime.AbstractTierBinding
      • willStop

        public void willStop()
        Specified by:
        willStop in interface swim.runtime.TierContext
        Overrides:
        willStop in class swim.runtime.AbstractTierBinding
      • didStop

        public void didStop()
        Specified by:
        didStop in interface swim.runtime.TierContext
        Overrides:
        didStop in class swim.runtime.AbstractTierBinding
      • willUnload

        public void willUnload()
        Specified by:
        willUnload in interface swim.runtime.TierContext
        Overrides:
        willUnload in class swim.runtime.AbstractTierBinding
      • didUnload

        public void didUnload()
        Specified by:
        didUnload in interface swim.runtime.TierContext
        Overrides:
        didUnload in class swim.runtime.AbstractTierBinding
      • willClose

        public void willClose()
        Specified by:
        willClose in interface swim.runtime.TierContext
        Overrides:
        willClose in class swim.runtime.AbstractTierBinding
      • didClose

        public void didClose()
        Specified by:
        didClose in interface swim.runtime.TierBinding
        Overrides:
        didClose in class swim.runtime.AbstractTierBinding
      • didFail

        public void didFail​(Throwable error)
        Specified by:
        didFail in interface swim.runtime.TierBinding
        Overrides:
        didFail in class swim.runtime.AbstractTierBinding