Class AbstractGwtRpcRequestMatcher
- java.lang.Object
-
- com.hitachivantara.security.web.impl.model.matcher.RegexRequestMatcher
-
- org.pentaho.platform.web.gwt.rpc.matcher.AbstractGwtRpcRequestMatcher
-
- All Implemented Interfaces:
com.hitachivantara.security.web.model.matcher.RequestMatcher
,Predicate<javax.servlet.http.HttpServletRequest>
- Direct Known Subclasses:
PluginGwtRpcRequestMatcher
,SystemGwtRpcRequestMatcher
public abstract class AbstractGwtRpcRequestMatcher extends com.hitachivantara.security.web.impl.model.matcher.RegexRequestMatcher
TheAbstractGwtRpcRequestMatcher
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 theAbstractGwtRpc
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 ofIGwtRpcSerializationPolicyCache
, where these objects are stored and loaded from.
-
-
Constructor Summary
Constructors Constructor Description AbstractGwtRpcRequestMatcher(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractGwtRpc
getGwtRpc(javax.servlet.http.HttpServletRequest httpRequest)
Gets theAbstractGwtRpc
instance associated with the given request, creating one if it has not yet been created.Collection<String>
getRpcMethodNames()
Gets the collection of matching GWT-RPC service method names.IGwtRpcSerializationPolicyCache
getSerializationPolicyCache()
Gets the serialization policy cache, if any.boolean
test(javax.servlet.http.HttpServletRequest httpRequest)
-
-
-
Constructor Detail
-
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 givenpattern
matches 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 Detail
-
getSerializationPolicyCache
@Nullable public IGwtRpcSerializationPolicyCache getSerializationPolicyCache()
Gets the serialization policy cache, if any.
-
getRpcMethodNames
@Nullable public Collection<String> 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 theAbstractGwtRpc
instance associated with the given request, creating one if it has not yet been created.- Parameters:
httpRequest
- The HTTP request.- Returns:
- The associated
AbstractGwtRpc
instance. - Throws:
GwtRpcProxyException
- if theAbstractGwtRpc
instance fails to be created.
-
-