public abstract class AdminAdapter extends org.glassfish.grizzly.http.server.StaticHttpHandler implements Adapter, org.glassfish.hk2.api.PostConstruct, EventListener
EventListener.Event<T>| Modifier and Type | Field and Description |
|---|---|
static String |
ASADMIN_PATH |
static int |
MAX_AGE |
static String |
PREFIX_URI |
static String |
SESSION_COOKIE_NAME |
static String |
VS_NAME |
| Modifier | Constructor and Description |
|---|---|
protected |
AdminAdapter(Class<? extends Privacy> privacyClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterService(org.glassfish.grizzly.http.server.Request req,
org.glassfish.grizzly.http.server.Response res)
Finish the response and recycle the request/response tokens.
|
AdminAccessController.Access |
authenticate(org.glassfish.grizzly.http.server.Request req) |
String |
createSessionId()
This will create a new sessionId and add the server name as a jvmroute information to it
|
void |
event(EventListener.Event event)
Process a Glassfish/Payara event
|
void |
fireAdapterEvent(String type,
Object data)
Notify all container event listeners that a particular event has
occurred for this Adapter.
|
String |
getCookieHeader(org.glassfish.grizzly.http.server.Request req)
This will create a unique SessionId, Max-Age,Version,Path to be added to the Set-Cookie header
|
org.glassfish.grizzly.http.server.HttpHandler |
getHttpService()
Get the underlying Grizzly
HttpHandler. |
String[] |
getJSESSIONIDHeaders(org.glassfish.grizzly.http.server.Request req)
This method will return the Cookie header with name JSESSIONID="..."
|
InetAddress |
getListenAddress() |
int |
getListenPort()
Returns the listener port for this adapter
|
static String[] |
getUserPassword(org.glassfish.grizzly.http.server.Request req)
A convenience method to extract user name from a request.
|
List<String> |
getVirtualServers()
Returns the virtual servers supported by this adapter
|
boolean |
hasCookieHeader(org.glassfish.grizzly.http.server.Request req)
This method checks if the request has a Cookie header and
if the instance name serving the request is the same as the
jvmRoute information
|
boolean |
isRegistered()
Checks whether this adapter has been registered as a network endpoint.
|
boolean |
isSingleInstanceCommand(String commandName)
This method checks if this command has @ExecuteOn annotation with
RuntimeType.SINGle_INSTANCE
|
void |
onMissingResource(org.glassfish.grizzly.http.server.Request req,
org.glassfish.grizzly.http.server.Response res)
Call the service method, and notify all listeners
|
void |
postConstruct() |
void |
setRegistered(boolean isRegistered)
Marks this adapter as having been registered or unregistered as a
network endpoint
|
protected abstract boolean |
validatePrivacy(AdminCommand command) |
addDocRoot, addDocRoot, getDefaultDocRoot, getDocRoots, handle, isDirectorySlashOff, removeDocRoot, setDirectorySlashOffaddCachingHeaders, addToFileCache, getRelativeURI, isFileCacheEnabled, lookupFileCache, pickupContentType, sendFile, service, setFileCacheEnableddestroy, getErrorPageGenerator, getName, getRequestExecutorProvider, getRequestURIEncoding, getSessionCookieName, getSessionManager, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, start, updatePathsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContextRootpublic static final String VS_NAME
public static final String PREFIX_URI
public static final String SESSION_COOKIE_NAME
public static final int MAX_AGE
public static final String ASADMIN_PATH
public final org.glassfish.grizzly.http.server.HttpHandler getHttpService()
AdapterHttpHandler.getHttpService in interface AdapterHttpHandler.public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic void onMissingResource(org.glassfish.grizzly.http.server.Request req,
org.glassfish.grizzly.http.server.Response res)
onMissingResource in class org.glassfish.grizzly.http.server.StaticHttpHandlerBaseException - if an error happens during handling of
the request. Common errors are:
public boolean hasCookieHeader(org.glassfish.grizzly.http.server.Request req)
req - Request to examine the Cookie headerpublic String[] getJSESSIONIDHeaders(org.glassfish.grizzly.http.server.Request req)
req - The request which may contain cookie headerspublic boolean isSingleInstanceCommand(String commandName)
commandName - the command which is executedpublic String getCookieHeader(org.glassfish.grizzly.http.server.Request req)
public String createSessionId()
public AdminAccessController.Access authenticate(org.glassfish.grizzly.http.server.Request req) throws Exception
Exceptionpublic static String[] getUserPassword(org.glassfish.grizzly.http.server.Request req) throws IOException
req - instance of RequestIOException - in case of error with decoding the buffer (HTTP basic auth)protected abstract boolean validatePrivacy(AdminCommand command)
public void afterService(org.glassfish.grizzly.http.server.Request req,
org.glassfish.grizzly.http.server.Response res)
throws Exception
Exceptionpublic void fireAdapterEvent(String type, Object data)
type - Event typedata - Event datapublic void event(EventListener.Event event)
EventListenerevent in interface EventListenerpublic int getListenPort()
AdaptergetListenPort in interface Adapterpublic InetAddress getListenAddress()
getListenAddress in interface AdapterInetAddress on which this adapter is listeningpublic List<String> getVirtualServers()
AdaptergetVirtualServers in interface Adapterpublic boolean isRegistered()
isRegistered in interface Adapterpublic void setRegistered(boolean isRegistered)
setRegistered in interface AdapterCopyright © 2017. All rights reserved.