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 booleanmoveFromFilesystemToRepository-
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 voidaddItem(CertificateItem item)The method adds a new or updates existing Item in the repository.voiddestroy()Method destroys this instance of ComponentRepository releasing resources allocated for this instance of ComponentRepository if possiblejava.lang.StringgetConfigKey()CertificateItemgetItemInstance()Creates a new, uninitialized instance of the repository Item.java.lang.StringgetPropertyKey()BareJIDgetRepoUser()booleanisMoveFromFilesystemToRepository()booleanitemChanged(CertificateItem oldItem, CertificateItem newItem)voidreload()This method is called to reload items from the database or other permanent storage.voidremoveItem(java.lang.String key)The method is called to remove given Item from the memory cache and permanent storage.voidsetRepo(UserRepository userRepository)Deprecated.voidstore()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:ComponentRepositoryThe 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:
addItemin interfaceComponentRepository<CertificateItem>- Overrides:
addItemin classConfigRepository<CertificateItem>- Parameters:
item- aItemwith all it's configuration parameters.
-
itemChanged
public boolean itemChanged(CertificateItem oldItem, CertificateItem newItem)
- Overrides:
itemChangedin classConfigRepository<CertificateItem>
-
destroy
public void destroy()
Description copied from interface:ComponentRepositoryMethod destroys this instance of ComponentRepository releasing resources allocated for this instance of ComponentRepository if possible
-
getConfigKey
public java.lang.String getConfigKey()
- Specified by:
getConfigKeyin classConfigRepository<CertificateItem>
-
getItemInstance
public CertificateItem getItemInstance()
Description copied from interface:ComponentRepositoryCreates 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:
getPropertyKeyin classConfigRepository<CertificateItem>
-
getRepoUser
public BareJID getRepoUser()
- Specified by:
getRepoUserin classUserRepoRepository<CertificateItem>
-
isMoveFromFilesystemToRepository
public boolean isMoveFromFilesystemToRepository()
-
reload
public void reload()
Description copied from interface:ComponentRepositoryThis 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:
reloadin interfaceComponentRepository<CertificateItem>- Overrides:
reloadin classUserRepoRepository<CertificateItem>
-
removeItem
public void removeItem(java.lang.String key)
Description copied from interface:ComponentRepositoryThe 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:
removeItemin interfaceComponentRepository<CertificateItem>- Overrides:
removeItemin classConfigRepository<CertificateItem>- Parameters:
key- aStringwith domain name to remove.
-
setRepo
@Deprecated public void setRepo(UserRepository userRepository)
Deprecated.- Overrides:
setRepoin classUserRepoRepository<CertificateItem>
-
store
public void store()
Description copied from interface:ComponentRepositoryThe 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:
storein interfaceComponentRepository<CertificateItem>- Overrides:
storein classUserRepoRepository<CertificateItem>
-
-