Class RestRequestEvent
java.lang.Object
org.refcodes.web.AbstractHttpRequest
org.refcodes.web.HttpServerRequest
org.refcodes.rest.RestRequestEvent
- All Implemented Interfaces:
ActionAccessor<HttpMethod>, SourceAccessor<RestServer>, WildcardSubstitutes, ActionEvent<HttpMethod, RestServer>, Event<RestServer>, HeaderFieldsAccessor<RequestHeaderFields>, HttpBodyAccessor, HttpInputStreamAccessor, HttpMethodAccessor, HttpRequest, LocalAddressAccessor, RealmAccessor, RemoteAddressAccessor, UrlAccessor
public class RestRequestEvent
extends HttpServerRequest
implements ActionEvent<HttpMethod, RestServer>, WildcardSubstitutes, RemoteAddressAccessor, LocalAddressAccessor, RealmAccessor
Defines a
RestRequestEvent being the request as consumed by a
RestEndpoint. Usually you will use
RestServer.onRequest(HttpMethod, String, RestRequestConsumer) for
registering a RestRequestConsumer to the RestServer (
HttpRestServer).-
Nested Class Summary
Nested classes/interfaces inherited from interface ActionAccessor
ActionAccessor.ActionBuilder<A,B>, ActionAccessor.ActionMutator<A>, ActionAccessor.ActionProperty<A> Nested classes/interfaces inherited from interface HeaderFieldsAccessor
HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>, HeaderFieldsAccessor.HeaderFieldsMutator<T>, HeaderFieldsAccessor.HeaderFieldsProperty<T> Nested classes/interfaces inherited from interface HttpBodyAccessor
HttpBodyAccessor.HttpBodyBuilder<B>, HttpBodyAccessor.HttpBodyMutator, HttpBodyAccessor.HttpBodyProperty, HttpBodyAccessor.HttpBodyProvider<EXC>Nested classes/interfaces inherited from interface HttpInputStreamAccessor
HttpInputStreamAccessor.HttpInputStreamBuilder<B>, HttpInputStreamAccessor.HttpInputStreamMutator, HttpInputStreamAccessor.HttpInputStreamProperty, HttpInputStreamAccessor.HttpInputStreamProvider<EXC>Nested classes/interfaces inherited from interface HttpMethodAccessor
HttpMethodAccessor.HttpMethodBuilder<B>, HttpMethodAccessor.HttpMethodMutator, HttpMethodAccessor.HttpMethodPropertyNested classes/interfaces inherited from interface LocalAddressAccessor
LocalAddressAccessor.LocalAddressBuilder<B>, LocalAddressAccessor.LocalAddressMutator, LocalAddressAccessor.LocalAddressPropertyNested classes/interfaces inherited from interface RealmAccessor
RealmAccessor.RealmBuilder<B>, RealmAccessor.RealmMutator, RealmAccessor.RealmPropertyNested classes/interfaces inherited from interface RemoteAddressAccessor
RemoteAddressAccessor.RemoteAddressBuilder<B>, RemoteAddressAccessor.RemoteAddressMutator, RemoteAddressAccessor.RemoteAddressPropertyNested classes/interfaces inherited from interface SourceAccessor
SourceAccessor.SourceBuilder<SRC,B>, SourceAccessor.SourceMutator<SRC>, SourceAccessor.SourceProperty<SRC> Nested classes/interfaces inherited from interface UrlAccessor
UrlAccessor.UrlBuilder, UrlAccessor.UrlMutator, UrlAccessor.UrlProperty -
Field Summary
Fields inherited from class HttpServerRequest
_mediaTypeFactoryLookupFields inherited from class AbstractHttpRequest
_headerFields, _httpMethod, _url -
Constructor Summary
ConstructorsConstructorDescriptionRestRequestEvent(InetSocketAddress aLocalAddress, InetSocketAddress aRemoteAddress, HttpMethod aHttpMethod, Url aUrl, WildcardSubstitutes aWildcardSubstitutes, RequestHeaderFields aHeaderFields, InputStream aHttpInputStream, RestServer aRestServer) Constructs aRestRequestEventwith all required attributes. -
Method Summary
Modifier and TypeMethodDescriptiongetRealm()String[]getWildcardReplacement(String aWildcardName) getWildcardReplacementAt(int aIndex) String[]String[]getWildcardReplacements(String... aWildcardNames) String[]getWildcardReplacementsAt(int... aIndexes) Methods inherited from class HttpServerRequest
getHttpBody, getHttpInputStream, getRequest, getRequest, toStringMethods inherited from class AbstractHttpRequest
getHeaderFields, getHttpMethod, getUrl
-
Constructor Details
-
RestRequestEvent
public RestRequestEvent(InetSocketAddress aLocalAddress, InetSocketAddress aRemoteAddress, HttpMethod aHttpMethod, Url aUrl, WildcardSubstitutes aWildcardSubstitutes, RequestHeaderFields aHeaderFields, InputStream aHttpInputStream, RestServer aRestServer) Constructs aRestRequestEventwith all required attributes.- Parameters:
aLocalAddress- The local address where the event is being received.aRemoteAddress- The remote address from which the request originates.aHttpMethod- TheHttpMethodwith which the request has been sent.aUrl- TheUrlfrom which to take the URL specific data.aWildcardSubstitutes- The text being substituted by the wildcard of theRestEndpoint's Locator-Pattern.aHeaderFields- TheRequestHeaderFieldssent by the request.aHttpInputStream- TheInputStreamrepresenting the request's HTTP body.aRestServer- The system firing the event.
-
-
Method Details
-
getAction
- Specified by:
getActionin interfaceActionAccessor<HttpMethod>
-
getSource
- Specified by:
getSourcein interfaceSourceAccessor<RestServer>
-
getWildcardReplacements
- Specified by:
getWildcardReplacementsin interfaceWildcardSubstitutes
-
getWildcardReplacementAt
- Specified by:
getWildcardReplacementAtin interfaceWildcardSubstitutes
-
getWildcardReplacement
- Specified by:
getWildcardReplacementin interfaceWildcardSubstitutes
-
getWildcardReplacements
- Specified by:
getWildcardReplacementsin interfaceWildcardSubstitutes
-
getWildcardReplacementsAt
- Specified by:
getWildcardReplacementsAtin interfaceWildcardSubstitutes
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceRemoteAddressAccessor
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceLocalAddressAccessor
-
getRealm
- Specified by:
getRealmin interfaceRealmAccessor
-
getWildcardNames
- Specified by:
getWildcardNamesin interfaceWildcardSubstitutes
-