public class ClientSessionTarget extends ClientSideSessionTarget
Associated with each logical target are: - A single image data return type - A model of client's cache - One or more JPIP channels
Usage example:
constructor
[setMethods]
[newChannel]
getMethdos
Further information, please see see ISO/IEC 15444-1 section B.2
Modifier and Type | Field and Description |
---|---|
private ClientCacheManagement |
cache
Saves the server cache model of this logical target for all channels.
|
private long[] |
downloadedBytes
An one-dimensional array which contains a log of the last amount of
downloaded data.
|
private long[] |
downloadsTimes
An one-dimensional array which contains the time when the saved data
at
downloadedBytes were downloaded. |
private ImageData |
imageData
This object is the container where the decoder saves the recovered image
and it will read by the client application (usually, a graphical user
interface).
|
private JP2KClientLogicalTarget |
jp2kClientLogicalTarget
It is the JPEG2000 decoder.
|
private int |
numThreads
Definition in
JPEG2KDecoder.numThreads . |
private int |
proxyPort
Is the port of the proxy used to connect to the server.
|
private java.lang.String |
proxyServer
Is the proxy server used to connect to the server.
|
align, allowedReturnTypes, channels, debug, descriptorQualifier, descriptorType, extendedHeaders, lock, log, managementPolicy, MAX_HISTORY_RECORDS, maxCacheSize, maxTargetLength, port, preferredTransportProtocols, recordWOIHistory, responseViewWindow, reuseCache, server, sid, subtarget, target, useKeepAlive, userAgent, wait, woiHistory
returnType, tid
Constructor and Description |
---|
ClientSessionTarget(java.lang.String server,
int port,
java.lang.String proxyServer,
int proxyPort,
java.lang.String target,
ImageData imageData,
java.util.ArrayList<java.lang.String> preferredTransportProtocols,
CADILog log)
Constructor.
|
ClientSessionTarget(java.lang.String server,
int port,
java.lang.String proxyServer,
int proxyPort,
java.lang.String target,
ImageData imageData,
java.util.ArrayList<java.lang.String> preferredTransportProtocols,
CADILog log,
int numThreads)
Constructor.
|
ClientSessionTarget(java.lang.String server,
int port,
java.lang.String proxyServer,
int proxyPort,
java.lang.String target,
ImageData imageData,
CADILog log)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static float |
calculateAverageWeighted(long[] bytes,
long[] times)
Calculates the average of bytes per second.
|
void |
closeSession()
Closes the session with the server.
|
void |
fetchWindow(int[] components,
int discardLevels,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
This method fetches a logical target defined by the method's input
parameters.
|
void |
fetchWindow(int[] components,
int discardLevels,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength,
boolean recordWOI)
This method fetches a logical target defined by the method input
parameters.
|
void |
fetchWindow(ViewWindowField requestViewWindow)
This method fetches a logical target defined by the method's input
parameters.
|
void |
fetchWindow(ViewWindowField requestViewWindow,
boolean recordWOI)
This method fetches a logical target defined by the method's input
parameters.
|
ClientCacheManagement |
getCacheManagement()
TODO: THIS METHOD DO NOT BE USED.
|
ClientJPEG2KCodestream |
getCodestream()
TODO: THIS METHOD DO NOT BE USED.
|
ImageData |
getImageData() |
JP2KClientLogicalTarget |
getLogicalTarget() |
private void |
getMainHeader()
Gets the main header of the logical target.
|
int |
getManagementPolicy()
Definition in
CacheManagement.getManagementPolicy() . |
long |
getMaxCacheSize()
Definition in
CacheManagement.getMaxCacheSize() . |
void |
getRequest(java.lang.String requestURI) |
float |
getSpeed()
Returns the download's speed average.
|
java.lang.String |
getTargetDescription()
This method returns a detailed description of the last decoded logical
target.
|
void |
getWindow(int[] components,
int discardLevels,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength)
This method fetches a logical target defined by the method input
parameters.
|
void |
getWindow(int[] components,
int discardLevels,
int[] roff,
int[] rsiz,
int layers,
int quality,
long maxTargetLength,
boolean recordWOI) |
void |
getWindow(ViewWindowField requestViewWindow)
Get the target target window of interest.
|
void |
getWindow(ViewWindowField requestViewWindow,
boolean recordWOI) |
boolean |
isAvailable(long inClassIdentifier,
int layer) |
boolean |
isAvailable(ViewWindowField viewWindow) |
void |
list(java.io.PrintStream out)
Prints this Client Session Target out to the specified output stream.
|
void |
loadCache(java.lang.String fileName) |
private java.lang.String |
manageChannels() |
java.lang.String |
newChannel() |
java.lang.String |
newChannel(java.util.ArrayList<java.lang.String> preferredTransportProtocols) |
java.lang.String |
newChannel(java.lang.String transport) |
void |
remove()
Removes all the attributes.
|
void |
saveCache(java.lang.String fileName) |
void |
setAllowedReturnTypes(java.util.ArrayList<java.lang.String> returnTypes) |
void |
setManagementPolicy(int managementPolicy)
Definition in
CacheManagement.setManagementPolicy(int) . |
void |
setMaxCacheSize(long maxCacheSize)
Definition in
CacheManagement.setMaxCacheSize(long) . |
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. |
addWOIHistory, closeChannel, contains, copyJPIPResponseFields, generateUID, getBytesJPIPMessageBody, getBytesJPIPMessageHeader, getCacheDescriptorQualifier, getCacheDescriptorType, getDownloadedBytes, getJPIPResponseFields, getLocalCID, getLocalCIDs, getPort, getRequestedURI, getServer, getSessionID, getTarget, getWOIHistory, lock, newChannel, newChannel, newChannel, newChannel, numOfChannels, resetJPIPMessagesCounters, reuseCache, setAlign, setAllowedReturnTypes, setCacheDescriptor, setCacheDescriptorType, setDebug, setMaxTargetLength, setPort, setRecordWOIHistory, setUseHTTPSession, setUseHTTPTCPSession, setUseIndexRange, setUseKeepAlive, setUseNumberOfBytes, setUseNumberOfLayers, setUserAgent, setUseWildcard, setWait, unlock, useIndexRange, useNumberOfBytes, useNumberOfLayers, useWildcard
getChannel, getCid, getCids, getReturnType, getTid, getTID, setTID
private java.lang.String proxyServer
private int proxyPort
private ImageData imageData
private int numThreads
JPEG2KDecoder.numThreads
.private ClientCacheManagement cache
private JP2KClientLogicalTarget jp2kClientLogicalTarget
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.public ClientSessionTarget(java.lang.String server, int port, java.lang.String proxyServer, int proxyPort, java.lang.String target, ImageData imageData, CADILog log)
server
- port
- proxyServer
- proxyPort
- target
- imageData
- log
- public ClientSessionTarget(java.lang.String server, int port, java.lang.String proxyServer, int proxyPort, java.lang.String target, ImageData imageData, java.util.ArrayList<java.lang.String> preferredTransportProtocols, CADILog log)
server
- port
- proxyServer
- proxyPort
- target
- imageData
- preferredTransportProtocols
- log
- public ClientSessionTarget(java.lang.String server, int port, java.lang.String proxyServer, int proxyPort, java.lang.String target, ImageData imageData, java.util.ArrayList<java.lang.String> preferredTransportProtocols, CADILog log, int numThreads)
server
- port
- proxyServer
- proxyPort
- target
- imageData
- preferredTransportProtocols
- log
- numThreads
- public java.lang.String newChannel()
newChannel
in class SessionTarget
public java.lang.String newChannel(java.lang.String transport)
newChannel
in class SessionTarget
transport
- public java.lang.String newChannel(java.util.ArrayList<java.lang.String> preferredTransportProtocols)
preferredTransportProtocols
- public JP2KClientLogicalTarget getLogicalTarget()
public int getManagementPolicy()
CacheManagement.getManagementPolicy()
.CacheManagement.managementPolicy
.public void setManagementPolicy(int managementPolicy)
CacheManagement.setManagementPolicy(int)
.managementPolicy
- definition in CacheManagement.managementPolicy
.public long getMaxCacheSize()
CacheManagement.getMaxCacheSize()
.CacheManagement.cacheSize
.public void setMaxCacheSize(long maxCacheSize)
CacheManagement.setMaxCacheSize(long)
.maxCacheSize
- definition in CacheManagement.cacheSize
.public void remove()
remove
in class ClientSideSessionTarget
public void setAllowedReturnTypes(java.util.ArrayList<java.lang.String> returnTypes)
returnTypes
- public void getRequest(java.lang.String requestURI) throws WarningException
requestURI
- WarningException
public void fetchWindow(ViewWindowField requestViewWindow) throws ErrorException
requestViewWindow
- the target Window Of Interest to fetch.ErrorException
- if an error occurs fetching the WOI.public void fetchWindow(ViewWindowField requestViewWindow, boolean recordWOI) throws ErrorException
fetchWindow
in class ClientSideSessionTarget
viewWindow
- the target Window Of Interest to fetch.recordWOI
- throws WarningException if an error occurs fetching the WOI or
received data cannot be decompressedErrorException
- if an error occurs fetching the WOI.#getWindow(CADI.Common.Network.JPIP.ViewWindowField, boolean)}.
public void fetchWindow(int[] components, int discardLevels, int[] roff, int[] rsiz, int layers, int quality, long maxTargetLength) throws ErrorException
components
- is an one-dimension array with the component indexes.discardLevels
- .roff
- definition in ViewWindowField.roff
.rsiz
- definition in ViewWindowField.rsiz
.layers
- definition in ViewWindowField.layers
.quality
- definition in JPIPResponseFields.quality
.maxTargetLength
- definition in ClientSideSessionTarget.maxTargetLength
ErrorException
public void fetchWindow(int[] components, int discardLevels, int[] roff, int[] rsiz, int layers, int quality, long maxTargetLength, boolean recordWOI) throws ErrorException
components
- is an one-dimension array with the component indexes.discardLevels
- .roff
- definition in ViewWindowField.roff
.rsiz
- definition in ViewWindowField.rsiz
.layers
- definition in ViewWindowField.layers
.quality
- definition in JPIPResponseFields.quality
.maxTargetLength
- definition in ClientSideSessionTarget.maxTargetLength
recordWOI
- ErrorException
- if the target (requestURI
) cannot be
fetched from the server, or the delivery data cannot be
decompressed correctly.public void getWindow(ViewWindowField requestViewWindow) throws ErrorException
requestViewWindow
- the target Window Of Interest to fetch.ErrorException
- if an error occurs fetching the WOI.public void getWindow(ViewWindowField requestViewWindow, boolean recordWOI) throws ErrorException
requestViewWindow
- recordWOI
- ErrorException
public void getWindow(int[] components, int discardLevels, int[] roff, int[] rsiz, int layers, int quality, long maxTargetLength) throws ErrorException
components
- is an one-dimension array with the component indexes.discardLevels
- .roff
- definition in ViewWindowField.roff
.rsiz
- definition in ViewWindowField.rsiz
.layers
- definition in ViewWindowField.layers
.quality
- definition in JPIPResponseFields.quality
.maxTargetLength
- definition in ClientSideSessionTarget.maxTargetLength
ErrorException
public void getWindow(int[] components, int discardLevels, int[] roff, int[] rsiz, int layers, int quality, long maxTargetLength, boolean recordWOI) throws ErrorException
components
- discardLevels
- roff
- rsiz
- layers
- quality
- maxTargetLength
- recordWOI
- ErrorException
public void closeSession() throws ErrorException
ClientSideSessionTarget
closeSession
in class ClientSideSessionTarget
ErrorException
public final ClientJPEG2KCodestream getCodestream()
public ClientCacheManagement getCacheManagement()
public float getSpeed()
public void saveCache(java.lang.String fileName) throws ErrorException
fileName
- ErrorException
public void loadCache(java.lang.String fileName) throws ErrorException
fileName
- ErrorException
public final java.lang.String getTargetDescription()
null
pointer is returned.null
pointer is
returned.public final ImageData getImageData()
public boolean isAvailable(long inClassIdentifier, int layer)
isAvailable
in class ClientSideSessionTarget
inClassIdentifier
- layer
- public boolean isAvailable(ViewWindowField viewWindow)
isAvailable
in class ClientSideSessionTarget
viewWindow
- public java.lang.String toString()
toString
in class ClientSideSessionTarget
public void list(java.io.PrintStream out)
list
in class ClientSideSessionTarget
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 java.lang.String manageChannels()
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 data was sent, and the last one is the most
most recently time.
CADI - Copyright (C) 2007
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Group on Interactive Coding of Images (GICI) (contact)