public interface RestEndpointBuilder extends RestEndpoint, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty, org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestEndpointBuilder>, org.refcodes.component.LinkComponent.LinkComponentBuilder<RestEndpointBuilder>, org.refcodes.component.ConnectionStatusAccessor
RestEndpointBuilder
extends an RestEndpoint
with builder
functionality and adds lambda
support for handling the requests
addressed to this RestEndpoint
. The lambda
defined as
RestRequestObserver
acts as the single listener to this
RestEndpoint
responsible for handling the requests for which this
RestEndpoint
is responsible.
The locator for which an RestEndpointBuilder
is responsible for is
defined by the RestEndpointBuilder
's Locator-Pattern:
A single asterisk ("*") matches zero or more characters within a locator
name. A double asterisk ("**") matches zero or more characters across
directory levels. A question mark ("?") matches exactly one character within
a locator name.
The single asterisk ("*"), the double asterisk ("**") and the question mark
("?") we refer to as wildcard: You get an array with the substitutes of the
wildcards using the method WildcardSubstitutes.getWildcardReplacements()
.
You may name a wildcard by prefixing it with "{someWildcardName}". For
example a named wildcard may look as follows: "{arg1}*" or "{arg2}**" or
"{arg3}?". You can get the text substituting a named wildcard using the
method WildcardSubstitutes.getWildcardReplacement(String)
.org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
org.refcodes.component.LinkComponent.LinkAutomaton, org.refcodes.component.LinkComponent.LinkComponentBuilder<B extends org.refcodes.component.LinkComponent.LinkComponentBuilder<B>>
org.refcodes.component.Openable.OpenAutomaton, org.refcodes.component.Openable.OpenBuilder<B extends org.refcodes.component.Openable.OpenBuilder<B>>
getLocatorPattern
onRequest
setHttpMethod
default RestEndpointBuilder withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
withHttpMethod
in interface org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestEndpointBuilder>
default RestEndpointBuilder withLocatorPattern(String aLocatorPattern)
aLocatorPattern
- the a locator patternRestEndpoint
builder to continue configuration (as of
the Builder-Pattern).void setLocatorPattern(String aLocatorPattern)
aLocatorPattern
- the new locator patternRestRequestObserver getRequestObserver()
RestRequestObserver
to which any requests are
delegated upon invocation of the
RestRequestObserver.onRequest(RestRequestEvent, org.refcodes.net.HttpServerResponse)
method.RestRequestObserver
to handle
requests.void setRequestObserver(RestRequestObserver aLambda)
RestRequestObserver
to which any requests are delegated
upon invocation of the
RestRequestObserver.onRequest(RestRequestEvent, org.refcodes.net.HttpServerResponse)
method.aLambda
- The (user defined) RestRequestObserver
to handle
requests, feel free to code it as lambda
expression!default RestEndpointBuilder withRequestObserver(RestRequestObserver aLambda)
RestRequestObserver
.aLambda
- The (user defined) RestRequestObserver
to handle
requests, feel free to code it as lambda
expressionRestEndpointBuilder
for the sake of a fluent API.default RestEndpointBuilder withOpen() throws org.refcodes.component.OpenException
withOpen
in interface org.refcodes.component.Openable.OpenBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestEndpointBuilder>>
org.refcodes.component.OpenException
default RestEndpointBuilder withClose() throws org.refcodes.component.CloseException
withClose
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestEndpointBuilder>>
org.refcodes.component.CloseException
default RestEndpointBuilder withCloseQuietly()
withCloseQuietly
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestEndpointBuilder>>
default RestEndpointBuilder withCloseIn(int aCloseInMillis)
withCloseIn
in interface org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<RestEndpointBuilder>>
Copyright © 2018. All rights reserved.