Package org.wildfly.httpclient.common
Enum HttpServiceConfig
- java.lang.Object
-
- java.lang.Enum<HttpServiceConfig>
-
- org.wildfly.httpclient.common.HttpServiceConfig
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<HttpServiceConfig>
public enum HttpServiceConfig extends java.lang.Enum<HttpServiceConfig>
Mode configuration for http services.The http services are internal server services responsible for handling client requests, and they are simple pojos conventionally named Http*Service.
- Author:
- Flavia Rainone
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEFAULTDefault configuration.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description HttpMarshallerFactorygetHttpMarshallerFactory(io.undertow.server.HttpServerExchange exchange)Returns the http marshaller factory that must be used for marshalling the service responses as bytes to be sent as a server response data.HttpMarshallerFactorygetHttpUnmarshallerFactory(io.undertow.server.HttpServerExchange exchange)Returns the http marshaller factory that must be used for unmarshalling the objects from service requests bytes.static HttpServiceConfiggetInstance()Returns the default configuration.static HttpServiceConfigvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static HttpServiceConfig[]values()Returns an array containing the constants of this enum type, in the order they are declared.io.undertow.server.HttpHandlerwrap(io.undertow.server.HttpHandler handler)Wraps the http service handler.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final HttpServiceConfig DEFAULT
Default configuration. Used by both EE namespace interoperable and non-interoperable servers
-
-
Method Detail
-
values
public static HttpServiceConfig[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (HttpServiceConfig c : HttpServiceConfig.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static HttpServiceConfig valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getInstance
public static HttpServiceConfig getInstance()
Returns the default configuration.- Returns:
- the configuration for http services
-
wrap
public io.undertow.server.HttpHandler wrap(io.undertow.server.HttpHandler handler)
Wraps the http service handler. Should be applied to all http handlers configured by a http service.- Parameters:
handler- responsible for handling the HTTP service requests directed to a specific URI- Returns:
- the HttpHandler that should be provided to Undertow and associated with the HTTP
service URI. The resulting handler is a wrapper that will add any necessary actions
before invoking the inner
handler.
-
getHttpUnmarshallerFactory
public HttpMarshallerFactory getHttpUnmarshallerFactory(io.undertow.server.HttpServerExchange exchange)
Returns the http marshaller factory that must be used for unmarshalling the objects from service requests bytes.- Parameters:
exchange- the server exchange- Returns:
- the HTTP marshaller factory for unmarshalling server request objects
-
getHttpMarshallerFactory
public HttpMarshallerFactory getHttpMarshallerFactory(io.undertow.server.HttpServerExchange exchange)
Returns the http marshaller factory that must be used for marshalling the service responses as bytes to be sent as a server response data.- Parameters:
exchange- the server exchange- Returns:
- the HTTP marshaller factory for marshalling server responses
-
-