org.walluck.oscar.handlers.directim
Class DirectIM

java.lang.Object
  extended byjava.lang.Thread
      extended byorg.walluck.oscar.handlers.directim.DirectIM
All Implemented Interfaces:
java.lang.Runnable

public class DirectIM
extends java.lang.Thread

Handles DirectIM (ODC) connections. This should probably be split in half as is done with FileTransfer (OFT) connections.

Since:
1.0
Version:
1.0
Author:
David Walluck

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DirectIM(AIMSession sess, byte[] cookie, java.lang.String screenname, java.lang.String host, int port, boolean wantResponse)
          Creates a new DirectIM.
 
Method Summary
 void end()
          End this Direct IM session.
 boolean isListener()
          Get the value of listener.
 boolean isSender()
          Get the value of sender.
 void run()
          Run method for the file transfer thread.
 void sendIM(int charset, int charSubset, java.lang.String msg)
          Send a direct IM message.
 void sendTyping(boolean typing)
          Send a typing notification.
 void setListener(boolean listener)
          Set the value of listener.
 void setSender(boolean sender)
          Set the value of sender.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectIM

public DirectIM(AIMSession sess,
                byte[] cookie,
                java.lang.String screenname,
                java.lang.String host,
                int port,
                boolean wantResponse)
Creates a new DirectIM.

Parameters:
sess - the oscar session
cookie - the cookie
screenname - the screenname
host - the host
port - the port
wantResponse - whether ot not you want an ack for this request
Method Detail

setListener

public void setListener(boolean listener)
Set the value of listener.

Parameters:
listener - Value to assign to listener.

isListener

public boolean isListener()
Get the value of listener.

Returns:
value of listener.

setSender

public void setSender(boolean sender)
Set the value of sender.

Parameters:
sender - Value to assign to sender.

isSender

public boolean isSender()
Get the value of sender.

Returns:
value of sender.

end

public void end()
End this Direct IM session.


sendTyping

public void sendTyping(boolean typing)
                throws java.io.IOException
Send a typing notification.

Parameters:
typing - set to true if typing, false otherwise
Throws:
java.io.IOException - if an error occurs

sendIM

public void sendIM(int charset,
                   int charSubset,
                   java.lang.String msg)
            throws java.io.IOException
Send a direct IM message.

Parameters:
charset - the charset
charSubset - the charSubset
msg - the message to send
Throws:
java.io.IOException - if an error occurs

run

public void run()
Run method for the file transfer thread.