Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.ssh
Interface ContactSSH

All Superinterfaces:
Contact
All Known Implementing Classes:
ContactSSHImpl

interface ContactSSH
extends Contact

This interface represents a Contact of SSH Type As a SSH Session is specific to a contact, additional information needed to maintain its state with the remote server is present here

Author:
Shobhit Jindal

Field Summary
static int CONVERSATION_MESSAGE_RECEIVED
          An event type indicating that the message being received is a standard conversation message sent by another contact.
static int SYSTEM_MESSAGE_RECEIVED
          An event type indicting that the message being received is a system message being sent by the server or a system administrator.
 
Method Summary
 void closeShellIO()
          Closes the readers and writer associated with shell of this contact
 OperationSetFileTransfer getFileTransferOperationSet()
          Returns the File Transfer operation set that this contact belongs to.
 String getHostName()
          Returns the Hostname associated with this contact
 com.jcraft.jsch.JSch getJSch()
          Returns the JSch Stack identified associated with this contact
 int getMessageType()
          Return the type of message received from remote server
 OperationSetBasicInstantMessaging getParentBasicInstantMessagingOperationSet()
          Returns the BasicInstant Messaging operation set that this contact belongs to.
 OperationSetPersistentPresence getParentPresenceOperationSet()
          Returns the persistent presence operation set that this contact belongs to.
 String getPassword()
          Returns the Password associated with this contact
 com.jcraft.jsch.Channel getShellChannel()
          Returns the SSH Shell Channel associated with this contact
 InputStream getShellInputStream()
          Returns the Input Stream associated with SSH Channel of this contact
 OutputStream getShellOutputStream()
          Returns the Output Stream associated with SSH Channel of this contact
 InputStreamReader getShellReader()
          Returns the BufferedReader associated with SSH Channel of this contact
 PrintWriter getShellWriter()
          Returns the PrintWriter associated with SSH Channel of this contact
 SSHContactInfo getSSHConfigurationForm()
           
 com.jcraft.jsch.Session getSSHSession()
          Returns the SSH Session associated with this contact
 String getUserName()
          Returns the Username associated with this contact
 void initializeShellIO(InputStream shellInputStream, OutputStream shellOutputStream)
          Initializes the reader and writers associated with shell of this contact
 boolean isCommandSent()
          Returns true if a command has been sent whos reply was not received yet false otherwise
 boolean isConnectionInProgress()
          Determines whether a connection to a remote server is already underway
 void savePersistentDetails()
          Saves the details of contact in persistentData
 void sendLine(String message)
          Sends a message a line to remote machine via the Shell Writer
 void setCommandSent(boolean commandSent)
          Set the state of commandSent variable which determines whether a reply to a command sent is awaited
 void setConnectionInProgress(boolean connectionInProgress)
          Sets the status of connection attempt to remote server
 void setJSch(com.jcraft.jsch.JSch jsch)
          Sets the JSch Stack identified associated with this contact
 void setMessageType(int messageType)
          Sets the type of message received from remote server
 void setParentGroup(ContactGroupSSHImpl newParentGroup)
          This method is only called when the contact is added to a new ContactGroupSSHImpl by the ContactGroupSSHImpl itself.
 void setPassword(String password)
          Sets the Password associated with this contact
 void setPersistent(boolean isPersistent)
          Specifies whether or not this contact is being stored by the server.
 void setPersistentData(String persistentData)
          Stores persistent data of the contact.
 void setPresenceStatus(PresenceStatus sshPresenceStatus)
          Sets sshPresenceStatus as the PresenceStatus that this contact is currently in.
 void setResolved(boolean resolved)
          Makes the contact resolved or unresolved.
 void setShellChannel(com.jcraft.jsch.Channel shellChannel)
          Sets the SSH Shell channel associated with this contact
 void setSSHSession(com.jcraft.jsch.Session sshSession)
          Sets the SSH Session associated with this contact
 void startTimerTask()
          Starts the timer and its task to periodically update the status of remote machine
 void stopTimerTask()
          Stops the timer and its task to stop updating the status of remote machine
 
Methods inherited from interface net.java.sip.communicator.service.protocol.Contact
getAddress, getDisplayName, getImage, getParentContactGroup, getPersistentData, getPresenceStatus, getProtocolProvider, getStatusMessage, isPersistent, isResolved
 

Field Detail

CONVERSATION_MESSAGE_RECEIVED

static final int CONVERSATION_MESSAGE_RECEIVED
An event type indicating that the message being received is a standard conversation message sent by another contact.

See Also:
Constant Field Values

SYSTEM_MESSAGE_RECEIVED

static final int SYSTEM_MESSAGE_RECEIVED
An event type indicting that the message being received is a system message being sent by the server or a system administrator.

See Also:
Constant Field Values
Method Detail

setParentGroup

void setParentGroup(ContactGroupSSHImpl newParentGroup)
This method is only called when the contact is added to a new ContactGroupSSHImpl by the ContactGroupSSHImpl itself.

Parameters:
newParentGroup - the ContactGroupSSHImpl that is now parent of this ContactSSHImpl

setPresenceStatus

void setPresenceStatus(PresenceStatus sshPresenceStatus)
Sets sshPresenceStatus as the PresenceStatus that this contact is currently in.

