|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.xmpp.RepositoryAccess
tigase.xmpp.XMPPResourceConnection
public class XMPPResourceConnection
Describe class XMPPResourceConnection here. Created: Wed Feb 8 22:30:37 2006
| Field Summary | |
|---|---|
static java.lang.String |
PRESENCE_KEY
Constant PRESENCE_KEY is a key in temporary session data
where the last presence sent by the userto server is stored,
either initial presence or off-line presence before disconnecting. |
| Fields inherited from class tigase.xmpp.RepositoryAccess |
|---|
domain, NO_ACCESS_TO_REP_MSG, NOT_AUTHORIZED_MSG |
| Constructor Summary | |
|---|---|
XMPPResourceConnection(tigase.xmpp.JID connectionId,
UserRepository rep,
UserAuthRepository authRepo,
SessionManagerHandler loginHandler)
Creates a new XMPPResourceConnection instance. |
|
| Method Summary | |
|---|---|
java.util.List<XMPPResourceConnection> |
getActiveSessions()
Method description |
tigase.xmpp.JID[] |
getAllResourcesJIDs()
Method description |
long |
getAuthTime()
Method description |
tigase.xmpp.BareJID |
getBareJID()
Returns user JID but without resource part. |
java.lang.Object |
getCommonSessionData(java.lang.String key)
|
tigase.xmpp.JID |
getConnectionId()
Gets the value of connectionId |
tigase.xmpp.JID |
getConnectionId(tigase.xmpp.JID jid)
Method description |
ConnectionStatus |
getConnectionStatus()
Method description |
long |
getCreationTime()
Method description |
java.lang.String |
getDefLang()
Method description |
tigase.xmpp.JID |
getjid()
Returns full user JID for this session without throwing the NotAuthorizedException exception if session is not authorized
yet and therefore user name and resource is not known yet. |
tigase.xmpp.JID |
getJID()
Returns full user JID for this session or throws NotAuthorizedException if session is not authorized yet and
therefore user name and resource is not known yet. |
long |
getLastAccessed()
Gets the value of lastAccessed |
XMPPSession |
getParentSession()
Method description |
tigase.xml.Element |
getPresence()
Returns last presence packet with the user presence status or null
if the user has not yet sent an initial presence. |
int |
getPriority()
Method description |
java.lang.String |
getResource()
Gets the value of resource |
java.lang.Object |
getSessionData(java.lang.String key)
Retrieves session data. |
java.lang.String |
getSessionId()
Gets the value of sessionId |
tigase.xmpp.JID |
getSMComponentId()
Method description |
tigase.xmpp.BareJID |
getUserId()
Deprecated. |
java.lang.String |
getUserName()
Method description |
boolean |
isAuthorized()
Method description |
boolean |
isLocalDomain(java.lang.String outDomain,
boolean includeComponents)
Method description |
boolean |
isResourceSet()
Method description |
boolean |
isServerSession()
Returns information whether this is a server (SessionManager) session or normal user session. |
boolean |
isUserId(tigase.xmpp.BareJID bareJID)
Method description |
protected void |
login()
|
Authorization |
loginDigest(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
Method description |
Authorization |
loginOther(java.util.Map<java.lang.String,java.lang.Object> props)
Method description |
Authorization |
loginPlain(java.lang.String user,
java.lang.String password)
Method description |
void |
logout()
Method description |
java.lang.String |
nextStanzaId()
Method description |
void |
putCommonSessionData(java.lang.String key,
java.lang.Object value)
Method description |
void |
putSessionData(java.lang.String key,
java.lang.Object value)
Saves given session data. |
void |
queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
Method description |
java.lang.Object |
removeCommonSessionData(java.lang.String key)
Method description |
void |
removeParentSession(XMPPSession parent)
Method description |
void |
removeSessionData(java.lang.String key)
Method description |
void |
setConnectionStatus(ConnectionStatus status)
Method description |
void |
setDefLang(java.lang.String lang)
Method description |
void |
setLastAccessed(long argLastAccessed)
Sets the value of lastAccessed |
void |
setParentSession(XMPPSession parent)
Method description |
void |
setPresence(tigase.xml.Element packet)
Method description |
void |
setPriority(int priority)
Method description |
void |
setResource(java.lang.String argResource)
Sets the connection resource |
void |
setSessionId(java.lang.String argSessionId)
Sets the value of sessionId |
void |
streamClosed()
Method description |
java.lang.String |
toString()
Method description |
Authorization |
unregister(java.lang.String name_param)
Method description |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PRESENCE_KEY
PRESENCE_KEY is a key in temporary session data
where the last presence sent by the userto server is stored,
either initial presence or off-line presence before disconnecting.
| Constructor Detail |
|---|
public XMPPResourceConnection(tigase.xmpp.JID connectionId,
UserRepository rep,
UserAuthRepository authRepo,
SessionManagerHandler loginHandler)
XMPPResourceConnection instance.
connectionId - rep - authRepo - loginHandler - | Method Detail |
|---|
public java.util.List<XMPPResourceConnection> getActiveSessions()
throws NotAuthorizedException
NotAuthorizedException
public tigase.xmpp.JID[] getAllResourcesJIDs()
throws NotAuthorizedException
NotAuthorizedExceptionpublic long getAuthTime()
public final tigase.xmpp.BareJID getBareJID()
throws NotAuthorizedException
getJID()
method.NotAuthorizedException.
getBareJID in class RepositoryAccessString value of user ID - this is user JID without
resource part. To obtain full user JID please refer to getJID
method.
NotAuthorizedException - when this session has not
been authorized yet and some parts of user JID are not known yet.getJID()public java.lang.Object getCommonSessionData(java.lang.String key)
key -
public tigase.xmpp.JID getConnectionId()
throws NoConnectionIdException
NoConnectionIdException
public tigase.xmpp.JID getConnectionId(tigase.xmpp.JID jid)
throws NoConnectionIdException
jid -
NoConnectionIdExceptionpublic ConnectionStatus getConnectionStatus()
public long getCreationTime()
public java.lang.String getDefLang()
public final tigase.xmpp.JID getJID()
throws NotAuthorizedException
NotAuthorizedException if session is not authorized yet and
therefore user name and resource is not known yet.
String value of calculated user full JID for this
session including resource name.
NotAuthorizedExceptionpublic long getLastAccessed()
public XMPPSession getParentSession()
public tigase.xml.Element getPresence()
null
if the user has not yet sent an initial presence.
Element with last presence status received
from the user.public int getPriority()
public java.lang.String getResource()
public tigase.xmpp.JID getSMComponentId()
public final java.lang.Object getSessionData(java.lang.String key)
putSessionData description for more details.
key - a String value of stored data ID.
Object value of data for given key.putSessionData(String, Object)public java.lang.String getSessionId()
@Deprecated
public tigase.xmpp.BareJID getUserId()
throws NotAuthorizedException
getBareJID method, to check the
whether the user with given BareJID is owner of the session please use method
isUserId(...). From now one the user session may handle more than
a single userId, hence getting just userId is not enough to check whether the
user Id belongs to the session.
NotAuthorizedException
public final java.lang.String getUserName()
throws NotAuthorizedException
getUserName in class RepositoryAccessNotAuthorizedExceptionpublic final tigase.xmpp.JID getjid()
NotAuthorizedException exception if session is not authorized
yet and therefore user name and resource is not known yet.
Please note this method if for logging using only to avoid excessive use
of try/catch for debugging code. It may return null.
String value of calculated user full JID for this
session including resource name.public boolean isAuthorized()
isAuthorized in class RepositoryAccess
public boolean isLocalDomain(java.lang.String outDomain,
boolean includeComponents)
outDomain - includeComponents -
public boolean isResourceSet()
public boolean isServerSession()
boolean value of true if this is the server session
and false otherwise.
public boolean isUserId(tigase.xmpp.BareJID bareJID)
throws NotAuthorizedException
bareJID -
NotAuthorizedException
public final Authorization loginDigest(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
loginDigest in class RepositoryAccessuser - digest - id - alg -
AuthorizationException
NotAuthorizedException
TigaseDBException
public final Authorization loginOther(java.util.Map<java.lang.String,java.lang.Object> props)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
loginOther in class RepositoryAccessprops -
AuthorizationException
NotAuthorizedException
TigaseDBException
public final Authorization loginPlain(java.lang.String user,
java.lang.String password)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
loginPlain in class RepositoryAccessuser - password -
AuthorizationException
NotAuthorizedException
TigaseDBException
public final void logout()
throws NotAuthorizedException
logout in class RepositoryAccessNotAuthorizedExceptionpublic java.lang.String nextStanzaId()
public void putCommonSessionData(java.lang.String key,
java.lang.Object value)
key - value -
public final void putSessionData(java.lang.String key,
java.lang.Object value)
Object can be stored and retrieved through
getSessionData(...).get/setData...(...) methods familly. They gives you
access to hierachical permanent data base. Permanent data base however can
be accessed after successuf authorization while session storage is availble
all the time.
key - a String value of stored data key ID.value - a Object value of data stored in session.getSessionData(String)public void queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
queryAuth in class RepositoryAccessauthProps - public java.lang.Object removeCommonSessionData(java.lang.String key)
key -
public void removeParentSession(XMPPSession parent)
parent - public final void removeSessionData(java.lang.String key)
key - public void setConnectionStatus(ConnectionStatus status)
status - public void setDefLang(java.lang.String lang)
lang - public void setLastAccessed(long argLastAccessed)
argLastAccessed - Value to assign to this.lastAccessed
public void setParentSession(XMPPSession parent)
throws tigase.util.TigaseStringprepException
parent -
tigase.util.TigaseStringprepExceptionpublic void setPresence(tigase.xml.Element packet)
packet - public void setPriority(int priority)
priority -
public void setResource(java.lang.String argResource)
throws NotAuthorizedException,
tigase.util.TigaseStringprepException
argResource - Value to assign to this.resource
NotAuthorizedException
tigase.util.TigaseStringprepExceptionpublic void setSessionId(java.lang.String argSessionId)
argSessionId - Value to assign to this.sessionIdpublic void streamClosed()
public java.lang.String toString()
toString in class java.lang.Object
public Authorization unregister(java.lang.String name_param)
throws NotAuthorizedException,
TigaseDBException
unregister in class RepositoryAccessname_param -
NotAuthorizedException
TigaseDBExceptionprotected void login()
login in class RepositoryAccess
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||