Package org.apache.qpid.jms.policy
Class JmsDefaultDeserializationPolicy
java.lang.Object
org.apache.qpid.jms.policy.JmsDefaultDeserializationPolicy
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringValue used to indicate that all classes should be allowed or denied,static final Stringstatic final StringDeprecated.new applications should use the ALLOWLIST_PROPERTY insteadstatic final StringDeprecated.new applications should use the DENYLIST_PROPERTY instead -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of this policy with default configuration. -
Method Summary
Modifier and TypeMethodDescriptioncopy()booleanDeprecated.Use the replacement methodgetDenyList()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 Details
-
CATCH_ALL_WILDCARD
Value used to indicate that all classes should be allowed or denied,- See Also:
-
DEPRECATED_ALLOWLIST_PROPERTY
Deprecated.new applications should use the ALLOWLIST_PROPERTY instead- See Also:
-
DEPRECATED_DENYLIST_PROPERTY
Deprecated.new applications should use the DENYLIST_PROPERTY instead- See Also:
-
ALLOWLIST_PROPERTY
- See Also:
-
DENYLIST_PROPERTY
- See Also:
-
-
Constructor Details
-
JmsDefaultDeserializationPolicy
public JmsDefaultDeserializationPolicy()Creates an instance of this policy with default configuration. -
JmsDefaultDeserializationPolicy
- Parameters:
source- The instance whose configuration should be copied from.
-
-
Method Details
-
copy
- Specified by:
copyin interfaceJmsDeserializationPolicy
-
isTrustedType
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.Use the replacement methodgetAllowList()- Returns:
- the allow list configured on this policy instance.
-
getAllowList
- Returns:
- the allow list configured on this policy instance.
-
getBlackList
Deprecated.Use the replacement methodgetDenyList()- Returns:
- the deny list configured on this policy instance.
-
getDenyList
- Returns:
- the deny list configured on this policy instance.
-
setWhiteList
Deprecated.Use the replacement methodsetAllowList(String)- Parameters:
allowList- the allow list that this policy is configured to recognize.
-
setAllowList
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.Use the replacement methodsetDenyList(String)- Parameters:
denyList- the deny list that this policy is configured to recognize.
-
setDenyList
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.
-
hashCode
public int hashCode() -
equals
-