Package org.exoplatform.services.jcr.impl.core.lock.jbosscache

Examples of org.exoplatform.services.jcr.impl.core.lock.jbosscache.LockData


   private synchronized void internalLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      CacheableSessionLockManager sessionLockManager = sessionLockManagers.get(sessionId);
      if (sessionLockManager != null && sessionLockManager.containsPendingLock(nodeIdentifier))
      {
         LockData lockData = sessionLockManager.getPendingLock(nodeIdentifier);

         // add to DB for first
         LockJDBCConnection connection = null;
         try
         {
            // write to database
            connection = this.lockJDBCContainer.openConnection();
            connection.addLockData(lockData);
            connection.commit();

            // if any SQL exception, that nothing should be placed to cache
            Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());

            cache.put(lockPath, LOCK_DATA, lockData);

            sessionLockManager.notifyLockPersisted(nodeIdentifier);
         }
View Full Code Here


    * @param nodeIdentifier
    * @throws LockException
    */
   private synchronized void internalUnLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      LockData lData = getLockDataById(nodeIdentifier);

      if (lData != null)
      {
         LockJDBCConnection connection = null;
         try
View Full Code Here

    */
   public LockData getExactNodeOrCloseParentLock(NodeData node) throws RepositoryException
   {
      if (node == null)
         return null;
      LockData retval = null;
      retval = getLockDataById(node.getIdentifier());
      if (retval == null)
      {
         NodeData parentData = (NodeData)dataManager.getItemData(node.getParentIdentifier());
         if (parentData != null)
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public LockData getClosedChild(NodeData node) throws RepositoryException
   {
      LockData retval = null;

      List<NodeData> childData = dataManager.getChildNodesData(node);
      for (NodeData nodeData : childData)
      {
         retval = getLockDataById(nodeData.getIdentifier());
View Full Code Here

      return retval;
   }

   protected LockData getLockDataById(String nodeId) throws RepositoryException
   {
      LockData lData = (LockData)cache.get(makeLockFqn(nodeId), LOCK_DATA);

      if (lData != null)
      {
         return lData;
      }
View Full Code Here

         connection = this.lockJDBCContainer.openConnection();
         Set<String> nodesId = connection.getLockedNodes();
         List<LockData> locksData = new ArrayList<LockData>();
         for (String nodeId : nodesId)
         {
            LockData lockData = (LockData)cache.get(makeLockFqn(nodeId), LOCK_DATA);
            if (lockData != null)
            {
               locksData.add(lockData);
            }
            else
View Full Code Here

         getLockData.setString(2, wsName);
         // get result set
         ResultSet result = getLockData.executeQuery();
         if (result.next())
         {
            return new LockData(result.getString(COLUMN_NODE_ID), result.getString(COLUMN_TOKEN_HASH), result
               .getBoolean(COLUMN_IS_DEEP), result.getBoolean(COLUMN_IS_SESSIONSCOPED), result.getString(COLUMN_OWNER),
               result.getLong(COLUMN_TIMEOUT), result.getLong(COLUMN_BIRTHDAY));
         }
         return null;
      }
View Full Code Here

   private synchronized void internalLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      CacheableSessionLockManager sessionLockManager = sessionLockManagers.get(sessionId);
      if (sessionLockManager != null && sessionLockManager.containsPendingLock(nodeIdentifier))
      {
         LockData lockData = sessionLockManager.getPendingLock(nodeIdentifier);

         // add to DB for first
         LockJDBCConnection connection = null;
         try
         {
            // write to database
            connection = this.lockJDBCContainer.openConnection();
            connection.addLockData(lockData);
            connection.commit();

            // if any SQL exception, that nothing should be placed to cache
            Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());

            cache.put(lockPath, LOCK_DATA, lockData);

            sessionLockManager.notifyLockPersisted(nodeIdentifier);
         }
View Full Code Here

    * @param nodeIdentifier
    * @throws LockException
    */
   private synchronized void internalUnLock(String sessionId, String nodeIdentifier) throws RepositoryException
   {
      LockData lData = getLockDataById(nodeIdentifier);

      if (lData != null)
      {
         LockJDBCConnection connection = null;
         try
View Full Code Here

    */
   public LockData getExactNodeOrCloseParentLock(NodeData node) throws RepositoryException
   {
      if (node == null)
         return null;
      LockData retval = null;
      retval = getLockDataById(node.getIdentifier());
      if (retval == null)
      {
         NodeData parentData = (NodeData)dataManager.getItemData(node.getParentIdentifier());
         if (parentData != null)
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.core.lock.jbosscache.LockData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.