|
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.SimpleSecurityContextSimple implementation of the SecurityContext interface. |
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_SUBJECTAttribute name that should be used to store Subject for the request. |
static java.lang.String |
AUTH_BASICHTTP basic authentication. |
static java.lang.String |
AUTH_CERTCertificate authentication. |
static java.lang.String |
AUTH_CERT_BASICCertificate authentication. |
static java.lang.String |
AUTH_NONENo authentication. |
static java.lang.String |
DEFAULT_ADDRESSDefault HTTP server address. |
static IdentityAsserter |
DEFAULT_IDENTITY_ASSERTERDefault identity asserter. |
static int |
DEFAULT_PORTDefault HTTP server port. |
static java.lang.String |
HEADER_AUTHORIZATIONAuthorization header. |
protected static java.lang.String |
HEADER_WWW_AUTHENTICATEWWW-Authenticate header. |
static java.lang.String |
HTTP_BASIC_REALMRealm for HTTP basic authentication. |
protected ConfigurableCacheFactory |
m_cacheFactoryCache factory. |
protected boolean |
m_fStartedFlag specifying whether the server is already started. |
protected IdentityAsserter |
m_identityAsserterIdentity asserter to use with HTTP basic authentication. |
protected java.util.Map |
m_mapResourceConfigMap of context names to Jersey resource configurations. |
protected int |
m_nPortPort number server should listen on. |
protected java.lang.String |
m_sAddrAddress server should listen on. |
protected java.lang.String |
m_sAuthMethodAuthentication method. |
protected Service |
m_serviceParentParent service. |
protected com.oracle.common.net.SocketProvider |
m_socketProviderSocketProvider 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 HttpServersMethod - the authentication method to usepublic void setCacheFactory(ConfigurableCacheFactory cacheFactory)
setCacheFactory in interface HttpServercacheFactory - the cache factorypublic void setLocalAddress(java.lang.String sAddr)
setLocalAddress in interface HttpServersAddr - the addresspublic void setLocalPort(int nPort)
setLocalPort in interface HttpServernPort - the port numberpublic void setParentService(Service service)
setParentService in interface HttpServerservice - 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 HttpServerconfig - the resource config for a Jersey web applicationpublic void setResourceConfig(java.util.Map mapConfig)
setResourceConfig in interface HttpServermapConfig - the map of context names to corresponding Jersey resource configs to usepublic void setSocketProvider(com.oracle.common.net.SocketProvider provider)
setSocketProvider in interface HttpServerprovider - the SocketProvider
public void start()
throws java.io.IOException
start in interface HttpServerjava.io.IOException - if an error occurs
public void stop()
throws java.io.IOException
stop in interface HttpServerjava.io.IOException - if an error occurs
protected abstract void startInternal()
throws java.io.IOException
java.io.IOException - if an error occurs
protected abstract void stopInternal()
throws java.io.IOException
java.io.IOException - if an error occurs
protected 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 request
protected 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 authenticated
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)
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 | |||||||