Search in sources :

Example 6 with EHttpMethod

use of com.helger.commons.http.EHttpMethod in project ph-web by phax.

the class XServletHandlerRegistry method copyHandler.

/**
 * Copy an existing handler of a certain HTTP method to another HTTP method.
 * The same instance of the handler is re-used!
 *
 * @param eFromMethod
 *        Source method. May not be <code>null</code>.
 * @param aToMethods
 *        Destination methods. May not be <code>null</code> and may not
 *        contain <code>null</code> values.
 * @return {@link EChange#UNCHANGED} if no existing handler was found,
 *         {@link EChange#CHANGED} if at least one handler was copied.
 * @throws IllegalStateException
 *         In another handler is already registered for one of the destination
 *         methods.
 * @see #copyHandlerToAll(EHttpMethod)
 */
public EChange copyHandler(@Nonnull final EHttpMethod eFromMethod, @Nonnull @Nonempty final Set<EHttpMethod> aToMethods) {
    ValueEnforcer.notNull(eFromMethod, "FromMethod");
    ValueEnforcer.notEmptyNoNullValue(aToMethods, "ToMethods");
    final IXServletHandler aFromHandler = getHandler(eFromMethod);
    if (aFromHandler == null)
        return EChange.UNCHANGED;
    for (final EHttpMethod eToMethod : aToMethods) registerHandler(eToMethod, aFromHandler, false);
    return EChange.CHANGED;
}
Also used : EHttpMethod(com.helger.commons.http.EHttpMethod)

Aggregations

EHttpMethod (com.helger.commons.http.EHttpMethod)6 AS2HttpClient (com.helger.as2lib.util.http.AS2HttpClient)2 AS2HttpHeaderSetter (com.helger.as2lib.util.http.AS2HttpHeaderSetter)2 StopWatch (com.helger.commons.timing.StopWatch)2 EHttpVersion (com.helger.http.EHttpVersion)2 InputStream (java.io.InputStream)2 MIC (com.helger.as2lib.crypto.MIC)1 AS2DispositionException (com.helger.as2lib.disposition.AS2DispositionException)1 AS2Exception (com.helger.as2lib.exception.AS2Exception)1 WrappedAS2Exception (com.helger.as2lib.exception.WrappedAS2Exception)1 IMessageMDN (com.helger.as2lib.message.IMessageMDN)1 Partnership (com.helger.as2lib.partner.Partnership)1 AS2NoModuleException (com.helger.as2lib.processor.AS2NoModuleException)1 AS2ComponentNotFoundException (com.helger.as2lib.session.AS2ComponentNotFoundException)1 OverrideOnDemand (com.helger.commons.annotation.OverrideOnDemand)1 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)1 HttpHeaderMap (com.helger.commons.http.HttpHeaderMap)1 EContentTransferEncoding (com.helger.mail.cte.EContentTransferEncoding)1 StatusAwareHttpResponseWrapper (com.helger.servlet.response.StatusAwareHttpResponseWrapper)1 UnifiedResponse (com.helger.servlet.response.UnifiedResponse)1