Class RemoteAddressConnectorPolicy
- All Implemented Interfaces:
RemoteAddressConnectorPolicyMBean, TransportConnectorPolicyMBean, org.apache.activemq.transport.TransportConnectorPolicy
TransportConnectorPolicy that admits or refuses each accepted socket
by its remote IP address, using allow and deny lists in CIDR notation.
Deny entries are checked first, then the allow list; an empty allow list
permits every address not denied. Each list is a comma separated string of
CIDR blocks or a file: URI to a file with one block per line; see
CidrListLoader for the accepted forms. A list is parsed when its
property is set, so a broken file reference fails the broker configuration
instead of the first connection.
The lists are configuration, set before the connector starts. At runtime
JMX exposes this policy as a RemoteAddressConnectorPolicyMBean under the
connector's object name: enforcement can be switched with the enabled
attribute, the counters report admissions and refusals, and the allowed
operation runs an address or block through the decision without connecting.
<transportConnector name="openwire" uri="tcp://0.0.0.0:61616">
<transportConnectorPolicy>
<remoteAddressConnectorPolicy allowList="10.0.0.0/8" denyList="10.0.0.53/32"/>
</transportConnectorPolicy>
</transportConnector>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglonglonglonglonglonggetName()booleanvoidvoidvoidsetAllowList(String allowList) CIDR blocks that remote addresses must fall within to connect, as a comma separated list (e.g.voidsetDenyList(String denyList) CIDR blocks that are refused regardless of the allow list, in the same comma separated orfile:URI form as the allow list.voidsetEnabled(boolean enabled) voidNames this policy instance in log messages and in its JMX object name.toString()
-
Constructor Details
-
RemoteAddressConnectorPolicy
public RemoteAddressConnectorPolicy()
-
-
Method Details
-
process
- Specified by:
processin interfaceorg.apache.activemq.transport.TransportConnectorPolicy- Throws:
SecurityException
-
allowed
- Specified by:
allowedin interfaceRemoteAddressConnectorPolicyMBean
-
getName
- Specified by:
getNamein interfaceTransportConnectorPolicyMBean
-
setName
Names this policy instance in log messages and in its JMX object name. -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceTransportConnectorPolicyMBean
-
setEnabled
public void setEnabled(boolean enabled) - Specified by:
setEnabledin interfaceTransportConnectorPolicyMBean
-
getAllowList
- Specified by:
getAllowListin interfaceRemoteAddressConnectorPolicyMBean
-
setAllowList
CIDR blocks that remote addresses must fall within to connect, as a comma separated list (e.g.10.0.0.0/8,192.168.1.0/24) or afile:URI to a file with one CIDR block per line.${activemq.conf}and${activemq.data}may be used in the URI. Empty means no restriction beyond the deny list. -
getDenyList
- Specified by:
getDenyListin interfaceRemoteAddressConnectorPolicyMBean
-
setDenyList
CIDR blocks that are refused regardless of the allow list, in the same comma separated orfile:URI form as the allow list. Deny entries are checked first. -
getAllowListCount
public long getAllowListCount()- Specified by:
getAllowListCountin interfaceRemoteAddressConnectorPolicyMBean
-
getDenyListCount
public long getDenyListCount()- Specified by:
getDenyListCountin interfaceRemoteAddressConnectorPolicyMBean
-
getAllowListInvalidCount
public long getAllowListInvalidCount()- Specified by:
getAllowListInvalidCountin interfaceRemoteAddressConnectorPolicyMBean
-
getDenyListInvalidCount
public long getDenyListInvalidCount()- Specified by:
getDenyListInvalidCountin interfaceRemoteAddressConnectorPolicyMBean
-
getAllowedCount
public long getAllowedCount()- Specified by:
getAllowedCountin interfaceRemoteAddressConnectorPolicyMBean
-
getDeniedCount
public long getDeniedCount()- Specified by:
getDeniedCountin interfaceRemoteAddressConnectorPolicyMBean
-
resetStatistics
public void resetStatistics()- Specified by:
resetStatisticsin interfaceRemoteAddressConnectorPolicyMBean
-
toString
-