public interface RestServer extends org.refcodes.observer.Observable<RestEndpoint>, org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup, org.refcodes.net.RealmAccessor.RealmProperty, org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty, org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
RestServer
acts as the target for clients issuing REST requests.
RestEndpointBuilder
instances, most easily being created with the
onRequest(HttpMethod, String, RestRequestObserver)
method (or the
like), are registered as listeners to the RestServer
(
HttpRestServer
). The RestServer
(HttpRestServer
)
fires RestRequestEvent
events to the RestRequestObserver
s of
an RestEndpoint
dedicated to an according locator (pattern) for a
specific HttpMethod
.org.refcodes.net.MediaTypeFactoryLookup.MutableMediaTypeFactoryLookup
org.refcodes.net.RealmAccessor.RealmBuilder<B extends org.refcodes.net.RealmAccessor.RealmBuilder<B>>, org.refcodes.net.RealmAccessor.RealmMutator, org.refcodes.net.RealmAccessor.RealmProperty
org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B extends org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<B>>, org.refcodes.net.BaseLocatorAccessor.BaseLocatorMutator, org.refcodes.net.BaseLocatorAccessor.BaseLocatorProperty
Modifier and Type | Method and Description |
---|---|
default RestEndpointBuilder |
onDelete(String aLocatorPattern,
RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done using
onRequest(HttpMethod, String, RestRequestObserver) :
Registers a RestRequestObserver with the given Locator-Pattern to
incoming DELETE methods. |
default RestEndpointBuilder |
onGet(String aLocatorPattern,
RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done using
onRequest(HttpMethod, String, RestRequestObserver) :
Registers a RestRequestObserver with the given Locator-Pattern to
incoming GET methods. |
default RestEndpointBuilder |
onPost(String aLocatorPattern,
RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done using
onRequest(HttpMethod, String, RestRequestObserver) :
Registers a RestRequestObserver with the given Locator-Pattern to
incoming POST methods. |
default RestEndpointBuilder |
onPut(String aLocatorPattern,
RestRequestObserver aRequestObserver)
Even more convenient: Everything done here can also be done using
onRequest(HttpMethod, String, RestRequestObserver) :
Registers a RestRequestObserver with the given Locator-Pattern to
incoming PUT methods. |
RestEndpointBuilder |
onRequest(org.refcodes.net.HttpMethod aHttpMethod,
String aLocatorPattern,
RestRequestObserver aRequestObserver)
Registers a pre-configured
RestEndpoint with the least required
attributes and returns its instance. |
default boolean |
onRequest(RestEndpoint aRestEndpoint)
For the sake of unified naming, this method just delegates to
#subscribeObserver(RestEndpoint) . |
default RestEndpointBuilder |
onRequest(String aLocatorPattern,
RestRequestObserver aRequestObserver)
Registers a pre-configured
RestEndpoint , triggerd by any HTTP
method, and returns its instance. |
default RestServer |
withBaseLocator(String aBaseLocator) |
default RestServer |
withRealm(String aRealm) |
hasObserverSubscription, subscribeObserver, unsubscribeObserver
addMediaTypeFactory
default boolean onRequest(RestEndpoint aRestEndpoint)
#subscribeObserver(RestEndpoint)
.#subscribeObserver(RestEndpoint)
default RestServer withBaseLocator(String aBaseLocator)
withBaseLocator
in interface org.refcodes.net.BaseLocatorAccessor.BaseLocatorBuilder<RestServer>
default RestServer withRealm(String aRealm)
withRealm
in interface org.refcodes.net.RealmAccessor.RealmBuilder<RestServer>
default RestEndpointBuilder onRequest(String aLocatorPattern, RestRequestObserver aRequestObserver)
RestEndpoint
, triggerd by any HTTP
method, and returns its instance. To unsubscribe via
#unsubscribeObserver(RestEndpoint)
, use the returned instance.
Attention: Invoke Openable.open()
to activate this
endpoint!aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.RestEndpointBuilder onRequest(org.refcodes.net.HttpMethod aHttpMethod, String aLocatorPattern, RestRequestObserver aRequestObserver)
RestEndpoint
with the least required
attributes and returns its instance. To unsubscribe via
#unsubscribeObserver(RestEndpoint)
, use the returned instance.
Attention: Invoke Openable.open()
to activate this
endpoint!aHttpMethod
- The HTTP method to which this RestEndpoint
is
bound. A value of null means that any HTTP method may
trigger this RestEndpoint
.
aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound. A value of null means
that any locator may trigger this RestEndpoint
.
aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.default RestEndpointBuilder onGet(String aLocatorPattern, RestRequestObserver aRequestObserver)
onRequest(HttpMethod, String, RestRequestObserver)
:
Registers a RestRequestObserver
with the given Locator-Pattern to
incoming GET methods.
Attention: Invoke Openable.open()
to activate this
endpoint!aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.default RestEndpointBuilder onPut(String aLocatorPattern, RestRequestObserver aRequestObserver)
onRequest(HttpMethod, String, RestRequestObserver)
:
Registers a RestRequestObserver
with the given Locator-Pattern to
incoming PUT methods.
Attention: Invoke Openable.open()
to activate this
endpoint!aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.default RestEndpointBuilder onPost(String aLocatorPattern, RestRequestObserver aRequestObserver)
onRequest(HttpMethod, String, RestRequestObserver)
:
Registers a RestRequestObserver
with the given Locator-Pattern to
incoming POST methods.
Attention: Invoke Openable.open()
to activate this
endpoint!aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.default RestEndpointBuilder onDelete(String aLocatorPattern, RestRequestObserver aRequestObserver)
onRequest(HttpMethod, String, RestRequestObserver)
:
Registers a RestRequestObserver
with the given Locator-Pattern to
incoming DELETE methods.
Attention: Invoke Openable.open()
to activate this
endpoint!aLocatorPattern
- The local Locator-Pattern to which this
RestEndpoint
is bound.aRequestObserver
- The listener processing a request targeted at
this RestEndpoint
.RestEndpoint
which acts as handle to
unsubscribe the RestEndpoint
via
#unsubscribeObserver(RestEndpoint)
.Copyright © 2017. All rights reserved.