public class GemSpoolHandler extends java.lang.Object implements java.io.Serializable, MessageResponseInterface, SystemHandlerInterface, StateChangeNotification
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
cvsRev |
static int |
debugLevel |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Initialize the spooler variable and send the activated event report.
|
void |
changeStateProposed(int oldState,
int newState)
Implement the state change notification to know when to activate the spooler.
|
void |
deactivate()
Set the spooler variables and send the deactivated event report.
|
boolean |
deSpool()
Send the data.
|
static GemSpoolHandler |
getSpoolHandler(java.lang.String equipmentName)
Returns the persistent instance of the spool handler or null if one has
not been created for the provided equipment name.
|
static GemSpoolHandler |
getSpoolHandler(java.lang.String equipmentName,
SecsFormat3x5x activateCEID,
SecsFormat3x5x deactivateCEID,
SecsFormat3x5x spoolingTransmitFailure)
Returns the persistent instance of the spool handler.
|
static GemSpoolHandler |
getSpoolHandler(java.lang.String equipmentName,
SecsFormat3x5x activateCEID,
SecsFormat3x5x deactivateCEID,
SecsFormat3x5x spoolingTransmitFailure,
boolean createNew)
Returns the persistent instance of the spool handler.
|
static void |
init(boolean delete)
Initialize the disk.
|
boolean |
isActive()
Returns true if spooling is active
|
boolean |
isEnabled()
Returns true if spooling is enabled.
|
static GemSpoolHandler |
loadFromDisk(java.lang.String equipmentName,
SecsFormat3x5x activateCEID,
SecsFormat3x5x deactivateCEID,
SecsFormat3x5x spoolingTransmitFailure)
Returns the persistent instance of the spool handler.
|
static GemSpoolHandler |
loadFromXML(java.lang.String equipmentName,
SecsFormat3x5x activateCEID,
SecsFormat3x5x deactivateCEID,
SecsFormat3x5x spoolingTransmitFailure)
This will load the last saved persistence file.
|
void |
purge()
Purge the spool queue.
|
void |
register(int stream)
Spool all messages in the stream.
|
void |
register(int stream,
int function)
Register to spool the particular stream/function.
|
boolean |
responseReceived(int status,
SecsMsg primary,
SecsMsg response)
The MsgResponseInterface.
|
boolean |
S2F43(SecsMsg msg)
This method receives an S2F43 and sends an S2F44.
|
boolean |
S6F23(SecsMsg msg)
Process the S6F23 message.
|
void |
setEnabled(boolean flag)
Enable spooling.
|
void |
setEnabled(ValueChangedEvent event)
This is the target of the called back for the EnableSpooling DVNAME.
|
void |
showSpool(java.lang.String header,
int debug)
Show the spool for the only spooler.
|
boolean |
spoolMessage(SecsMsg msg)
This will accept spool requests and determine how to handle them.
|
void |
store()
Store the object to it's persistent form.
|
void |
storeToXML()
Save the handler object.
|
boolean |
verifyMessage(SecsMsg msg)
This checks to see if we need to spool the message.
|
public static final java.lang.String cvsRev
public static int debugLevel
public void activate()
public void changeStateProposed(int oldState, int newState) throws DeclinedStateChangeException
changeStateProposed
in interface StateChangeNotification
DeclinedStateChangeException
public void deactivate()
public boolean deSpool()
public static GemSpoolHandler getSpoolHandler(java.lang.String equipmentName)
public static GemSpoolHandler getSpoolHandler(java.lang.String equipmentName, SecsFormat3x5x activateCEID, SecsFormat3x5x deactivateCEID, SecsFormat3x5x spoolingTransmitFailure) throws java.io.IOException
equipmentName
- TODOjava.io.IOException
public static GemSpoolHandler getSpoolHandler(java.lang.String equipmentName, SecsFormat3x5x activateCEID, SecsFormat3x5x deactivateCEID, SecsFormat3x5x spoolingTransmitFailure, boolean createNew) throws java.io.IOException
createNew
- forces the creation of a new handler even if a persistent
copy exists.java.io.IOException
public static void init(boolean delete) throws java.io.IOException
delete
- cleans the directory if true.java.io.IOException
- if there is some error creating a directory with the
name "spool".public boolean isActive()
public boolean isEnabled()
public static GemSpoolHandler loadFromDisk(java.lang.String equipmentName, SecsFormat3x5x activateCEID, SecsFormat3x5x deactivateCEID, SecsFormat3x5x spoolingTransmitFailure)
equipmentName
- the equipment name. This is not part of the persistance but must be valid so is provided here.activateCEID
- the activate CEID. This is not part of the persistance but must be valid so is provided here.deactivateCEID
- the deactivate CEID. This is not part of the persistance but must be valid so is provided here.spoolingTransmitFailure
- the CEID triggered on a spool transmit failure. This is not part of the persistance but must be valid so is provided here.public static GemSpoolHandler loadFromXML(java.lang.String equipmentName, SecsFormat3x5x activateCEID, SecsFormat3x5x deactivateCEID, SecsFormat3x5x spoolingTransmitFailure)
equipmentName
- the equipment name. This is not part of the persistance but must be valid so is provided here.activateCEID
- the activate CEID. This is not part of the persistance but must be valid so is provided here.deactivateCEID
- the deactivate CEID. This is not part of the persistance but must be valid so is provided here.spoolingTransmitFailure
- the CEID triggered on a spool transmit failure. This is not part of the persistance but must be valid so is provided here.public void purge() throws java.io.IOException
java.io.IOException
public void register(int stream)
public void register(int stream, int function)
public boolean responseReceived(int status, SecsMsg primary, SecsMsg response)
responseReceived
in interface MessageResponseInterface
public boolean S2F43(SecsMsg msg)
public boolean S6F23(SecsMsg msg)
public void setEnabled(boolean flag)
flag
- true to enable spooling false to disable spooling.public void setEnabled(ValueChangedEvent event)
public void showSpool(java.lang.String header, int debug)
public boolean spoolMessage(SecsMsg msg)
MessageSpooledException
- if the message is spooledpublic void store()
public void storeToXML()
public boolean verifyMessage(SecsMsg msg) throws SecsException
verifyMessage
in interface SystemHandlerInterface
SecsException
Copyright © 1999-2021 ErgoTech Systems, Inc. All Rights Reserved.