Class AbstractGwtRpcRequestMatcher
- All Implemented Interfaces:
com.hitachivantara.security.web.model.matcher.RequestMatcher,Predicate<javax.servlet.http.HttpServletRequest>
- Direct Known Subclasses:
PluginGwtRpcRequestMatcher,SystemGwtRpcRequestMatcher
AbstractGwtRpcRequestMatcher class is the base class for GWT-RPC request matchers.
This request matcher class allows matching the GWT-RPC service method name of each request against a list of method names. The service method name is present in the request body, which is encoded in the GWT-RPC request format.
The abstract getGwtRpc(HttpServletRequest) method is responsible for obtaining the AbstractGwtRpc
object for the given request.
The service method name of the request is then obtained from the returned AbstractGwtRpc object.
Parsing the GWT-RPC request bodies requires a SerializationPolicy object, which is typically the result
of loading a file from disk. To make this process performant, this class optionally accepts an instance of
IGwtRpcSerializationPolicyCache, where these objects are stored and loaded from.
-
Field Summary
Fields inherited from interface com.hitachivantara.security.web.model.matcher.RequestMatcher
ALL, NONE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGwtRpcRequestMatcher(String pattern, boolean isCaseInsensitive, Collection<String> rpcMethodNames, IGwtRpcSerializationPolicyCache serializationPolicyCache) Constructs a GWT-RPC request matcher given a path pattern, collection of RPC method names, and a GWT-RPC serialization policy cache.AbstractGwtRpcRequestMatcher(String pattern, Collection<String> rpcMethodNames, IGwtRpcSerializationPolicyCache serializationPolicyCache) Constructs a GWT-RPC request matcher given a path pattern, collection of RPC method names, and a GWT-RPC serialization policy cache. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractGwtRpcgetGwtRpc(javax.servlet.http.HttpServletRequest httpRequest) Gets theAbstractGwtRpcinstance associated with the given request, creating one if it has not yet been created.Gets the collection of matching GWT-RPC service method names.Gets the serialization policy cache, if any.booleantest(javax.servlet.http.HttpServletRequest httpRequest)
-
Constructor Details
-
AbstractGwtRpcRequestMatcher
public AbstractGwtRpcRequestMatcher(@NonNull String pattern, @Nullable Collection<String> rpcMethodNames, @Nullable IGwtRpcSerializationPolicyCache serializationPolicyCache) Constructs a GWT-RPC request matcher given a path pattern, collection of RPC method names, and a GWT-RPC serialization policy cache.The request matcher created with this constructor applies matches the request path with the given pattern in a case-sensitive manner. Note that the RPC method name is always matched in a case-sensitive manner.
- Parameters:
pattern- The request path pattern.rpcMethodNames- The collection of service method names. Can benull, in which case all methods match.serializationPolicyCache- The serialization policy cache. Can benull, in which case no caching occurs.
-
AbstractGwtRpcRequestMatcher
public AbstractGwtRpcRequestMatcher(@NonNull String pattern, boolean isCaseInsensitive, @Nullable Collection<String> rpcMethodNames, @Nullable IGwtRpcSerializationPolicyCache serializationPolicyCache) Constructs a GWT-RPC request matcher given a path pattern, collection of RPC method names, and a GWT-RPC serialization policy cache.- Parameters:
pattern- The request path pattern.isCaseInsensitive- Indicates whether the givenpatternmatches the request path in a case-insensitive manner. Note that the RPC method name is always matched in a case-sensitive manner.rpcMethodNames- The collection of service method names. Can benull, in which case all methods match.serializationPolicyCache- The serialization policy cache. Can benull, in which case no caching occurs.
-
-
Method Details
-
getSerializationPolicyCache
Gets the serialization policy cache, if any. -
getRpcMethodNames
Gets the collection of matching GWT-RPC service method names. Whennull, all methods match. -
test
public boolean test(@NonNull javax.servlet.http.HttpServletRequest httpRequest) -
getGwtRpc
@NonNull protected abstract AbstractGwtRpc getGwtRpc(@NonNull javax.servlet.http.HttpServletRequest httpRequest) Gets theAbstractGwtRpcinstance associated with the given request, creating one if it has not yet been created.- Parameters:
httpRequest- The HTTP request.- Returns:
- The associated
AbstractGwtRpcinstance. - Throws:
GwtRpcProxyException- if theAbstractGwtRpcinstance fails to be created.
-