Class ChannelUtil
java.lang.Object
com.mirth.connect.server.userutil.ChannelUtil
This utility class allows the user to query information from channels or to perform actions on
channels.
-
Method Summary
Modifier and TypeMethodDescriptiondeployChannel(String channelIdOrName) Deploy a channel.Get all channel Ids.static StringgetChannelName(String channelId) Get the name for a channel.Get all channels names.static DeployedStategetChannelState(String channelIdOrName) Get the current state of a channel.static DeployedStategetConnectorState(String channelIdOrName, Number metaDataId) Get the current state of a connector.static StringgetDeployedChannelId(String channelName) Get the id for a deployed channel.Get all deployed channel Ids.static StringgetDeployedChannelName(String channelId) Get the name for a deployed channel.Get all deployed channels names.static LonggetErrorCount(String channelIdOrName) Get the error count statistic for a specific channel.static LonggetErrorCount(String channelIdOrName, Number metaDataId) Get the error count statistic for a specific connector.static LonggetFilteredCount(String channelIdOrName) Get the filtered count statistic for a specific channel.static LonggetFilteredCount(String channelIdOrName, Number metaDataId) Get the filtered count statistic for a specific connector.static LonggetQueuedCount(String channelIdOrName) Get the queued count statistic for a specific channel.static LonggetQueuedCount(String channelIdOrName, Number metaDataId) Get the queued count statistic for a specific connector.static LonggetReceivedCount(String channelIdOrName) Get the received count statistic for a specific channel.static LonggetReceivedCount(String channelIdOrName, Number metaDataId) Get the received count statistic for a specific connector.static LonggetSentCount(String channelIdOrName) Get the sent count statistic for a specific channel.static LonggetSentCount(String channelIdOrName, Number metaDataId) Get the sent count statistic for a specific connector.haltChannel(String channelIdOrName) Halt a deployed channel.static booleanisChannelDeployed(String channelIdOrName) Check if a channel is currently deployed.pauseChannel(String channelIdOrName) Pause a deployed channel.resetStatistics(String channelIdOrName) Reset all statistics for a specific channel.resetStatistics(String channelIdOrName, Integer metaDataId) Reset all statistics for the specified connector on the given channel.resetStatistics(String channelIdOrName, Integer metaDataId, Collection<Status> statuses) Reset the specified statistics for the specified connector on the given channel.resumeChannel(String channelIdOrName) Resume a deployed channel.startChannel(String channelIdOrName) Start a deployed channel.startConnector(String channelIdOrName, Integer metaDataId) Start a connector on a given channel.stopChannel(String channelIdOrName) Stop a deployed channel.stopConnector(String channelIdOrName, Integer metaDataId) Stop a connector on a given channel.undeployChannel(String channelIdOrName) Undeploy a channel.
-
Method Details
-
getChannelNames
Get all channels names.- Returns:
- A list of all channel names.
-
getChannelIds
Get all channel Ids.- Returns:
- A list of all channel Ids.
-
getDeployedChannelNames
Get all deployed channels names.- Returns:
- A list of all deployed channel names.
-
getChannelName
Get the name for a channel.- Parameters:
channelId- The channel id of the channel.- Returns:
- The channel name of the specified channel.
-
getDeployedChannelIds
Get all deployed channel Ids.- Returns:
- A list of all deployed channel Ids.
-
getDeployedChannelName
Get the name for a deployed channel.- Parameters:
channelId- The channel id of the deployed channel.- Returns:
- The channel name of the specified channel.
-
getDeployedChannelId
Get the id for a deployed channel.- Parameters:
channelName- The channel name of the deployed channel.- Returns:
- The channel Id of the specified channel.
-
startChannel
Start a deployed channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
stopChannel
Stop a deployed channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
pauseChannel
Pause a deployed channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
resumeChannel
Resume a deployed channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
haltChannel
Halt a deployed channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
getChannelState
Get the current state of a channel.- Parameters:
channelIdOrName- The channel id or current name of the channel.- Returns:
- The current DeployedState.
-
deployChannel
Deploy a channel.- Parameters:
channelIdOrName- The channel id or current name of the channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish.
-
undeployChannel
Undeploy a channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish.
-
isChannelDeployed
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 Future<Void> startConnector(String channelIdOrName, Integer metaDataId) throws 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.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
stopConnector
public static Future<Void> stopConnector(String channelIdOrName, Integer metaDataId) throws 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.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
getConnectorState
Get the current state of a connector.- 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.- Returns:
- The current connector state returned as the DeployedState enumerator.
-
getReceivedCount
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
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
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
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
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
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
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
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
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
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.
-
resetStatistics
Reset all statistics for a specific channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
resetStatistics
public static Future<Void> resetStatistics(String channelIdOrName, Integer metaDataId) throws Exception Reset all statistics for the specified connector on the given channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.metaDataId- The metadata id of the deployed connector. Note that the source connector has a metadata id of 0 and the aggregate of null.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-
resetStatistics
public static Future<Void> resetStatistics(String channelIdOrName, Integer metaDataId, Collection<Status> statuses) throws Exception Reset the specified statistics for the specified connector on the given channel.- Parameters:
channelIdOrName- The channel id or current name of the deployed channel.metaDataId- The metadata id of the deployed connector. Note that the source connector has a metadata id of 0 and the aggregate of null.statuses- A collection of statuses to reset.- Returns:
- A
Futureobject representing the result of the asynchronous operation. You can callget()orget(timeoutInMillis)to wait for the operation to finish. - Throws:
Exception- If the task cannot be scheduled for execution.
-