Package org.refcodes.rest
Interface BasicAuthEndpoint
-
- All Superinterfaces:
org.refcodes.net.BasicAuthObserver
,org.refcodes.net.HttpMethodAccessor
- All Known Subinterfaces:
BasicAuthEndpointBuilder
- All Known Implementing Classes:
BasicAuthEndpointBuilderImpl
public interface BasicAuthEndpoint extends org.refcodes.net.BasicAuthObserver, org.refcodes.net.HttpMethodAccessor
ABasicAuthEndpoint
subscribes to aRestServer
(HttpRestServer
) and defines the target for a Basic-Auth request. Therefore theBasicAuthEndpoint
describes theHttpMethod
, the locator (pattern) to which to respond as well as aBasicAuthObserver
responsible for processing the request. TheBasicAuthObserver
is invoked as soon as a request with the givenHttpMethod
for a locator matching the given Locator-Pattern is being processed by theRestServer
(HttpRestServer
). The locator for which aBasicAuthEndpoint
is responsible for is defined by theBasicAuthEndpoint
'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 theRestRequestEvent
's methodWildcardSubstitutes.getWildcardReplacements()
inside theBasicAuthObserver.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}?".
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.net.HttpMethodAccessor
org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getLocatorPattern()
Retrieves the resource Locator-Pattern this endpoint has been registered to.
-
-
-
Method Detail
-
getLocatorPattern
java.lang.String getLocatorPattern()
Retrieves the resource Locator-Pattern this endpoint has been registered to. The Locator-Pattern may contain wildcards as known from file-systems as follows: 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 theRestRequestEvent
's methodWildcardSubstitutes.getWildcardReplacements()
inside theBasicAuthObserver.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}?". TheRestRequestEvent
lets you access the wildcard substitutes either by index or by name.
-
-