com.toremote.websocket.handler
Class AbstractSessionHandler

java.lang.Object
  extended by com.toremote.websocket.handler.AbstractHandler
      extended by com.toremote.websocket.handler.AbstractSessionHandler
All Implemented Interfaces:
SessionInformation, HandlerInterface
Direct Known Subclasses:
RdpHandler, SSHHandler, VncHandler

public abstract class AbstractSessionHandler
extends AbstractHandler
implements SessionInformation


Field Summary
protected  boolean control
           
protected static int FEATURE_ALL
           
protected static int FEATURE_AUDIO_PLAYBACK
           
protected static int FEATURE_BASIC
           
protected static int FEATURE_CLIPBOARD
           
protected static int FEATURE_FILE
           
protected static int FEATURE_NO_UPLOAD
           
protected static int FEATURE_PRINT
           
protected static int FEATURE_REMOTEAPP
           
protected static int FEATURE_REMOTEFX
           
protected static int FEATURE_SESSION_REC
           
protected static int FEATURE_SHADOWING
           
protected  int joinMode
           
protected  int numericId
           
protected  boolean readOnly
           
 User usr
           
 
Fields inherited from class com.toremote.websocket.handler.AbstractHandler
CLIENT_CLOSE, clientProperties, INFO_TAG, listener, out, properties, startTime, userAgent, userIp, WARGIN_TAG
 
Fields inherited from interface com.toremote.gateway.client.SessionInformation
JOIN_MODE_ALL_CONTROL, JOIN_MODE_ONE_CONTROL, SESSION_STATUS_CLIENT_DISCONNECTED, SESSION_STATUS_CONNECTED, SESSION_STATUS_LOGOFF, SESSION_STATUS_SERVER_DISCONNECTED, SESSION_STATUS_UNKOWN, TYPE_RDP, TYPE_SSH, TYPE_VNC
 
Fields inherited from interface com.toremote.websocket.handler.HandlerInterface
ARG_CLIENT_IP, ARG_HOST
 
Constructor Summary
protected AbstractSessionHandler()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getClientProperties()
           
abstract  com.toremote.websocket.rdp.clipboard.ClipDataRequest getCopyToText()
           
 InputInterface getInput()
           
 java.util.List<SessionInformation> getJoinedSessions()
           
 java.util.List<SessionInformation> getJoinedSessionsWithParent()
           
 int getJoinMode()
           
 int getNumericId()
           
 SessionInformation getParent()
           
 java.util.Map<java.lang.String,java.lang.String> getProperties()
           
abstract  java.lang.String getProtocol()
           
protected abstract  com.toremote.websocket.general.Runner getRunner()
           
 SessionSaveInfo getSaveSession()
           
 int getSessionStatus()
           
 void giveControl()
          give control to current session too, be aware it doesn't take control from others
protected  void handshake(java.lang.String action, java.util.Map<java.lang.String,java.lang.String> properties)
           
 boolean hasControl()
           
 void refuseControl()
          reufce contorl request
 void refuseControl(int id)
           
 void requestControl()
           
 void requestControl(SessionInformation from)
          request control from the seeion which has contorl
 void requestJoin(SessionInformation from)
           
 void setJoinMode(int mode)
          set up shadowing/join mode
 void setListener(SessionListener sl)
           
 void setSaveSession(SessionSaveInfo si)
          control if save(cache) the session on gateway
 void setSessionStaus(int value)
           
 void setThumbnail(int width, int interval)
           
 void takeBackControl()
          revoke control from current session
abstract  java.lang.String toJsonTableRow()
           
 
Methods inherited from class com.toremote.websocket.handler.AbstractHandler
checkLicense, exit, getGatewayWebAddress, getSessionId, isTrue, onClientDisconnected, onHandShake, onText, onTextReceived, processHandShake, sendError, sendError, sendError, setHandshakeListener, setOutput, setSessionId, showMessge, showMessge, toJson
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.toremote.gateway.client.SessionInformation
allowJoin, getConfig, getRecordingFile, getSessioinType, getSessionId, getUser, showMessge
 
Methods inherited from interface com.toremote.websocket.handler.HandlerInterface
onBinaryReceived
 

Field Detail

usr

public User usr

numericId

protected int numericId

readOnly

protected boolean readOnly

control

protected boolean control

joinMode

protected int joinMode

FEATURE_BASIC

protected static final int FEATURE_BASIC
See Also:
Constant Field Values

FEATURE_CLIPBOARD

protected static final int FEATURE_CLIPBOARD
See Also:
Constant Field Values

FEATURE_AUDIO_PLAYBACK

protected static final int FEATURE_AUDIO_PLAYBACK
See Also:
Constant Field Values

FEATURE_PRINT

protected static final int FEATURE_PRINT
See Also:
Constant Field Values

FEATURE_FILE

protected static final int FEATURE_FILE
See Also:
Constant Field Values

FEATURE_REMOTEAPP

protected static final int FEATURE_REMOTEAPP
See Also:
Constant Field Values

FEATURE_SESSION_REC

protected static final int FEATURE_SESSION_REC
See Also:
Constant Field Values

