public class Session
extends java.lang.Object
For further information about JPIP sessions, see ISO/IEC 15444-9 section B.2
Modifier and Type | Field and Description |
---|---|
protected long |
DEFAULT_EXPIRATION_TIME
The default expiration time.
|
protected long |
expirationTime
Expiration time of the session.
|
protected java.util.concurrent.locks.ReentrantReadWriteLock |
mutex
Is a mutex to lock the object when a thread is setting some attribute.
|
protected java.lang.String |
sessionID |
protected java.util.HashMap<java.lang.String,SessionTarget> |
targets
Is a Map with the logical targets avialable within this session.
|
Constructor and Description |
---|
Session()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
closeChannel(java.lang.String cid)
Closes a channel.
|
boolean |
contains(java.lang.String cid)
Checks if the channel
cid belongs to this session. |
boolean |
containsTID(java.lang.String tid)
Check if the current session has a target identified by the
tid
target identifier. |
java.lang.String |
createSessionTarget(JP2KServerLogicalTarget logicalTarget,
java.lang.String returnType)
Creates a new session.
|
java.lang.String |
getReturnType(java.lang.String cid) |
java.lang.String |
getSessionID() |
SessionTarget |
getSessionTarget(java.lang.String cid) |
SessionTarget |
getSessionTargetByTID(java.lang.String tid) |
java.lang.String |
getTID(java.lang.String cid)
|
boolean |
hasExpired()
Checks whether the session has expired or it has not.
|
void |
list(java.io.PrintStream out)
Prints this Session out to the specified output stream.
|
java.lang.String |
openChannel(java.lang.String cid)
Opens a new channel within the logical target which the cid belongs to.
|
void |
remove()
Removes the session.
|
java.util.Set<java.lang.String> |
tidKeySet() |
java.lang.String |
toString() |
protected void |
updateExpirationTime() |
protected java.lang.String sessionID
protected java.util.concurrent.locks.ReentrantReadWriteLock mutex
protected java.util.HashMap<java.lang.String,SessionTarget> targets
protected long expirationTime
protected final long DEFAULT_EXPIRATION_TIME
public java.lang.String createSessionTarget(JP2KServerLogicalTarget logicalTarget, java.lang.String returnType)
returnType
- transport
- public java.lang.String getSessionID()
public boolean contains(java.lang.String cid)
cid
belongs to this session.cid
- the unique channel identifier.true
if the channel belongs to this session.
Otherwise, returns false
.public boolean containsTID(java.lang.String tid)
tid
target identifier.tid
- a target identifier.true
if the session has the target. Otherwise, returns
false
.public java.lang.String openChannel(java.lang.String cid)
cid
- a Channel Identifier belonging to a logical target.null
if the cid does not belong
to this session.public void closeChannel(java.lang.String cid)
cid
- the unique channel identifier.public void remove()
public SessionTarget getSessionTarget(java.lang.String cid)
cid
- public SessionTarget getSessionTargetByTID(java.lang.String tid)
cid
- public java.util.Set<java.lang.String> tidKeySet()
public java.lang.String getReturnType(java.lang.String cid)
public java.lang.String getTID(java.lang.String cid)
cid
- the channel identifier.public boolean hasExpired()
true
if the session has expired. Otherwise,
returns false
.public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.protected void updateExpirationTime()
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)