Parameters:
sshPresenceStatus - the SSHPresenceStatus currently valid for this contact.

getParentPresenceOperationSet

OperationSetPersistentPresence getParentPresenceOperationSet()
Returns the persistent presence operation set that this contact belongs to.

Returns:
the OperationSetPersistentPresenceSSHImpl that this contact belongs to.

getParentBasicInstantMessagingOperationSet

OperationSetBasicInstantMessaging getParentBasicInstantMessagingOperationSet()
Returns the BasicInstant Messaging operation set that this contact belongs to.

Returns:
the OperationSetBasicInstantMessagingSSHImpl that this contact belongs to.

getFileTransferOperationSet

OperationSetFileTransfer getFileTransferOperationSet()
Returns the File Transfer operation set that this contact belongs to.

Returns:
the OperationSetFileTransferSSHImpl that this contact belongs to.

getMessageType

int getMessageType()
Return the type of message received from remote server

Returns:
messageType

setMessageType

void setMessageType(int messageType)
Sets the type of message received from remote server

Parameters:
messageType -

setPersistentData

void setPersistentData(String persistentData)
Stores persistent data of the contact.

Parameters:
persistentData - of the contact

setResolved

void setResolved(boolean resolved)
Makes the contact resolved or unresolved.

Parameters:
resolved - true to make the contact resolved; false to make it unresolved

setPersistent

void setPersistent(boolean isPersistent)
Specifies whether or not this contact is being stored by the server. Non persistent contacts are common in the case of simple, non-persistent presence operation sets. They could however also be seen in persistent presence operation sets when for example we have received an event from someone not on our contact list. Non persistent contacts are volatile even when coming from a persistent presence op. set. They would only exist until the application is closed and will not be there next time it is loaded.

Parameters:
isPersistent - true if the contact is persistent and false otherwise.

isCommandSent

boolean isCommandSent()
Returns true if a command has been sent whos reply was not received yet false otherwise

Returns:
commandSent

setCommandSent

void setCommandSent(boolean commandSent)
Set the state of commandSent variable which determines whether a reply to a command sent is awaited

Parameters:
commandSent -

initializeShellIO

void initializeShellIO(InputStream shellInputStream,
                       OutputStream shellOutputStream)
Initializes the reader and writers associated with shell of this contact

Parameters:
shellInputStream - The InputStream of stack
shellOutputStream - The OutputStream of stack

closeShellIO

void closeShellIO()
Closes the readers and writer associated with shell of this contact


isConnectionInProgress

boolean isConnectionInProgress()
Determines whether a connection to a remote server is already underway

Returns:
connectionInProgress

setConnectionInProgress

void setConnectionInProgress(boolean connectionInProgress)
Sets the status of connection attempt to remote server

Parameters:
connectionInProgress -

savePersistentDetails

void savePersistentDetails()
Saves the details of contact in persistentData


getSSHConfigurationForm

SSHContactInfo getSSHConfigurationForm()

getJSch

com.jcraft.jsch.JSch getJSch()
Returns the JSch Stack identified associated with this contact

Returns:
jsch

startTimerTask

void startTimerTask()
Starts the timer and its task to periodically update the status of remote machine


stopTimerTask

void stopTimerTask()
Stops the timer and its task to stop updating the status of remote machine


setJSch

void setJSch(com.jcraft.jsch.JSch jsch)
Sets the JSch Stack identified associated with this contact

Parameters:
jsch - to be associated

getUserName

String getUserName()
Returns the Username associated with this contact

Returns:
userName

getHostName

String getHostName()
Returns the Hostname associated with this contact

Returns:
hostName

getPassword

String getPassword()
Returns the Password associated with this contact

Returns:
password

setPassword

void setPassword(String password)
Sets the Password associated with this contact

Parameters:
password -

getSSHSession

com.jcraft.jsch.Session getSSHSession()
Returns the SSH Session associated with this contact

Returns:
sshSession

setSSHSession

void setSSHSession(com.jcraft.jsch.Session sshSession)
Sets the SSH Session associated with this contact

Parameters:
sshSession - the newly created SSH Session to be associated

getShellChannel

com.jcraft.jsch.Channel getShellChannel()
Returns the SSH Shell Channel associated with this contact

Returns:
shellChannel

setShellChannel

void setShellChannel(com.jcraft.jsch.Channel shellChannel)
Sets the SSH Shell channel associated with this contact

Parameters:
shellChannel - to be associated with SSH Session of this contact

sendLine

void sendLine(String message)
              throws IOException
Sends a message a line to remote machine via the Shell Writer

Parameters:
message - to be sent
Throws:
IOException - if message failed to be sent

getShellInputStream

InputStream getShellInputStream()
Returns the Input Stream associated with SSH Channel of this contact

Returns:
shellInputStream associated with SSH Channel of this contact

getShellOutputStream

OutputStream getShellOutputStream()
Returns the Output Stream associated with SSH Channel of this contact

Returns:
shellOutputStream associated with SSH Channel of this contact

getShellReader

InputStreamReader getShellReader()
Returns the BufferedReader associated with SSH Channel of this contact

Returns:
shellReader associated with SSH Channel of this contact

getShellWriter

PrintWriter getShellWriter()
Returns the PrintWriter associated with SSH Channel of this contact

Returns:
shellWriter associated with SSH Channel of this contact

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.