Package com.isode.som.qmgr.objects
Class SomQmgrMta
java.lang.Object
com.isode.som.qmgr.objects.SomQmgrObject
com.isode.som.qmgr.objects.SomQmgrMta
- All Implemented Interfaces:
SomQmgrHandler,SomHandler
Class which models a Peer MTA object within M-Switch
- Author:
- tc
-
Field Summary
Fields inherited from class com.isode.som.qmgr.objects.SomQmgrObject
errortext, somSession -
Constructor Summary
ConstructorsConstructorDescriptionSomQmgrMta(SomSession session) Create a new MTA objectSomQmgrMta(SomSession session, String[] pairs) Create a new MTA object, populating it from the attribute pairs -
Method Summary
Modifier and TypeMethodDescriptionactive()Test whether this MTA is active or notbooleanTest whether MTA activeGet number of active associations on this MTAvoidaddMessage(SomQmgrMessage object) Add a new message to the objectGet total number of inbound addresses handledGet total number of outbound addresses handledGenerate an information string for this MTAGet time until which this MTA is cachedchannel()Get channel name for this MTAvoidclear(SomCommandListener listener) Clear any delay on this MTAvoidconnect(SomCommandListener listener) Connect to this permanent peer MTAGet creation time of this MTAvoiddelay(int mins, SomCommandListener listener) Delay this MTAvoiddelete(SomCommandListener listener) Delete this permanent peer MTAvoiddeleteMessages(SomCommandListener listener) Delete all the messages on this MTAGet MTA descriptionvoiddisable(SomCommandListener listener) Disable this MTAvoiddisableInbound(SomCommandListener listener) Disable inbound connections to this peer MTAvoiddisconnect(SomCommandListener listener) Disconnect from this permanent peer MTAdiverted()Whether MTA has the 'divert' flag set or notvoiddownwardsforce(SomCommandListener listener) Clear delays and enable this MTA and subordinate messagesvoidenable(SomCommandListener listener) Enable this MTA, if disabledenabled()Get string indicating whether MTA is enabledbooleanTest whether MTA enabledCheck whether this MTA is enabled for inbound connectionsbooleanCheck whether this MTA is enabled for inbound connectionsvoidenableInbound(SomCommandListener listener) Enable inbound connections to this peer MTAGet count of errors on this MTAGet count of failed conversions on this MTAGet count of failed outbound associations on this MTAGet the associations subordinate to this MTAGet the inbound messages subordinate to this MTAGet the messages subordinate to this MTAGet the name of this MTAGet the schedules subordinate to this MTAvoidgetStatus(SomCommandListener listener) Update the status of this MTA object by querying the Queue ManagervoidgetSubordinateMessages(SomCommandListener listener) Get the subordinate messages of this MTAvoidgetSubordinateMessages(SomCommandListener listener, Integer sizelimit) Get the subordinate messages of this MTAvoidhandleBindResponse(int status, String detail) Handle the response to a Bind operationvoidhandleResponse(SomCommand obj, int status, SomMessage msg) Handles the response to commands which return a SomMessage object (i.e.voidhandleResponse(SomCommand command, int status, SomQmgrChannel object) Handles the response to commands which return a list of channel objectsvoidhandleResponse(SomCommand command, int status, SomQmgrMessage object) Handles the response to commands which return a list of message objectsvoidhandleResponse(SomCommand command, int status, SomQmgrMta object) Handles the response to commands which return a list of MTA objectsvoidhandleResponse(SomCommand command, int status, SomQmgrQueueManager object) voidhandleResponse(SomCommand command, int status, String detail) Handles the response to control commands which return an OK/error response plus an info stringvoidhandleResponse(SomCommand command, int status, String[] pairs) Handles the response to commands which return data about the current object - i.e.Get this MTA's hierarchy valueinAssoc()Get current number of inbound associations on this MTAindex()Get this MTA's index valueinfo()Get information string for Peer MTAGet time of last attempted connectionGet time of last inbound association on this MTAGet time of last outbound association on this MTAGet time of last successful connectionGet count of loops detected on this MTAGet maximum permitted number of inbound connectionsGet maximum permitted number of outbound connectionsGet total number of inbound messages receivedGet total number of outbound messages sentmta()Get MTA nameTest whether MTA is currently connectingbooleanTest whether MTA is currently connectingvoidnondeliverMessages(String reason, SomCommandListener listener) Nondeliver all the messages on this MTAGet number of messages queuedGet number of reports queuedGet age of oldest messageGet Queue Id of oldest messageGet number of current outbound associationsvoidparsePairs(String[] pairs) Parse the Attribute pairs passed inprotocol()Get protocol id for MTAGet total volume of received messagesvoidrefreshSubordinates(SomCommandListener listener) Refresh the list of subordinate messages of this MTAvoidrefreshSubordinates(SomCommandListener listener, Integer sizelimit) Refresh the list of subordinate messages of this MTA, with size limitGet last outbound connection refusal status as x.y.z stringGet last outbound connection refusal reason textGet last outbound connection refusal timeGet number of rejected inbound connectionsGet number of rejected inbound messagesGet last inbound connection rejection status as x.y.z stringGet last inbound connection reject timevoidremoveFromArray(ArrayList<SomQmgrMta> mtas) Remove this MTA from the array passed invoidreprocess(SomCommandListener listener) Reprocess all messages on this MTArerouted()voidSet the SOM version associated with this MTAGet the number of stored recipientsGet the number of successful conversions (for a shaper channel MTA)voidtimeoutMessages(SomCommandListener listener) Time out all the messages on this MTAGet total number of inbound associationsGet total number of outbound associationsGet total volume of transmitted messagesGet volume of messages queuedMethods inherited from class com.isode.som.qmgr.objects.SomQmgrObject
addAttribute, addAttribute, addBindListener, clearAttributes, getBooleanAttributeValue, getDoubleAttributeValue, getIntegerAttributeValue, getSession, getStringAttributeValue, notifyBindListeners, notifyListener, notifyListeners, print, print_str, removeBindListener, setSkipNotifications
-
Constructor Details
-
SomQmgrMta
Create a new MTA object- Parameters:
session- Session which the message is associated with, which cannot be null
-
SomQmgrMta
Create a new MTA object, populating it from the attribute pairs- Parameters:
session- Session which the message is associated with, which cannot be nullpairs- Attribute pairs to use which cannot be null
-
-
Method Details
-
setSomVersion
Set the SOM version associated with this MTA- Parameters:
v- the version of SOM protocol used to access this MTA
-
getMtaName
Get the name of this MTA- Returns:
- The String representation of this MTA or "Unknown".
-
parsePairs
Parse the Attribute pairs passed in- Overrides:
parsePairsin classSomQmgrObject- Parameters:
pairs- Array of attribute type:value strings which may not be null
-
addMessage
Add a new message to the object- Parameters:
object- Message to add which cannot be null
-
getMessages
Get the messages subordinate to this MTA- Returns:
- Array of messages
-
removeFromArray
Remove this MTA from the array passed in- Parameters:
mtas- Array of MTAs from which this one should be remove, which cannot be null
-
getInboundMessages
Get the inbound messages subordinate to this MTA- Returns:
- Array of inbound messages
-
getAssociations
Get the associations subordinate to this MTA- Returns:
- Array of associations
-
getSchedules
Get the schedules subordinate to this MTA- Returns:
- Array of schedules
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to control commands which return an OK/error response plus an info string- Specified by:
handleResponsein interfaceSomHandler- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
command- the SOM commandstatus- operation statusdetail- detail on error
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to commands which return data about the current object - i.e. we are refreshing an existing object.- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
command- the SOM commandstatus- operation statuspairs- data pairs
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to commands which return a list of MTA objects- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
command- the SOM commandstatus- operation statusobject- a SOM Qmgr MTA object
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to commands which return a list of channel objects- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
command- the SOM commandstatus- operation statusobject- a channel object
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to commands which return a SomMessage object (i.e. read from the Queue or Archive).- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
obj- the SOM commandstatus- operation statusmsg- a message object
-
handleBindResponse
Description copied from interface:SomHandlerHandle the response to a Bind operation- Specified by:
handleBindResponsein interfaceSomHandler- Parameters:
status- operation statusdetail- error detail on failure
-
handleResponse
-
handleResponse
Description copied from interface:SomQmgrHandlerHandles the response to commands which return a list of message objects- Specified by:
handleResponsein interfaceSomQmgrHandler- Parameters:
command- the SOM commandstatus- operation statusobject- a qmgr message object
-
getStatus
Update the status of this MTA object by querying the Queue Manager- Parameters:
listener- Listener to notify when update complete, which may be null- Throws:
SomException- on error
-
refreshSubordinates
Refresh the list of subordinate messages of this MTA- Parameters:
listener- Listener to notify when update complete, which may be null- Throws:
SomException- on error
-
refreshSubordinates
Refresh the list of subordinate messages of this MTA, with size limit- Parameters:
listener- Listener to notify when update complete, which may be nullsizelimit- Limit on number of entries to return, which may not be null- Throws:
SomException- on error
-
buildInfoString
Generate an information string for this MTA- Returns:
- info string
-
getSubordinateMessages
Get the subordinate messages of this MTA- Parameters:
listener- Listener to notify when update complete, which may be null- Throws:
SomException- on error
-
getSubordinateMessages
public void getSubordinateMessages(SomCommandListener listener, Integer sizelimit) throws SomException Get the subordinate messages of this MTA- Parameters:
listener- Listener to notify when update complete, which may be nullsizelimit- Limit on number of messages, which may not be null- Throws:
SomException- on error
-
clear
Clear any delay on this MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
enable
Enable this MTA, if disabled- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
disable
Disable this MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
delay
Delay this MTA- Parameters:
mins- Number of minutes to delay bylistener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
downwardsforce
Clear delays and enable this MTA and subordinate messages- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
reprocess
Reprocess all messages on this MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
delete
Delete this permanent peer MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
connect
Connect to this permanent peer MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
disconnect
Disconnect from this permanent peer MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
enableInbound
Enable inbound connections to this peer MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
disableInbound
Disable inbound connections to this peer MTA- Parameters:
listener- Listener to notify when operation is complete, which may be null- Throws:
SomException- on error
-
active
Test whether this MTA is active or not- Returns:
- true if MTA is active
- Throws:
SomException- on error
-
activeNumber
Get number of active associations on this MTA- Returns:
- Number of active associations
- Throws:
SomException- on error
-
cachedUntil
Get time until which this MTA is cached- Returns:
- Time until which MTA is cached (UTC Time String)
- Throws:
SomException- on error
-
channel
Get channel name for this MTA- Returns:
- Channel name
- Throws:
SomException- on error
-
enabled
Get string indicating whether MTA is enabled- Returns:
- String "True" if MTA enabled, else "False"
- Throws:
SomException- on error
-
activeBool
Test whether MTA active- Returns:
- true if active
- Throws:
SomException- on error
-
enabledBool
Test whether MTA enabled- Returns:
- true if enabled
- Throws:
SomException- on error
-
info
Get information string for Peer MTA- Returns:
- Information string
- Throws:
SomException- on error
-
lastAttempt
Get time of last attempted connection- Returns:
- Time of last attempted connection (UTC time string)
- Throws:
SomException- on error
-
lastSuccess
Get time of last successful connection- Returns:
- Time of last successful connection (UTC time string)
- Throws:
SomException- on error
-
mta
Get MTA name- Returns:
- MTA Name
- Throws:
SomException- on error
-
numberMessages
Get number of messages queued- Returns:
- Number of messages on MTA
- Throws:
SomException- on error
-
numberReports
Get number of reports queued- Returns:
- Number of reports on MTA
- Throws:
SomException- on error
-
oldestMessage
Get age of oldest message- Returns:
- Age of oldest message (UTC Time string)
- Throws:
SomException- on error
-
volumeMessages
Get volume of messages queued- Returns:
- Volume of messages on MTA (bytes)
- Throws:
SomException- on error
-
addressesIn
Get total number of inbound addresses handled- Returns:
- Total number of inbound addresses
- Throws:
SomException- on error
-
addressesOut
Get total number of outbound addresses handled- Returns:
- Total number of outbound addresses
- Throws:
SomException- on error
-
creationTime
Get creation time of this MTA- Returns:
- Creation time of MTA (UTC Time string)
- Throws:
SomException- on error
-
description
Get MTA description- Returns:
- MTA description
- Throws:
SomException- on error
-
enabledInboundBool
Check whether this MTA is enabled for inbound connections- Returns:
- true if enabled for inbound connections
- Throws:
SomException- on error
-
enabledInbound
Check whether this MTA is enabled for inbound connections- Returns:
- "True" if enabled for inbound connections
- Throws:
SomException- on error
-
errorCount
Get count of errors on this MTA- Returns:
- error count
- Throws:
SomException- on error
-
failedConversions
Get count of failed conversions on this MTA- Returns:
- count of failed conversions
- Throws:
SomException- on error
-
failedOutAssoc
Get count of failed outbound associations on this MTA- Returns:
- count of failed outbound associations
- Throws:
SomException- on error
-
hierarchy
Get this MTA's hierarchy value- Returns:
- hierarchy value
- Throws:
SomException- on error
-
inAssoc
Get current number of inbound associations on this MTA- Returns:
- current number of inbound associations
- Throws:
SomException- on error
-
index
Get this MTA's index value- Returns:
- index value
- Throws:
SomException- on error
-
lastInboundTime
Get time of last inbound association on this MTA- Returns:
- time of inbound associations (UTC Time string)
- Throws:
SomException- on error
-
lastOutboundTime
Get time of last outbound association on this MTA- Returns:
- time of outbound associations (UTC Time string)
- Throws:
SomException- on error
-
loopsDetected
Get count of loops detected on this MTA- Returns:
- count of loops detected
- Throws:
SomException- on error
-
maxInboundConnections
Get maximum permitted number of inbound connections- Returns:
- maximum permitted inbound connections
- Throws:
SomException- on error
-
maxOutboundConnections
Get maximum permitted number of outbound connections- Returns:
- maximum permitted outbound connections
- Throws:
SomException- on error
-
messagesIn
Get total number of inbound messages received- Returns:
- total number of inbound messages received
- Throws:
SomException- on error
-
messagesOut
Get total number of outbound messages sent- Returns:
- total number of outbound messages sent
- Throws:
SomException- on error
-
mtaConnectingBool
Test whether MTA is currently connecting- Returns:
- true if connecting
- Throws:
SomException- on error
-
mtaConnecting
Test whether MTA is currently connecting- Returns:
- string "True" if connecting
- Throws:
SomException- on error
-
oldestMessageId
Get Queue Id of oldest message- Returns:
- queueid of oldest message
- Throws:
SomException- on error
-
outboundAssociations
Get number of current outbound associations- Returns:
- current number of outbound associations
- Throws:
SomException- on error
-
protocol
Get protocol id for MTA- Returns:
- String encoding of protocol id
- Throws:
SomException- on error
-
receivedVolume
Get total volume of received messages- Returns:
- total volume of received messages
- Throws:
SomException- on error
-
refuseStatus
Get last outbound connection refusal status as x.y.z string- Returns:
- Last connection refusal status
- Throws:
SomException- on error
-
refuseText
Get last outbound connection refusal reason text- Returns:
- Last connection refusal reason text
- Throws:
SomException- on error
-
refuseTime
Get last outbound connection refusal time- Returns:
- Last connection refusal time (UTC Time String)
- Throws:
SomException- on error
-
rejectTime
Get last inbound connection reject time- Returns:
- Last connection reject time (UTC Time String)
- Throws:
SomException- on error
-
rejectedAssoc
Get number of rejected inbound connections- Returns:
- Total number of rejected inbound connections
- Throws:
SomException- on error
-
rejectedMessage
Get number of rejected inbound messages- Returns:
- Total number of rejected inbound messages
- Throws:
SomException- on error
-
rejectStatus
Get last inbound connection rejection status as x.y.z string- Returns:
- Last inbound connection rejection status
- Throws:
SomException- on error
-
storedRecipients
Get the number of stored recipients- Returns:
- Number of stored recipients
- Throws:
SomException- on error
-
successfulConversions
Get the number of successful conversions (for a shaper channel MTA)- Returns:
- Number of successful conversions
- Throws:
SomException- on error
-
totalInAssoc
Get total number of inbound associations- Returns:
- Total number of inbound associations
- Throws:
SomException- on error
-
totalOutAssoc
Get total number of outbound associations- Returns:
- Total number of outbound associations
- Throws:
SomException- on error
-
diverted
Whether MTA has the 'divert' flag set or not- Returns:
- Diverted or not
- Throws:
SomException- on error
-
transmittedVolume
Get total volume of transmitted messages- Returns:
- Total volume of transmitted messages (bytes)
- Throws:
SomException- on error
-
rerouted
- Throws:
SomException
-
deleteMessages
Delete all the messages on this MTA- Parameters:
listener- Listener object which will be notified when complete which may be null- Throws:
SomException- on error
-
nondeliverMessages
Nondeliver all the messages on this MTA- Parameters:
reason- String reason text which may not be nulllistener- Listener object which will be notified when complete which may be null- Throws:
SomException- on error
-
timeoutMessages
Time out all the messages on this MTA- Parameters:
listener- Listener object which will be notified when complete which may be null- Throws:
SomException- on error
-