|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Proxy.Core.CachedProxy
public class CachedProxy
This class implements a simple transparent proxy. It reads a request sent by a client which is forwarded to the JPIP server waiting for the server response to be forwarded to the client.
Usage example:
construct
run
| Field Summary | |
|---|---|
private int |
cacheDescriptorSubType
|
private int |
cacheDescriptorType
|
private ProxyCacheManagement |
cacheManagement
|
private HTTPRequest |
clientHTTPRequest
Is the request sent by the client. |
private java.lang.String |
clientUserAgent
This attribute is only for debugging and experimental purposes. |
private int |
EORReasonCode
|
private java.lang.String |
EORReasonMessage
|
private FetchTarget |
fetchTarget
|
private HTTPClient |
httpClient
|
private HTTPResponse |
httpResponse
|
private HTTPResponseSender |
httpResponseSender
|
private java.lang.String |
inCacheText
|
private JPCParameters |
jpcParameters
|
private JPIPMessageEncoder |
jpipMessageEncoder
|
private JPIPRequestFields |
jpipRequestFields
|
private JPIPResponseFields |
jpipResponseFields
|
private ClientSessions |
listOfClientSessions
Definition in Scheduler.clientSessions. |
private CADILog |
log
It is an object that will be used to log the server process |
private java.lang.String |
name
This attribute is only for debugging and experimental purposes. |
private ProxyRequestedWOIs |
proxyRequestedWOIs
|
private ViewWindowField |
responseViewWindow
|
private java.net.Socket |
socketToClient
Contains the client socket of which request is being processed. |
private StopWatch |
stopWatch
|
| Constructor Summary | |
|---|---|
CachedProxy()
This class' constructor is not allowed. |
|
CachedProxy(ProxyCacheManagement cacheManagement,
java.net.Socket socketToClient,
HTTPRequest httpRequest,
ProxyRequestedWOIs proxyRequestedWOIs,
CADILog log)
Constructor. |
|
| Method Summary | |
|---|---|
private void |
addMetadaBin0(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
Adds the metadata bin 0 to the response. |
private void |
addTileHeader(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
Adds the tile-header to the response. |
private void |
adjustRequestedViewWindow(ViewWindowField adjustedViewWindow)
|
private void |
checkJPIPParameters()
This method tests several JPIP restrictions of the parameters |
private void |
encodeJPIPResponseFields()
JPIP HEADERS (See ISO/IEC 15444-9 Annex D) |
java.lang.String |
getName()
|
private void |
logicalTargetsManager(java.lang.String target,
java.lang.String tid)
This method is used to manage the list of loaded targets. |
void |
run()
Performs the forwarding of the client request to the server and the forwarding of the server response to the client. |
private void |
sendData(java.util.ArrayList<SendDataInfo> cacheDescriptor)
|
private void |
sendEndOfResponse(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
This method is used to send the End of Response of a JPIP message. |
private void |
sendHTTPResponseError(int statusCode,
java.lang.String reasonPhrase)
This method will be used to send an HTTP error response to the client. |
private void |
sendHTTPResponseHeader(HTTPResponse httpResponse)
|
void |
sessionsManager()
|
void |
setClientUserAgent(java.lang.String clientUserAgent)
|
void |
setName(java.lang.String name)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private ProxyCacheManagement cacheManagement
private java.net.Socket socketToClient
private HTTPRequest clientHTTPRequest
Definition in HTTPRequest.
private ProxyRequestedWOIs proxyRequestedWOIs
private CADILog log
private ClientSessions listOfClientSessions
Scheduler.clientSessions.
private java.lang.String name
private JPIPRequestFields jpipRequestFields
private JPCParameters jpcParameters
private HTTPResponseSender httpResponseSender
private JPIPMessageEncoder jpipMessageEncoder
private int EORReasonCode
private java.lang.String EORReasonMessage
private HTTPResponse httpResponse
private JPIPResponseFields jpipResponseFields
private ViewWindowField responseViewWindow
private int cacheDescriptorType
private int cacheDescriptorSubType
private FetchTarget fetchTarget
private HTTPClient httpClient
private StopWatch stopWatch
private java.lang.String clientUserAgent
private java.lang.String inCacheText
| Constructor Detail |
|---|
public CachedProxy()
public CachedProxy(ProxyCacheManagement cacheManagement,
java.net.Socket socketToClient,
HTTPRequest httpRequest,
ProxyRequestedWOIs proxyRequestedWOIs,
CADILog log)
cacheManagement - definition in cacheManagement.clientSocket - definition in socketToClient.httpRequest - definition in #httpRequest.log - definition in log.| Method Detail |
|---|
public void run()
throws ErrorException,
WarningException,
java.io.IOException
java.io.IOException
ErrorException
WarningExceptionpublic void setName(java.lang.String name)
name - public java.lang.String getName()
public void setClientUserAgent(java.lang.String clientUserAgent)
private void sendData(java.util.ArrayList<SendDataInfo> cacheDescriptor)
throws java.io.IOException
java.io.IOExceptionprivate void adjustRequestedViewWindow(ViewWindowField adjustedViewWindow)
viewWindow -
private void addMetadaBin0(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
throws java.io.IOException
It is a temporal method while metadata are not supported.
java.io.IOException
private void addTileHeader(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
throws java.io.IOException
It is a temporal method while tiles are not supported.
java.io.IOException
private void sendEndOfResponse(HTTPResponseSender httpResponseSender,
JPIPMessageEncoder jpipMessageEncoder)
throws java.io.IOException
httpResponseSender - jpipMessageEncoder -
java.io.IOException
private void sendHTTPResponseHeader(HTTPResponse httpResponse)
throws WarningException
httpResponse -
WarningExceptionprivate void encodeJPIPResponseFields()
private void checkJPIPParameters()
throws WarningException
WarningException
private void sendHTTPResponseError(int statusCode,
java.lang.String reasonPhrase)
statusCode - definition in StatusCodes.reasonPhrase - a reason phrase related with the status code.
public void sessionsManager()
throws WarningException
WarningException
private void logicalTargetsManager(java.lang.String target,
java.lang.String tid)
throws WarningException
target field, the jpip tid
field, or both.
If the requested target has been loaded in a previous request, it will be in the list of loaded targets. So, its parameters will be recovered from that list.
Otherwise, target will be searched in disk. And if it is in disk, it will be loaded to the list.
target - definition in TargetField.targettid - definition in TargetField.tid
WarningException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||