Module swim.remote
Package swim.remote

Class RemoteHost

java.lang.Object
swim.system.AbstractWarpRef
swim.system.AbstractTierBinding
swim.remote.RemoteHost
All Implemented Interfaces:
swim.api.downlink.DownlinkFactory, swim.api.ref.WarpRef, swim.concurrent.StayContext, swim.io.warp.WarpSocket, swim.system.CellBinding, swim.system.CellContext, swim.system.HostBinding, swim.system.TierBinding, swim.util.Log
Direct Known Subclasses:
RemoteHostClient

public class RemoteHost extends swim.system.AbstractTierBinding implements swim.system.HostBinding, swim.io.warp.WarpSocket, swim.concurrent.StayContext
  • Field Details

    • hostContext

      protected swim.system.HostContext hostContext
    • warpSocketContext

      protected swim.io.warp.WarpSocketContext warpSocketContext
  • Constructor Details

    • RemoteHost

      public RemoteHost(swim.uri.Uri requestUri, swim.uri.Uri baseUri)
    • RemoteHost

      public RemoteHost(swim.uri.Uri requestUri, swim.uri.Uri baseUri, swim.collections.HashTrieMap<String,swim.http.Cookie> cookies)
    • RemoteHost

      public RemoteHost(swim.uri.Uri baseUri)
  • Method Details

    • tierContext

      public final swim.system.TierContext tierContext()
      Specified by:
      tierContext in interface swim.system.TierBinding
      Specified by:
      tierContext in class swim.system.AbstractTierBinding
    • part

      public final swim.system.PartBinding part()
      Specified by:
      part in interface swim.system.HostBinding
    • hostWrapper

      public final swim.system.HostBinding hostWrapper()
      Specified by:
      hostWrapper in interface swim.system.HostBinding
    • unwrapHost

      public <T> T unwrapHost(Class<T> hostClass)
      Specified by:
      unwrapHost in interface swim.system.HostBinding
    • bottomHost

      public <T> T bottomHost(Class<T> hostClass)
      Specified by:
      bottomHost in interface swim.system.HostBinding
    • hostContext

      public final swim.system.HostContext hostContext()
      Specified by:
      hostContext in interface swim.system.HostBinding
    • setHostContext

      public void setHostContext(swim.system.HostContext hostContext)
      Specified by:
      setHostContext in interface swim.system.HostBinding
    • warpSocketContext

      public swim.io.warp.WarpSocketContext warpSocketContext()
      Specified by:
      warpSocketContext in interface swim.io.warp.WarpSocket
    • setWarpSocketContext

      public void setWarpSocketContext(swim.io.warp.WarpSocketContext warpSocketContext)
      Specified by:
      setWarpSocketContext in interface swim.io.warp.WarpSocket
    • idleTimeout

      public long idleTimeout()
      Specified by:
      idleTimeout in interface swim.io.warp.WarpSocket
    • cellAddress

      public swim.system.HostAddress cellAddress()
      Specified by:
      cellAddress in interface swim.system.CellContext
      Specified by:
      cellAddress in interface swim.system.HostBinding
    • edgeName

      public String edgeName()
      Specified by:
      edgeName in interface swim.system.CellContext
    • meshUri

      public swim.uri.Uri meshUri()
      Specified by:
      meshUri in interface swim.system.CellContext
      Specified by:
      meshUri in interface swim.system.HostBinding
    • partKey

      public swim.structure.Value partKey()
      Specified by:
      partKey in interface swim.system.HostBinding
    • hostUri

      public swim.uri.Uri hostUri()
      Specified by:
      hostUri in interface swim.system.HostBinding
    • policy

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

      public swim.concurrent.Schedule schedule()
      Specified by:
      schedule in interface swim.system.CellContext
    • stage

      public swim.concurrent.Stage stage()
      Specified by:
      stage in interface swim.system.CellContext
    • store

      public swim.store.StoreBinding store()
      Specified by:
      store in interface swim.system.CellContext
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface swim.system.HostBinding
    • isRemote

      public boolean isRemote()
      Specified by:
      isRemote in interface swim.system.HostBinding
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface swim.system.HostBinding
    • securityProtocol

      public String securityProtocol()
    • cipherSuite

      public String cipherSuite()
    • localAddress

      public InetSocketAddress localAddress()
    • localIdentity

      public swim.api.auth.Identity localIdentity()
    • localPrincipal

      public Principal localPrincipal()
    • localCertificates

      public Collection<Certificate> localCertificates()
    • remoteAddress

      public InetSocketAddress remoteAddress()
    • remoteIdentity

      public swim.api.auth.Identity remoteIdentity()
    • remotePrincipal

      public Principal remotePrincipal()
    • remoteCertificates

      public Collection<Certificate> remoteCertificates()
    • isPrimary

      public boolean isPrimary()
      Specified by:
      isPrimary in interface swim.system.HostBinding
    • setPrimary

      public void setPrimary(boolean isPrimary)
      Specified by:
      setPrimary in interface swim.system.HostBinding
    • isReplica

      public boolean isReplica()
      Specified by:
      isReplica in interface swim.system.HostBinding
    • setReplica

      public void setReplica(boolean isReplica)
      Specified by:
      setReplica in interface swim.system.HostBinding
    • isMaster

      public boolean isMaster()
      Specified by:
      isMaster in interface swim.system.HostBinding
    • isSlave

      public boolean isSlave()
      Specified by:
      isSlave in interface swim.system.HostBinding
    • didBecomeMaster

      public void didBecomeMaster()
      Specified by:
      didBecomeMaster in interface swim.system.HostBinding
    • didBecomeSlave

      public void didBecomeSlave()
      Specified by:
      didBecomeSlave in interface swim.system.HostBinding
    • resolve

      protected swim.uri.Uri resolve(swim.uri.Uri relativeUri)
    • nodes

      public swim.uri.UriMapper<swim.system.NodeBinding> nodes()
      Specified by:
      nodes in interface swim.system.HostBinding
    • getNode

      public swim.system.NodeBinding getNode(swim.uri.Uri nodeUri)
      Specified by:
      getNode in interface swim.system.HostBinding
    • openNode

      public swim.system.NodeBinding openNode(swim.uri.Uri nodeUri)
      Specified by:
      openNode in interface swim.system.HostBinding
    • openNode

      public swim.system.NodeBinding openNode(swim.uri.Uri nodeUri, swim.system.NodeBinding node)
      Specified by:
      openNode in interface swim.system.HostBinding
    • openUplink

      public void openUplink(swim.system.LinkBinding link)
      Specified by:
      openUplink in interface swim.system.CellBinding
    • openWarpUplink

      protected void openWarpUplink(swim.system.WarpBinding link)
    • pushUp

      public void pushUp(swim.system.Push<?> push)
      Specified by:
      pushUp in interface swim.system.CellBinding
    • willConnect

      public void willConnect()
      Specified by:
      willConnect in interface swim.io.warp.WarpSocket
    • didConnect

      public void didConnect()
      Specified by:
      didConnect in interface swim.io.warp.WarpSocket
    • willSecure

      public void willSecure()
      Specified by:
      willSecure in interface swim.io.warp.WarpSocket
    • didSecure

      public void didSecure()
      Specified by:
      didSecure in interface swim.io.warp.WarpSocket
    • willBecome

      public void willBecome(swim.io.IpSocket socket)
      Specified by:
      willBecome in interface swim.io.warp.WarpSocket
    • didBecome

      public void didBecome(swim.io.IpSocket socket)
      Specified by:
      didBecome in interface swim.io.warp.WarpSocket
    • didUpgrade

      public void didUpgrade(swim.http.HttpRequest<?> request, swim.http.HttpResponse<?> response)
      Specified by:
      didUpgrade in interface swim.io.warp.WarpSocket
    • doRead

      public void doRead()
      Specified by:
      doRead in interface swim.io.warp.WarpSocket
    • didRead

      public void didRead(swim.warp.Envelope envelope)
      Specified by:
      didRead in interface swim.io.warp.WarpSocket
    • didRead

      public void didRead(swim.ws.WsControlFrame<?,?> frame)
      Specified by:
      didRead in interface swim.io.warp.WarpSocket
    • didReadClose

      protected void didReadClose(swim.ws.WsCloseFrame<?,?> frame)
    • onEventMessage

      protected void onEventMessage(swim.warp.EventMessage message)
    • onCommandMessage

      protected void onCommandMessage(swim.warp.CommandMessage message)
    • willPushMessage

      protected void willPushMessage(swim.warp.Envelope envelope)
    • didPushMessage

      protected void didPushMessage(swim.warp.Envelope envelope)
    • reconcileReceiveBacklog

      protected void reconcileReceiveBacklog()
    • routeDownlink

      protected void routeDownlink(swim.warp.LinkAddressed envelope)
    • didOpenDownlink

      protected void didOpenDownlink(swim.system.WarpBinding downlink)
    • didCloseDownlink

      protected void didCloseDownlink(swim.system.WarpBinding downlink)
    • routeUplink

      protected void routeUplink(swim.warp.LaneAddressed envelope)
    • didOpenUplink

      protected void didOpenUplink(swim.system.WarpContext uplink)
    • didCloseUplink

      protected void didCloseUplink(swim.system.WarpContext uplink)
    • onLinkRequest

      protected void onLinkRequest(swim.warp.LinkRequest request)
    • onLinkedResponse

      protected void onLinkedResponse(swim.warp.LinkedResponse response)
    • onSyncRequest

      protected void onSyncRequest(swim.warp.SyncRequest request)
    • onSyncedResponse

      protected void onSyncedResponse(swim.warp.SyncedResponse response)
    • onUnlinkRequest

      protected void onUnlinkRequest(swim.warp.UnlinkRequest request)
    • onUnlinkedResponse

      protected void onUnlinkedResponse(swim.warp.UnlinkedResponse response)
    • onAuthRequest

      protected void onAuthRequest(swim.warp.AuthRequest request)
    • onAuthedResponse

      protected void onAuthedResponse(swim.warp.AuthedResponse response)
    • onDeauthRequest

      protected void onDeauthRequest(swim.warp.DeauthRequest request)
    • onDeauthedResponse

      protected void onDeauthedResponse(swim.warp.DeauthedResponse response)
    • onUnknownEnvelope

      protected void onUnknownEnvelope(swim.warp.Envelope envelope)
    • forbid

      protected void forbid()
    • doWrite

      public void doWrite()
      Specified by:
      doWrite in interface swim.io.warp.WarpSocket
    • didWrite

      public void didWrite(swim.warp.Envelope envelope)
      Specified by:
      didWrite in interface swim.io.warp.WarpSocket
    • didWrite

      public void didWrite(swim.ws.WsControlFrame<?,?> frame)
      Specified by:
      didWrite in interface swim.io.warp.WarpSocket
    • didTimeout

      public void didTimeout()
      Specified by:
      didTimeout in interface swim.io.warp.WarpSocket
    • didDisconnect

      public void didDisconnect()
      Specified by:
      didDisconnect in interface swim.io.warp.WarpSocket
    • willClose

      protected void willClose()
      Overrides:
      willClose in class swim.system.AbstractTierBinding
    • didClose

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

      public void didFail(Throwable error)
      Specified by:
      didFail in interface swim.system.TierBinding
      Specified by:
      didFail in interface swim.io.warp.WarpSocket
      Overrides:
      didFail in class swim.system.AbstractTierBinding
    • openMetaHost

      public void openMetaHost(swim.system.HostBinding host, swim.system.NodeBinding metaHost)
      Specified by:
      openMetaHost in interface swim.system.HostBinding
    • openMetaLanes

      protected void openMetaLanes(swim.system.HostBinding host, swim.system.agent.AgentNode metaHost)
    • openReflectLanes

      protected void openReflectLanes(swim.system.HostBinding host, swim.system.agent.AgentNode metaHost)
    • openMetaNode

      public void openMetaNode(swim.system.NodeBinding node, swim.system.NodeBinding metaNode)
      Specified by:
      openMetaNode in interface swim.system.HostBinding
    • openMetaLane

      public void openMetaLane(swim.system.LaneBinding lane, swim.system.NodeBinding metaLane)
      Specified by:
      openMetaLane in interface swim.system.HostBinding
    • openMetaUplink

      public void openMetaUplink(swim.system.LinkBinding uplink, swim.system.NodeBinding metaUplink)
      Specified by:
      openMetaUplink in interface swim.system.HostBinding
    • openMetaDownlink

      public void openMetaDownlink(swim.system.LinkBinding downlink, swim.system.NodeBinding metaDownlink)
      Specified by:
      openMetaDownlink in interface swim.system.CellContext
    • bindDownlink

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

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

      public void closeDownlink(swim.system.LinkBinding link)
      Specified by:
      closeDownlink in interface swim.system.CellContext
    • pushDown

      public void pushDown(swim.system.Push<?> push)
      Specified by:
      pushDown in interface swim.system.CellContext
    • reportDown

      public void reportDown(swim.system.Metric metric)
      Specified by:
      reportDown in interface swim.system.CellContext
    • reconnect

      protected void reconnect()
    • closeDownlinks

      protected void closeDownlinks()
    • closeUplinks

      protected void closeUplinks()
    • connectUplinks

      protected void connectUplinks()
    • disconnectUplinks

      protected void disconnectUplinks()
    • 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
    • fail

      public void fail(Object message)
      Specified by:
      fail in interface swim.util.Log
    • didUpdateMetrics

      protected void didUpdateMetrics()
    • flushMetrics

      protected void flushMetrics()
    • reportMetrics

      protected void reportMetrics(long dt)
    • collectProfile

      protected swim.system.profile.HostProfile collectProfile(long dt)