public abstract class AdminAdapter
extends org.glassfish.grizzly.http.server.StaticHttpHandler
implements org.glassfish.api.container.Adapter, org.glassfish.hk2.api.PostConstruct, org.glassfish.api.event.EventListener
| 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 org.glassfish.internal.api.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.
|
org.glassfish.internal.api.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(org.glassfish.api.event.EventListener.Event 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() |
String[] |
getJSESSIONIDHeaders(org.glassfish.grizzly.http.server.Request req)
This method will return the Cookie header with name JSESSIONID="..."
|
InetAddress |
getListenAddress() |
int |
getListenPort() |
static String[] |
getUserPassword(org.glassfish.grizzly.http.server.Request req)
A convenience method to extract user name from a request.
|
List<String> |
getVirtualServers() |
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(org.glassfish.api.admin.AdminCommand command) |
addDocRoot, addDocRoot, addToFileCache, getDefaultDocRoot, getDocRoots, getRelativeURI, handle, isFileCacheEnabled, removeDocRoot, sendFile, service, setFileCacheEnabledcustomizedErrorPage, destroy, doHandle, getName, getRequestURIEncoding, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, start, updatePathspublic 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
protected AdminAdapter(Class<? extends org.glassfish.internal.api.Privacy> privacyClass)
public final org.glassfish.grizzly.http.server.HttpHandler getHttpService()
getHttpService in interface org.glassfish.api.container.Adapterpublic 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.StaticHttpHandlerException - 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 org.glassfish.internal.api.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(org.glassfish.api.admin.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(org.glassfish.api.event.EventListener.Event event)
event in interface org.glassfish.api.event.EventListenerpublic int getListenPort()
getListenPort in interface org.glassfish.api.container.Adapterpublic InetAddress getListenAddress()
getListenAddress in interface org.glassfish.api.container.Adapterpublic List<String> getVirtualServers()
getVirtualServers in interface org.glassfish.api.container.Adapterpublic boolean isRegistered()
isRegistered in interface org.glassfish.api.container.Adapterpublic void setRegistered(boolean isRegistered)
setRegistered in interface org.glassfish.api.container.AdapterCopyright © 2013. All Rights Reserved.