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 void
close()
protected void
doManagement(ManagementHelper.MessageAcceptor setup, ManagementHelper.MessageAcceptor ok, ManagementHelper.MessageAcceptor failed)
protected static void
failed(ClientMessage message)
long
getCurrentTimeMillis()
int
getDeliveringCountOnQueue(String queueName)
long
getMessageAddedOnQueue(String queueName)
long
getMessageCountOnQueue(String queueName)
long
getMessagesAddedOnQueue(String queueName)
String
getNodeID()
int
getNumberOfConsumersOnQueue(String queueName)
Map<String,Long>
getQueueCounts(int maxRows)
String
getUri()
boolean
isReplicaSync()
org.apache.activemq.artemis.json.JsonArray
listNetworkTopology()
SimpleManagement
open()
void
rebuildPageCounters()
protected static void
setBooleanResult(ClientMessage m, AtomicBoolean result)
protected static void
setIntResult(ClientMessage m, AtomicInteger result)
protected static void
setLongResult(ClientMessage m, AtomicLong result)
protected static void
setStringResult(ClientMessage m, AtomicReference<String> result)
protected static void
setupCall(ClientMessage m, String resource, String methodName, Object... parameters)
String
simpleManagement(String resource, String method, Object... parameters)
Simple helper for management returning a string.boolean
simpleManagementBoolean(String resource, String method, Object... parameters)
Simple helper for management returning a long.int
simpleManagementInt(String resource, String method, Object... parameters)
long
simpleManagementLong(String resource, String method, Object... parameters)
Simple helper for management returning a long.void
simpleManagementVoid(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:
close
in 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
-
-