@NotThreadSafe public class XServletHandlerRegistry extends Object implements Serializable
EHttpMethod to IXServletHandler.| Constructor and Description |
|---|
XServletHandlerRegistry() |
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.state.EChange |
copyHandler(com.helger.commons.http.EHttpMethod eFromMethod,
Set<com.helger.commons.http.EHttpMethod> aToMethods)
Copy an existing handler of a certain HTTP method to another HTTP method.
|
com.helger.commons.state.EChange |
copyHandlerToAll(com.helger.commons.http.EHttpMethod eFromMethod)
Copy the handler of the passed method to all other HTTP methods in the
range of GET, POST, PUT, DELETE and PATCH.
|
void |
forEachHandler(Consumer<? super IXServletHandler> aConsumer) |
<EXTYPE extends Throwable> |
forEachHandlerThrowing(com.helger.commons.functional.IThrowingConsumer<? super IXServletHandler,EXTYPE> aConsumer) |
EnumSet<com.helger.commons.http.EHttpMethod> |
getAllowedHTTPMethods() |
String |
getAllowedHttpMethodsString() |
IXServletHandler |
getHandler(com.helger.commons.http.EHttpMethod eHttpMethod) |
void |
registerHandler(com.helger.commons.http.EHttpMethod eMethod,
IXServletHandler aLowLevelHandler,
boolean bAllowOverwrite)
Register a handler for the provided HTTP method.
|
void |
registerHandler(com.helger.commons.http.EHttpMethod eMethod,
IXServletSimpleHandler aSimpleHandler) |
void |
registerHandler(com.helger.commons.http.EHttpMethod eMethod,
com.helger.servlet.async.ServletAsyncSpec aAsyncSpec,
IXServletSimpleHandler aSimpleHandler) |
String |
toString() |
public void registerHandler(@Nonnull com.helger.commons.http.EHttpMethod eMethod, @Nonnull IXServletHandler aLowLevelHandler, boolean bAllowOverwrite)
eMethod - The HTTP method to register for. May not be null.aLowLevelHandler - The handler to register. May not be null.bAllowOverwrite - if true existing handler can be overwritten, if
false this method will throw an
IllegalStateException.public void registerHandler(@Nonnull com.helger.commons.http.EHttpMethod eMethod, @Nonnull IXServletSimpleHandler aSimpleHandler)
public void registerHandler(@Nonnull com.helger.commons.http.EHttpMethod eMethod, @Nonnull com.helger.servlet.async.ServletAsyncSpec aAsyncSpec, @Nonnull IXServletSimpleHandler aSimpleHandler)
public com.helger.commons.state.EChange copyHandler(@Nonnull com.helger.commons.http.EHttpMethod eFromMethod, @Nonnull @Nonempty Set<com.helger.commons.http.EHttpMethod> aToMethods)
eFromMethod - Source method. May not be null.aToMethods - Destination methods. May not be null and may not
contain null values.EChange.UNCHANGED if no existing handler was found,
EChange.CHANGED if at least one handler was copied.IllegalStateException - In another handler is already registered for one of the destination
methods.copyHandlerToAll(EHttpMethod)@Nonnull public com.helger.commons.state.EChange copyHandlerToAll(@Nonnull com.helger.commons.http.EHttpMethod eFromMethod)
eFromMethod - From method. May not be null. Should be one of GET,
POST, PUT, DELETE or PATCH.EChange.UNCHANGED if no existing handler was found,
EChange.CHANGED if at least one handler was copied.IllegalStateException - In another handler is already registered for one of the destination
methods.copyHandler(EHttpMethod, Set)@Nonnull @ReturnsMutableCopy public EnumSet<com.helger.commons.http.EHttpMethod> getAllowedHTTPMethods()
@Nullable public IXServletHandler getHandler(@Nonnull com.helger.commons.http.EHttpMethod eHttpMethod)
public void forEachHandler(@Nonnull Consumer<? super IXServletHandler> aConsumer)
public <EXTYPE extends Throwable> void forEachHandlerThrowing(@Nonnull com.helger.commons.functional.IThrowingConsumer<? super IXServletHandler,EXTYPE> aConsumer) throws EXTYPE extends Throwable
EXTYPE extends ThrowableCopyright © 2017–2019 Philip Helger. All rights reserved.