|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.walluck.oscar.handlers.SNACHandler
org.walluck.oscar.handlers.ServiceHandler
public class ServiceHandler
Family 0x0001 - This is a very special group. All connections support this group, as it does some particularly good things (like rate limiting).
SNACHandler
Constructor Summary | |
---|---|
ServiceHandler()
Family 0x0001. |
Method Summary | |
---|---|
void |
clientReady(AIMSession sess,
AIMConnection conn)
Subtype 0x0002 - Client online. |
void |
handleSNAC(AIMSession sess,
SNACHandler handler,
AIMFrame frame,
SNAC snac,
AIMInputStream buffer)
Handles incoming SNAC's. |
void |
nop(AIMSession sess,
AIMConnection conn)
Subtype 0x0016 - Nop. |
void |
ratesAddParam(AIMSession sess,
AIMConnection conn)
Subtype 0x0008 - Add rate parameters. |
void |
ratesDelParam(AIMSession sess,
AIMConnection conn)
Subtype 0x0009 - Delete rate parameters. |
void |
reqPersonalInfo(AIMSession sess,
AIMConnection conn)
Subtype 0x000e - Request self information. |
void |
reqService(AIMSession sess,
AIMConnection conn,
int serviceID)
Subtype 0x0004 - Service request. |
void |
sendMemBlock(AIMSession sess,
AIMConnection conn,
int offset,
int len,
byte[] buf,
int flag)
Subtype 0x0020 - Client verification reply. |
void |
sendPauseAck(AIMSession sess,
AIMConnection conn)
Subtype 0x000c - Service Pause Acknowledgement. |
void |
setAvailableMsg(AIMSession sess,
String msg,
String enc)
Subtype 0x001e - Extended Status. |
void |
setExtStatus(AIMSession sess,
int status)
Subtype 0x001e - Sets your ICQ status (available, away, do not disturb, etc.). |
void |
setIdle(AIMSession sess,
int idleTime)
Subtype 0x0011 - Idle Notification. |
void |
setPrivacyFlags(AIMSession sess,
AIMConnection conn,
int flags)
Subtype 0x0014 - Set privacy flags. |
void |
setSecureIM(AIMSession sess)
Subtype 0x0022 - Set SecureIM. |
Methods inherited from class org.walluck.oscar.handlers.SNACHandler |
---|
getFamily, getVersion, setFamily, setVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceHandler()
Method Detail |
---|
public void clientReady(AIMSession sess, AIMConnection conn) throws IOException
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void reqService(AIMSession sess, AIMConnection conn, int serviceID) throws IOException
sess
- the oscar sessionconn
- the connectionserviceID
- the service ID
IOException
- if an error occurspublic void ratesAddParam(AIMSession sess, AIMConnection conn) throws IOException
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void ratesDelParam(AIMSession sess, AIMConnection conn) throws IOException
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void sendPauseAck(AIMSession sess, AIMConnection conn) throws IOException
It is rather important that sendPauseAck gets called for the exact same connection that Server Pause was called for, since we extract the & data for the SNAC from the connection structure.
Of course, if you don't do that, more bad things happen than just what we can cause here.
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void reqPersonalInfo(AIMSession sess, AIMConnection conn) throws IOException
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void setIdle(AIMSession sess, int idleTime) throws IOException
This should set your current idle time in seconds. Note that this should never be called consecutively with a non-zero idle time. That makes OSCAR do funny things. Instead, just set it once you go idle, and then call it again with zero when you're back.
sess
- the oscar sessionidleTime
- the idle time
IOException
- if an error occurspublic void setPrivacyFlags(AIMSession sess, AIMConnection conn, int flags) throws IOException
Normally 0x03.
sess
- the oscar sessionconn
- the connectionflags
- the privacy flags
IOException
- if an error occursAIMConstants
public void nop(AIMSession sess, AIMConnection conn) throws IOException
WinAIM sends these every 4 minutes or so to keep the connection alive. It's not really necessary.
sess
- the oscar sessionconn
- the connection
IOException
- if an error occurspublic void setExtStatus(AIMSession sess, int status) throws IOException
These are the same TLV's seen in user info. You can also set 0x0008 and 0x000c.
sess
- the oscar sessionstatus
- the extended status
IOException
- if an error occurspublic void setAvailableMsg(AIMSession sess, String msg, String enc) throws IOException
Sets your "available" message. This is currently only supported by iChat, gaim, and daim.
sess
- the oscar sessionmsg
- the "available" messageenc
- the "available" message encoding
IOException
- if an error occurspublic void sendMemBlock(AIMSession sess, AIMConnection conn, int offset, int len, byte[] buf, int flag) throws IOException
NOTE: If you need to make use of the
sendMemBlock
method, then the client information
specified here is what you need to pull data from. Currently,
we only internally support AIM 3.5, but we could use some
additional versions.
sess
- the oscar sessionconn
- the connectionoffset
- the offsetlen
- the lengthbuf
- the bufferflag
- the flags
IOException
- if an error occursAIMConstants
public void setSecureIM(AIMSession sess) throws IOException
The MD5 sum sent here appears to be a null checksum.
sess
- the oscar session
IOException
- if an error occurspublic void handleSNAC(AIMSession sess, SNACHandler handler, AIMFrame frame, SNAC snac, AIMInputStream buffer) throws IOException
handleSNAC
in class SNACHandler
sess
- the oscar sessionhandler
- the handlerframe
- the incoming framesnac
- the incoming SNACbuffer
- the incoming buffer
IOException
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |