Class ResCatStoPool


  • public class ResCatStoPool
    extends Object
    Pool for Resource Catalogue Storages
    Author:
    Niko Siltala
    • Method Detail

      • getInstance

        public static ResCatStoPool getInstance()
        Gets the common instance of this pool of Resource Catalogue Storages
        Returns:
        Singleton instance of this class
      • getStorageKeys

        public Set<String> getStorageKeys()
        Gets the list of the IDs of available Resource Catalogue Storages in this pool
        Returns:
        Set(storage name/ID as String)
      • getStorage_byId

        public ResCatStoImpl getStorage_byId​(String id)
        Gets specific Resource Catalogue Storage from the pool
        Parameters:
        id - ID of the Storage
        Returns:
        Resource Catalogue Storage. Returns null if it does not exist.
      • getStorage_byName

        public ResCatStoImpl getStorage_byName​(String name)
        Gets specific Resource Catalogue Storage from the pool
        Parameters:
        name - Name of the Storage
        Returns:
        Resource Catalogue Storage. Returns null if it does not exist.
      • addStorage

        public boolean addStorage​(String id,
                                  ResCatStoImpl storage)
        Adds specific Resource Catalogue Storage to the pool
        Parameters:
        id - to be used. If null, tries to get it from inside ResCatStoImpl.
        storage - Resource Catalogue storage instance
        Returns:
        true if adding is successful
      • removeFromStorage

        public boolean removeFromStorage​(String id)
        Removes specific Resource Catalogue Storage from the pool
        Parameters:
        id - ID of the removed Storage
        Returns:
        if removal was successful
      • reinitialiseStorages

        public boolean reinitialiseStorages()
        Re-initialises the Storage Pool with data from (updated) configuration. First it removes all previous resources from the pool.
        Returns:
        True if all went ok.
      • getStoragePool

        protected Map<String,​ResCatStoImpl> getStoragePool()
        Gets the entire Storage Pool
        Returns:
        Map(String, ResCatStoImpl)