com.supermap.services.rest.repository

Class EhcacheRepoProvider

  • java.lang.Object
    • com.supermap.services.rest.repository.EhcacheRepoProvider


  • public class EhcacheRepoProvider
    extends java.lang.Object
    

    Temporary storage resources based on Ehcache

    Since:
    8.0.0
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean contain(java.lang.String groupId, java.lang.String id)
      Contains the temporary resource object
      void destroy()
      Destroy the warehouse
      java.lang.Object get(java.lang.String groupId, java.lang.String cacheId)
      Gets the temporary resource object
      java.util.List<java.lang.String> getAllStatusKeys(java.lang.String groupId)
      Gets the key-value list of all temporary resources
      java.util.Map<java.lang.String,java.lang.Object> getAllStatusObject(java.lang.String groupId)
      Gets all the mapping of temporary resources in the specified group
      boolean init(RepositorySetting setting)
      Initialize the temporary storage settings
      boolean remove(java.lang.String groupId, java.lang.String id)
      Deletes the temporary resource object
      boolean save(java.lang.String groupId, java.lang.String cacheId, java.lang.Object obj, int expire)
      Store the temporary resource
      boolean update(java.lang.String groupId, java.lang.String id, java.lang.Object toUpdate)
      Updates the temporary resource object
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EhcacheRepoProvider

        public EhcacheRepoProvider()
        
    • Method Detail

      • init

        public boolean init(RepositorySetting setting)
        

        Initialize the temporary storage settings

        Parameters:
        setting -
        Returns:
        Since:
        8.0.0
      • get

        public java.lang.Object get(java.lang.String groupId,
                           java.lang.String cacheId)
        

        Gets the temporary resource object

        Parameters:
        groupId -
        cacheId -
        Returns:
        Temporary resource object
        Since:
        8.0.0
      • contain

        public boolean contain(java.lang.String groupId,
                      java.lang.String id)
        

        Contains the temporary resource object

        Parameters:
        groupId -
        id -
        Returns:
        Whether to contain
        Since:
        8.0.0
      • save

        public boolean save(java.lang.String groupId,
                   java.lang.String cacheId,
                   java.lang.Object obj,
                   int expire)
        

        Store the temporary resource

        Parameters:
        groupId -
        cacheId -
        obj -
        expire - Saving time. The unit is the second
        Returns:
        Whether the storage is successful
        Since:
        8.0.0
      • getAllStatusObject

        public java.util.Map<java.lang.String,java.lang.Object> getAllStatusObject(java.lang.String groupId)
        

        Gets all the mapping of temporary resources in the specified group

        Parameters:
        groupId -
        Returns:
        All the mapping of temporary resources in the specified group
        Since:
        8.0.0
      • getAllStatusKeys

        public java.util.List<java.lang.String> getAllStatusKeys(java.lang.String groupId)
        

        Gets the key-value list of all temporary resources

        Parameters:
        groupId -
        Returns:
        Returns the key-value list of all temporary resources
        Since:
        8.0.0
      • update

        public boolean update(java.lang.String groupId,
                     java.lang.String id,
                     java.lang.Object toUpdate)
        

        Updates the temporary resource object

        Parameters:
        groupId -
        id -
        toUpdate -
        Returns:
        If it is updated successfully
        Since:
        8.0.0
      • remove

        public boolean remove(java.lang.String groupId,
                     java.lang.String id)
        

        Deletes the temporary resource object

        Parameters:
        groupId -
        id -
        Returns:
        If it is deleted successfully or not.
        Since:
        8.0.0
      • destroy

        public void destroy()
        

        Destroy the warehouse

        Since:
        8.0.0