|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttigase.db.jdbc.JDBCRepository
public class JDBCRepository
Not synchronized implementation! Musn't be used by more than one thread at the same time.
Thanks to Daniele for better unique IDs handling. Created: Thu Oct 26 11:48:53 2006
| Field Summary | |
|---|---|
static java.lang.String |
DEF_MAXIDS_TBL
|
static java.lang.String |
DEF_NODES_TBL
|
static java.lang.String |
DEF_PAIRS_TBL
|
static java.lang.String |
DEF_ROOT_NODE
|
static java.lang.String |
DEF_USERS_TBL
|
static java.lang.String |
DERBY_CONNVALID_QUERY
|
static java.lang.String |
DERBY_GETSCHEMAVER_QUERY
|
static java.lang.String |
JDBC_CONNVALID_QUERY
|
static java.lang.String |
JDBC_GETSCHEMAVER_QUERY
|
| Fields inherited from interface tigase.db.UserAuthRepository |
|---|
DATA_KEY, MACHANISM_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY |
| Constructor Summary | |
|---|---|
JDBCRepository()
|
|
| Method Summary | |
|---|---|
void |
addDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
Describe addDataList method here. |
void |
addUser(java.lang.String user_id)
Describe addUser method here. |
void |
addUser(java.lang.String user,
java.lang.String password)
Describe addUser method here. |
boolean |
digestAuth(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
Describe digestAuth method here. |
java.lang.String |
getData(java.lang.String user_id,
java.lang.String key)
Describe getData method here. |
java.lang.String |
getData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
Describe getData method here. |
java.lang.String |
getData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String def)
Describe getData method here. |
java.lang.String[] |
getDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
Describe getDataList method here. |
java.lang.String[] |
getKeys(java.lang.String user_id)
Describe getKeys method here. |
java.lang.String[] |
getKeys(java.lang.String user_id,
java.lang.String subnode)
Describe getKeys method here. |
java.lang.String |
getResourceUri()
getResourceUri method returns database connection string. |
java.lang.String[] |
getSubnodes(java.lang.String user_id)
Describe getSubnodes method here. |
java.lang.String[] |
getSubnodes(java.lang.String user_id,
java.lang.String subnode)
Describe getSubnodes method here. |
java.util.List<java.lang.String> |
getUsers()
getUsers method is thread safe. |
long |
getUsersCount()
getUsersCount method is thread safe. |
void |
initRepository(java.lang.String connection_str,
java.util.Map<java.lang.String,java.lang.String> params)
Describe initRepository method here. |
void |
logout(java.lang.String user)
Describe logout method here. |
boolean |
otherAuth(java.util.Map<java.lang.String,java.lang.Object> props)
Describe otherAuth method here. |
boolean |
plainAuth(java.lang.String user,
java.lang.String password)
Describe plainAuth method here. |
void |
queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
queryAuth returns mechanisms available for authentication. |
void |
removeData(java.lang.String user_id,
java.lang.String key)
Describe removeData method here. |
void |
removeData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
Describe removeData method here. |
void |
removeSubnode(java.lang.String user_id,
java.lang.String subnode)
Describe removeSubnode method here. |
void |
removeUser(java.lang.String user_id)
removeUser method is thread safe. |
void |
setData(java.lang.String user_id,
java.lang.String key,
java.lang.String value)
Describe setData method here. |
void |
setData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String value)
Describe setData method here. |
void |
setDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
Describe setDataList method here. |
void |
updatePassword(java.lang.String user,
java.lang.String password)
Describe updatePassword method here. |
boolean |
userExists(java.lang.String user)
Method userExists checks whether the user (or repository top node)
exists in the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEF_USERS_TBL
public static final java.lang.String DEF_NODES_TBL
public static final java.lang.String DEF_PAIRS_TBL
public static final java.lang.String DEF_MAXIDS_TBL
public static final java.lang.String DEF_ROOT_NODE
public static final java.lang.String DERBY_CONNVALID_QUERY
public static final java.lang.String JDBC_CONNVALID_QUERY
public static final java.lang.String DERBY_GETSCHEMAVER_QUERY
public static final java.lang.String JDBC_GETSCHEMAVER_QUERY
| Constructor Detail |
|---|
public JDBCRepository()
| Method Detail |
|---|
public boolean userExists(java.lang.String user)
UserRepositoryuserExists checks whether the user (or repository top node)
exists in the database. The method doesn't throw any exception nor it creates
the user in case it is missing. It just checjs wether the user is already
in the database.
Please don't overuser this method. All other methods
throw UserNotFoundException exception in case the user is missing
for which you executed the method. The exception is thrown unless
userAutoCreate property is set to true. In such case the exception
is never thrown and the methods are executed for given parameters prior to
creating user entry if it is missing.
Therefore this method should be used only to check whether the account exists
without creating it.
userExists in interface UserRepositoryuser - a String value
boolean valuepublic java.lang.String getResourceUri()
UserAuthRepositorygetResourceUri method returns database connection string.
getResourceUri in interface UserAuthRepositorygetResourceUri in interface UserRepositoryString value of database connection string.
public void initRepository(java.lang.String connection_str,
java.util.Map<java.lang.String,java.lang.String> params)
throws DBInitException
initRepository method here.
initRepository in interface UserAuthRepositoryinitRepository in interface UserRepositoryconnection_str - a String value
DBInitException - if an error occurs during access database. It won't
happen however as in this method we do simple variable assigment.public long getUsersCount()
getUsersCount method is thread safe. It uses local variable
for storing Statement.
getUsersCount in interface UserRepositorylong number of user accounts in database.
public java.util.List<java.lang.String> getUsers()
throws TigaseDBException
getUsers method is thread safe. It uses local variable
for storing Statement.
getUsers in interface UserRepositoryList of user IDs from database.
TigaseDBException
public void addUser(java.lang.String user_id)
throws UserExistsException,
TigaseDBException
addUser method here.
addUser in interface UserRepositoryuser_id - a String value
UserExistsException - if an error occurs
TigaseDBException
public void removeUser(java.lang.String user_id)
throws UserNotFoundException,
TigaseDBException
removeUser method is thread safe. It uses local variable
for storing Statement.
removeUser in interface UserAuthRepositoryremoveUser in interface UserRepositoryuser_id - a String value the user Jabber ID.
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
public java.lang.String[] getDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
throws UserNotFoundException,
TigaseDBException
getDataList method here.
getDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String value
String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String[] getSubnodes(java.lang.String user_id,
java.lang.String subnode)
throws UserNotFoundException,
TigaseDBException
getSubnodes method here.
getSubnodes in interface UserRepositoryuser_id - a String valuesubnode - a String value
String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String[] getSubnodes(java.lang.String user_id)
throws UserNotFoundException,
TigaseDBException
getSubnodes method here.
getSubnodes in interface UserRepositoryuser_id - a String value
String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public void removeSubnode(java.lang.String user_id,
java.lang.String subnode)
throws UserNotFoundException,
TigaseDBException
removeSubnode method here.
removeSubnode in interface UserRepositoryuser_id - a String valuesubnode - a String value
UserNotFoundException - if an error occurs
TigaseDBException
public void setDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws UserNotFoundException,
TigaseDBException
setDataList method here.
setDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuelist - a String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public void addDataList(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String[] list)
throws UserNotFoundException,
TigaseDBException
addDataList method here.
addDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuelist - a String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String[] getKeys(java.lang.String user_id,
java.lang.String subnode)
throws UserNotFoundException,
TigaseDBException
getKeys method here.
getKeys in interface UserRepositoryuser_id - a String valuesubnode - a String value
String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String[] getKeys(java.lang.String user_id)
throws UserNotFoundException,
TigaseDBException
getKeys method here.
getKeys in interface UserRepositoryuser_id - a String value
String[] value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String getData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String def)
throws UserNotFoundException,
TigaseDBException
getData method here.
getData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuedef - a String value
String value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String getData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
throws UserNotFoundException,
TigaseDBException
getData method here.
getData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String value
String value
UserNotFoundException - if an error occurs
TigaseDBException
public java.lang.String getData(java.lang.String user_id,
java.lang.String key)
throws UserNotFoundException,
TigaseDBException
getData method here.
getData in interface UserRepositoryuser_id - a String valuekey - a String value
String value
UserNotFoundException - if an error occurs
TigaseDBException
public void setData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key,
java.lang.String value)
throws UserNotFoundException,
TigaseDBException
setData method here.
setData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuevalue - a String value
UserNotFoundException - if an error occurs
TigaseDBException
public void setData(java.lang.String user_id,
java.lang.String key,
java.lang.String value)
throws UserNotFoundException,
TigaseDBException
setData method here.
setData in interface UserRepositoryuser_id - a String valuekey - a String valuevalue - a String value
UserNotFoundException - if an error occurs
TigaseDBException
public void removeData(java.lang.String user_id,
java.lang.String subnode,
java.lang.String key)
throws UserNotFoundException,
TigaseDBException
removeData method here.
removeData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String value
UserNotFoundException - if an error occurs
TigaseDBException
public void removeData(java.lang.String user_id,
java.lang.String key)
throws UserNotFoundException,
TigaseDBException
removeData method here.
removeData in interface UserRepositoryuser_id - a String valuekey - a String value
UserNotFoundException - if an error occurs
TigaseDBException
public boolean plainAuth(java.lang.String user,
java.lang.String password)
throws UserNotFoundException,
TigaseDBException,
AuthorizationException
plainAuth method here.
plainAuth in interface UserAuthRepositoryuser - a String valuepassword - a String value
boolean value
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs during authentication
process.
public boolean digestAuth(java.lang.String user,
java.lang.String digest,
java.lang.String id,
java.lang.String alg)
throws UserNotFoundException,
TigaseDBException,
AuthorizationException
digestAuth method here.
digestAuth in interface UserAuthRepositoryuser - a String valuedigest - a String valueid - a String valuealg - a String value
boolean value
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs during authentication
process.
public boolean otherAuth(java.util.Map<java.lang.String,java.lang.Object> props)
throws UserNotFoundException,
TigaseDBException,
AuthorizationException
otherAuth method here.
otherAuth in interface UserAuthRepositoryprops - a Map value
boolean value
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
AuthorizationException - if an error occurs
public void updatePassword(java.lang.String user,
java.lang.String password)
throws TigaseDBException
UserAuthRepositoryupdatePassword method here.
updatePassword in interface UserAuthRepositoryuser - a String valuepassword - a String value
TigaseDBException - if an error occurs
public void logout(java.lang.String user)
throws UserNotFoundException,
TigaseDBException
UserAuthRepositorylogout method here.
logout in interface UserAuthRepositoryuser - a String value
UserNotFoundException - if an error occurs
TigaseDBException - if an error occurs
public void addUser(java.lang.String user,
java.lang.String password)
throws UserExistsException,
TigaseDBException
addUser method here.
addUser in interface UserAuthRepositoryuser - a String valuepassword - a String value
UserExistsException - if an error occurs
TigaseDBException - if an error occurspublic void queryAuth(java.util.Map<java.lang.String,java.lang.Object> authProps)
UserAuthRepositoryqueryAuth returns mechanisms available for authentication.
queryAuth in interface UserAuthRepositoryauthProps - a Map value with parameters for authentication.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||