public class MsgCookie extends Object
Constructor and Description |
---|
MsgCookie()
Create a cookie and add the cookie to the cookie cache automatically.
|
MsgCookie(AIMConnection conn,
byte[] cookie,
int type,
Object data)
Create a cookie and add the cookie to the cookie cache automatically.
|
MsgCookie(AIMConnection conn,
byte[] cookie,
int type,
Object data,
boolean toc)
Create a TOC-compatible cookie and add the cookie to the cookie cache
automatically.
|
Modifier and Type | Method and Description |
---|---|
static void |
cacheCookie(AIMConnection conn,
MsgCookie cookie)
Add a cookie to the cookie cache.
|
static MsgCookie |
checkCookie(AIMConnection conn,
MsgCookie cookie)
Check if the given cookie is in the cookie cache.
|
boolean |
equals(Object obj)
Tests the current cookie and the given cookie for equality.
|
static byte[] |
genCookie(boolean toc)
Generate a cookie.
|
long |
getAddTime()
Get the value of addTime.
|
byte[] |
getCookie()
Get the value of cookie.
|
Object |
getData()
Get the value of data.
|
int |
getType()
Get the value of type.
|
int |
getType(int reqClass)
Get the cookie type based on the given capability.
|
int |
hashCode()
The hashcode.
|
void |
setAddTime(long addTime)
Set the value of addTime.
|
void |
setCookie(byte[] cookie)
Set the value of cookie.
|
void |
setData(Object data)
Set the value of data.
|
void |
setType(int type)
Set the value of type.
|
static MsgCookie |
uncacheCookie(AIMConnection conn,
MsgCookie cookie)
Get a cookie from the cookie cache and remove it from the cookie cache.
|
public MsgCookie()
public MsgCookie(AIMConnection conn, byte[] cookie, int type, Object data)
conn
- the connectioncookie
- the cookietype
- the cookie typedata
- the cookie datapublic MsgCookie(AIMConnection conn, byte[] cookie, int type, Object data, boolean toc)
conn
- the connectioncookie
- the cookietype
- the cookie typedata
- the cookie datatoc
- set to true if you want TOC-compatible, false otherwisepublic static byte[] genCookie(boolean toc)
toc
- set to true for TOC-compatible, false otherwisepublic byte[] getCookie()
public void setCookie(byte[] cookie)
cookie
- Value to assign to cookie.public int getType()
public void setType(int type)
type
- Value to assign to type.public Object getData()
public void setData(Object data)
data
- Value to assign to data.public long getAddTime()
public void setAddTime(long addTime)
addTime
- Value to assign to addTime.public static void cacheCookie(AIMConnection conn, MsgCookie cookie)
If the cookie is found, update the addtime of the cached cookie, otherwise add it to the cache.
conn
- the connectioncookie
- the MessageCookiepublic static MsgCookie uncacheCookie(AIMConnection conn, MsgCookie cookie)
conn
- the connectioncookie
- the MessageCookiepublic static MsgCookie checkCookie(AIMConnection conn, MsgCookie cookie)
conn
- the connectioncookie
- the MessageCookiepublic int getType(int reqClass)
reqClass
- the capability flagpublic boolean equals(Object obj)