|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Client.Client
public class Client
This class implements a JPIP Client.
NOTE: It implements the Runnable interface but it is not
working like a thread. It will be done in the next version.
Usage example:
constructor
setClientProperties
setServerAndTarget
getTarget | getThumbnail
get methods
| Field Summary | |
|---|---|
static int |
ABORT
|
private int |
action
|
private int |
auxport
|
private long |
bytesJPIPMessageBody
Is used to save the amount of received bytes in the JPIP message body. |
private long |
bytesJPIPMessageHeader
Is used to save the amount of received bytes in the JPIP message header. |
private java.lang.String[] |
cclose
|
private java.lang.String |
cid
|
private ClientCacheManagement |
clientCache
Contains the client cache. |
private java.lang.String |
clientHostName
Contains the local host name. |
private ClientProperties |
clientProperties
Contains the client preferences. |
private int[] |
cnew
|
static int |
DECOMPRESSING
|
private long[] |
downloadedBytes
An one-dimmensional array which contains a log of the last amount of downloaded data. |
private long[] |
downloadsTimes
An one-dimmensional array which contains the time when the saved data at downloadedBytes were downloaded. |
private boolean |
error
Indicates whether an error has been occurred. |
private java.lang.String |
errorMessage
It is an error message which has a short description of the error. |
static int |
FINISH
|
private java.lang.String |
host
|
private HTTPClient |
httpClient
An object to send the request and receive the server response. |
private ImageData |
imageData
Contains the last requested image. |
private int |
imageDataType
Is the image type that will be used to delivery the decompressed image. |
private long |
initStageTime
Used for verbose information (time for stage). |
private long |
initTime
Used for verbose information (total time). |
private JPIPMessageDecoder |
jpipMessageDecoder
Object used to decode the JPIP response messages. |
private JPIPRequestEncoder |
jpipRequestEncoder
Object to encode the JPIP request parameters. |
private JPIPResponseFields |
jpipResponseFields
This object contains the JPIP response parameters. |
private boolean |
keepAlive
Indicates whether the HTTP connection to remote server are persistents. |
private int |
len
|
private CADILog |
log
Is used to log the client messages. |
private ClientLogicalTarget |
logicalTarget
|
protected int |
managementPolicy
Definition in CADI.Client.Cache.ClientCache#managementPolicy. |
private long |
maxCacheSize
Is the maximum size (in bytes) allowed for the saved data in the cache. |
private long |
maxTargetLength
Is the maximum length of the compressed target to be decompresed. |
private java.lang.String |
path
|
private int |
port
|
static int |
PROCESSING_REQUEST
|
private int |
proxyPort
|
private java.lang.String |
proxyServer
Is the proxy server used to connect to the server. |
private int |
qid
|
private int |
quality
|
private ViewWindowField |
requestViewWindow
Contains the view window requested by the client application. |
private ViewWindowField |
responseViewWindow
Contains the request view window which has been modified by the remote server if any of the parameters has been modified. |
private boolean |
reuseCache
Indicates whether the cache is used between two consecutive requests. |
static int |
RUN
|
private java.lang.String |
server
Is the server name where logical targets are located. |
private int |
state
Indicates the actual state of the thread process. |
static int |
STOPPED
|
private StopWatch |
stopWatch
|
private int[] |
subtarget
|
private java.lang.String |
target
Documentar: variables que mantienen el estado del cliente jpip. |
private ImageData |
thumbnailData
Is a thumbnail of the image. |
private java.lang.String |
tid
|
private long |
totalDownloadedBytes
Contains the downloaded total bytes for the actual logical target. |
private int |
transport
|
private int |
type
Indicates the image return type which it is being used. |
boolean |
useHTTPSession
Indicates if HTTP session is allowed. |
boolean |
useHTTPTCPSession
Indicates if HTTP TCP session is allowed. |
private java.lang.String |
userAgent
Contains the value of the HTTP user-agent feature. |
private boolean |
useSession
Indicates whether stateless request or session request will be used. |
static int |
WAITING_SERVER_RESPONSE
|
| Constructor Summary | |
|---|---|
Client(ImageData imageData)
Constructor. |
|
| Method Summary | |
|---|---|
static float |
calculateAverageWeighted(long[] bytes,
long[] times)
Calculates the average of bytes per second. |
void |
closeLogicalTarget()
Release all data about the current logical target. |
boolean |
closeSession()
Closes the session with the server. |
private int[][] |
componentsToRangeOfComponents(int[] comps)
This method moves the number of components from an array structure to an array of ranges. |
long |
getBytesJPIPMessageBody()
Returns the bytesJPIPMessageBody attribute. |
long |
getBytesJPIPMessageHeader()
Returns the bytesJPIPMessageHeader attribute. |
long |
getDownloadedBytes()
Returns the downloaded total bytes for the actual logical target. |
java.lang.String |
getErrorMessage()
Not available yet. |
int |
getJPIPStreamType()
Returns the JPIP-stream media type with is beind used. |
java.lang.String |
getLogFileName()
Definition in CADILog.getFileName(). |
int |
getLogLevel()
Definition in CADILog.getLogLevel(). |
private void |
getMainHeader()
Gets the main header of the logical target. |
int |
getManagementPolicy()
Definition in CADI.Client.Cache.ClientCache#getManagementPolicy() |
long |
getMaxCacheSize()
Definition in CADI.Client.Cache.ClientCache#getMaxCacheSize() |
int |
getPort()
Return the port number of the server. |
private void |
getRequest(java.lang.String requestURI)
Get the target which is identified by the URI requestURI |
java.lang.String |
getServer()
Return the sever name of the latest connection. |
float |
getSpeed()
Returns the download's speed average. |
int |
getState()
Not available yet. |
void |
getTarget()
This method fetchs a logical target. |
void |
getTarget(int[][] comps,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[][] comps,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[][] comps,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[][] comps,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(int[] components,
long maxTargetLength)
This method fetchs a logical target defined by the method input parameters. |
void |
getTarget(long maxTargetLength)
This method fetchs a logical target at a fixed length. |
void |
getTarget(long maxTargetLength,
int layers,
int quality)
This method fetchs a logical target at a fixed length. |
void |
getTarget(java.lang.String requestURI)
Get the target which is identified by the URI requestURI |
java.lang.String |
getTargetDescription()
This method returns a detailed description of the last decoded logical target. |
java.lang.String |
getTargetName()
Return the latest requested target name. |
ImageData |
getThumbnail(int thumbnailWidth,
int thumbnailHeight,
int imageDataType)
Gets a thumbnail image of the actual logical target. |
java.lang.String |
getURI()
Returns the last requested URI. |
private void |
getWindow(ViewWindowField viewWindow)
Get the target target window of interest. |
boolean |
isError()
Not available yet. |
boolean |
isKeepAlive()
Returns the keepAlive attribute. |
boolean |
isLogEnabled()
Definition in CADILog.isEnabled(). |
boolean |
isUseHTTPSession()
Returns the useHTTPSession attribute. |
boolean |
isUseHTTPTCPSession()
Returns the useHTTPTCPSession attribute |
boolean |
isUseSession()
Returns the useSession attribute. |
void |
list(java.io.PrintStream out)
Prints this Client fields out to the specified output stream. |
void |
loadCache(java.lang.String fileName)
|
void |
resetBytesJPIPMessages()
Sets the JPIP message counter to 0. |
void |
reuseCache(boolean reuseCache)
Sets if the client cache must be used. |
void |
run()
|
void |
saveCache(java.lang.String fileName)
|
void |
setCacheType(int cacheType,
int cacheSubtype)
|
void |
setClientProperties(ClientProperties clientProperties)
Sets the JPIP client properties. |
void |
setKeepAlive(boolean keepAlive)
Sets the keepAlive attribute. |
void |
setLogEnabled(boolean enabled)
Sets the log enabled or disabled. |
void |
setLogFile(java.lang.String logFileName)
Sets the file name where the log will be done. |
void |
setLogFile(java.lang.String logFileName,
boolean useXMLFormat)
Sets the file name where the log will be done. |
void |
setLogLevel(int logLevel)
Sets the log level. |
void |
setManagementPolicy(int managementPolicy)
Definition in CADI.Client.Cache.ClientCache#setManagementPolicy(int). |
void |
setMaxCacheSize(long maxCacheSize)
Definition in CADI.Client.Cache.ClientCache#setMaxCacheSize(long). |
void |
setServerAndTarget(java.lang.String server,
int port,
java.lang.String target)
Sets the server name and port where the logical targets are located. |
void |
setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
long maxTargetLength)
Sets the server name and port where the logical targets are located. |
void |
setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
java.lang.String proxyServer,
int proxyPort)
Sets the server name and port where the logical targets are located, as well as the proxy and port that will be used. |
void |
setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
java.lang.String proxyServer,
int proxyPort,
long maxTargetLength)
|
void |
setUseHTTPSession(boolean useHTTPSession)
Sets the useHTTPSession attribute. |
void |
setUseHTTPTCPSession(boolean useHTTPTCPSession)
Sets the useHTTPTCPSession attribute |
void |
setUserAgent(java.lang.String userAgent)
This method sets the HTTP's user agent header. |
void |
setUseSession(boolean useSession)
Indicates whether sessions will be used in the JPIP connections. |
private void |
showTimeMemory(java.lang.String stage)
Show some time and memory usage statisticals. |
void |
start()
Not available yet. |
void |
stop()
Not available yet. |
java.lang.String |
toString()
|
private void |
updateReceivedBytesAndTimes(long bytes,
long time)
This method updates the downloadedBytes and
downloadsTimes attributes with new new values which are parssed
as input parameters. |
boolean |
useLogXMLFormat()
Definition in CADILog.useXMLFormat(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private ImageData imageData
private ImageData thumbnailData
private ClientProperties clientProperties
private int imageDataType
Further information about allowed data types, see ImageData.dataType.
private boolean reuseCache
true cached data is keep, meanwhile if it is false
cached data are deleted.
protected int managementPolicy
CADI.Client.Cache.ClientCache#managementPolicy.
private long maxCacheSize
Only positive values are allowed.
A 0 value means unlimited.
private boolean useSession
public boolean useHTTPSession
This attribute is only allowed when useSession attribute is true.
public boolean useHTTPTCPSession
This attribute is only allowed when useSession attribute is true.
private long maxTargetLength
A negative value means no limit (infinite length).
private volatile long totalDownloadedBytes
private volatile int state
public static final int STOPPED
public static final int PROCESSING_REQUEST
public static final int WAITING_SERVER_RESPONSE
public static final int DECOMPRESSING
private volatile int action
public static final int RUN
public static final int ABORT
public static final int FINISH
private boolean error
private java.lang.String errorMessage
private long bytesJPIPMessageBody
private long bytesJPIPMessageHeader
private java.lang.String userAgent
private ClientLogicalTarget logicalTarget
private ClientCacheManagement clientCache
private ViewWindowField requestViewWindow
private CADILog log
private HTTPClient httpClient
private boolean keepAlive
private JPIPRequestEncoder jpipRequestEncoder
private JPIPMessageDecoder jpipMessageDecoder
private JPIPResponseFields jpipResponseFields
private ViewWindowField responseViewWindow
private java.lang.String clientHostName
private java.lang.String target
private int[] subtarget
private java.lang.String tid
private java.lang.String cid
private int[] cnew
private java.lang.String[] cclose
private int qid
private java.lang.String host
private int transport
private java.lang.String path
private int port
private int auxport
private int len
private int quality
private int type
Allowed values, see ImageReturnTypes
private java.lang.String server
private java.lang.String proxyServer
private int proxyPort
private long initStageTime
0 is initial time.
private long initTime
0 is initial time.
private long[] downloadedBytes
This attribute is related to downloadsTimes attribute.
private long[] downloadsTimes
downloadedBytes were downloaded. Both attributes are used
to estimate the download read.
private StopWatch stopWatch
| Constructor Detail |
|---|
public Client(ImageData imageData)
imageData - | Method Detail |
|---|
public void run()
run in interface java.lang.Runnablepublic void start()
public void stop()
public int getState()
public boolean isError()
error.public java.lang.String getErrorMessage()
errorMessage.
public void setServerAndTarget(java.lang.String server,
int port,
java.lang.String target)
throws ErrorException
server - definition in serverport - definition in porttarget - definition in target
ErrorException - this exception can be thrown due to:
public void setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
long maxTargetLength)
throws ErrorException
server - definition in serverport - definition in porttarget - definition in targetmaxTargetLength - definition in maxTargetLength
ErrorException - this exception can be thrown due to:
public void setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
java.lang.String proxyServer,
int proxyPort)
throws ErrorException
server - port - target - proxyServer - proxyPort -
ErrorException
public void setServerAndTarget(java.lang.String server,
int port,
java.lang.String target,
java.lang.String proxyServer,
int proxyPort,
long maxTargetLength)
throws ErrorException
server - port - target - proxyServer - proxyPort - maxTargetLength -
ErrorException
public void getTarget()
throws ErrorException,
java.lang.IllegalAccessException
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
maxTargetLength parameters means a maximum limit for
the compressed logical target; and a negative value means the maximum is
unlimited.
maxTargetLength - maximum length of the compressed target. A
positive value means a maximum, and a negative value means
unlimited.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(long maxTargetLength,
int layers,
int quality)
throws java.lang.IllegalAccessException,
ErrorException
maxTargetLength parameters means a maximum limit for
the compressed logical target; and a negative value means the maximum is
unlimited.
maxTargetLength - maximum length of the compressed target. A
positive value means a maximum, and a negative value means
unlimited.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(java.lang.String requestURI)
throws ErrorException
requestURI
requestURI - is the URI to locate the target.
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.fsiz - definition in ViewWindowField.fsiz.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.resolutionLevel - is the desired resolution level of the target.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[][] comps,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality)
throws java.lang.IllegalAccessException,
ErrorException
comps - definition in ViewWindowField.comps.resolutionLevel - is the desired resolution level of the target.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.resolutionLevel - is the desired resolution level of the target.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[][] comps,
int resolutionLevel,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
comps - definition in ViewWindowField.comps.resolutionLevel - is the desired resolution level of the target.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.fsiz - definition in ViewWindowField.fsiz.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[][] comps,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round)
throws java.lang.IllegalAccessException,
ErrorException
comps - definition in ViewWindowField.comps.fsiz - definition in ViewWindowField.fsiz.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[] components,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
components - is an one-dimension array with the component indeces.fsiz - definition in ViewWindowField.fsiz.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public void getTarget(int[][] comps,
int[] fsiz,
int[] roff,
int[] rsiz,
int layers,
int quality,
int round,
long maxTargetLength)
throws java.lang.IllegalAccessException,
ErrorException
comps - definition in ViewWindowField.comps.fsiz - definition in ViewWindowField.fsiz.roff - definition in ViewWindowField.roff.rsiz - definition in ViewWindowField.rsiz.layers - definition in ViewWindowField.layers.quality - definition in JPIPResponseFields.quality.maxTargetLength - definition in maxTargetLength
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the target (requestURI) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.
public ImageData getThumbnail(int thumbnailWidth,
int thumbnailHeight,
int imageDataType)
throws java.lang.IllegalAccessException,
ErrorException
This method must be called after the
setServerAndTarget(String, int, String) method had been called.
Otherwise, a IllegalAccessException will be thrown.
thumbnailWidth - width of the thumbnail image.thumbnailHeight - height of the thumbnail image.imageDataType - definition in ImageData.dataType.
java.lang.IllegalAccessException - if the method is called before the
setServerAndTarget(String, int, String).
ErrorException - if the thumbnail compressed image cannot be got from the
server, or the delivery data cannot be decompressed.public void setClientProperties(ClientProperties clientProperties)
clientProperties
attribute is an object which wraps the values of the properties.
clientProperties - an object with the client properties.public void closeLogicalTarget()
public boolean closeSession()
throws ErrorException
true if the session has been closed without
any problem. Otherwise, returns false.
ErrorException - it an error occurs while the session is being
closed.public void setUseSession(boolean useSession)
useSession - true if sessions will be used.
false if it will not.public void setUseHTTPSession(boolean useHTTPSession)
useHTTPSession attribute.
useHTTPSession - useHTTPSession.public void setUseHTTPTCPSession(boolean useHTTPTCPSession)
useHTTPTCPSession attribute
useHTTPTCPSession - useHTTPTCPSession.public void setKeepAlive(boolean keepAlive)
keepAlive attribute.
keepAlive - see keepAlive.public void reuseCache(boolean reuseCache)
reuseCache - true if the cache is reseted every time a
new target is requested.
public void setCacheType(int cacheType,
int cacheSubtype)
public final void setManagementPolicy(int managementPolicy)
CADI.Client.Cache.ClientCache#setManagementPolicy(int).
managementPolicy - definition in managementPolicy.public final void setMaxCacheSize(long maxCacheSize)
CADI.Client.Cache.ClientCache#setMaxCacheSize(long).
maxCacheSize - is the maximum size (in bytes) allowed for the
cached data. Only positive values are allowed, a value of 0
means unlimited.public final void setLogFile(java.lang.String logFileName)
logFileName
parameter is null, logs are printed out the default output in
plain text.
logFileName - file name of the log file.
public final void setLogFile(java.lang.String logFileName,
boolean useXMLFormat)
logFileName
parameter is null, logs are printed out the default output.
logFileName - file name of the log file.useXMLFormat - if true logs are printed out following
a XML format. Otherwise, plain text is used.public final void setLogEnabled(boolean enabled)
enabled - if true, logs are enabled.
Otherwise, logs are disabled.public final void setLogLevel(int logLevel)
logLevel - public final java.lang.String getTargetDescription()
null pointer is returned.
null pointer is
returned.public final java.lang.String getURI()
public final java.lang.String getServer()
public final int getPort()
public java.lang.String getTargetName()
public float getSpeed()
public long getDownloadedBytes()
public void resetBytesJPIPMessages()
public long getBytesJPIPMessageHeader()
bytesJPIPMessageHeader attribute.
bytesJPIPMessageHeader attribute.public long getBytesJPIPMessageBody()
bytesJPIPMessageBody attribute.
bytesJPIPMessageBody attribute.public boolean isKeepAlive()
keepAlive attribute.
keepAlive attribute.public boolean isUseSession()
useSession attribute.
useSession attribute.public boolean isUseHTTPSession()
useHTTPSession attribute.
useHTTPSession attribute.public boolean isUseHTTPTCPSession()
useHTTPTCPSession attribute
useHTTPTCPSession attribute.public int getManagementPolicy()
CADI.Client.Cache.ClientCache#getManagementPolicy()
CADI.Client.Cache.ClientCache#getManagementPolicy()public long getMaxCacheSize()
CADI.Client.Cache.ClientCache#getMaxCacheSize()
CADI.Client.Cache.ClientCache#getMaxCacheSize()public boolean isLogEnabled()
CADILog.isEnabled().
CADILog.isEnabled().public boolean useLogXMLFormat()
CADILog.useXMLFormat().
CADILog.useXMLFormat().public java.lang.String getLogFileName()
CADILog.getFileName().
CADILog.getFileName().public int getLogLevel()
CADILog.getLogLevel().
CADILog.getLogLevel().public int getJPIPStreamType()
public void saveCache(java.lang.String fileName)
fileName - public void loadCache(java.lang.String fileName)
fileName - public void setUserAgent(java.lang.String userAgent)
userAgent - public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.
private void getMainHeader()
throws ErrorException
ErrorException - if an error occurs while main header is being
fetched or received data cannot be decompressed correctly.
private void getWindow(ViewWindowField viewWindow)
throws ErrorException
viewWindow - the target Window Of Interest to fetch.
throws WarningException if an error occurs fetching the WOI or
received data cannot be decompressed
ErrorException
private void getRequest(java.lang.String requestURI)
throws WarningException
requestURI
requestURI - the URI to locate the logical target.
throws WarningException if an error occurs fetching the target or
received data cannot be decompressed
WarningExceptionprivate int[][] componentsToRangeOfComponents(int[] comps)
comps - an array with the component number.
private void updateReceivedBytesAndTimes(long bytes,
long time)
downloadedBytes and
downloadsTimes attributes with new new values which are parssed
as input parameters.
bytes - the new value to be added in the downloadedBytes
attribute.time - the new value to be added in the downloadsTimes
attribute.
public static float calculateAverageWeighted(long[] bytes,
long[] times)
bytes - is an one-dimensional array with the amount of bytes.times - is an one-dimensional array with the time where bytes
was sent. It is expressed in miliseconds. The first index is
when the first dada was sent, and the last one is the most
most recently time.
private void showTimeMemory(java.lang.String stage)
stage - string that will be displayed
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||