Package org.apache.qpid.jms.policy
Class JmsDefaultDeserializationPolicy
- java.lang.Object
-
- org.apache.qpid.jms.policy.JmsDefaultDeserializationPolicy
-
- All Implemented Interfaces:
JmsDeserializationPolicy
public class JmsDefaultDeserializationPolicy extends Object implements JmsDeserializationPolicy
Default implementation of the deserialization policy that can read allow and deny lists of classes/packages from the environment, and be updated by the connection uri options. The policy reads a default deny list string value (comma separated) from the system property "org.apache.qpid.jms.deserialization.deny_list" which defaults to null which indicates an empty deny list. The policy reads a default allow list string value (comma separated) from the system property "org.apache.qpid.jms.deserialization.allow_list" which defaults to a "*" which indicates that all classes are allowed. The deny list overrides the allow list, entries that could match both are counted as denied. If the policy should treat all classes as untrusted the deny list should be set to "*"".
-
-
Field Summary
Fields Modifier and Type Field Description static StringALLOWLIST_PROPERTYstatic StringCATCH_ALL_WILDCARDValue used to indicate that all classes should be allowed or denied,static StringDENYLIST_PROPERTYstatic StringDEPRECATED_ALLOWLIST_PROPERTYDeprecated.new applications should use the ALLOWLIST_PROPERTY insteadstatic StringDEPRECATED_DENYLIST_PROPERTYDeprecated.new applications should use the DENYLIST_PROPERTY instead
-
Constructor Summary
Constructors Constructor Description JmsDefaultDeserializationPolicy()Creates an instance of this policy with default configuration.JmsDefaultDeserializationPolicy(JmsDefaultDeserializationPolicy source)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JmsDeserializationPolicycopy()booleanequals(Object obj)StringgetAllowList()StringgetBlackList()Deprecated.Use the replacement methodgetDenyList()StringgetDenyList()StringgetWhiteList()Deprecated.Use the replacement methodgetAllowList()inthashCode()booleanisTrustedType(JmsDestination destination, Class<?> clazz)Returns whether the given class is a trusted type and can be deserialized by the client when calls toObjectMessage.getObject()are made.voidsetAllowList(String allowList)Replaces the currently configured allow list with a comma separated string containing the new allow list.voidsetBlackList(String denyList)Deprecated.Use the replacement methodsetDenyList(String)voidsetDenyList(String denyList)Replaces the currently configured deny list with a comma separated string containing the new deny list.voidsetWhiteList(String allowList)Deprecated.Use the replacement methodsetAllowList(String)
-
-
-
Field Detail
-
CATCH_ALL_WILDCARD
public static final String CATCH_ALL_WILDCARD
Value used to indicate that all classes should be allowed or denied,- See Also:
- Constant Field Values
-
DEPRECATED_ALLOWLIST_PROPERTY
@Deprecated public static final String DEPRECATED_ALLOWLIST_PROPERTY
Deprecated.new applications should use the ALLOWLIST_PROPERTY instead- See Also:
- Constant Field Values
-
DEPRECATED_DENYLIST_PROPERTY
@Deprecated public static final String DEPRECATED_DENYLIST_PROPERTY
Deprecated.new applications should use the DENYLIST_PROPERTY instead- See Also:
- Constant Field Values
-
ALLOWLIST_PROPERTY
public static final String ALLOWLIST_PROPERTY
- See Also:
- Constant Field Values
-
DENYLIST_PROPERTY
public static final String DENYLIST_PROPERTY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JmsDefaultDeserializationPolicy
public JmsDefaultDeserializationPolicy()
Creates an instance of this policy with default configuration.
-
JmsDefaultDeserializationPolicy
public JmsDefaultDeserializationPolicy(JmsDefaultDeserializationPolicy source)
- Parameters:
source- The instance whose configuration should be copied from.
-
-
Method Detail
-
copy
public JmsDeserializationPolicy copy()
- Specified by:
copyin interfaceJmsDeserializationPolicy
-
isTrustedType
public boolean isTrustedType(JmsDestination destination, Class<?> clazz)
Description copied from interface:JmsDeserializationPolicyReturns whether the given class is a trusted type and can be deserialized by the client when calls toObjectMessage.getObject()are made.- Specified by:
isTrustedTypein interfaceJmsDeserializationPolicy- Parameters:
destination- the Destination for the message containing the type to be deserialized.clazz- the Type of the object that is about to be read.- Returns:
- true if the type is trusted or false if not.
-
getWhiteList
@Deprecated public String getWhiteList()
Deprecated.Use the replacement methodgetAllowList()- Returns:
- the allow list configured on this policy instance.
-
getAllowList
public String getAllowList()
- Returns:
- the allow list configured on this policy instance.
-
getBlackList
@Deprecated public String getBlackList()
Deprecated.Use the replacement methodgetDenyList()- Returns:
- the deny list configured on this policy instance.
-
getDenyList
public String getDenyList()
- Returns:
- the deny list configured on this policy instance.
-
setWhiteList
@Deprecated public void setWhiteList(String allowList)
Deprecated.Use the replacement methodsetAllowList(String)- Parameters:
allowList- the allow list that this policy is configured to recognize.
-
setAllowList
public void setAllowList(String allowList)
Replaces the currently configured allow list with a comma separated string containing the new allow list. Null or empty string denotes no allow list entries, "*" indicates that all classes are allowed.- Parameters:
allowList- the allow list that this policy is configured to recognize.
-
setBlackList
@Deprecated public void setBlackList(String denyList)
Deprecated.Use the replacement methodsetDenyList(String)- Parameters:
denyList- the deny list that this policy is configured to recognize.
-
setDenyList
public void setDenyList(String denyList)
Replaces the currently configured deny list with a comma separated string containing the new deny list. Null or empty string denotes no deny list entries, "*" indicates that all classes are denied.- Parameters:
denyList- the deny list that this policy is configured to recognize.
-
-