Class LockRepositoryImpl

    • Constructor Summary

      Constructors 
      Constructor Description
      LockRepositoryImpl​(javax.sql.DataSource dataSource)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean lockTask​(java.lang.String key, java.lang.String method, long time, java.lang.String server)
      Acquire task lock from database
      • Methods inherited from class java.lang.Object

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

      • LOCK_SELECT_QUERY

        protected static final java.lang.String LOCK_SELECT_QUERY
        See Also:
        Constant Field Values
      • LOCK_INSERT_QUERY

        protected static final java.lang.String LOCK_INSERT_QUERY
        See Also:
        Constant Field Values
      • LOCK_COUNT_QUERY

        protected static final java.lang.String LOCK_COUNT_QUERY
        See Also:
        Constant Field Values
    • Constructor Detail

      • LockRepositoryImpl

        @Autowired
        public LockRepositoryImpl​(@Qualifier("snapDataSource")
                                  javax.sql.DataSource dataSource)
    • Method Detail

      • lockTask

        public boolean lockTask​(java.lang.String key,
                                java.lang.String method,
                                long time,
                                java.lang.String server)
                         throws DatabaseException
        Description copied from interface: LockRepository
        Acquire task lock from database
        Specified by:
        lockTask in interface LockRepository
        Parameters:
        key - that identifies task
        method - class and method where task was running
        time - to lock task
        server - identification (server hostname)
        Returns:
        true if can acquire lock or false if not
        Throws:
        DatabaseException - that was thrown when do not have database configured