org.walluck.oscar
Class SNAC

java.lang.Object
  extended byorg.walluck.oscar.SNAC

public class SNAC
extends java.lang.Object

A SNAC is the basic communications unit that is exchanged between clients and servers. The SNAC communication layer sits on top of the FLAP layer. The SNAC flags for the client are always 0x0000. From the server, they can be 0x8000, 0x1000, or possibly others.

Since:
1.0
Version:
1.0
Author:
David Walluck

Constructor Summary
SNAC()
          Creates a new empty SNAC.
SNAC(int family, int subtype, short flags, int id)
          Creates a new server SNAC.
SNAC(int family, int subtype, short flags, java.lang.Object data, boolean wantResponse)
          Creates a new client SNAC.
 
Method Summary
 java.lang.Object getData()
          Get the value of data.
 int getFamily()
          Get the value of family.
 short getFlags()
          Get the value of flags.
 int getId()
          Get the value of id.
 long getIssueTime()
          Get the value of issueTime.
 int getSubtype()
          Get the value of subtype.
 int getVersion()
          Get the value of version.
 void setData(java.lang.Object data)
          Set the value of data.
 void setFamily(int family)
          Set the value of family.
 void setFlags(short flags)
          Set the value of flags.
 void setId(int id)
          Set the value of id.
 void setIssueTime(long issueTime)
          Set the value of issueTime.
 void setSubtype(int subtype)
          Set the value of subtype.
 void setVersion(int version)
          Set the value of version.
 void setWantResponse(boolean wantResponse)
          Set the value of wantResponse.
 boolean wantResponse()
          Get the value of wantResponse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SNAC

public SNAC()
Creates a new empty SNAC.


SNAC

public SNAC(int family,
            int subtype,
            short flags,
            java.lang.Object data,
            boolean wantResponse)
Creates a new client SNAC.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
flags - the SNAC flags (normally 0x0000)
data - the data to store with this SNAC
wantResponse - whether or not we expect a response for this SNAC

SNAC

public SNAC(int family,
            int subtype,
            short flags,
            int id)
Creates a new server SNAC.

Parameters:
family - the SNAC family
subtype - the SNAC subtype
flags - the SNAC flags (normally 0x0000)
id - the SNAC ID
Method Detail

getFamily

public int getFamily()
Get the value of family.

Returns:
value of family.

setFamily

public void setFamily(int family)
Set the value of family.

Parameters:
family - Value to assign to family.

getSubtype

public int getSubtype()
Get the value of subtype.

Returns:
value of subtype.

setSubtype

public void setSubtype(int subtype)
Set the value of subtype.

Parameters:
subtype - Value to assign to subtype.

getFlags

public short getFlags()
Get the value of flags.

Returns:
value of flags.

setFlags

public void setFlags(short flags)
Set the value of flags.

Parameters:
flags - Value to assign to flags.

getId

public int getId()
Get the value of id.

Returns:
value of id.

setId

public void setId(int id)
Set the value of id.

Parameters:
id - Value to assign to id.

getData

public java.lang.Object getData()
Get the value of data.

Returns:
value of data.

setData

public void setData(java.lang.Object data)
Set the value of data.

Parameters:
data - Value to assign to data.

wantResponse

public boolean wantResponse()
Get the value of wantResponse.

Returns:
value of wantResponse.

setWantResponse

public void setWantResponse(boolean wantResponse)
Set the value of wantResponse.

Parameters:
wantResponse - Value to assign to wantResponse.

getIssueTime

public long getIssueTime()
Get the value of issueTime.

Returns:
value of issueTime.

setIssueTime

public void setIssueTime(long issueTime)
Set the value of issueTime.

Parameters:
issueTime - Value to assign to issueTime.

getVersion

public int getVersion()
Get the value of version.

Returns:
value of version.

setVersion

public void setVersion(int version)
Set the value of version.

Parameters:
version - Value to assign to version.