com.supermap.services.rest.repository
Class HsqldbRepoProvider
- java.lang.Object
-
- com.supermap.services.rest.repository.HsqldbRepoProvider
-
public class HsqldbRepoProvider extends java.lang.ObjectBased on the HSQL database temporary resource storage implementation, the warehouse supports multi-node sharing.
That is, iServer A created temporary resources, iServer B can also be seen, provided that iServer A and B share a Hsqldb service.
Built-in process cache, performance is relatively high- Since:
- 8.0.0
-
-
Constructor Summary
Constructors Constructor and Description HsqldbRepoProvider()
-
Method Summary
Methods Modifier and Type Method and Description booleancontain(java.lang.String groupId, java.lang.String id)protected voiddecodeParamResultEntity(ParamResultEntity obj)Hsqldb uses the fastjson class to serialize the java object internally.voiddestroy()protected ParamResultEntityencodeParamResultEntity(ParamResultEntity obj)Hsqldb uses the fastjson class to serialize the java object internally.java.lang.Objectget(java.lang.String groupId, java.lang.String id)java.util.List<java.lang.String>getAllStatusKeys(java.lang.String groupId)java.util.Map<java.lang.String,java.lang.Object>getAllStatusObject(java.lang.String groupId)protectedgetCache()protected HsqldbRepoProviderDaemongetDaemon()protected BasicDataSourcegetDatasoruce_previous()protected BasicDataSourcegetDatasoruce()protected intgetPort()booleaninit(RepositorySetting setting)protected booleaninit(RepositorySetting setting, com.supermap.services.rest.repository.HsqldbRepoProvider.DBCPDataSourceFactory dsFactory, HsqldbRepoProviderDaemon daemon)protected booleanisAvaliable()booleanremove(java.lang.String groupId, java.lang.String id)booleansave(java.lang.String groupId, java.lang.String id, java.lang.Object obj, int holdTime)booleanupdate(java.lang.String groupId, java.lang.String id, java.lang.Object toUpdate)
-
-
-
Method Detail
-
init
public boolean init(RepositorySetting setting)
-
init
protected boolean init(RepositorySetting setting, com.supermap.services.rest.repository.HsqldbRepoProvider.DBCPDataSourceFactory dsFactory, HsqldbRepoProviderDaemon daemon)
-
save
public boolean save(java.lang.String groupId, java.lang.String id, java.lang.Object obj, int holdTime)
-
encodeParamResultEntity
protected ParamResultEntity encodeParamResultEntity(ParamResultEntity obj)
Hsqldb uses the fastjson class to serialize the java object internally.
In the process of serializing a Map type object into a fastjson process, if the keys in the Map are of type Array, List, or Set, fastjson internally processes the array (json does not distinguish and unify the array)
So when the json is deserialized into a Map, fastjson deserializes the contents of the collection into JSONArray because it can not get the keys and the set type in the value according to the reflection.
This will cause unnecessary trouble with subsequent processing. So deal with a unified, incode the Map of the collection type.- Parameters:
obj-
-
decodeParamResultEntity
protected void decodeParamResultEntity(ParamResultEntity obj)
Hsqldb uses the fastjson class to serialize the java object internally.
In the process of serializing a Map type object into a fastjson process, if the keys in the Map are of type Array, List, or Set, fastjson internally processes the array (json does not distinguish and unify the array)
So when the json is deserialized into a Map, fastjson deserializes the contents of the collection into JSONArray because it can not get the keys and the set type in the value according to the reflection.
This will cause unnecessary trouble with subsequent processing. So deal with a unified, just do the next two decoding the fastjson anti-sequence out of the object. Solution out of JSONArray.- Parameters:
obj-
-
update
public boolean update(java.lang.String groupId, java.lang.String id, java.lang.Object toUpdate)
-
remove
public boolean remove(java.lang.String groupId, java.lang.String id)
-
contain
public boolean contain(java.lang.String groupId, java.lang.String id)
-
getAllStatusObject
public java.util.Map<java.lang.String,java.lang.Object> getAllStatusObject(java.lang.String groupId)
-
getAllStatusKeys
public java.util.List<java.lang.String> getAllStatusKeys(java.lang.String groupId)
-
get
public java.lang.Object get(java.lang.String groupId, java.lang.String id)
-
destroy
public void destroy()
-
getDatasoruce
protected BasicDataSource getDatasoruce()
-
getDatasoruce_previous
protected BasicDataSource getDatasoruce_previous()
-
getDaemon
protected HsqldbRepoProviderDaemon getDaemon()
-
getCache
protected getCache()
-
getPort
protected int getPort()
-
isAvaliable
protected boolean isAvaliable()
-
-