- java.lang.Object
-
- swim.runtime.AbstractSwimRef
-
- swim.runtime.AbstractTierBinding
-
- swim.fabric.Fabric
-
- All Implemented Interfaces:
DownlinkFactory
,PlaneContext
,SwimRef
,Space
,CellContext
,EdgeContext
,TierBinding
,TierContext
,Log
public class Fabric extends AbstractTierBinding implements EdgeContext, PlaneContext, Space
-
-
Field Summary
-
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 Fabric(String spaceName, FabricDef fabricDef, KernelContext kernel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAgentRoute(String routeName, String pattern, AgentRoute<?> agentRoute)
void
addAgentRoute(String routeName, UriPattern pattern, AgentRoute<?> agentRoute)
void
addAuthenticator(String authenticatorName, Authenticator authenticator)
PolicyDirective<Identity>
authenticate(Credentials credentials)
LinkBinding
bindDownlink(Downlink downlink)
void
close()
void
closeDownlink(LinkBinding link)
protected void
closeLog()
protected void
closePolicy()
protected void
closeStage()
protected void
closeStore()
<A extends Agent>
AgentFactory<A>createAgentFactory(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Class<? extends A> agentClass)
AgentFactory<?>
createAgentFactory(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, AgentDef agentDef)
<A extends Agent>
AgentRoute<A>createAgentRoute(Class<? extends A> agentClass)
protected EdgeBinding
createEdge()
protected HostBinding
createHost(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostDef hostDef)
HostBinding
createHost(Uri meshUri, Value partKey, Uri hostUri)
protected LaneBinding
createLane(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostBinding host, NodeBinding node, LaneDef laneDef)
LaneBinding
createLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, LaneDef laneDef)
LaneBinding
createLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
Log
createLog(LogDef logDef)
protected MeshBinding
createMesh(EdgeBinding edge, MeshDef meshDef)
MeshBinding
createMesh(Uri meshUri)
protected NodeBinding
createNode(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostBinding host, NodeDef nodeDef)
NodeBinding
createNode(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
protected PartBinding
createPart(EdgeBinding edge, MeshBinding mesh, PartDef partDef)
PartBinding
createPart(Uri meshUri, Value partKey)
protected <P extends Plane>
PcreatePlane(PlaneFactory<P> planeFactory)
Policy
createPolicy(PolicyDef policyDef)
Stage
createStage(StageDef stageDef)
StoreBinding
createStore(StoreDef storeDef)
void
debug(Object message)
Logs a debug-level message.void
didClose()
void
didFail(Throwable error)
void
didLoad()
void
didOpen()
void
didStart()
void
didStop()
void
didUnload()
EdgeBinding
edge()
EdgeBinding
edgeWrapper()
void
error(Object message)
Logs an error-level message.FabricDef
fabricDef()
AgentFactory<?>
getAgentFactory(Uri nodeUri)
<A extends Agent>
AgentRoute<A>getAgentRoute(String routeName)
Authenticator
getAuthenticator(String authenticatorName)
HostDef
getHostDef(Uri meshUri, Value partKey, Uri hostUri)
LaneDef
getLaneDef(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
MeshDef
getMeshDef(Uri meshUri)
NodeDef
getNodeDef(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
PartDef
getPartDef(Uri meshUri, Value partKey)
<P extends Plane>
PgetPlane(Class<? extends P> planeClass)
Plane
getPlane(String planeName)
void
info(Object message)
Logs an info-level message.protected EdgeBinding
injectEdge(EdgeBinding edge)
HostBinding
injectHost(Uri meshUri, Value partKey, Uri hostUri, HostBinding host)
LaneBinding
injectLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri, LaneBinding lane)
Log
injectLog(Log log)
MeshBinding
injectMesh(Uri meshUri, MeshBinding mesh)
NodeBinding
injectNode(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
PartBinding
injectPart(Uri meshUri, Value partKey, PartBinding part)
Policy
injectPolicy(Policy policy)
Stage
injectStage(Stage stage)
StoreBinding
injectStore(StoreBinding store)
KernelContext
kernel()
void
load()
Uri
meshUri()
void
open()
void
openAgents(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
void
openDownlink(LinkBinding link)
protected void
openEdge(EdgeBinding edge)
protected Log
openEdgeLog()
protected Policy
openEdgePolicy()
protected Stage
openEdgeStage()
protected StoreBinding
openEdgeStore()
Log
openHostLog(Uri meshUri, Value partKey, Uri hostUri)
Policy
openHostPolicy(Uri meshUri, Value partKey, Uri hostUri)
Stage
openHostStage(Uri meshUri, Value partKey, Uri hostUri)
StoreBinding
openHostStore(Uri meshUri, Value partKey, Uri hostUri)
Log
openLaneLog(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
Policy
openLanePolicy(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
void
openLanes(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
Stage
openLaneStage(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
StoreBinding
openLaneStore(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
protected Log
openLog()
Log
openMeshLog(Uri meshUri)
Policy
openMeshPolicy(Uri meshUri)
Stage
openMeshStage(Uri meshUri)
StoreBinding
openMeshStore(Uri meshUri)
Log
openNodeLog(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
Policy
openNodePolicy(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
Stage
openNodeStage(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
StoreBinding
openNodeStore(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
Log
openPartLog(Uri meshUri, Value partKey)
Policy
openPartPolicy(Uri meshUri, Value partKey)
Stage
openPartStage(Uri meshUri, Value partKey)
StoreBinding
openPartStore(Uri meshUri, Value partKey)
<P extends Plane>
PopenPlane(String planeName, Class<? extends P> planeClass)
<P extends Plane>
PopenPlane(String planeName, PlaneFactory<P> planeFactory)
protected PlanePolicy
openPolicy()
protected Stage
openStage()
protected StoreBinding
openStore()
Collection<? extends Plane>
planes()
PlanePolicy
policy()
void
pushDown(PushRequest pushRequest)
void
removeAgentRoute(String routeName)
Schedule
schedule()
void
setPolicy(PlanePolicy policy)
String
spaceName()
Stage
stage()
void
start()
void
stop()
StoreBinding
store()
TierContext
tierContext()
void
trace(Object message)
Logs a trace-level message.void
unload()
<T> T
unwrapEdge(Class<T> edgeClass)
void
warn(Object message)
Logs a warn-level message.void
willClose()
void
willLoad()
void
willOpen()
void
willStart()
void
willStop()
void
willUnload()
-
Methods inherited from class swim.runtime.AbstractTierBinding
activate, isClosed, isLoaded, isOpened, isStarted
-
Methods inherited from class swim.runtime.AbstractSwimRef
command, command, command, command, command, command, command, command, downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs, hostRef, hostRef, laneRef, laneRef, laneRef, laneRef, nodeRef, nodeRef, nodeRef, nodeRef
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface swim.api.downlink.DownlinkFactory
downlink, downlinkHttp, downlinkList, downlinkMap, downlinkValue, downlinkWs
-
-
-
-
Constructor Detail
-
Fabric
public Fabric(String spaceName, FabricDef fabricDef, KernelContext kernel)
-
-
Method Detail
-
spaceName
public final String spaceName()
-
fabricDef
public final FabricDef fabricDef()
-
tierContext
public final TierContext tierContext()
- Specified by:
tierContext
in interfaceTierBinding
- Specified by:
tierContext
in classAbstractTierBinding
-
edgeWrapper
public final EdgeBinding edgeWrapper()
- Specified by:
edgeWrapper
in interfaceEdgeContext
-
unwrapEdge
public <T> T unwrapEdge(Class<T> edgeClass)
- Specified by:
unwrapEdge
in interfaceEdgeContext
-
meshUri
public final Uri meshUri()
- Specified by:
meshUri
in interfaceCellContext
-
policy
public final PlanePolicy policy()
- Specified by:
policy
in interfaceCellContext
- Specified by:
policy
in interfacePlaneContext
- Specified by:
policy
in interfaceSpace
-
setPolicy
public void setPolicy(PlanePolicy policy)
- Specified by:
setPolicy
in interfacePlaneContext
-
schedule
public Schedule schedule()
- Specified by:
schedule
in interfaceCellContext
- Specified by:
schedule
in interfacePlaneContext
- Specified by:
schedule
in interfaceSpace
-
stage
public final Stage stage()
- Specified by:
stage
in interfaceCellContext
- Specified by:
stage
in interfacePlaneContext
- Specified by:
stage
in interfaceSpace
-
store
public final StoreBinding store()
- Specified by:
store
in interfaceCellContext
-
kernel
public final KernelContext kernel()
-
edge
public final EdgeBinding edge()
-
getAuthenticator
public Authenticator getAuthenticator(String authenticatorName)
- Specified by:
getAuthenticator
in interfacePlaneContext
-
addAuthenticator
public void addAuthenticator(String authenticatorName, Authenticator authenticator)
- Specified by:
addAuthenticator
in interfacePlaneContext
-
planes
public Collection<? extends Plane> planes()
-
openPlane
public <P extends Plane> P openPlane(String planeName, PlaneFactory<P> planeFactory)
-
createPlane
protected <P extends Plane> P createPlane(PlaneFactory<P> planeFactory)
-
getAgentRoute
public <A extends Agent> AgentRoute<A> getAgentRoute(String routeName)
- Specified by:
getAgentRoute
in interfacePlaneContext
-
createAgentRoute
public <A extends Agent> AgentRoute<A> createAgentRoute(Class<? extends A> agentClass)
- Specified by:
createAgentRoute
in interfacePlaneContext
-
addAgentRoute
public void addAgentRoute(String routeName, UriPattern pattern, AgentRoute<?> agentRoute)
- Specified by:
addAgentRoute
in interfacePlaneContext
-
addAgentRoute
public void addAgentRoute(String routeName, String pattern, AgentRoute<?> agentRoute)
- Specified by:
addAgentRoute
in interfacePlaneContext
-
removeAgentRoute
public void removeAgentRoute(String routeName)
- Specified by:
removeAgentRoute
in interfacePlaneContext
-
getAgentFactory
public AgentFactory<?> getAgentFactory(Uri nodeUri)
- Specified by:
getAgentFactory
in interfacePlaneContext
-
createAgentFactory
public AgentFactory<?> createAgentFactory(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, AgentDef agentDef)
- Specified by:
createAgentFactory
in interfaceEdgeContext
-
createAgentFactory
public <A extends Agent> AgentFactory<A> createAgentFactory(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Class<? extends A> agentClass)
- Specified by:
createAgentFactory
in interfaceEdgeContext
-
openAgents
public void openAgents(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
- Specified by:
openAgents
in interfaceEdgeContext
-
openLog
protected Log openLog()
-
closeLog
protected void closeLog()
-
openPolicy
protected PlanePolicy openPolicy()
-
closePolicy
protected void closePolicy()
-
openStage
protected Stage openStage()
-
closeStage
protected void closeStage()
-
createStore
public StoreBinding createStore(StoreDef storeDef)
-
injectStore
public StoreBinding injectStore(StoreBinding store)
-
openStore
protected StoreBinding openStore()
-
closeStore
protected void closeStore()
-
createEdge
protected EdgeBinding createEdge()
-
openEdge
protected void openEdge(EdgeBinding edge)
-
createMesh
protected MeshBinding createMesh(EdgeBinding edge, MeshDef meshDef)
-
createPart
protected PartBinding createPart(EdgeBinding edge, MeshBinding mesh, PartDef partDef)
-
createHost
protected HostBinding createHost(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostDef hostDef)
-
createNode
protected NodeBinding createNode(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostBinding host, NodeDef nodeDef)
-
createLane
protected LaneBinding createLane(EdgeBinding edge, MeshBinding mesh, PartBinding part, HostBinding host, NodeBinding node, LaneDef laneDef)
-
injectEdge
protected EdgeBinding injectEdge(EdgeBinding edge)
-
openEdgeLog
protected Log openEdgeLog()
-
openEdgePolicy
protected Policy openEdgePolicy()
-
openEdgeStage
protected Stage openEdgeStage()
-
openEdgeStore
protected StoreBinding openEdgeStore()
-
createMesh
public MeshBinding createMesh(Uri meshUri)
- Specified by:
createMesh
in interfaceEdgeContext
-
injectMesh
public MeshBinding injectMesh(Uri meshUri, MeshBinding mesh)
- Specified by:
injectMesh
in interfaceEdgeContext
-
openMeshStore
public StoreBinding openMeshStore(Uri meshUri)
-
createPart
public PartBinding createPart(Uri meshUri, Value partKey)
- Specified by:
createPart
in interfaceEdgeContext
-
injectPart
public PartBinding injectPart(Uri meshUri, Value partKey, PartBinding part)
- Specified by:
injectPart
in interfaceEdgeContext
-
openPartStore
public StoreBinding openPartStore(Uri meshUri, Value partKey)
-
createHost
public HostBinding createHost(Uri meshUri, Value partKey, Uri hostUri)
- Specified by:
createHost
in interfaceEdgeContext
-
injectHost
public HostBinding injectHost(Uri meshUri, Value partKey, Uri hostUri, HostBinding host)
- Specified by:
injectHost
in interfaceEdgeContext
-
openHostStore
public StoreBinding openHostStore(Uri meshUri, Value partKey, Uri hostUri)
-
createNode
public NodeBinding createNode(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
- Specified by:
createNode
in interfaceEdgeContext
-
injectNode
public NodeBinding injectNode(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
- Specified by:
injectNode
in interfaceEdgeContext
-
openNodeStore
public StoreBinding openNodeStore(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri)
-
getLaneDef
public LaneDef getLaneDef(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
-
createLane
public LaneBinding createLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, LaneDef laneDef)
- Specified by:
createLane
in interfaceEdgeContext
-
createLane
public LaneBinding createLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
- Specified by:
createLane
in interfaceEdgeContext
-
injectLane
public LaneBinding injectLane(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri, LaneBinding lane)
- Specified by:
injectLane
in interfaceEdgeContext
-
openLanes
public void openLanes(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, NodeBinding node)
- Specified by:
openLanes
in interfaceEdgeContext
-
openLaneLog
public Log openLaneLog(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
-
openLanePolicy
public Policy openLanePolicy(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
-
openLaneStage
public Stage openLaneStage(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
-
openLaneStore
public StoreBinding openLaneStore(Uri meshUri, Value partKey, Uri hostUri, Uri nodeUri, Uri laneUri)
-
authenticate
public PolicyDirective<Identity> authenticate(Credentials credentials)
- Specified by:
authenticate
in interfaceEdgeContext
-
bindDownlink
public LinkBinding bindDownlink(Downlink downlink)
- Specified by:
bindDownlink
in interfaceCellContext
-
openDownlink
public void openDownlink(LinkBinding link)
- Specified by:
openDownlink
in interfaceCellContext
-
closeDownlink
public void closeDownlink(LinkBinding link)
- Specified by:
closeDownlink
in interfaceCellContext
-
pushDown
public void pushDown(PushRequest pushRequest)
- Specified by:
pushDown
in interfaceCellContext
-
trace
public void trace(Object message)
Description copied from interface:Log
Logs a trace-level message.
-
debug
public void debug(Object message)
Description copied from interface:Log
Logs a debug-level message.
-
info
public void info(Object message)
Description copied from interface:Log
Logs an info-level message.
-
warn
public void warn(Object message)
Description copied from interface:Log
Logs a warn-level message.
-
error
public void error(Object message)
Description copied from interface:Log
Logs an error-level message.
-
open
public void open()
- Specified by:
open
in interfaceTierBinding
- Overrides:
open
in classAbstractTierBinding
-
load
public void load()
- Specified by:
load
in interfaceTierBinding
- Overrides:
load
in classAbstractTierBinding
-
start
public void start()
- Specified by:
start
in interfaceTierBinding
- Overrides:
start
in classAbstractTierBinding
-
stop
public void stop()
- Specified by:
stop
in interfaceTierBinding
- Overrides:
stop
in classAbstractTierBinding
-
unload
public void unload()
- Specified by:
unload
in interfaceTierBinding
- Overrides:
unload
in classAbstractTierBinding
-
close
public void close()
- Specified by:
close
in interfaceSwimRef
- Specified by:
close
in interfaceTierBinding
- Specified by:
close
in interfaceTierContext
- Overrides:
close
in classAbstractTierBinding
-
willOpen
public void willOpen()
- Specified by:
willOpen
in interfaceTierContext
- Overrides:
willOpen
in classAbstractTierBinding
-
didOpen
public void didOpen()
- Specified by:
didOpen
in interfaceTierContext
- Overrides:
didOpen
in classAbstractTierBinding
-
willLoad
public void willLoad()
- Specified by:
willLoad
in interfaceTierContext
- Overrides:
willLoad
in classAbstractTierBinding
-
didLoad
public void didLoad()
- Specified by:
didLoad
in interfaceTierContext
- Overrides:
didLoad
in classAbstractTierBinding
-
willStart
public void willStart()
- Specified by:
willStart
in interfaceTierContext
- Overrides:
willStart
in classAbstractTierBinding
-
didStart
public void didStart()
- Specified by:
didStart
in interfaceTierContext
- Overrides:
didStart
in classAbstractTierBinding
-
willStop
public void willStop()
- Specified by:
willStop
in interfaceTierContext
- Overrides:
willStop
in classAbstractTierBinding
-
didStop
public void didStop()
- Specified by:
didStop
in interfaceTierContext
- Overrides:
didStop
in classAbstractTierBinding
-
willUnload
public void willUnload()
- Specified by:
willUnload
in interfaceTierContext
- Overrides:
willUnload
in classAbstractTierBinding
-
didUnload
public void didUnload()
- Specified by:
didUnload
in interfaceTierContext
- Overrides:
didUnload
in classAbstractTierBinding
-
willClose
public void willClose()
- Specified by:
willClose
in interfaceTierContext
- Overrides:
willClose
in classAbstractTierBinding
-
didClose
public void didClose()
- Specified by:
didClose
in interfaceTierBinding
- Overrides:
didClose
in classAbstractTierBinding
-
didFail
public void didFail(Throwable error)
- Specified by:
didFail
in interfaceTierBinding
- Overrides:
didFail
in classAbstractTierBinding
-
-