Class AddressControlImpl
- java.lang.Object
-
- javax.management.StandardMBean
-
- org.apache.activemq.artemis.core.management.impl.AbstractControl
-
- org.apache.activemq.artemis.core.management.impl.AddressControlImpl
-
- All Implemented Interfaces:
DynamicMBean,MBeanRegistration,AddressControl
public class AddressControlImpl extends AbstractControl implements AddressControl
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.core.management.impl.AbstractControl
storageManager
-
Fields inherited from interface org.apache.activemq.artemis.api.core.management.AddressControl
ADDRESS_SIZE_DESCRIPTION, NUMBER_OF_PAGES_DESCRIPTION, ROUTED_MESSAGE_COUNT_DESCRIPTION, UNROUTED_MESSAGE_COUNT_DESCRIPTION
-
-
Constructor Summary
Constructors Constructor Description AddressControlImpl(AddressInfo addressInfo, ActiveMQServer server, PagingManager pagingManager, StorageManager storageManager, HierarchicalRepository<Set<Role>> securityRepository, SecurityStore securityStore, ManagementService managementService)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanblock()Blocks message production to this address by limiting creditbooleanclearDuplicateIdCache()protected MBeanAttributeInfo[]fillMBeanAttributeInfo()protected MBeanOperationInfo[]fillMBeanOperationInfo()StringgetAddress()Returns the managed address.intgetAddressLimitPercent()Returns the % of memory limit that is currently in uselonggetAddressSize()Returns the number of estimated bytes being used by all the queue(s) bound to this address; used to control paging and blocking.String[]getAllQueueNames()Returns the names of both the local and remote queue(s) bound to this address.String[]getBindingNames()Returns the names of all bindings (both queues and diverts) bound to this addresslonggetCurrentDuplicateIdCacheSize()longgetMessageCount()longgetNumberOfBytesPerPage()Returns the number of bytes used by each page for this address.longgetNumberOfMessages()Deprecated.intgetNumberOfPages()Returns the number of pages used by this address.String[]getQueueNames()Returns the names of the local queue(s) bound to this address.String[]getRemoteQueueNames()Returns the names of the remote queue(s) bound to this address.Object[]getRoles()Returns the roles (name and permissions) associated with this address.StringgetRolesAsJSON()Returns the roles (name and permissions) associated with this address using JSON serialization.longgetRoutedMessageCount()Returns the number of messages routed to one or more bindingsString[]getRoutingTypes()StringgetRoutingTypesAsJSON()longgetUnRoutedMessageCount()Returns the number of messages not routed to any bindingsbooleanisAutoCreated()Returns whether this address was created automatically in response to client action.booleanisInternal()Returns whether this address was created for the broker's internal use.booleanisPaging()Returns whether this address is paging.booleanisPaused()booleanisRetroactiveResource()booleanisTemporary()Returns whether this address is temporary.voidpause()Pauses all the queues bound to this address.voidpause(boolean persist)Pauses all the queues bound to this address.longpurge()Purge all the queues bound of this address.voidreplay(String target, String filter)voidreplay(String startScan, String endScan, String target, String filter)voidresume()Resume all the queues bound of this address.StringsendMessage(Map<String,String> headers, int type, String body, boolean durable, String user, String password)StringsendMessage(Map<String,String> headers, int type, String body, boolean durable, String user, String password, boolean createMessageId)voidunblock()-
Methods inherited from class org.apache.activemq.artemis.core.management.impl.AbstractControl
blockOnIO, clearIO, getMBeanInfo, sendMessage, tcclCall, tcclInvoke
-
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInterface, getParameterName, getParameterName, invoke, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
-
-
-
-
Constructor Detail
-
AddressControlImpl
public AddressControlImpl(AddressInfo addressInfo, ActiveMQServer server, PagingManager pagingManager, StorageManager storageManager, HierarchicalRepository<Set<Role>> securityRepository, SecurityStore securityStore, ManagementService managementService) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getAddress
public String getAddress()
Description copied from interface:AddressControlReturns the managed address.- Specified by:
getAddressin interfaceAddressControl
-
getRoutingTypes
public String[] getRoutingTypes()
- Specified by:
getRoutingTypesin interfaceAddressControl
-
getRoutingTypesAsJSON
public String getRoutingTypesAsJSON() throws Exception
- Specified by:
getRoutingTypesAsJSONin interfaceAddressControl- Throws:
Exception
-
getRemoteQueueNames
public String[] getRemoteQueueNames()
Description copied from interface:AddressControlReturns the names of the remote queue(s) bound to this address.- Specified by:
getRemoteQueueNamesin interfaceAddressControl
-
getQueueNames
public String[] getQueueNames()
Description copied from interface:AddressControlReturns the names of the local queue(s) bound to this address.- Specified by:
getQueueNamesin interfaceAddressControl
-
getAllQueueNames
public String[] getAllQueueNames()
Description copied from interface:AddressControlReturns the names of both the local and remote queue(s) bound to this address.- Specified by:
getAllQueueNamesin interfaceAddressControl
-
getBindingNames
public String[] getBindingNames() throws Exception
Description copied from interface:AddressControlReturns the names of all bindings (both queues and diverts) bound to this address- Specified by:
getBindingNamesin interfaceAddressControl- Throws:
Exception
-
getRoles
public Object[] getRoles() throws Exception
Description copied from interface:AddressControlReturns the roles (name and permissions) associated with this address.- Specified by:
getRolesin interfaceAddressControl- Throws:
Exception
-
getRolesAsJSON
public String getRolesAsJSON() throws Exception
Description copied from interface:AddressControlReturns the roles (name and permissions) associated with this address using JSON serialization.
Java objects can be recreated from JSON serialization usingRoleInfo.from(String).- Specified by:
getRolesAsJSONin interfaceAddressControl- Throws:
Exception
-
getNumberOfBytesPerPage
public long getNumberOfBytesPerPage() throws ExceptionDescription copied from interface:AddressControlReturns the number of bytes used by each page for this address.- Specified by:
getNumberOfBytesPerPagein interfaceAddressControl- Throws:
Exception
-
getAddressSize
public long getAddressSize()
Description copied from interface:AddressControlReturns the number of estimated bytes being used by all the queue(s) bound to this address; used to control paging and blocking.- Specified by:
getAddressSizein interfaceAddressControl
-
getNumberOfMessages
@Deprecated public long getNumberOfMessages()
Deprecated.Description copied from interface:AddressControlReturns the sum of messages on queue(s), including messages in delivery.- Specified by:
getNumberOfMessagesin interfaceAddressControl
-
isPaging
public boolean isPaging() throws ExceptionDescription copied from interface:AddressControlReturns whether this address is paging.- Specified by:
isPagingin interfaceAddressControl- Throws:
Exception
-
getAddressLimitPercent
public int getAddressLimitPercent() throws ExceptionDescription copied from interface:AddressControlReturns the % of memory limit that is currently in use- Specified by:
getAddressLimitPercentin interfaceAddressControl- Throws:
Exception
-
block
public boolean block()
Description copied from interface:AddressControlBlocks message production to this address by limiting credit- Specified by:
blockin interfaceAddressControl- Returns:
- true if production is blocked
-
unblock
public void unblock()
- Specified by:
unblockin interfaceAddressControl
-
getNumberOfPages
public int getNumberOfPages()
Description copied from interface:AddressControlReturns the number of pages used by this address.- Specified by:
getNumberOfPagesin interfaceAddressControl
-
getMessageCount
public long getMessageCount()
- Specified by:
getMessageCountin interfaceAddressControl
-
getRoutedMessageCount
public long getRoutedMessageCount()
Description copied from interface:AddressControlReturns the number of messages routed to one or more bindings- Specified by:
getRoutedMessageCountin interfaceAddressControl
-
getUnRoutedMessageCount
public long getUnRoutedMessageCount()
Description copied from interface:AddressControlReturns the number of messages not routed to any bindings- Specified by:
getUnRoutedMessageCountin interfaceAddressControl
-
sendMessage
public String sendMessage(Map<String,String> headers, int type, String body, boolean durable, String user, String password) throws Exception
- Specified by:
sendMessagein interfaceAddressControl- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to send- Returns:
- Throws:
Exception
-
sendMessage
public String sendMessage(Map<String,String> headers, int type, String body, boolean durable, String user, String password, boolean createMessageId) throws Exception
- Specified by:
sendMessagein interfaceAddressControl- Parameters:
headers- the message headers and properties to set. Can only container Strings maped to primitive types.body- the text to sendcreateMessageId- whether or not to auto generate a Message ID- Returns:
- Throws:
Exception
-
fillMBeanOperationInfo
protected MBeanOperationInfo[] fillMBeanOperationInfo()
- Specified by:
fillMBeanOperationInfoin classAbstractControl
-
fillMBeanAttributeInfo
protected MBeanAttributeInfo[] fillMBeanAttributeInfo()
- Specified by:
fillMBeanAttributeInfoin classAbstractControl
-
pause
public void pause()
Description copied from interface:AddressControlPauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. Newly added queue will be paused too until resume is called.- Specified by:
pausein interfaceAddressControl
-
pause
public void pause(boolean persist)
Description copied from interface:AddressControlPauses all the queues bound to this address. Messages are no longer delivered to all its bounded queues. Newly added queue will be paused too until resume is called.- Specified by:
pausein interfaceAddressControl- Parameters:
persist- if true, the pause state will be persisted.
-
resume
public void resume()
Description copied from interface:AddressControlResume all the queues bound of this address. Messages are delivered again to all its bounded queues.- Specified by:
resumein interfaceAddressControl
-
isPaused
public boolean isPaused()
- Specified by:
isPausedin interfaceAddressControl
-
isRetroactiveResource
public boolean isRetroactiveResource()
- Specified by:
isRetroactiveResourcein interfaceAddressControl
-
getCurrentDuplicateIdCacheSize
public long getCurrentDuplicateIdCacheSize()
- Specified by:
getCurrentDuplicateIdCacheSizein interfaceAddressControl
-
clearDuplicateIdCache
public boolean clearDuplicateIdCache()
- Specified by:
clearDuplicateIdCachein interfaceAddressControl
-
isAutoCreated
public boolean isAutoCreated()
Description copied from interface:AddressControlReturns whether this address was created automatically in response to client action.- Specified by:
isAutoCreatedin interfaceAddressControl
-
isInternal
public boolean isInternal()
Description copied from interface:AddressControlReturns whether this address was created for the broker's internal use.- Specified by:
isInternalin interfaceAddressControl
-
isTemporary
public boolean isTemporary()
Description copied from interface:AddressControlReturns whether this address is temporary.- Specified by:
isTemporaryin interfaceAddressControl
-
purge
public long purge() throws ExceptionDescription copied from interface:AddressControlPurge all the queues bound of this address. Returns the total number of messages purged.- Specified by:
purgein interfaceAddressControl- Throws:
Exception
-
replay
public void replay(String target, String filter) throws Exception
- Specified by:
replayin interfaceAddressControl- Throws:
Exception
-
-