org.walluck.oscar.handlers
Class StatsHandler

java.lang.Object
  extended byorg.walluck.oscar.handlers.SNACHandler
      extended byorg.walluck.oscar.handlers.StatsHandler

public class StatsHandler
extends SNACHandler

Family 0x000b - Statistics.

Stats can keep track of anything. These stats keep track of what advertisements are displayed and whether or not the user clicked on any of them. I wonder how the server decides to parse the stats. It must make use of the client information send during logon.

Since:
1.0
Version:
1.0
Author:
David Walluck
See Also:
SNACHandler

Constructor Summary
StatsHandler()
          Family 0x000b.
 
Method Summary
 void handleSNAC(AIMSession sess, SNACHandler handler, AIMFrame frame, SNAC snac, AIMInputStream buffer)
          Handles incoming SNAC's.
 void reportEvent(AIMSession sess, AIMConnection conn, java.util.ArrayList stats, int type, int id)
          Report a stat event.
 void reportStats(AIMSession sess, AIMConnection conn, java.util.ArrayList stats, boolean wantResponse)
          Subtype 0x0002 - Report our stats to the server.
 
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

StatsHandler

public StatsHandler()
Family 0x000b.

Method Detail

reportEvent

public void reportEvent(AIMSession sess,
                        AIMConnection conn,
                        java.util.ArrayList stats,
                        int type,
                        int id)
Report a stat event. Event type 1 is the ad is viewed, type 2 is the ad has been clicked on.

Parameters:
sess - the oscar session
conn - the bos connection for this session
stats - the stats vector
type - the type of stat
id - the stat ID

reportStats

public void reportStats(AIMSession sess,
                        AIMConnection conn,
                        java.util.ArrayList stats,
                        boolean wantResponse)
                 throws java.io.IOException
Subtype 0x0002 - Report our stats to the server.

Parameters:
sess - the oscar session
conn - the bos connection for this session
stats - the stats vector
wantResponse - whether or not you want a server ack (usually false)
Throws:
java.io.IOException - if an error occurs

handleSNAC

public void handleSNAC(AIMSession sess,
                       SNACHandler handler,
                       AIMFrame frame,
                       SNAC snac,
                       AIMInputStream buffer)
                throws java.io.IOException
Handles incoming SNAC's.

Specified by:
handleSNAC in class SNACHandler
Parameters:
sess - the oscar session
handler - the handler
frame - the incoming frame
snac - the incoming SNAC
buffer - the incoming buffer
Throws:
java.io.IOException - if an error occurs