com.mirth.connect.server.userutil
Class ChannelUtil

java.lang.Object
  extended by com.mirth.connect.server.userutil.ChannelUtil

public class ChannelUtil
extends java.lang.Object

This utility class allows the user to query information from channels or to perform actions on channels.


Method Summary
static void deployChannel(java.lang.String channelIdOrName)
          Deploy a channel.
static DeployedState getChannelState(java.lang.String channelIdOrName)
          Get the current state of a deployed channel.
static DeployedState getConnectorState(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the current state of a deployed connector.
static java.lang.String getDeployedChannelName(java.lang.String channelId)
          Get the name for a specified channel.
static java.lang.Long getErrorCount(java.lang.String channelIdOrName)
          Get the error count statistic for a specific channel.
static java.lang.Long getErrorCount(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the error count statistic for a specific connector.
static java.lang.Long getFilteredCount(java.lang.String channelIdOrName)
          Get the filtered count statistic for a specific channel.
static java.lang.Long getFilteredCount(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the filtered count statistic for a specific connector.
static java.lang.Long getQueuedCount(java.lang.String channelIdOrName)
          Get the queued count statistic for a specific channel.
static java.lang.Long getQueuedCount(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the queued count statistic for a specific connector.
static java.lang.Long getReceivedCount(java.lang.String channelIdOrName)
          Get the received count statistic for a specific channel.
static java.lang.Long getReceivedCount(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the received count statistic for a specific connector.
static java.lang.Long getSentCount(java.lang.String channelIdOrName)
          Get the sent count statistic for a specific channel.
static java.lang.Long getSentCount(java.lang.String channelIdOrName, java.lang.Number metaDataId)
          Get the sent count statistic for a specific connector.
static void haltChannel(java.lang.String channelIdOrName)
          Halt a deployed channel.
static boolean isChannelDeployed(java.lang.String channelIdOrName)
          Check if a channel is currently deployed.
static void pauseChannel(java.lang.String channelIdOrName)
          Pause a deployed channel.
static void resumeChannel(java.lang.String channelIdOrName)
          Resume a deployed channel.
static void startChannel(java.lang.String channelIdOrName)
          Start a deployed channel.
static void startConnector(java.lang.String channelIdOrName, java.lang.Integer metaDataId)
          Start a connector on a given channel.
static void stopChannel(java.lang.String channelIdOrName)
          Stop a deployed channel.
static void stopConnector(java.lang.String channelIdOrName, java.lang.Integer metaDataId)
          Stop a connector on a given channel.
static void undeployChannel(java.lang.String channelIdOrName)
          Undeploy a channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDeployedChannelName

public static java.lang.String getDeployedChannelName(java.lang.String channelId)
Get the name for a specified channel.

Parameters:
channelId - The channel id of the deployed channel.
Returns:
The channel name of the specified channel.

startChannel

public static void startChannel(java.lang.String channelIdOrName)
                         throws java.lang.Exception
Start a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Throws:
java.lang.Exception

stopChannel

public static void stopChannel(java.lang.String channelIdOrName)
                        throws java.lang.Exception
Stop a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Throws:
java.lang.Exception

pauseChannel

public static void pauseChannel(java.lang.String channelIdOrName)
                         throws java.lang.Exception
Pause a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Throws:
java.lang.Exception

resumeChannel

public static void resumeChannel(java.lang.String channelIdOrName)
                          throws java.lang.Exception
Resume a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Throws:
java.lang.Exception

haltChannel

public static void haltChannel(java.lang.String channelIdOrName)
                        throws java.lang.Exception
Halt a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Throws:
java.lang.Exception

getChannelState

public static DeployedState getChannelState(java.lang.String channelIdOrName)
Get the current state of a deployed channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The current DeployedState.

deployChannel

public static void deployChannel(java.lang.String channelIdOrName)
Deploy a channel.

Parameters:
channelIdOrName - The channel id or current name of the channel.

undeployChannel

public static void undeployChannel(java.lang.String channelIdOrName)
Undeploy a channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.

isChannelDeployed

public static boolean isChannelDeployed(java.lang.String channelIdOrName)
Check if a channel is currently deployed.

Parameters:
channelIdOrName - The channel id or current name of the channel.
Returns:
True if the channel is deployed, false if it is not.

startConnector

public static void startConnector(java.lang.String channelIdOrName,
                                  java.lang.Integer metaDataId)
                           throws java.lang.Exception
Start a connector on a given channel.

Parameters:
channelIdOrName - The channel id or current name of the channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Throws:
java.lang.Exception

stopConnector

public static void stopConnector(java.lang.String channelIdOrName,
                                 java.lang.Integer metaDataId)
                          throws java.lang.Exception
Stop a connector on a given channel.

Parameters:
channelIdOrName - The channel id or current name of the channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Throws:
java.lang.Exception

getConnectorState

public static DeployedState getConnectorState(java.lang.String channelIdOrName,
                                              java.lang.Number metaDataId)
Get the current state of a deployed connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The current connector state returned as the DeployedState enumerator.

getReceivedCount

public static java.lang.Long getReceivedCount(java.lang.String channelIdOrName)
Get the received count statistic for a specific channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The received count statistic as a Long for the specified channel.

getReceivedCount

public static java.lang.Long getReceivedCount(java.lang.String channelIdOrName,
                                              java.lang.Number metaDataId)
Get the received count statistic for a specific connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The received count statistic as a Long for the specified connector.

getFilteredCount

public static java.lang.Long getFilteredCount(java.lang.String channelIdOrName)
Get the filtered count statistic for a specific channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The filtered count statistic as a Long for the specified channel.

getFilteredCount

public static java.lang.Long getFilteredCount(java.lang.String channelIdOrName,
                                              java.lang.Number metaDataId)
Get the filtered count statistic for a specific connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The filtered count statistic as a Long for the specified connector.

getQueuedCount

public static java.lang.Long getQueuedCount(java.lang.String channelIdOrName)
Get the queued count statistic for a specific channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The queued count statistic as a Long for the specified channel.

getQueuedCount

public static java.lang.Long getQueuedCount(java.lang.String channelIdOrName,
                                            java.lang.Number metaDataId)
Get the queued count statistic for a specific connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The queued count statistic as a Long for the specified connector.

getSentCount

public static java.lang.Long getSentCount(java.lang.String channelIdOrName)
Get the sent count statistic for a specific channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The sent count statistic as a Long for the specified channel.

getSentCount

public static java.lang.Long getSentCount(java.lang.String channelIdOrName,
                                          java.lang.Number metaDataId)
Get the sent count statistic for a specific connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The sent count statistic as a Long for the specified connector.

getErrorCount

public static java.lang.Long getErrorCount(java.lang.String channelIdOrName)
Get the error count statistic for a specific channel.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
Returns:
The error count statistic as a Long for the specified channel.

getErrorCount

public static java.lang.Long getErrorCount(java.lang.String channelIdOrName,
                                           java.lang.Number metaDataId)
Get the error count statistic for a specific connector.

Parameters:
channelIdOrName - The channel id or current name of the deployed channel.
metaDataId - The metadata id of the connector. Note that the source connector has a metadata id of 0.
Returns:
The error count statistic as a Long for the specified connector.