public class MessageFlow
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
static int |
FLOW_CLOSED |
static int |
FLOW_DISABLED |
static int |
FLOW_PAUSE |
static int |
FLOW_READY |
static int |
FLOW_RETRYING |
static int |
FLOW_RUNNING |
static int |
FLOW_STANDBY |
static int |
FLOW_STOPPED |
static int |
GROUP_COUNT |
static int |
GROUP_HBEAT |
static int |
GROUP_ID |
static int |
GROUP_RETRY |
static int |
GROUP_SIZE |
static int |
GROUP_SPAN |
static int |
GROUP_STATUS |
static int |
GROUP_TID |
static int |
GROUP_TIME |
static int |
GROUP_TIMEOUT |
static int |
GROUP_TYPE |
static int |
MF_NODE |
static int |
MF_PSTR |
static int |
MF_RCVR |
Constructor and Description |
---|
MessageFlow(java.util.Map props) |
MessageFlow(java.util.Map props,
XQueue escalation)
Creates new MessageFlow
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
demote()
demotes the flow from the current status to its default status
|
java.util.Map<java.lang.String,java.lang.Object> |
diff(java.util.Map props)
It returns a Map with only modified or new props.
|
int |
disable()
disables the flow from the current status to the disabled status
|
int |
enable()
enables the disabled flow to its previous status
|
int |
getDebugMode() |
int |
getDefaultStatus() |
java.lang.String |
getName() |
int |
getNumberOfNodes(int type)
returns number of nodes of the specific type
|
int |
getNumberOfXQueues()
returns number of XQueues of the flow
|
java.lang.String |
getOperation() |
int[] |
getPartition()
returns partition of root queue for external requests
|
XQueue |
getRootQueue() |
int |
getStatus() |
boolean |
hasMajorChange(java.util.Map<java.lang.String,java.lang.Object> change)
It takes the Map returned from diff() and analizes what have been
changed.
|
int |
ingest(java.lang.String key,
javax.jms.Message msg)
It ingests the message into the XQueue with the name of key and
returns the id upon success.
|
static java.lang.Object |
initNode(java.util.Map props,
java.lang.String prefix)
It instantiates a node object from the given props and returns the object
upon success.
|
java.lang.String |
list(int type)
returns a text of list with all nodes in either JSON or XML
|
int |
promote()
promotes the flow from the current status to running status
|
java.util.Map<java.lang.String,java.lang.String> |
queryInfo(long currentTime,
long sessionTime,
java.lang.String target,
java.lang.String key,
int type)
returns a Map containing queried information according to the result type
|
int |
refreshRules(java.lang.String key)
It refreshes the external rules on all the nodes contains the rule
with the given name and returns the number of external rulesets updated.
|
int |
reload(java.util.Map<java.lang.String,java.lang.Object> change)
It reloads the changes for the entire flow and returns the number of
failures.
|
void |
run() |
void |
setDebugMode(int debug) |
java.lang.String |
show(java.lang.String key,
int id,
int type)
returns the display text on the message at the cell id of the queue
|
void |
showChange(java.lang.String prefix,
java.lang.String base,
java.util.Map<java.lang.String,java.lang.Object> change,
boolean detail)
It loggs the details of the change returned by diff()
|
void |
start()
starts all threads and/or nodes
|
void |
stop()
stops all nodes and the threads
|
javax.jms.Message |
takeback(java.lang.String key,
int id)
takes back the message at the cell of id from the queue
|
public static final int MF_RCVR
public static final int MF_NODE
public static final int MF_PSTR
public static final int GROUP_ID
public static final int GROUP_TID
public static final int GROUP_TYPE
public static final int GROUP_SIZE
public static final int GROUP_HBEAT
public static final int GROUP_TIMEOUT
public static final int GROUP_STATUS
public static final int GROUP_COUNT
public static final int GROUP_SPAN
public static final int GROUP_RETRY
public static final int GROUP_TIME
public static final int FLOW_READY
public static final int FLOW_RUNNING
public static final int FLOW_RETRYING
public static final int FLOW_PAUSE
public static final int FLOW_STANDBY
public static final int FLOW_DISABLED
public static final int FLOW_STOPPED
public static final int FLOW_CLOSED
public MessageFlow(java.util.Map props, XQueue escalation)
public MessageFlow(java.util.Map props)
public void run()
run
in interface java.lang.Runnable
public void start()
public void stop()
public int enable()
public int disable()
public int promote()
public int demote()
public int ingest(java.lang.String key, javax.jms.Message msg)
public java.lang.String show(java.lang.String key, int id, int type)
public javax.jms.Message takeback(java.lang.String key, int id)
public java.util.Map<java.lang.String,java.lang.String> queryInfo(long currentTime, long sessionTime, java.lang.String target, java.lang.String key, int type)
public java.lang.String list(int type)
public java.lang.String getName()
public java.lang.String getOperation()
public int getStatus()
public int getDefaultStatus()
public int getDebugMode()
public void setDebugMode(int debug)
public XQueue getRootQueue()
public int[] getPartition()
public int getNumberOfNodes(int type)
public int getNumberOfXQueues()
public int refreshRules(java.lang.String key)
public int reload(java.util.Map<java.lang.String,java.lang.Object> change)
public java.util.Map<java.lang.String,java.lang.Object> diff(java.util.Map props)
public boolean hasMajorChange(java.util.Map<java.lang.String,java.lang.Object> change)
public void showChange(java.lang.String prefix, java.lang.String base, java.util.Map<java.lang.String,java.lang.Object> change, boolean detail)
public static java.lang.Object initNode(java.util.Map props, java.lang.String prefix)
public void close()