Class StaticResponseHandler

  • All Implemented Interfaces:
    org.forgerock.http.Handler

    public class StaticResponseHandler
    extends Object
    implements org.forgerock.http.Handler
    Creates a static HTTP response.
    • Constructor Detail

      • StaticResponseHandler

        public StaticResponseHandler​(org.forgerock.http.protocol.Status status)
        Constructor.
        Parameters:
        status - The response status to set.
      • StaticResponseHandler

        public StaticResponseHandler​(org.forgerock.http.protocol.Status status,
                                     String version,
                                     Expression<String> entity)
        Constructor.
        Parameters:
        status - The response status to set.
        version - The protocol version.
        entity - The message entity expression.
    • Method Detail

      • addHeader

        public StaticResponseHandler addHeader​(String key,
                                               Expression<String> expression)
        Adds a pair key / expression to the header.
        Parameters:
        key - The header key.
        expression - The expression to evaluate.
        Returns:
        The current static response handler.
      • handle

        public org.forgerock.util.promise.Promise<org.forgerock.http.protocol.Response,​org.forgerock.util.promise.NeverThrowsException> handle​(org.forgerock.services.context.Context context,
                                                                                                                                                     org.forgerock.http.protocol.Request request)
        Specified by:
        handle in interface org.forgerock.http.Handler