Class SimpleManagement
- java.lang.Object
-
- org.apache.activemq.artemis.api.core.management.SimpleManagement
-
- All Implemented Interfaces:
AutoCloseable
public class SimpleManagement extends Object implements AutoCloseable
This class provides a simple proxy for management operations
-
-
Constructor Summary
Constructors Constructor Description SimpleManagement(String uri, String user, String password)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voiddoManagement(ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed)protected static voidfailed(ClientMessage message)longgetCurrentTimeMillis()intgetDeliveringCountOnQueue(String queueName)longgetMessageAddedOnQueue(String queueName)longgetMessageCountOnQueue(String queueName)longgetMessagesAddedOnQueue(String queueName)StringgetNodeID()intgetNumberOfConsumersOnQueue(String queueName)Map<String,Long>getQueueCounts(int maxRows)StringgetUri()booleanisReplicaSync()org.apache.activemq.artemis.json.JsonArraylistNetworkTopology()SimpleManagementopen()voidrebuildPageCounters()protected static voidsetBooleanResult(ClientMessage m, AtomicBoolean result)protected static voidsetIntResult(ClientMessage m, AtomicInteger result)protected static voidsetLongResult(ClientMessage m, AtomicLong result)protected static voidsetStringResult(ClientMessage m, AtomicReference<String> result)protected static voidsetupCall(ClientMessage m, String resource, String methodName, Object... parameters)StringsimpleManagement(String resource, String method, Object... parameters)Simple helper for management returning a string.booleansimpleManagementBoolean(String resource, String method, Object... parameters)Simple helper for management returning a long.intsimpleManagementInt(String resource, String method, Object... parameters)longsimpleManagementLong(String resource, String method, Object... parameters)Simple helper for management returning a long.voidsimpleManagementVoid(String resource, String method, Object... parameters)Simple helper for management void calls.
-
-
-
Method Detail
-
open
public SimpleManagement open() throws Exception
- Throws:
Exception
-
getUri
public String getUri()
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
simpleManagement
public String simpleManagement(String resource, String method, Object... parameters) throws Exception
Simple helper for management returning a string.- Throws:
Exception
-
simpleManagementLong
public long simpleManagementLong(String resource, String method, Object... parameters) throws Exception
Simple helper for management returning a long.- Throws:
Exception
-
simpleManagementBoolean
public boolean simpleManagementBoolean(String resource, String method, Object... parameters) throws Exception
Simple helper for management returning a long.- Throws:
Exception
-
simpleManagementVoid
public void simpleManagementVoid(String resource, String method, Object... parameters) throws Exception
Simple helper for management void calls.- Throws:
Exception
-
simpleManagementInt
public int simpleManagementInt(String resource, String method, Object... parameters) throws Exception
- Throws:
Exception
-
getMessageCountOnQueue
public long getMessageCountOnQueue(String queueName) throws Exception
- Throws:
Exception
-
getMessageAddedOnQueue
public long getMessageAddedOnQueue(String queueName) throws Exception
- Throws:
Exception
-
getDeliveringCountOnQueue
public int getDeliveringCountOnQueue(String queueName) throws Exception
- Throws:
Exception
-
getNumberOfConsumersOnQueue
public int getNumberOfConsumersOnQueue(String queueName) throws Exception
- Throws:
Exception
-
getMessagesAddedOnQueue
public long getMessagesAddedOnQueue(String queueName) throws Exception
- Throws:
Exception
-
getQueueCounts
public Map<String,Long> getQueueCounts(int maxRows) throws Exception
- Throws:
Exception
-
listNetworkTopology
public org.apache.activemq.artemis.json.JsonArray listNetworkTopology() throws Exception- Throws:
Exception
-
failed
protected static void failed(ClientMessage message) throws Exception
- Throws:
Exception
-
setupCall
protected static void setupCall(ClientMessage m, String resource, String methodName, Object... parameters) throws Exception
- Throws:
Exception
-
setStringResult
protected static void setStringResult(ClientMessage m, AtomicReference<String> result) throws Exception
- Throws:
Exception
-
setLongResult
protected static void setLongResult(ClientMessage m, AtomicLong result) throws Exception
- Throws:
Exception
-
setBooleanResult
protected static void setBooleanResult(ClientMessage m, AtomicBoolean result) throws Exception
- Throws:
Exception
-
setIntResult
protected static void setIntResult(ClientMessage m, AtomicInteger result) throws Exception
- Throws:
Exception
-
doManagement
protected void doManagement(ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed) throws Exception
- Throws:
Exception
-
-