|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.xmpp.RepositoryAccess
public abstract class RepositoryAccess
Describe class RepositoryAccess here. Created: Tue Oct 24 10:38:41 2006
| Field Summary | |
|---|---|
protected static java.lang.String |
NO_ACCESS_TO_REP_MSG
|
protected static java.lang.String |
NOT_AUTHORIZED_MSG
|
| Constructor Summary | |
|---|---|
RepositoryAccess(UserRepository rep,
UserAuthRepository auth,
boolean anon_allowed)
Creates a new RepositoryAccess instance. |
|
| Method Summary | |
|---|---|
void |
addDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
|
void |
addOfflineDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
|
void |
addPublicDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
|
java.lang.String |
getAuthenticationToken(java.lang.String xmpp_sessionId)
|
Authorization |
getAuthState()
Gets the value of authState |
java.lang.String |
getData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
getData method is a twin sister (brother?) of
setData(String, String, String) method. |
java.lang.String[] |
getDataGroups(java.lang.String subnode)
This method retrieves list of all direct subnodes for given node. |
java.lang.String[] |
getDataKeys(java.lang.String subnode)
This method returns all data keys available in permanent storage in given node. |
java.lang.String[] |
getDataList(java.lang.String subnode,
java.lang.String key)
This method allows to retrieve list of values associated with one key. |
abstract java.lang.String |
getDomain()
|
java.lang.String |
getOfflineData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
|
java.lang.String[] |
getOfflineDataList(java.lang.String subnode,
java.lang.String key)
|
java.lang.String |
getPublicData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
|
java.lang.String[] |
getPublicDataList(java.lang.String subnode,
java.lang.String key)
|
abstract java.lang.String |
getUserId()
|
abstract java.lang.String |
getUserName()
|
boolean |
isAnonymous()
|
boolean |
isAuthorized()
This method allows you test this session if it already has been authorized. |
protected abstract void |
login()
|
Authorization |
loginDigest(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
|
Authorization |
loginOther(java.util.Map<java.lang.String,java.lang.Object> props)
|
Authorization |
loginPlain(java.lang.String user,
java.lang.String password)
authorize method performs authorization with given
password as plain text. |
Authorization |
loginToken(java.lang.String xmpp_sessionId,
java.lang.String token)
|
void |
logout()
|
void |
queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
|
Authorization |
register(java.lang.String name_param,
java.lang.String pass_param,
java.lang.String email_param)
|
void |
removeData(java.lang.String subnode,
java.lang.String key)
|
void |
removeDataGroup(java.lang.String subnode)
Removes the last data node given in subnode path as parameter to this method. |
void |
removeOfflineData(java.lang.String subnode,
java.lang.String key)
|
void |
removeOfflineDataGroup(java.lang.String subnode)
|
void |
removePublicData(java.lang.String subnode,
java.lang.String key)
|
void |
removePublicDataGroup(java.lang.String subnode)
|
void |
setData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
This method stores given data in permanent storage in given point of hierarchy of data base. |
void |
setDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
This method allows to store list of values under one key ID reference. |
void |
setOfflineData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
|
void |
setOfflineDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
|
void |
setPublicData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
|
void |
setPublicDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
|
Authorization |
unregister(java.lang.String name_param)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String NOT_AUTHORIZED_MSG
protected static final java.lang.String NO_ACCESS_TO_REP_MSG
| Constructor Detail |
|---|
public RepositoryAccess(UserRepository rep,
UserAuthRepository auth,
boolean anon_allowed)
RepositoryAccess instance.
rep - auth - anon_allowed - | Method Detail |
|---|
public abstract java.lang.String getUserId()
throws NotAuthorizedException
NotAuthorizedException
public abstract java.lang.String getUserName()
throws NotAuthorizedException
NotAuthorizedExceptionpublic abstract java.lang.String getDomain()
public Authorization unregister(java.lang.String name_param)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public Authorization register(java.lang.String name_param,
java.lang.String pass_param,
java.lang.String email_param)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBExceptionpublic final Authorization getAuthState()
public final boolean isAuthorized()
true is returned as method result it means session has
already been authorized, if false however session is still not
authorized.
boolean value which informs whether this session has
been already authorized or not.
public Authorization loginPlain(java.lang.String user,
java.lang.String password)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
authorize method performs authorization with given
password as plain text.
If AUTHORIZED has been returned it means authorization
process is successful and session has been activated, otherwise session
hasn't been authorized and return code gives more detailed information
of fail reason. Please refer to Authorizaion documentation for
more details.
Authorization value of result code.
NotAuthorizedException
AuthorizationException
TigaseDBExceptionpublic boolean isAnonymous()
public Authorization loginOther(java.util.Map<java.lang.String,java.lang.Object> props)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
NotAuthorizedException
AuthorizationException
TigaseDBException
public java.lang.String getAuthenticationToken(java.lang.String xmpp_sessionId)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public Authorization loginToken(java.lang.String xmpp_sessionId,
java.lang.String token)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public Authorization loginDigest(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
throws NotAuthorizedException,
AuthorizationException,
TigaseDBException
NotAuthorizedException
AuthorizationException
TigaseDBExceptionpublic void queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
public void logout()
throws NotAuthorizedException
NotAuthorizedExceptionprotected abstract void login()
public java.lang.String[] getDataList(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
null is returned.
subnode - a String value pointing to specific subnode in
user reposiotry where data have to be stored.key - a String value of data key ID.
String[] array containing all values found for
given key.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public java.lang.String getData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
throws NotAuthorizedException,
TigaseDBException
getData method is a twin sister (brother?) of
setData(String, String, String) method.
It allows you to retrieve data stored with above method. It is data stored
in given node with given key identifier. If there are no data associated
with given key or given node does not exist given def value
is returned.
subnode - a String value is path to node where pair
(key, value) are stored.key - a String value of key ID for data to retrieve.def - a String value of default returned if there is
nothing stored with given key. def can be set to any value
you wish to have back as default value or null if you want
to have back null if no data was found. If you set
def to null it has exactly the
same effect as if you use getData(String) method.
String value of data found for given key or
def if there was no data associated with given key.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public void setData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
throws NotAuthorizedException,
TigaseDBException
setData(String, String) and
differs in one additional parameter which point to user data base subnode
where data must be stored. It helps to organize user data in more logical
hierarchy.UserRepository
interface for general info and to XMLRepository for detailed
explanation regarding XML implementation of user repository.
Thus subnode is kind of path to data node. If you specify
null or empty node data will be stored in root user node.
This has exactly the same effect as you call
setData(String, String). If you want to store data in
different node you must just specify node path like you do it to directory
on most file systems:
/rosterOr, if you need access deeper node:
/just/like/path/to/fileIf given node does not yet exist it will be automaticaly created with all nodes in given path so there is no need for developer to perform additional action to create node. There is, however method
removeDataGroup(String) for deleting specified node as nodes
are not automaticaly deleted.
subnode - a String value pointing to specific subnode in
user reposiotry where data have to be stored.key - a String value of data key ID.value - a String actual data stored in user repository.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionremoveDataGroup(String),
UserRepository
public void removeData(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public java.lang.String[] getDataGroups(java.lang.String subnode)
throws NotAuthorizedException,
TigaseDBException
ls unix command or dir
under DOS/Windows systems.
subnode - a String value of path to node for which we
want to retrieve list of direct subnodes.
String[] array of direct subnodes names for given
node.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public java.lang.String[] getDataKeys(java.lang.String subnode)
throws NotAuthorizedException,
TigaseDBException
subnode - a String value pointing to specific subnode in
user reposiotry where data have to be stored.
String[] array containing all data keys found in
given subnode.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public void removeDataGroup(java.lang.String subnode)
throws NotAuthorizedException,
TigaseDBException
(key, val) are removed as well. Changes are commited to
repository immediatelly and there is no way to undo this operation so
use it with care.
subnode - a String value of path to node which has
to be removed.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public void setDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
subnode - a String value pointing to specific subnode in
user reposiotry where data have to be stored.key - a String value of data key ID.list - a String[] keeping list of actual data to be
stored in user repository.
NotAuthorizedException - is thrown when session
has not been authorized yet and there is no access to permanent storage.
TigaseDBExceptionsetData(String, String, String)
public void addDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void setPublicDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void addPublicDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public java.lang.String[] getPublicDataList(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void setPublicData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public java.lang.String getPublicData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void removePublicData(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void removePublicDataGroup(java.lang.String subnode)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void setOfflineDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void addOfflineDataList(java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public java.lang.String[] getOfflineDataList(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void setOfflineData(java.lang.String subnode,
java.lang.String key,
java.lang.String value)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public java.lang.String getOfflineData(java.lang.String subnode,
java.lang.String key,
java.lang.String def)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void removeOfflineData(java.lang.String subnode,
java.lang.String key)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
public void removeOfflineDataGroup(java.lang.String subnode)
throws NotAuthorizedException,
TigaseDBException
NotAuthorizedException
TigaseDBException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||