Package tigase.io.repo
Class CertificateRepository
- java.lang.Object
-
- tigase.db.comp.ConfigRepository<Item>
-
- tigase.db.comp.UserRepoRepository<CertificateItem>
-
- tigase.io.repo.CertificateRepository
-
- All Implemented Interfaces:
java.lang.Iterable<CertificateItem>
,ComponentRepository<CertificateItem>
,Repository
,Initializable
,UnregisterAware
@Bean(name="repository", parent=CertificateContainer.class, active=false) public class CertificateRepository extends UserRepoRepository<CertificateItem>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface tigase.db.Repository
Repository.Meta, Repository.SchemaId
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
moveFromFilesystemToRepository
-
Fields inherited from class tigase.db.comp.UserRepoRepository
repo, REPO_CLASS_PROP_KEY, REPO_URI_PROP_KEY
-
Fields inherited from class tigase.db.comp.ConfigRepository
autoReloadInterval, items, itemsHash
-
Fields inherited from interface tigase.db.comp.ComponentRepository
COMP_REPO_BIND
-
-
Constructor Summary
Constructors Constructor Description CertificateRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addItem(CertificateItem item)
The method adds a new or updates existing Item in the repository.void
destroy()
Method destroys this instance of ComponentRepository releasing resources allocated for this instance of ComponentRepository if possiblejava.lang.String
getConfigKey()
CertificateItem
getItemInstance()
Creates a new, uninitialized instance of the repository Item.java.lang.String
getPropertyKey()
BareJID
getRepoUser()
boolean
isMoveFromFilesystemToRepository()
boolean
itemChanged(CertificateItem oldItem, CertificateItem newItem)
void
reload()
This method is called to reload items from the database or other permanent storage.void
removeItem(java.lang.String key)
The method is called to remove given Item from the memory cache and permanent storage.void
setRepo(UserRepository userRepository)
Deprecated.void
store()
The method is called to store all data in the database.-
Methods inherited from class tigase.db.comp.UserRepoRepository
getItemsListPKey
-
Methods inherited from class tigase.db.comp.ConfigRepository
addItemNoStore, addRepoChangeListener, allItems, beforeUnregister, contains, getDefaultItems, getDefaultPropetyItems, getDefaults, getItem, getItemsOld, initialize, initItemsMap, isInitialized, iterator, removeItemNoStore, removeRepoChangeListener, setAutoloadTimer, setAutoReloadInterval, setItemsOld, setProperties, size, toString, validateItem
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface tigase.db.Repository
initRepository
-
-
-
-
Field Detail
-
moveFromFilesystemToRepository
@ConfigField(desc="Automatically migrate certificates from filesystem to repository (and make backup)", alias="move-from-filesystem-to-repository") protected boolean moveFromFilesystemToRepository
-
-
Method Detail
-
addItem
public void addItem(CertificateItem item)
Description copied from interface:ComponentRepository
The method adds a new or updates existing Item in the repository. It needs to have all fields set correctly. After this method call is finished a new added item must be available in the component repository. The method adds the item to memory cache and permanent storage.- Specified by:
addItem
in interfaceComponentRepository<CertificateItem>
- Overrides:
addItem
in classConfigRepository<CertificateItem>
- Parameters:
item
- aItem
with all it's configuration parameters.
-
itemChanged
public boolean itemChanged(CertificateItem oldItem, CertificateItem newItem)
- Overrides:
itemChanged
in classConfigRepository<CertificateItem>
-
destroy
public void destroy()
Description copied from interface:ComponentRepository
Method destroys this instance of ComponentRepository releasing resources allocated for this instance of ComponentRepository if possible
-
getConfigKey
public java.lang.String getConfigKey()
- Specified by:
getConfigKey
in classConfigRepository<CertificateItem>
-
getItemInstance
public CertificateItem getItemInstance()
Description copied from interface:ComponentRepository
Creates a new, uninitialized instance of the repository Item.- Returns:
- a new, uninitialized instance of the repository Item.
-
getPropertyKey
public java.lang.String getPropertyKey()
- Specified by:
getPropertyKey
in classConfigRepository<CertificateItem>
-
getRepoUser
public BareJID getRepoUser()
- Specified by:
getRepoUser
in classUserRepoRepository<CertificateItem>
-
isMoveFromFilesystemToRepository
public boolean isMoveFromFilesystemToRepository()
-
reload
public void reload()
Description copied from interface:ComponentRepository
This method is called to reload items from the database or other permanent storage. It is possible that items list is modified externally by third-party system. When all modifications are done this method is called to refresh the class cache. Whether the implementation load whole list or just last modifications is implementation dependent.- Specified by:
reload
in interfaceComponentRepository<CertificateItem>
- Overrides:
reload
in classUserRepoRepository<CertificateItem>
-
removeItem
public void removeItem(java.lang.String key)
Description copied from interface:ComponentRepository
The method is called to remove given Item from the memory cache and permanent storage. After this method is completed the item should no longer be available in the component repository.- Specified by:
removeItem
in interfaceComponentRepository<CertificateItem>
- Overrides:
removeItem
in classConfigRepository<CertificateItem>
- Parameters:
key
- aString
with domain name to remove.
-
setRepo
@Deprecated public void setRepo(UserRepository userRepository)
Deprecated.- Overrides:
setRepo
in classUserRepoRepository<CertificateItem>
-
store
public void store()
Description copied from interface:ComponentRepository
The method is called to store all data in the database. It is used when the repository has been changed in some way and the changes have to be put to a permanent storage for later retrieval.- Specified by:
store
in interfaceComponentRepository<CertificateItem>
- Overrides:
store
in classUserRepoRepository<CertificateItem>
-
-