Package tigase.io.repo
Class CertificateRepository
- All Implemented Interfaces:
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 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 possibleCreates a new, uninitialized instance of the repository Item.boolean
boolean
itemChanged
(CertificateItem oldItem, CertificateItem newItem) void
reload()
This method is called to reload items from the database or other permanent storage.void
removeItem
(String key) The method is called to remove given Item from the memory cache and permanent storage.void
store()
The method is called to store all data in the database.protected void
Methods inherited from class tigase.db.comp.UserRepoRepository
getItemsListPKey, setRepo
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 java.lang.Iterable
forEach, spliterator
Methods inherited from interface tigase.db.Repository
initRepository
-
Field Details
-
moveFromFilesystemToRepository
@ConfigField(desc="Automatically migrate certificates from filesystem to repository (and make backup)", alias="move-from-filesystem-to-repository") protected boolean moveFromFilesystemToRepository
-
-
Constructor Details
-
CertificateRepository
public CertificateRepository()
-
-
Method Details
-
addItem
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
- 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
- Specified by:
getConfigKey
in classConfigRepository<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
- Specified by:
getPropertyKey
in classConfigRepository<CertificateItem>
-
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
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.
-
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>
-
storeSingleItem
-