FEATURE_NO_UPLOAD

protected static final int FEATURE_NO_UPLOAD
See Also:
Constant Field Values

FEATURE_SHADOWING

protected static final int FEATURE_SHADOWING
See Also:
Constant Field Values

FEATURE_REMOTEFX

protected static final int FEATURE_REMOTEFX
See Also:
Constant Field Values

FEATURE_ALL

protected static final int FEATURE_ALL
See Also:
Constant Field Values
Constructor Detail

AbstractSessionHandler

protected AbstractSessionHandler()
Method Detail

getRunner

protected abstract com.toremote.websocket.general.Runner getRunner()

getCopyToText

public abstract com.toremote.websocket.rdp.clipboard.ClipDataRequest getCopyToText()

getJoinedSessionsWithParent

public java.util.List<SessionInformation> getJoinedSessionsWithParent()

refuseControl

public void refuseControl(int id)
                   throws java.io.IOException
Throws:
java.io.IOException

refuseControl

public void refuseControl()
                   throws java.io.IOException
Description copied from interface: SessionInformation
reufce contorl request

Specified by:
refuseControl in interface SessionInformation
Throws:
java.io.IOException

requestControl

public void requestControl()
                    throws java.io.IOException
Throws:
java.io.IOException

setJoinMode

public void setJoinMode(int mode)
                 throws java.io.IOException,
                        AccessException
Description copied from interface: SessionInformation
set up shadowing/join mode

Specified by:
setJoinMode in interface SessionInformation
Throws:
java.io.IOException
AccessException

getJoinMode

public int getJoinMode()
Specified by:
getJoinMode in interface SessionInformation
Returns:
JOIN_MODE_ALL_CONTROL or JOIN_MODE_ONE_CONTROL

getNumericId

public int getNumericId()
Specified by:
getNumericId in interface SessionInformation
Returns:
the 9 digit number id

getParent

public SessionInformation getParent()
Specified by:
getParent in interface SessionInformation
Returns:
parent session, the session was shadowed/joined

getJoinedSessions

public java.util.List<SessionInformation> getJoinedSessions()
Specified by:
getJoinedSessions in interface SessionInformation
Returns:
all joined sessions

hasControl

public boolean hasControl()
Specified by:
hasControl in interface SessionInformation
Returns:
control status

giveControl

public void giveControl()
                 throws java.io.IOException
Description copied from interface: SessionInformation
give control to current session too, be aware it doesn't take control from others

Specified by:
giveControl in interface SessionInformation
Throws:
java.io.IOException

takeBackControl

public void takeBackControl()
                     throws java.io.IOException
Description copied from interface: SessionInformation
revoke control from current session

Specified by:
takeBackControl in interface SessionInformation
Throws:
java.io.IOException

requestControl

public void requestControl(SessionInformation from)
                    throws java.io.IOException
Description copied from interface: SessionInformation
request control from the seeion which has contorl

Specified by:
requestControl in interface SessionInformation
Throws:
java.io.IOException

requestJoin

public void requestJoin(SessionInformation from)
                 throws java.io.IOException
Specified by:
requestJoin in interface SessionInformation
Throws:
java.io.IOException

getInput

public InputInterface getInput()
Specified by:
getInput in interface SessionInformation
Returns:
input interface

setListener

public void setListener(SessionListener sl)
Specified by:
setListener in interface SessionInformation
Parameters:
sl - session listner
See Also:
SessionListener

setThumbnail

public void setThumbnail(int width,
                         int interval)
                  throws java.io.IOException
Specified by:
setThumbnail in interface SessionInformation
Parameters:
width - width of thumbnail, 0 will disable thumbnail
interval - 0 will disable thumbnail
Throws:
java.io.IOException

getProperties

public java.util.Map<java.lang.String,java.lang.String> getProperties()
Specified by:
getProperties in interface SessionInformation
Returns:
all parameters for this session, from the client side and parameters configured on server side (plugin)

getClientProperties

public java.util.Map<java.lang.String,java.lang.String> getClientProperties()
Specified by:
getClientProperties in interface SessionInformation
Returns:
parameters passed from the client side

setSaveSession

public void setSaveSession(SessionSaveInfo si)
Description copied from interface: SessionInformation
control if save(cache) the session on gateway

Specified by:
setSaveSession in interface SessionInformation
See Also:
SessionSaveInfo

getSaveSession

public SessionSaveInfo getSaveSession()
Specified by:
getSaveSession in interface SessionInformation
Returns:
configuration for session cache

getSessionStatus

public int getSessionStatus()
Specified by:
getSessionStatus in interface SessionInformation
Returns:
session status, SESSION_STATUS_UNKOWN, SESSION_STATUS_CONNECTED etc

setSessionStaus

public void setSessionStaus(int value)

handshake

protected void handshake(java.lang.String action,
                         java.util.Map<java.lang.String,java.lang.String> properties)
                  throws java.lang.Exception
Overrides:
handshake in class AbstractHandler
Throws:
java.lang.Exception

toJsonTableRow

public abstract java.lang.String toJsonTableRow()

getProtocol

public abstract java.lang.String getProtocol()