Class RestrictedContentAdapter
- java.lang.Object
-
- org.glassfish.grizzly.http.server.HttpHandler
-
- org.glassfish.appclient.server.core.jws.RestrictedContentAdapter
-
- Direct Known Subclasses:
AppClientHTTPAdapter
public class RestrictedContentAdapter extends org.glassfish.grizzly.http.server.HttpHandler
- Author:
- tjquinn
-
-
Field Summary
Fields Modifier and Type Field Description static String
DATE_HEADER_NAME
protected static String
IF_MODIFIED_SINCE
static String
LAST_MODIFIED_HEADER_NAME
protected static Logger
logger
-
Constructor Summary
Constructors Constructor Description RestrictedContentAdapter(String contextRoot)
RestrictedContentAdapter(String contextRoot, Map<String,StaticContent> content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addContentIfAbsent(String relativeURIString, StaticContent newContent)
void
addContentIfAbsent(Map<String,StaticContent> staticContent)
protected int
contentStateToResponseStatus(Content content, URI requestURI)
String
contextRoot()
protected String
dumpContent()
protected void
finishErrorResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
protected void
finishResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
protected void
finishSuccessResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
protected String
logPrefix()
protected String
relativizeURIString(String candidateContextRoot, String uriString)
protected void
respondNotFound(org.glassfish.grizzly.http.server.Response gResp)
void
resume()
protected boolean
returnIfClientCacheIsCurrent(String relativeURIString, org.glassfish.grizzly.http.server.Request gReq, long contentTimestamp)
void
service(org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp)
protected boolean
serviceContent(org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp)
void
suspend()
String
toString()
-
Methods inherited from class org.glassfish.grizzly.http.server.HttpHandler
destroy, getErrorPageGenerator, getName, getRequestExecutorProvider, getRequestURIEncoding, getSessionCookieName, getSessionManager, isAllowCustomStatusMessage, isAllowEncodedSlash, sendAcknowledgment, setAllowCustomStatusMessage, setAllowEncodedSlash, setDecodeUrl, setDispatcherHelper, setRequestURIEncoding, setRequestURIEncoding, start, updatePaths
-
-
-
-
Field Detail
-
LAST_MODIFIED_HEADER_NAME
public static final String LAST_MODIFIED_HEADER_NAME
- See Also:
- Constant Field Values
-
DATE_HEADER_NAME
public static final String DATE_HEADER_NAME
- See Also:
- Constant Field Values
-
IF_MODIFIED_SINCE
protected static final String IF_MODIFIED_SINCE
- See Also:
- Constant Field Values
-
logger
protected static final Logger logger
-
-
Constructor Detail
-
RestrictedContentAdapter
public RestrictedContentAdapter(String contextRoot, Map<String,StaticContent> content) throws IOException
- Throws:
IOException
-
RestrictedContentAdapter
public RestrictedContentAdapter(String contextRoot)
-
-
Method Detail
-
service
public void service(org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp)
- Specified by:
service
in classorg.glassfish.grizzly.http.server.HttpHandler
-
contextRoot
public String contextRoot()
-
addContentIfAbsent
public void addContentIfAbsent(String relativeURIString, StaticContent newContent) throws IOException
- Throws:
IOException
-
addContentIfAbsent
public void addContentIfAbsent(Map<String,StaticContent> staticContent) throws IOException
- Throws:
IOException
-
relativizeURIString
protected String relativizeURIString(String candidateContextRoot, String uriString)
-
serviceContent
protected boolean serviceContent(org.glassfish.grizzly.http.server.Request gReq, org.glassfish.grizzly.http.server.Response gResp) throws IOException
- Throws:
IOException
-
returnIfClientCacheIsCurrent
protected boolean returnIfClientCacheIsCurrent(String relativeURIString, org.glassfish.grizzly.http.server.Request gReq, long contentTimestamp)
-
contentStateToResponseStatus
protected int contentStateToResponseStatus(Content content, URI requestURI) throws IOException
- Throws:
IOException
-
suspend
public void suspend()
-
resume
public void resume()
-
finishResponse
protected void finishResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
-
respondNotFound
protected void respondNotFound(org.glassfish.grizzly.http.server.Response gResp)
-
finishSuccessResponse
protected void finishSuccessResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
-
finishErrorResponse
protected void finishErrorResponse(org.glassfish.grizzly.http.server.Response gResp, int status)
-
dumpContent
protected String dumpContent()
-
logPrefix
protected String logPrefix()
-
-