public class JDBCRepository extends Object implements AuthRepository, UserRepository
Thanks to Daniele for better unique IDs handling. Created: Thu Oct 26 11:48:53 2006
| Modifier and Type | Field and Description |
|---|---|
static String |
CURRENT_DB_SCHEMA_VER
Field description
|
static String |
DEF_MAXIDS_TBL
Field description
|
static String |
DEF_NODES_TBL
Field description
|
static String |
DEF_PAIRS_TBL
Field description
|
static String |
DEF_ROOT_NODE
Field description
|
static String |
DEF_USERS_TBL
Field description
|
static String |
DERBY_GETSCHEMAVER_QUERY
Field description
|
static String |
JDBC_GETSCHEMAVER_QUERY
Field description
|
static String |
SCHEMA_UPGRADE_LINK
Field description
|
static String |
SQLSERVER_GETSCHEMAVER_QUERY
Stored procedure used to check version of the schema
neither MS SQL Server JDBC driver supports default
schema prefix in connection string for stored functions
|
DATA_KEY, DIGEST_ID_KEY, DIGEST_KEY, MACHANISM_KEY, PASSWORD_KEY, PROTOCOL_KEY, PROTOCOL_VAL_NONSASL, PROTOCOL_VAL_SASL, REALM_KEY, RESULT_KEY, SERVER_NAME_KEY, USER_ID_KEY, USERNAME_KEY| Constructor and Description |
|---|
JDBCRepository() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDataList(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String[] list)
Describe
addDataList method here. |
void |
addUser(tigase.xmpp.BareJID user_id)
Describe
addUser method here. |
void |
addUser(tigase.xmpp.BareJID user,
String password)
Describe
addUser method here. |
boolean |
digestAuth(tigase.xmpp.BareJID user,
String digest,
String id,
String alg)
Deprecated.
|
String |
getData(tigase.xmpp.BareJID user_id,
String key)
Describe
getData method here. |
String |
getData(tigase.xmpp.BareJID user_id,
String subnode,
String key)
Describe
getData method here. |
String |
getData(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String def)
Describe
getData method here. |
String[] |
getDataList(tigase.xmpp.BareJID user_id,
String subnode,
String key)
Describe
getDataList method here. |
String[] |
getKeys(tigase.xmpp.BareJID user_id)
Describe
getKeys method here. |
String[] |
getKeys(tigase.xmpp.BareJID user_id,
String subnode)
Describe
getKeys method here. |
String |
getResourceUri()
Method description
|
String[] |
getSubnodes(tigase.xmpp.BareJID user_id)
Describe
getSubnodes method here. |
String[] |
getSubnodes(tigase.xmpp.BareJID user_id,
String subnode)
Describe
getSubnodes method here. |
List<tigase.xmpp.BareJID> |
getUsers()
getUsers method is thread safe. |
long |
getUsersCount()
getUsersCount method is thread safe. |
long |
getUsersCount(String domain)
Method description
|
long |
getUserUID(tigase.xmpp.BareJID user_id)
Method description
|
long |
getUserUID(DataRepository repo,
tigase.xmpp.BareJID user_id)
Method description
|
void |
initRepository(String connection_str,
Map<String,String> params)
Describe
initRepository method here. |
void |
logout(tigase.xmpp.BareJID user)
Method description
|
boolean |
otherAuth(Map<String,Object> props)
Describe
otherAuth method here. |
boolean |
plainAuth(tigase.xmpp.BareJID user,
String password)
Deprecated.
|
void |
queryAuth(Map<String,Object> authProps)
Method description
|
void |
removeData(tigase.xmpp.BareJID user_id,
String key)
Describe
removeData method here. |
void |
removeData(tigase.xmpp.BareJID user_id,
String subnode,
String key)
Describe
removeData method here. |
void |
removeSubnode(tigase.xmpp.BareJID user_id,
String subnode)
Describe
removeSubnode method here. |
void |
removeUser(tigase.xmpp.BareJID user_id)
removeUser method is thread safe. |
void |
setData(tigase.xmpp.BareJID user_id,
String key,
String value)
Describe
setData method here. |
void |
setData(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String value)
Describe
setData method here. |
void |
setDataList(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String[] list)
Describe
setDataList method here. |
void |
updatePassword(tigase.xmpp.BareJID user,
String password)
Method description
|
boolean |
userExists(tigase.xmpp.BareJID user)
Method description
|
public static final String CURRENT_DB_SCHEMA_VER
public static final String DEF_MAXIDS_TBL
public static final String DEF_NODES_TBL
public static final String DEF_PAIRS_TBL
public static final String DEF_ROOT_NODE
public static final String DEF_USERS_TBL
public static final String DERBY_GETSCHEMAVER_QUERY
public static final String SQLSERVER_GETSCHEMAVER_QUERY
public static final String JDBC_GETSCHEMAVER_QUERY
public static final String SCHEMA_UPGRADE_LINK
public void addDataList(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String[] list)
throws UserNotFoundException,
TigaseDBException
addDataList method here.addDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuelist - a String[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void addUser(tigase.xmpp.BareJID user_id)
throws UserExistsException,
TigaseDBException
addUser method here.addUser in interface UserRepositoryuser_id - a String valueUserExistsException - if an error occursTigaseDBExceptionpublic void addUser(tigase.xmpp.BareJID user,
String password)
throws UserExistsException,
TigaseDBException
addUser method here.addUser in interface AuthRepositoryuser - a String valuepassword - a String valueUserExistsException - if an error occursTigaseDBException - if an error occurs@Deprecated public boolean digestAuth(tigase.xmpp.BareJID user, String digest, String id, String alg) throws UserNotFoundException, TigaseDBException, AuthorizationException
digestAuth method here.digestAuth in interface AuthRepositoryuser - a String valuedigest - a String valueid - a String valuealg - a String valueboolean valueAuthorizationExceptionUserNotFoundException - if an error occursTigaseDBException - if an error occurspublic String getData(tigase.xmpp.BareJID user_id, String subnode, String key, String def) throws UserNotFoundException, TigaseDBException
getData method here.getData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuedef - a String valueString valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String getData(tigase.xmpp.BareJID user_id, String subnode, String key) throws UserNotFoundException, TigaseDBException
getData method here.getData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valueString valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String getData(tigase.xmpp.BareJID user_id, String key) throws UserNotFoundException, TigaseDBException
getData method here.getData in interface UserRepositoryuser_id - a String valuekey - a String valueString valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String[] getDataList(tigase.xmpp.BareJID user_id, String subnode, String key) throws UserNotFoundException, TigaseDBException
getDataList method here.getDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valueString[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String[] getKeys(tigase.xmpp.BareJID user_id, String subnode) throws UserNotFoundException, TigaseDBException
getKeys method here.getKeys in interface UserRepositoryuser_id - a String valuesubnode - a String valueString[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String[] getKeys(tigase.xmpp.BareJID user_id) throws UserNotFoundException, TigaseDBException
getKeys method here.getKeys in interface UserRepositoryuser_id - a String valueString[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String getResourceUri()
getResourceUri in interface AuthRepositorygetResourceUri in interface UserRepositoryString value of database connection string.public String[] getSubnodes(tigase.xmpp.BareJID user_id, String subnode) throws UserNotFoundException, TigaseDBException
getSubnodes method here.getSubnodes in interface UserRepositoryuser_id - a String valuesubnode - a String valueString[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic String[] getSubnodes(tigase.xmpp.BareJID user_id) throws UserNotFoundException, TigaseDBException
getSubnodes method here.getSubnodes in interface UserRepositoryuser_id - a String valueString[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic long getUserUID(tigase.xmpp.BareJID user_id)
throws TigaseDBException
getUserUID in interface UserRepositoryuser_id - TigaseDBExceptionpublic long getUserUID(DataRepository repo, tigase.xmpp.BareJID user_id) throws SQLException
repo - user_id - SQLExceptionpublic List<tigase.xmpp.BareJID> getUsers() throws TigaseDBException
getUsers method is thread safe.getUsers in interface UserRepositoryList of user IDs from database.TigaseDBExceptionpublic long getUsersCount()
getUsersCount method is thread safe. It uses local variable
for storing Statement.getUsersCount in interface AuthRepositorygetUsersCount in interface UserRepositorylong number of user accounts in database.public long getUsersCount(String domain)
getUsersCount in interface AuthRepositorygetUsersCount in interface UserRepositorydomain - long number of registered users in the repository.public void initRepository(String connection_str, Map<String,String> params) throws DBInitException
initRepository method here.initRepository in interface AuthRepositoryinitRepository in interface UserRepositoryconnection_str - a String valueparams - DBInitExceptionpublic void logout(tigase.xmpp.BareJID user)
throws UserNotFoundException,
TigaseDBException
logout in interface AuthRepositoryuser - TigaseDBExceptionUserNotFoundExceptionpublic boolean otherAuth(Map<String,Object> props) throws UserNotFoundException, TigaseDBException, AuthorizationException
otherAuth method here.otherAuth in interface AuthRepositoryprops - a Map valueboolean valueUserNotFoundException - if an error occursTigaseDBException - if an error occursAuthorizationException - if an error occurs@Deprecated public boolean plainAuth(tigase.xmpp.BareJID user, String password) throws UserNotFoundException, TigaseDBException, AuthorizationException
plainAuth method here.plainAuth in interface AuthRepositoryuser - a String valuepassword - a String valueboolean valueAuthorizationExceptionUserNotFoundException - if an error occursTigaseDBException - if an error occurspublic void queryAuth(Map<String,Object> authProps)
queryAuth in interface AuthRepositoryauthProps - public void removeData(tigase.xmpp.BareJID user_id,
String subnode,
String key)
throws UserNotFoundException,
TigaseDBException
removeData method here.removeData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void removeData(tigase.xmpp.BareJID user_id,
String key)
throws UserNotFoundException,
TigaseDBException
removeData method here.removeData in interface UserRepositoryuser_id - a String valuekey - a String valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void removeSubnode(tigase.xmpp.BareJID user_id,
String subnode)
throws UserNotFoundException,
TigaseDBException
removeSubnode method here.removeSubnode in interface UserRepositoryuser_id - a String valuesubnode - a String valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void removeUser(tigase.xmpp.BareJID user_id)
throws UserNotFoundException,
TigaseDBException
removeUser method is thread safe. It uses local variable for
storing Statement.removeUser in interface AuthRepositoryremoveUser in interface UserRepositoryuser_id - a String value the user Jabber ID.TigaseDBExceptionUserNotFoundException - if an error occurspublic void setData(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String value)
throws UserNotFoundException,
TigaseDBException
setData method here.setData in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuevalue - a String valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void setData(tigase.xmpp.BareJID user_id,
String key,
String value)
throws UserNotFoundException,
TigaseDBException
setData method here.setData in interface UserRepositoryuser_id - a String valuekey - a String valuevalue - a String valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void setDataList(tigase.xmpp.BareJID user_id,
String subnode,
String key,
String[] list)
throws UserNotFoundException,
TigaseDBException
setDataList method here.setDataList in interface UserRepositoryuser_id - a String valuesubnode - a String valuekey - a String valuelist - a String[] valueUserNotFoundException - if an error occursTigaseDBExceptionpublic void updatePassword(tigase.xmpp.BareJID user,
String password)
throws TigaseDBException
updatePassword in interface AuthRepositoryuser - password - TigaseDBExceptionUserNotFoundExceptionpublic boolean userExists(tigase.xmpp.BareJID user)
userExists in interface UserRepositoryuser - boolean valueCopyright © 2014 "Tigase, Inc.". All rights reserved.