public class ClientSideSessionTargets
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,ClientSideSessionTarget> |
clientSessionTargets
A hash table to save the Session Targets.
|
Constructor and Description |
---|
ClientSideSessionTargets()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
belongs(java.lang.String cid1,
java.lang.String cid2)
Checks whether the
cid1 and cid2 channel
identifiers belongs to the same session. |
void |
clear()
Remove all elements from the clients list
|
void |
closeSession(java.lang.String cid)
Closes all channels that belongs to the same sessions, so the session
is closed and removed from the sessions list.
|
boolean |
contains(java.lang.String cid)
Returns true if the clients list contains the specified element.
|
boolean |
containsSession(java.lang.String sid)
Returns true if the clients list contains the specified element.
|
ClientSideSessionTarget |
create(java.lang.String server,
int port,
java.lang.String target,
java.util.ArrayList<java.lang.String> preferredTransportProtocols,
CADILog log)
Creates a new session target.
|
ClientSideSessionTarget |
create(java.lang.String server,
int port,
java.lang.String target,
CADILog log)
Creates a new session target.
|
boolean |
equals(java.lang.String target,
java.lang.String tid)
Check if the logical target identified
|
protected java.lang.String |
findSID(java.lang.String cid) |
ClientSideSessionTarget |
getBySID(java.lang.String sid) |
ClientSideSessionTarget |
getByTarget(java.lang.String target)
Gets a logical target from the list.
|
ClientSideSessionTarget |
getByTID(java.lang.String tid)
Gets a logical target from the list.
|
private ClientSideSessionTarget |
getTarget(java.lang.String target,
java.lang.String tid)
Gets a logical target from the list.
|
boolean |
isEmpty()
Checks if there is a empty list of sessions.
|
void |
list(java.io.PrintStream out)
Prints this Logical Target List fields out to the specified output
stream.
|
void |
remove(java.lang.String cid)
Removes the element that it is identifier by its session identifier.
|
java.util.ArrayList<java.lang.String> |
SIDKeyList() |
int |
size()
Returns the number of sessions.
|
java.lang.String |
toString() |
protected java.util.HashMap<java.lang.String,ClientSideSessionTarget> clientSessionTargets
The key
records the session target identifier (SID).
The value
saves the Session Target.
public ClientSideSessionTarget create(java.lang.String server, int port, java.lang.String target, CADILog log)
server
- server where the target is hosted.port
- port number of the server.target
- definition in TargetField.target
.log
- a CADILog
object.ProxySessionTarget
object.public ClientSideSessionTarget create(java.lang.String server, int port, java.lang.String target, java.util.ArrayList<java.lang.String> preferredTransportProtocols, CADILog log)
server
- server where the target is hosted.port
- port number of the server.target
- definition in TargetField.target
.preferredTransportProtocols
- definition in ClientSideSessionTarget.preferredTransportProtocols
.log
- a CADILog
object.ProxySessionTarget
object.public void remove(java.lang.String cid)
cid
- the channel identifier.public ClientSideSessionTarget getBySID(java.lang.String sid)
public boolean contains(java.lang.String cid)
cid
- public java.util.ArrayList<java.lang.String> SIDKeyList()
public boolean containsSession(java.lang.String sid)
cid
- public boolean belongs(java.lang.String cid1, java.lang.String cid2)
cid1
and cid2
channel
identifiers belongs to the same session.cid1
- a channel identifier.cid2
- a channel identifier.true
if both channel identifiers belong to the same
session. Otherwise, returns false
.public ClientSideSessionTarget getByTID(java.lang.String tid)
tid
).
tid
- definition in TargetField.target
.tid is not in the list, it returns null
public ClientSideSessionTarget getByTarget(java.lang.String target)
target
.
target
- definition in TargetField.target
.target is not in the list, it returns null
public boolean equals(java.lang.String target, java.lang.String tid)
target
- definition in TargetField.target
.tid
- definition in TargetField.tid
.true
if the target
belongs to the
target identifier tid
.public void closeSession(java.lang.String cid)
cid
- the unique channel identifier.public int size()
public boolean isEmpty()
true
if there is not any sessions. Otherwise,
returns false
.public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public void list(java.io.PrintStream out)
out
- an output stream.protected java.lang.String findSID(java.lang.String cid)
cid
- private ClientSideSessionTarget getTarget(java.lang.String target, java.lang.String tid)
target
and/or tid
. If the target
and tid
parameters do not identify the same target
an exception is thrown.target
- definition in TargetField.target
.tid
- definition in TargetField.target
.target is not in the list, it returns null
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)