com.supermap.services.rest.repository

Class HsqldbRepoProvider

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


  • public class HsqldbRepoProvider
    extends java.lang.Object
    

    Based 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
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean contain(java.lang.String groupId, java.lang.String id) 
      protected void decodeParamResultEntity(ParamResultEntity obj)
      Hsqldb uses the fastjson class to serialize the java object internally.
      void destroy() 
      protected ParamResultEntity encodeParamResultEntity(ParamResultEntity obj)
      Hsqldb uses the fastjson class to serialize the java object internally.
      java.lang.Object get(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) 
      protected getCache() 
      protected HsqldbRepoProviderDaemon getDaemon() 
      protected BasicDataSource getDatasoruce_previous() 
      protected BasicDataSource getDatasoruce() 
      protected int getPort() 
      boolean init(RepositorySetting setting) 
      protected boolean init(RepositorySetting setting, com.supermap.services.rest.repository.HsqldbRepoProvider.DBCPDataSourceFactory dsFactory, HsqldbRepoProviderDaemon daemon) 
      protected boolean isAvaliable() 
      boolean remove(java.lang.String groupId, java.lang.String id) 
      boolean save(java.lang.String groupId, java.lang.String id, java.lang.Object obj, int holdTime) 
      boolean update(java.lang.String groupId, java.lang.String id, java.lang.Object toUpdate) 
      • Methods inherited from class java.lang.Object

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

      • HsqldbRepoProvider

        public HsqldbRepoProvider()
        
    • 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()
        
      • getCache

        protected  getCache()
        
      • getPort

        protected int getPort()
        
      • isAvaliable

        protected boolean isAvaliable()