Package com.isode.som.qmgr.objects
Class SomQmgrChannel
java.lang.Object
com.isode.som.qmgr.objects.SomQmgrObject
com.isode.som.qmgr.objects.SomQmgrChannel
- All Implemented Interfaces:
SomQmgrHandler
,SomHandler
This class models a Channel within M-Switch.
- Author:
- tc
-
Field Summary
Fields inherited from class com.isode.som.qmgr.objects.SomQmgrObject
errortext, somSession
-
Constructor Summary
ConstructorsConstructorDescriptionSomQmgrChannel
(SomSession session) Create a new SOM Qmgr Channel objectSomQmgrChannel
(SomSession session, String[] pairs) Create a new SOM Qmgr Channel object, populating it -
Method Summary
Modifier and TypeMethodDescriptionGet the number of inbound addresses which this channel has deal withGet the number of outbound addresses which this channel has processedGenerate an information string for the channel objectGet a UTC Time String giving the time which the channel is delayed untilchannel()
Get the name of the channel.Get the channel's description stringchantype()
Get channel type as a stringint
void
clear
(SomCommandListener listener) Sends a command to clear any delay on the channel.void
clearMessages
(SomCommandListener listener) Sends a command to clear any delay on the channel's subordinate Messages.void
clearMTADelay
(String mtaName, SomCommandListener listener) Sends a SOM command to clear a delay associated with a particular MTA.void
clearMtas
(SomCommandListener listener) Sends a command to clear any delay on the channel's subordinate MTAs.void
connect
(String mtaname, SomCommandListener listener) Sends a command to connect the channel to the specified MTAGet the time at which the channel was createdvoid
delay
(int mins, SomCommandListener listener) Sends a command to delay the channel by a specified number of minutes.void
deleteMessages
(SomCommandListener listener) Delete all the messages on this channelGet channel direction stringint
void
disable
(SomCommandListener listener) Sends a command to disable the channel.void
disableInbound
(SomCommandListener listener) Disable the channel from accepting inbound connection.void
disconnect
(SomCommandListener listener) Disconnect any peer MTAs which we are currently connected to.void
disconnect
(String mtaName, SomCommandListener listener) Disconnect this channel from the specified MTA.void
downwardsforce
(SomCommandListener listener) Performs a "downwards force" on the channel - i.e.void
enable
(SomCommandListener listener) Sends a command to enable the channel.enabled()
Get string saying whether channel is enabled or notboolean
Get boolean indicating if channel is enabledTest whether the channel is enabled for inbound connections.boolean
Test whether the channel is enabled for inbound connections.void
enableInbound
(SomCommandListener listener) Enable the channel to accept inbound connection.Get a count of the number of error which the channel has encounteredGet count of failed conversions.Get count of failed outbound connectionsReturn an array containing the Message objects which are subordinate to this channel.Returns a SomQmgrMta object representing the external MTA this channel is connected to.getMTAError
(String mtaName) Returns the MTA refusal text for an MTA associated with this channel.getMtas()
Return an array containing the MTA objects which are subordinate to this channel.void
getStatus
(SomCommandListener listener) Get the current status of this Channel.void
getSubordinateMessages
(SomCommandListener listener, Integer sizelimit) Interrogate the channel object for its current set of subordinate Messagesvoid
getSubordinates
(SomCommandListener listener, Integer mtaSizeLimit, Integer messageSizeLimit) Interrogate the channel object for its current set of subordinate MTAs or Messagesvoid
handleBindResponse
(int status, String detail) Handle the response to a Bind operationvoid
handleResponse
(SomCommand obj, int status, SomMessage msg) Handles the response to commands which return a SomMessage object (i.e.void
handleResponse
(SomCommand command, int status, SomQmgrChannel object) Handles the response to commands which return a list of channel objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrMessage object) Handles the response to commands which return a list of message objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrMta object) Handles the response to commands which return a list of MTA objectsvoid
handleResponse
(SomCommand command, int status, SomQmgrQueueManager object) void
handleResponse
(SomCommand command, int status, String detail) Handles the response to control commands which return an OK/error response plus an info stringvoid
handleResponse
(SomCommand command, int status, String[] pairs) Handles the response to commands which return data about the current object - i.e.Get the channel hierarchy valueinAssoc()
Get number of current inbound associationsint
inAssocConnections
(String mtaName) Returns number of in bound Associations to this MTAindex()
Get the channel index numberboolean
isConnected
(String mtaName) Checks local cache of channel values to see if there is an outbound Association with the MTA given in mtaNameboolean
isConnecting
(String mtaName) Test whether this channel has a specific subordinate MTA which is currently connecting to a peer MTAboolean
Uses the cachedUntil() to tell if channel is delayed.Get UTC Time String indicating time of last connection attempt made by channelGet the time of the last inbound associationGet the time of the last outbound associationGet UTC Time String indicating time of last successful connection attempt made by channelGet a count of the number of loops detected.maxProcs()
Get maximum processes value for channelGet total number of messages that have been transfered in.Get total number of messages that have been transfered out.void
minimise
(int priority, Date start, Date stop, SomCommandListener listener) Invoke a MINIMISE operation on this channelGet current MINIMISE priority for channelGet current MINIMISE start time for channelGet current MINIMISE stop time for channelvoid
nondeliverMessages
(String reason, SomCommandListener listener) Non-deliver all the messages on this channelGet current number of active processes on channelGet current number of messages queued on channelGet current number of peer MTAs on channelGet the number of channel processes currently runningGet current number of reports queued on channelGet age of oldest message queued on channelGet the queueid of the oldest message on the channelint
outAssocConnections
(String mtaName) Returns number of out bound Associations to this MTAGet the current number of outbound associationsprotocol()
Get channel protocol identifier (OID string)Get total volume of received messages (bytes)Get 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 rejection textGet last inbound connection reject timevoid
removeFromArray
(ArrayList<SomQmgrChannel> channels) Remove this channel from the array of channels passed in.void
reprocess
(SomCommandListener listener) Perform a Reprocess operation on all Peer MTAs under this channel, or directly on any messages queuedvoid
Set the SOM version number for the channel - this controls how the FORCE command is implemented.Get the number of stored recipientsGet the number of successful conversions (for a shaper channel)void
timeoutMessages
(SomCommandListener listener) Time out all the messages on this channelGet total number of inbound associationsGet total number of outbound associationsGet total volume of transmitted messagesGet volume of messages queued on channelMethods inherited from class com.isode.som.qmgr.objects.SomQmgrObject
addAttribute, addAttribute, addBindListener, clearAttributes, getBooleanAttributeValue, getDoubleAttributeValue, getIntegerAttributeValue, getSession, getStringAttributeValue, notifyBindListeners, notifyListener, notifyListeners, parsePairs, print, print_str, removeBindListener, setSkipNotifications
-
Constructor Details
-
SomQmgrChannel
Create a new SOM Qmgr Channel object- Parameters:
session
- Session within which to create channel which cannot be null
-
SomQmgrChannel
Create a new SOM Qmgr Channel object, populating it- Parameters:
session
- Session within which to create channel which cannot be nullpairs
- type/value pairs
-
-
Method Details
-
setSomVersion
Set the SOM version number for the channel - this controls how the FORCE command is implemented.- Parameters:
v
- Som version number
-
removeFromArray
Remove this channel from the array of channels passed in.- Parameters:
channels
- Array of channels which may not be null
-
getMtas
Return an array containing the MTA objects which are subordinate to this channel.- Returns:
- Array of subordinate MTAs which will not be null
-
getMessages
Return an array containing the Message objects which are subordinate to this channel.- Returns:
- Array of subordinate Messages which will not be null
-
handleBindResponse
Description copied from interface:SomHandler
Handle the response to a Bind operation- Specified by:
handleBindResponse
in interfaceSomHandler
- Parameters:
status
- operation statusdetail
- error detail on failure
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to control commands which return an OK/error response plus an info string- Specified by:
handleResponse
in interfaceSomHandler
- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusdetail
- detail on error
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return data about the current object - i.e. we are refreshing an existing object.- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statuspairs
- data pairs
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of MTA objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a SOM Qmgr MTA object
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of message objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a qmgr message object
-
handleResponse
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a list of channel objects- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
command
- the SOM commandstatus
- operation statusobject
- a channel object
-
handleResponse
Description copied from interface:SomQmgrHandler
Handles the response to commands which return a SomMessage object (i.e. read from the Queue or Archive).- Specified by:
handleResponse
in interfaceSomQmgrHandler
- Parameters:
obj
- the SOM commandstatus
- operation statusmsg
- a message object
-
isConnecting
Test whether this channel has a specific subordinate MTA which is currently connecting to a peer MTA- Parameters:
mtaName
- name of MTA to test which may not be null- Returns:
- true if this MTA exists and is currently connecting
- Throws:
SomException
- on error
-
isConnected
Checks local cache of channel values to see if there is an outbound Association with the MTA given in mtaName- Parameters:
mtaName
- the String representation of the external MTA. Must not be null.- Returns:
- either true or false.
- Throws:
SomException
- is thrown if there is a problem reading the outboundAssociations value.
-
outAssocConnections
Returns number of out bound Associations to this MTA- Parameters:
mtaName
- Name of mta to check.- Returns:
- Number of out bound assoc
- Throws:
SomException
- on error
-
inAssocConnections
Returns number of in bound Associations to this MTA- Parameters:
mtaName
- Name of MTA to check- Returns:
- number of inbound associations
- Throws:
SomException
- on error
-
clearMTADelay
Sends a SOM command to clear a delay associated with a particular MTA.- Parameters:
mtaName
- String representation of the external MTA, this channel is associated with, whose delay needs to be cleared. Must not be null.listener
- SomCommandListener who will be called to handle the SOM response. Must not be null.- Throws:
SomException
- is thrown if MTA delay cannot be cleared.
-
reprocess
Perform a Reprocess operation on all Peer MTAs under this channel, or directly on any messages queued- Parameters:
listener
- Listener to notify when operation is complete, which may be null- Throws:
SomException
- on error
-
getMTAError
Returns the MTA refusal text for an MTA associated with this channel.- Parameters:
mtaName
- The string representation of the external MTA. Must not be null.- Returns:
- The last refuse Text.
- Throws:
SomException
- is thrown if the refuse text cannot be returned. This typically happens when there is no refuse text.
-
getMTA
Returns a SomQmgrMta object representing the external MTA this channel is connected to.- Parameters:
mtaName
- String representation of the external MTA. Must not be null.- Returns:
- SomQmgrMta object representing the external MTA this channel is connected to.
- Throws:
SomException
- Thrown if we are not connected to the specified MTA.
-
disconnect
Disconnect this channel from the specified MTA. The SomCommandListener is called to handle the response.- Parameters:
mtaName
- The string representation of the MTA we are disconnecting Must not be null.listener
- The SomCommandListener called when we have a response. Must not be null.- Throws:
SomException
- Thrown is we can't find an association, or disconnect.
-
getStatus
Get the current status of this Channel.- Parameters:
listener
- Listener object which will be notified when update complete which may be null- Throws:
SomException
- on error
-
getSubordinates
public void getSubordinates(SomCommandListener listener, Integer mtaSizeLimit, Integer messageSizeLimit) throws SomException Interrogate the channel object for its current set of subordinate MTAs or Messages- Parameters:
listener
- Listener object which will be notified when update complete which may be nullmtaSizeLimit
- Specifies the maximum number of MTAs to be returned. May not be null.messageSizeLimit
- Specifies the maximum number of Message to be returned. May not be null.- Throws:
SomException
- on error
-
getSubordinateMessages
public void getSubordinateMessages(SomCommandListener listener, Integer sizelimit) throws SomException Interrogate the channel object for its current set of subordinate Messages- Parameters:
listener
- Listener object which will be notified when update complete which may be nullsizelimit
- Specifies the maximum number of Message to be returned. May not be null.- Throws:
SomException
- on error
-
buildInfoString
Generate an information string for the channel object- Returns:
- Info string containing name, number of messages etc
-
clear
Sends a command to clear any delay on the channel.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
clearMtas
Sends a command to clear any delay on the channel's subordinate MTAs.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
clearMessages
Sends a command to clear any delay on the channel's subordinate Messages.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
enable
Sends a command to enable the channel.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
disable
Sends a command to disable the channel.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
delay
Sends a command to delay the channel by a specified number of minutes.- Parameters:
mins
- Number of minutes by which to delay channellistener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
connect
Sends a command to connect the channel to the specified MTA- Parameters:
mtaname
- Name of peer MTA to which to connectlistener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
downwardsforce
Performs a "downwards force" on the channel - i.e. clear any delay on the channel and its subordinate objects.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
disconnect
Disconnect any peer MTAs which we are currently connected to.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
enableInbound
Enable the channel to accept inbound connection.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
disableInbound
Disable the channel from accepting inbound connection.- Parameters:
listener
- Listener object which will be notified when operation completes which may be null- Throws:
SomException
- on error
-
channel
Get the name of the channel.- Returns:
- channel name
- Throws:
SomException
- on error
-
channelDescription
Get the channel's description string- Returns:
- description of channel
- Throws:
SomException
- on error
-
cachedUntil
Get a UTC Time String giving the time which the channel is delayed until- Returns:
- Time until which channel is delayed
- Throws:
SomException
- on error
-
isDelayed
public boolean isDelayed()Uses the cachedUntil() to tell if channel is delayed.- Returns:
- true if there is a delay, otherwise false.
-
chantype
Get channel type as a string- Returns:
- String indicating channel type
- Throws:
SomException
- on error
-
chanTypeInt
- Returns:
- 0 == mta, 1 == mts, 2==internal, 3==passive
- Throws:
SomException
-
direction
Get channel direction string- Returns:
- channel direction as string
- Throws:
SomException
- on error
-
directionInt
- Returns:
- channel direction as int. 1 == inbound, 2 == outbound, 3 == both
- Throws:
SomException
-
enabled
Get string saying whether channel is enabled or not- Returns:
- "True" if channel enabled, "False" otherwise
- Throws:
SomException
- on error
-
enabledBool
Get boolean indicating if channel is enabled- Returns:
- true if channel enabled
- Throws:
SomException
- on error
-
lastAttempt
Get UTC Time String indicating time of last connection attempt made by channel- Returns:
- time of last connection attempt
- Throws:
SomException
- on error
-
lastSuccess
Get UTC Time String indicating time of last successful connection attempt made by channel- Returns:
- time of last successful connection attempt
- Throws:
SomException
- on error
-
maxProcs
Get maximum processes value for channel- Returns:
- maximum processes allowed for channel
- Throws:
SomException
- on error
-
numberActiveProcesses
Get current number of active processes on channel- Returns:
- active processes on channel
- Throws:
SomException
- on error
-
numberMessages
Get current number of messages queued on channel- Returns:
- number messages on channel
- Throws:
SomException
- on error
-
numberMtas
Get current number of peer MTAs on channel- Returns:
- number of peer MTAs on channel
- Throws:
SomException
- on error
-
numberReports
Get current number of reports queued on channel- Returns:
- number of reports on channel
- Throws:
SomException
- on error
-
oldestMessage
Get age of oldest message queued on channel- Returns:
- age of oldest message on channel, as UTC Time String
- Throws:
SomException
- on error
-
volumeMessages
Get volume of messages queued on channel- Returns:
- Volume of messages (bytes) queued on channel
- Throws:
SomException
- on error
-
addressesIn
Get the number of inbound addresses which this channel has deal with- Returns:
- Number of inbound addresses handled
- Throws:
SomException
- on error
-
addressesOut
Get the number of outbound addresses which this channel has processed- Returns:
- Number of outbound addresses handled
- Throws:
SomException
- on error
-
creationTime
Get the time at which the channel was created- Returns:
- Creation time as UTC Time String
- Throws:
SomException
- on error
-
errorCount
Get a count of the number of error which the channel has encountered- Returns:
- Count of errors handled
- Throws:
SomException
- on error
-
enabledInboundBool
Test whether the channel is enabled for inbound connections.- Returns:
- true if enabled inbound
- Throws:
SomException
- on error
-
enabledInbound
Test whether the channel is enabled for inbound connections.- Returns:
- string "True" if enabled inbound, else "fFalse"
- Throws:
SomException
- on error
-
failedConversions
Get count of failed conversions. Only relevant if channel is a shaper.- Returns:
- Count of failed conversions
- Throws:
SomException
- on error
-
failedOutAssoc
Get count of failed outbound connections- Returns:
- number of failed outbound connections
- Throws:
SomException
- on error
-
hierarchy
Get the channel hierarchy value- Returns:
- Channel hierarchy
- Throws:
SomException
- on error
-
inAssoc
Get number of current inbound associations- Returns:
- Number of current inbound associations
- Throws:
SomException
- on error
-
index
Get the channel index number- Returns:
- Channel index
- Throws:
SomException
- on error
-
lastInboundTime
Get the time of the last inbound association- Returns:
- Time of last inbound association (UTC Time String)
- Throws:
SomException
- on error
-
lastOutboundTime
Get the time of the last outbound association- Returns:
- Time of last outbound association (UTC Time String)
- Throws:
SomException
- on error
-
loopsDetected
Get a count of the number of loops detected.- Returns:
- Count of loops detected
- Throws:
SomException
- on error
-
messagesIn
Get total number of messages that have been transfered in.- Returns:
- Total number of messages that have bee transfered in.
- Throws:
SomException
- on error
-
messagesOut
Get total number of messages that have been transfered out.- Returns:
- Total number of messages that have been transfered out.
- Throws:
SomException
- on error
-
oldestMessageId
Get the queueid of the oldest message on the channel- Returns:
- The queueid of the oldest message on the channel
- Throws:
SomException
- on error
-
outboundAssociations
Get the current number of outbound associations- Returns:
- Number of outbound associations
- Throws:
SomException
- on error
-
numberProcesses
Get the number of channel processes currently running- Returns:
- Number of channel processes running
- Throws:
SomException
- on error
-
protocol
Get channel protocol identifier (OID string)- Returns:
- Channel protocol id as OID string
- Throws:
SomException
- on error
-
receivedVolume
Get total volume of received messages (bytes)- Returns:
- Total volume of received messages in bytes
- 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
-
rejectText
Get last inbound connection rejection text- Returns:
- Last inbound connection rejection text
- 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)- 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
-
transmittedVolume
Get total volume of transmitted messages- Returns:
- Total volume of transmitted messages (bytes)
- Throws:
SomException
- on error
-
minimisePriority
Get current MINIMISE priority for channel- Returns:
- Current MINIMISE priority
- Throws:
SomException
- on error
-
minimiseStart
Get current MINIMISE start time for channel- Returns:
- Current MINIMISE start time (UTC Time String)
- Throws:
SomException
- on error
-
minimiseStop
Get current MINIMISE stop time for channel- Returns:
- Current MINIMISE stop time (UTC Time String)
- Throws:
SomException
- on error
-
minimise
public void minimise(int priority, Date start, Date stop, SomCommandListener listener) throws SomException Invoke a MINIMISE operation on this channel- Parameters:
priority
- MINIMISE prioritystart
- Start time which may be nullstop
- Stop time which may be nulllistener
- Listener object which will be notified when complete which may be null- Throws:
SomException
- on error
-
deleteMessages
Delete all the messages on this channel- Parameters:
listener
- Listener object which will be notified when complete which may be null- Throws:
SomException
- on error
-
nondeliverMessages
Non-deliver all the messages on this channel- Parameters:
reason
- Reason string for non-delivery 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 channel- Parameters:
listener
- Listener object which will be notified when complete which may be null- Throws:
SomException
- on error
-