|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.coherence.rest.server.AbstractHttpServer
public abstract class AbstractHttpServer
Abstract base class for HttpServer
implementations.
Nested Class Summary | |
---|---|
protected static class |
AbstractHttpServer.SimpleSecurityContext Simple implementation of the SecurityContext interface. |
Field Summary | |
---|---|
static java.lang.String |
ATTR_SUBJECT Attribute name that should be used to store Subject for the request. |
static java.lang.String |
AUTH_BASIC HTTP basic authentication. |
static java.lang.String |
AUTH_CERT Certificate authentication. |
static java.lang.String |
AUTH_CERT_BASIC Certificate authentication. |
static java.lang.String |
AUTH_NONE No authentication. |
static java.lang.String |
DEFAULT_ADDRESS Default HTTP server address. |
static IdentityAsserter |
DEFAULT_IDENTITY_ASSERTER Default identity asserter. |
static int |
DEFAULT_PORT Default HTTP server port. |
static java.lang.String |
HEADER_AUTHORIZATION Authorization header. |
protected static java.lang.String |
HEADER_WWW_AUTHENTICATE WWW-Authenticate header. |
static java.lang.String |
HTTP_BASIC_REALM Realm for HTTP basic authentication. |
protected ConfigurableCacheFactory |
m_cacheFactory Cache factory. |
protected boolean |
m_fStarted Flag specifying whether the server is already started. |
protected IdentityAsserter |
m_identityAsserter Identity asserter to use with HTTP basic authentication. |
protected java.util.Map |
m_mapResourceConfig Map of context names to Jersey resource configurations. |
protected int |
m_nPort Port number server should listen on. |
protected java.lang.String |
m_sAddr Address server should listen on. |
protected java.lang.String |
m_sAuthMethod Authentication method. |
protected Service |
m_serviceParent Parent service. |
protected com.oracle.common.net.SocketProvider |
m_socketProvider SocketProvider used by the server. |
Constructor Summary | |
---|---|
AbstractHttpServer() |
Method Summary | |
---|---|
protected javax.security.auth.Subject |
authenticate(java.lang.String sAuth) Perform HTTP Basic authentication and return authenticated Subject. |
protected java.lang.Object |
createContainer(com.sun.jersey.api.core.ResourceConfig resourceConfig) Create and configure a Jersey container that will process HTTP requests. |
IdentityAsserter |
getIdentityAsserter() Return identity asserter to use for HTTP basic authentication. |
java.lang.String |
getLocalAddress() Return the address the server should listen on. |
int |
getLocalPort() Return the port number the server should listen on. |
Service |
getParentService() Return the service that is embedding this server. |
java.util.Map |
getResourceConfig() Return map of context names to Jersey resource configurations. |
com.oracle.common.net.SocketProvider |
getSocketProvider() Return the SocketProvider to use. |
javax.net.ssl.SSLContext |
getSSLContext() Return the SSLContext to use. |
javax.net.ssl.SSLParameters |
getSSLParameters() Return the SSLParameters to use. |
protected javax.security.auth.Subject |
getSubjectFromSession(javax.net.ssl.SSLSession session) Creates Subject instance using principal and credentials from the SSL session. |
protected void |
handleRequest(com.sun.jersey.spi.container.WebApplication app, com.sun.jersey.spi.container.ContainerRequest request, com.sun.jersey.spi.container.ContainerResponseWriter responseWriter, javax.security.auth.Subject subject) Handle HTTP(S) request. |
protected abstract java.lang.Object |
instantiateContainer(com.sun.jersey.spi.container.WebApplication application, com.sun.jersey.api.core.ResourceConfig config) Factory method for Jersey container instances. |
protected boolean |
isAuthMethodBasic() Return true if this server should use HTTP basic authentication. |
protected boolean |
isAuthMethodCert() Return true if this server should use client certificates for authentication. |
protected boolean |
isAuthMethodNone() Return true if this server should not require client authentication. |
protected boolean |
isSecure() Return true if this server uses SSL to secure communication. |
void |
setAuthMethod(java.lang.String sMethod) Set the client authentication method to use. |
void |
setCacheFactory(ConfigurableCacheFactory cacheFactory) Set ConfigurableCacheFactory to use. |
protected void |
setIdentityAsserter(IdentityAsserter asserter) Configure the identity asserter to use for HTTP basic authentication. |
void |
setLocalAddress(java.lang.String sAddr) Set the address server should listen on. |
void |
setLocalPort(int nPort) Set the port number server should listen on. |
void |
setParentService(Service service) Set the Service that is embedding this HttpServer. |
void |
setResourceConfig(java.util.Map mapConfig) Set the map of Jersey ResourceConfig to use. |
void |
setResourceConfig(com.sun.jersey.api.core.ResourceConfig config) Set the Jersey ResourceConfig to use. |
void |
setSocketProvider(com.oracle.common.net.SocketProvider provider) Set the SocketProvider to use. |
void |
start() Start the server. |
protected abstract void |
startInternal() Start the server. |
void |
stop() Stop the server. |
protected abstract void |
stopInternal() Stop the server. |
java.lang.String |
toString() |
Field Detail |
---|
protected java.lang.String m_sAuthMethod
protected ConfigurableCacheFactory m_cacheFactory
protected java.lang.String m_sAddr
protected int m_nPort
protected Service m_serviceParent
protected java.util.Map m_mapResourceConfig
protected com.oracle.common.net.SocketProvider m_socketProvider
protected IdentityAsserter m_identityAsserter
protected boolean m_fStarted
public static final java.lang.String DEFAULT_ADDRESS
public static final int DEFAULT_PORT
public static final IdentityAsserter DEFAULT_IDENTITY_ASSERTER
public static final java.lang.String AUTH_BASIC
public static final java.lang.String AUTH_CERT
public static final java.lang.String AUTH_CERT_BASIC
public static final java.lang.String AUTH_NONE
public static final java.lang.String HTTP_BASIC_REALM
public static final java.lang.String ATTR_SUBJECT
public static final java.lang.String HEADER_AUTHORIZATION
protected static final java.lang.String HEADER_WWW_AUTHENTICATE
Constructor Detail |
---|
public AbstractHttpServer()
Method Detail |
---|
public void setAuthMethod(java.lang.String sMethod)
Valid values basic for HTTP basic authentication, cert for client certificate authentication, cert+basic for both client certificate and HTTP basic authentication, and none for no authentication.
setAuthMethod
in interface HttpServer
sMethod
- the authentication method to usepublic void setCacheFactory(ConfigurableCacheFactory cacheFactory)
setCacheFactory
in interface HttpServer
cacheFactory
- the cache factorypublic void setLocalAddress(java.lang.String sAddr)
setLocalAddress
in interface HttpServer
sAddr
- the addresspublic void setLocalPort(int nPort)
setLocalPort
in interface HttpServer
nPort
- the port numberpublic void setParentService(Service service)
setParentService
in interface HttpServer
service
- the parent servicepublic void setResourceConfig(com.sun.jersey.api.core.ResourceConfig config)
This method will register specified application under the root context, which is equivalent to: setResourceConfig(Collections.singletonMap("/", config));
setResourceConfig
in interface HttpServer
config
- the resource config for a Jersey web applicationpublic void setResourceConfig(java.util.Map mapConfig)
setResourceConfig
in interface HttpServer
mapConfig
- the map of context names to corresponding Jersey resource configs to usepublic void setSocketProvider(com.oracle.common.net.SocketProvider provider)
setSocketProvider
in interface HttpServer
provider
- the SocketProviderpublic void start() throws java.io.IOException
start
in interface HttpServer
java.io.IOException
- if an error occurspublic void stop() throws java.io.IOException
stop
in interface HttpServer
java.io.IOException
- if an error occursprotected abstract void startInternal() throws java.io.IOException
java.io.IOException
- if an error occursprotected abstract void stopInternal() throws java.io.IOException
java.io.IOException
- if an error occursprotected abstract java.lang.Object instantiateContainer(com.sun.jersey.spi.container.WebApplication application, com.sun.jersey.api.core.ResourceConfig config)
application
- the web application the container delegates to for the handling of HTTP requestsconfig
- the resource configurationprotected java.lang.Object createContainer(com.sun.jersey.api.core.ResourceConfig resourceConfig)
resourceConfig
- resource configurationprotected javax.security.auth.Subject authenticate(java.lang.String sAuth)
sAuth
- the value of Authorization header from the requestprotected javax.security.auth.Subject getSubjectFromSession(javax.net.ssl.SSLSession session) throws javax.net.ssl.SSLPeerUnverifiedException
session
- SSL sessionjavax.net.ssl.SSLPeerUnverifiedException
- if the client is not authenticatedprotected void handleRequest(com.sun.jersey.spi.container.WebApplication app, com.sun.jersey.spi.container.ContainerRequest request, com.sun.jersey.spi.container.ContainerResponseWriter responseWriter, javax.security.auth.Subject subject) throws java.io.IOException
app
- web application that should handle requestrequest
- the requestresponseWriter
- the response writersubject
- the subject, can be nulljava.io.IOException
- if an error occurspublic java.lang.String getLocalAddress()
public int getLocalPort()
public Service getParentService()
public com.oracle.common.net.SocketProvider getSocketProvider()
public javax.net.ssl.SSLContext getSSLContext()
public javax.net.ssl.SSLParameters getSSLParameters()
public java.util.Map getResourceConfig()
public IdentityAsserter getIdentityAsserter()
protected void setIdentityAsserter(IdentityAsserter asserter)
asserter
- the identity asserter to useprotected boolean isAuthMethodBasic()
protected boolean isAuthMethodCert()
protected boolean isAuthMethodNone()
protected boolean isSecure()
public java.lang.String toString()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |