com.supermap.services.rest.repository
Class MongoDBRepoProvider
- java.lang.Object
-
- com.supermap.services.rest.repository.MongoDBRepoProvider
-
public class MongoDBRepoProvider extends java.lang.ObjectThe 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
-
-
Constructor Summary
Constructors Constructor and Description MongoDBRepoProvider()
-
Method Summary
Methods Modifier and Type Method and Description booleancontain(java.lang.String groupId, java.lang.String id)Contains the temporary resource objectvoiddestroy()Destroy the warehousejava.lang.Objectget(java.lang.String groupId, java.lang.String cacheId)Gets the temporary resource objectjava.util.List<java.lang.String>getAllStatusKeys(java.lang.String groupId)Gets the key-value list of all temporary resourcesjava.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 indexjava.util.Map<java.lang.String,java.lang.Object>getAllStatusObject(java.lang.String groupId)Gets all the mapping of temporary resources in the specified groupjava.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 namebooleaninit(RepositorySetting setting)Initialize the temporary storage settingsbooleanremove(java.lang.String groupId, java.lang.String cacheId)Deletes the temporary resource objectbooleansave(java.lang.String groupId, java.lang.String cacheId, java.lang.Object obj, int holdTime)Store the temporary resourcebooleanupdate(java.lang.String groupId, java.lang.String cacheId, java.lang.Object toUpdated)Update the specified temporary resource cache object in the set
-
-
-
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 idcacheId- 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 indexingstartIndex- 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 idstartIndex- starts indexingstartIndex- 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 idcacheId- cache idobj- Temporary resource objectholdTime- 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
-
-