Package tigase.db
Class NonAuthUserRepositoryImpl
- java.lang.Object
-
- tigase.db.NonAuthUserRepositoryImpl
-
- All Implemented Interfaces:
NonAuthUserRepository
@Bean(name="nonAuthUserRepository", parent=Kernel.class, active=true, exportable=true) public class NonAuthUserRepositoryImpl extends java.lang.Object implements NonAuthUserRepository
Created: May 3, 2010 1:23:45 PM- Author:
- Artur Hefczyc
-
-
Field Summary
-
Fields inherited from interface tigase.db.NonAuthUserRepository
OFFLINE_DATA_NODE, PUBLIC_DATA_NODE
-
-
Constructor Summary
Constructors Constructor Description NonAuthUserRepositoryImpl()Constructor for beanNonAuthUserRepositoryImpl(UserRepository userRep, BareJID defDomain, boolean autoCreateOffline)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOfflineData(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String value)addDataListmethod adds mode entries to existing data list associated with given key in repository under given node path.voidaddOfflineDataList(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String[] list)addDataListmethod adds mode entries to existing data list associated with given key in repository under given node path.java.lang.StringgetDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key, java.lang.String def)Retrieves and returns a value associated with given subnode and key from a publicly available space.java.lang.StringgetPublicData(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String def)getPublicDatamethod returns a value associated with given key for user repository in given subnode.java.lang.String[]getPublicDataList(BareJID user, java.lang.String subnode, java.lang.String key)getPublicDataListmethod returns array of values associated with given key ornullif given key does not exist for given user ID in given node path.java.lang.StringgetTempData(java.lang.String subnode, java.lang.String key, java.lang.String def)Retrieves and returns a value associated with given subnode and key from a publicly available space.voidputDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key, java.lang.String value)The method allows to store some temporary data by the plugin in publicly available space.voidputTempData(java.lang.String subnode, java.lang.String key, java.lang.String value)The method allows to store some temporary data by the plugin in publicly available space.voidremoveDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key)The method allows to remove existing data stored in a temporary storage space associated with a given DNS domain.voidremoveTempData(java.lang.String subnode, java.lang.String key)The method allows to remove existing data stored in the Tigase instance specific temporary storage.
-
-
-
Constructor Detail
-
NonAuthUserRepositoryImpl
public NonAuthUserRepositoryImpl(UserRepository userRep, BareJID defDomain, boolean autoCreateOffline)
-
NonAuthUserRepositoryImpl
public NonAuthUserRepositoryImpl()
Constructor for bean
-
-
Method Detail
-
addOfflineData
public void addOfflineData(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String value) throws UserNotFoundException, DataOverwriteException
Description copied from interface:NonAuthUserRepositoryaddDataListmethod adds mode entries to existing data list associated with given key in repository under given node path. This method is very similar tosetDataList(...)except it doesn't remove existing data.- Specified by:
addOfflineDatain interfaceNonAuthUserRepository- Parameters:
user- aStringvalue of user ID for which data must be stored. User ID consists of user name and domain name.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.value- aStringis an array of values to be assosiated with the specified key.- Throws:
UserNotFoundException- if user id hasn't been found in reository.DataOverwriteException
-
addOfflineDataList
public void addOfflineDataList(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String[] list) throws UserNotFoundException
Description copied from interface:NonAuthUserRepositoryaddDataListmethod adds mode entries to existing data list associated with given key in repository under given node path. This method is very similar tosetDataList(...)except it doesn't remove existing data.- Specified by:
addOfflineDataListin interfaceNonAuthUserRepository- Parameters:
user- aStringvalue of user ID for which data must be stored. User ID consists of user name and domain name.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.list- aString[]is an array of values to be assosiated with the specified key.- Throws:
UserNotFoundException- if user id hasn't been found in reository.
-
getDomainTempData
public java.lang.String getDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key, java.lang.String def) throws TigaseDBException
Description copied from interface:NonAuthUserRepositoryRetrieves and returns a value associated with given subnode and key from a publicly available space. The space is specific to given virtual domain and is shared among all running cluster nodes. The data are stored in some temporary space outside of the registered user data so no information for registered users can be retrieved.- Specified by:
getDomainTempDatain interfaceNonAuthUserRepository- Parameters:
domain- is a DNS domain name with which the data is associated.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the needed value is associated.def- aStringvalue which is returned in case if data for specified key does not exixist in repository.- Returns:
- a
Stringvalue for a given subnode and key ordef]if no entry has been found. - Throws:
TigaseDBException- if there was an error during reading data from the repository.
-
getPublicData
public java.lang.String getPublicData(BareJID user, java.lang.String subnode, java.lang.String key, java.lang.String def) throws UserNotFoundException
Description copied from interface:NonAuthUserRepositorygetPublicDatamethod returns a value associated with given key for user repository in given subnode. If key is not found in repository given default value is returned.- Specified by:
getPublicDatain interfaceNonAuthUserRepository- Parameters:
user- aStringvalue of user ID for which data must be stored. User ID consists of user name and domain name.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the needed value is associated.def- aStringvalue which is returned in case if data for specified key does not exixist in repository.- Returns:
- a
Stringvalue for a given subnode and key ordefif no entry has been found. - Throws:
UserNotFoundException- if user id hasn't been found in reository.
-
getPublicDataList
public java.lang.String[] getPublicDataList(BareJID user, java.lang.String subnode, java.lang.String key) throws UserNotFoundException
Description copied from interface:NonAuthUserRepositorygetPublicDataListmethod returns array of values associated with given key ornullif given key does not exist for given user ID in given node path.- Specified by:
getPublicDataListin interfaceNonAuthUserRepository- Parameters:
user- aStringvalue of user ID for which data must be stored. User ID consists of user name and domain name.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the needed values list is associated.- Returns:
- a
String[]value - Throws:
UserNotFoundException- if user id hasn't been found in reository.
-
getTempData
public java.lang.String getTempData(java.lang.String subnode, java.lang.String key, java.lang.String def) throws TigaseDBExceptionDescription copied from interface:NonAuthUserRepositoryRetrieves and returns a value associated with given subnode and key from a publicly available space. The space is specific for the Tigase instance and is not shared among different cluster nodes. The data is stored in some temporary space outside of the registered user data. So no information for registered users can be retrieved.- Specified by:
getTempDatain interfaceNonAuthUserRepository- Parameters:
subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the needed value is associated.def- aStringvalue which is returned in case if data for specified key does not exixist in repository.- Returns:
- a
Stringvalue for a given subnode and key ordefif no entry has been found. - Throws:
TigaseDBException- if there was an error during reading data from the repository.
-
putDomainTempData
public void putDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key, java.lang.String value) throws TigaseDBException
Description copied from interface:NonAuthUserRepositoryThe method allows to store some temporary data by the plugin in publicly available space. The space is specific to given virtual domain and is shared among all running cluster nodes. The data is stored in some place outside of the normal user space so no information for registered user can be overwriten.
If there is already a value for a given subnode and key it will be overwritten otherwise a new entry will be created.- Specified by:
putDomainTempDatain interfaceNonAuthUserRepository- Parameters:
domain- is a DNS domain name with which the data is associated.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.value- aStringis an array of values to be assosiated with the specified key.- Throws:
TigaseDBException- if there was an error during writing data to the repository.
-
putTempData
public void putTempData(java.lang.String subnode, java.lang.String key, java.lang.String value) throws TigaseDBExceptionDescription copied from interface:NonAuthUserRepositoryThe method allows to store some temporary data by the plugin in publicly available space. The space is specific for the Tigase instance and is not shared among different cluster nodes. The data is stored in some place outside of the normal user space so no information for registered user can be overwriten.
If there is already a value for a given subnode and key it will be overwritten otherwise a new entry will be created.- Specified by:
putTempDatain interfaceNonAuthUserRepository- Parameters:
subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.value- aStringis an array of values to be assosiated with the specified key.- Throws:
TigaseDBException- if there was an error during writing data to the repository.
-
removeDomainTempData
public void removeDomainTempData(BareJID domain, java.lang.String subnode, java.lang.String key) throws TigaseDBException
Description copied from interface:NonAuthUserRepositoryThe method allows to remove existing data stored in a temporary storage space associated with a given DNS domain.- Specified by:
removeDomainTempDatain interfaceNonAuthUserRepository- Parameters:
domain- is a DNS domain name with which the data is associated.subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.- Throws:
TigaseDBException- if there was an error during writing data to the repository.
-
removeTempData
public void removeTempData(java.lang.String subnode, java.lang.String key) throws TigaseDBExceptionDescription copied from interface:NonAuthUserRepositoryThe method allows to remove existing data stored in the Tigase instance specific temporary storage.- Specified by:
removeTempDatain interfaceNonAuthUserRepository- Parameters:
subnode- aStringvalue is a node path where data is stored. Node path has the same form as directory path on file system:/root/subnode1/subnode2
.key- aStringwith which the specified values list is to be associated.- Throws:
TigaseDBException- if there was an error during writing data to the repository.
-
-