Package com.orchestranetworks.d3
Class D3NodeFactory
- java.lang.Object
-
- com.orchestranetworks.d3.D3NodeFactory
-
public final class D3NodeFactory extends Object
Factory for creating a D3 engine depending on the node type chosen (primary or replica), which offers D3 administrative functionalities.To avoid an
IllegalArgumentException
, verify that the node type is correct before instantiating engines. This can be checked in the propertyebx.d3.mode
in theebx.properties
file, or using the methodsisMasterNode()
andisSlaveNode()
.Depending on the type of the node, only some methods may be accessible.
-
If a
master
node, onlycreateForMasterFromSession(Session)
is accessible. -
If a
slave
node, onlycreateForSlaveFromSession(Session)
is accessible. -
If a
hub
, both methods are accessible. -
If a
single
node, that is, if D3 is deactivated, none of the methods are accessible.
- Since:
- 5.4.2
-
If a
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description D3NodeAsMaster
createForMasterFromSession(Session aSession)
Creates a primary D3 engine to offer primary administrative functionalities.D3NodeAsSlave
createForSlaveFromSession(Session aSession)
Creates a replica D3 engine to offer replica administrative functionalities.D3Node
getCurrentD3Node()
Returns currentD3Node
of the EBX® instance.static D3NodeFactory
getInstance(Repository aRepository)
Get a D3 engine factory.boolean
isMasterNode()
Returns whether the current node is a primary node.boolean
isSlaveNode()
Returns whether the current node is a replica node.
-
-
-
Method Detail
-
getInstance
public static D3NodeFactory getInstance(Repository aRepository)
Get a D3 engine factory.- Parameters:
aRepository
- repository in which D3 is running- Throws:
NullPointerException
- if no repository is defined.
-
createForMasterFromSession
public D3NodeAsMaster createForMasterFromSession(Session aSession)
Creates a primary D3 engine to offer primary administrative functionalities.- Parameters:
aSession
- current user session- Throws:
IllegalStateException
- if called within aBatch
or if not inmaster
orhub
node.- Since:
- 5.4.2
-
createForSlaveFromSession
public D3NodeAsSlave createForSlaveFromSession(Session aSession)
Creates a replica D3 engine to offer replica administrative functionalities.- Parameters:
aSession
- current user session- Throws:
IllegalStateException
- if called within aBatch
or if not inslave
orhub
node.- Since:
- 5.4.2
-
getCurrentD3Node
public D3Node getCurrentD3Node()
Returns currentD3Node
of the EBX® instance. This can be invoked to perform read-only operations without aSession
.If D3 mode is defined as
single
, thennull
is returned.- Since:
- 5.5.1
- See Also:
D3NodeAsMaster
,D3NodeAsSlave
-
isMasterNode
public boolean isMasterNode()
Returns whether the current node is a primary node.If
true
, a primary engine can be created using the methodcreateForMasterFromSession(Session)
.- Since:
- 5.4.2
-
isSlaveNode
public boolean isSlaveNode()
Returns whether the current node is a replica node.If
true
, a replica engine can be created using the methodcreateForSlaveFromSession(Session)
.- Since:
- 5.4.2
-
-