org.refcodes.component.Closable
, org.refcodes.component.Closable.CloseBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<BasicAuthEndpointBuilder>>
, org.refcodes.component.ConnectionStatusAccessor
, org.refcodes.component.LinkComponent
, org.refcodes.component.LinkComponent.LinkComponentBuilder<BasicAuthEndpointBuilder>
, org.refcodes.component.Openable
, org.refcodes.component.Openable.OpenBuilder<org.refcodes.component.LinkComponent.LinkComponentBuilder<BasicAuthEndpointBuilder>>
, org.refcodes.net.BasicAuthObserver
, org.refcodes.net.HttpMethodAccessor
, org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<BasicAuthEndpointBuilder>
, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator
, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
, BasicAuthEndpoint
, BasicAuthEndpointBuilder
public class BasicAuthEndpointBuilderImpl extends Object implements BasicAuthEndpointBuilder
BasicAuthEndpointBuilder
interface as good
old POJO for use by different RestServer
implementations.org.refcodes.component.Closable.CloseAutomaton, org.refcodes.component.Closable.CloseBuilder<B extends org.refcodes.component.Closable.CloseBuilder<B>>
org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusMutator, org.refcodes.component.ConnectionStatusAccessor.ConnectionStatusProperty
org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
Modifier and Type | Field | Description |
---|---|---|
protected org.refcodes.component.ConnectionStatus |
_connectionStatus |
|
protected org.refcodes.net.HttpMethod |
_httpMethod |
|
protected String |
_locatorPattern |
|
protected org.refcodes.net.BasicAuthObserver |
_requestObserver |
Constructor | Description |
---|---|
BasicAuthEndpointBuilderImpl() |
Constructs a plain
BasicAuthEndpointBuilder , make sure to provide
the least required attributes as demonstrated by the constructor
BasicAuthEndpointBuilderImpl(HttpMethod, String, BasicAuthObserver) . |
BasicAuthEndpointBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod,
String aLocatorPattern,
org.refcodes.net.BasicAuthObserver aRequestObserver) |
Constructs an
BasicAuthEndpointBuilder with the least required
attributes. |
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
org.refcodes.component.ConnectionStatus |
getConnectionStatus() |
|
org.refcodes.net.HttpMethod |
getHttpMethod() |
|
String |
getLocatorPattern() |
Retrieves the resource Locator-Pattern this endpoint has been registered
to.
|
org.refcodes.net.BasicAuthObserver |
getRequestObserver() |
Retrieves the
BasicAuthObserver to which any requests are
delegated upon invocation of the
BasicAuthObserver.onBasicAuthRequest(java.net.InetSocketAddress, java.net.InetSocketAddress, HttpMethod, String, org.refcodes.net.BasicAuthCredentials, String)
method. |
org.refcodes.net.BasicAuthResponse |
onBasicAuthRequest(InetSocketAddress aLocalAddress,
InetSocketAddress aRemoteAddress,
org.refcodes.net.HttpMethod aHttpMethod,
String aLocator,
org.refcodes.net.BasicAuthCredentials aCredentials,
String aRealm) |
|
void |
open() |
|
void |
setHttpMethod(org.refcodes.net.HttpMethod aHttpMethod) |
|
void |
setLocatorPattern(String aLocatorPattern) |
Sets the resource locator.
|
void |
setRequestObserver(org.refcodes.net.BasicAuthObserver aLambda) |
Sets the
BasicAuthObserver to which any requests are delegated
upon invocation of the
BasicAuthObserver.onBasicAuthRequest(java.net.InetSocketAddress, java.net.InetSocketAddress, HttpMethod, String, org.refcodes.net.BasicAuthCredentials, String)
method. |
withClose, withCloseIn, withCloseQuietly, withHttpMethod, withLocatorPattern, withOpen, withRequestObserver
closeIn, closeQuietly, closeUnchecked
protected org.refcodes.net.BasicAuthObserver _requestObserver
protected org.refcodes.net.HttpMethod _httpMethod
protected String _locatorPattern
protected org.refcodes.component.ConnectionStatus _connectionStatus
public BasicAuthEndpointBuilderImpl()
BasicAuthEndpointBuilder
, make sure to provide
the least required attributes as demonstrated by the constructor
BasicAuthEndpointBuilderImpl(HttpMethod, String, BasicAuthObserver)
.public BasicAuthEndpointBuilderImpl(org.refcodes.net.HttpMethod aHttpMethod, String aLocatorPattern, org.refcodes.net.BasicAuthObserver aRequestObserver)
BasicAuthEndpointBuilder
with the least required
attributes.aHttpMethod
- The HTTP-Method to which this
BasicAuthEndpointBuilder
is bound.aLocatorPattern
- The local host's locator patter to which this
BasicAuthEndpointBuilder
is bound. See
setLocatorPattern(String)
on the syntax of the pattern.aRequestObserver
- The listener processing requests targeted at this
BasicAuthEndpointBuilder
.public void setLocatorPattern(String aLocatorPattern)
WildcardSubstitutes.getWildcardReplacement(String)
.
For ease of use, a named wildcard with single asterisk ("*") such as
"${arg1}=*" can be abbreviated as "${arg1}".setLocatorPattern
in interface BasicAuthEndpointBuilder
aLocatorPattern
- the new locator patternpublic void setHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
setHttpMethod
in interface org.refcodes.net.HttpMethodAccessor.HttpMethodMutator
public void setRequestObserver(org.refcodes.net.BasicAuthObserver aLambda)
BasicAuthObserver
to which any requests are delegated
upon invocation of the
BasicAuthObserver.onBasicAuthRequest(java.net.InetSocketAddress, java.net.InetSocketAddress, HttpMethod, String, org.refcodes.net.BasicAuthCredentials, String)
method.setRequestObserver
in interface BasicAuthEndpointBuilder
aLambda
- The (user defined) BasicAuthObserver
to handle
requests, feel free to code it as lambda
expression!public org.refcodes.net.BasicAuthObserver getRequestObserver()
BasicAuthObserver
to which any requests are
delegated upon invocation of the
BasicAuthObserver.onBasicAuthRequest(java.net.InetSocketAddress, java.net.InetSocketAddress, HttpMethod, String, org.refcodes.net.BasicAuthCredentials, String)
method.getRequestObserver
in interface BasicAuthEndpointBuilder
BasicAuthObserver
to handle requests.public org.refcodes.net.BasicAuthResponse onBasicAuthRequest(InetSocketAddress aLocalAddress, InetSocketAddress aRemoteAddress, org.refcodes.net.HttpMethod aHttpMethod, String aLocator, org.refcodes.net.BasicAuthCredentials aCredentials, String aRealm)
onBasicAuthRequest
in interface org.refcodes.net.BasicAuthObserver
public org.refcodes.net.HttpMethod getHttpMethod()
getHttpMethod
in interface org.refcodes.net.HttpMethodAccessor
public String getLocatorPattern()
RestRequestEvent
's method
WildcardSubstitutes.getWildcardReplacements()
inside the
BasicAuthObserver.onBasicAuthRequest(java.net.InetSocketAddress, java.net.InetSocketAddress, HttpMethod, String, org.refcodes.net.BasicAuthCredentials, String)
method.
You may name a wildcard by prefixing it with "{someWildcardName}". For
example a named wildcard may look as follows: "{arg1}*" or "{arg2}**" or
"{arg3}?".
The RestRequestEvent
lets you access the wildcard substitutes
either by index or by name.
getLocatorPattern
in interface BasicAuthEndpoint
public void open() throws org.refcodes.component.OpenException
open
in interface org.refcodes.component.Openable
org.refcodes.component.OpenException
public void close() throws org.refcodes.component.CloseException
close
in interface org.refcodes.component.Closable
org.refcodes.component.CloseException
public org.refcodes.component.ConnectionStatus getConnectionStatus()
getConnectionStatus
in interface org.refcodes.component.ConnectionStatusAccessor
Copyright © 2018. All rights reserved.