com.supermap.services.rest.repository

Class MongoDBRepoProvider

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


  • public class MongoDBRepoProvider
    extends java.lang.Object
    
    The temporary storage resources based on MongoDB
    Support to delete the obsolete; Support to browse in pages; Support the second level cache in thread
    Known problems:
    1. the expiration time needs to consider the differences between MongoDBCacheProvider and MongoDB. There is no way temporarily, added to the FAQ
    • 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.List<java.lang.String> getAllStatusKeys(java.lang.String groupId, int startIndex, int toIndex)
      Get the key-value list of the temporary resources from the start index to the end index
      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
      java.util.Map<java.lang.String,java.lang.Object> getAllStatusObject(java.lang.String groupId, int startIndex, int toIndex)
      Get the temporary resources mapping table from the start index to the end index in the specified group name
      boolean init(RepositorySetting setting)
      Initialize the temporary storage settings
      boolean remove(java.lang.String groupId, java.lang.String cacheId)
      Deletes the temporary resource object
      boolean save(java.lang.String groupId, java.lang.String cacheId, java.lang.Object obj, int holdTime)
      Store the temporary resource
      boolean update(java.lang.String groupId, java.lang.String cacheId, java.lang.Object toUpdated)
      Update the specified temporary resource cache object in the set
      • Methods inherited from class java.lang.Object

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

      • MongoDBRepoProvider

        public MongoDBRepoProvider()
        
    • Method Detail

      • init

        public boolean init(RepositorySetting setting)
        

        Initialize the temporary storage settings

        Parameters:
        setting - The settings of temporary storage
        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 - group id
        cacheId - cache id
        Returns:
        Returns the temporary resource object
        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:
        All the key-value list of all temporary resources
        Since:
        8.0.0
      • getAllStatusKeys

        public java.util.List<java.lang.String> getAllStatusKeys(java.lang.String groupId,
                                                        int startIndex,
                                                        int toIndex)
        

        Get the key-value list of the temporary resources from the start index to the end index

        Parameters:
        groupId -
        startIndex - starts indexing
        startIndex - ends indexing
        Returns:
        The key-value list of temporary resources
        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
      • getAllStatusObject

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

        Get the temporary resources mapping table from the start index to the end index in the specified group name

        Parameters:
        groupId - group name id
        startIndex - starts indexing
        startIndex - ends indexing
        Returns:
        temporary resource mapping table
        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. Yes returns true; no returns false
        Since:
        8.0.0
      • save

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

        Store the temporary resource

        Parameters:
        groupId - group name id
        cacheId - cache id
        obj - Temporary resource object
        holdTime - Saving time. The unit is the second
        Returns:
        Whether the storage is successful
        Since:
        8.0.0
      • update

        public boolean update(java.lang.String groupId,
                     java.lang.String cacheId,
                     java.lang.Object toUpdated)
        

        Update the specified temporary resource cache object in the set

        Parameters:
        groupId -
        cacheId -
        toUpdated -
        Returns:
        Since:
        8.0.0
      • remove

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

        Deletes the temporary resource object

        Parameters:
        groupId -
        cacheId -
        Returns:
        Since:
        8.0.0
      • destroy

        public void destroy()
        

        Destroy the warehouse

        Since:
        8.0.0