Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.LockResult


        return null;
    }

    public LockToken createAndLock(String name, LockTimeout timeout, LockInfo lockInfo) {
        TTempResource temp = new TTempResource(this, name);
        LockResult r = temp.lock(timeout, lockInfo);
        if( r.isSuccessful() ) {
            return r.getLockToken();
        } else {
            throw new RuntimeException("didnt lock");
        }
    }
View Full Code Here


  public LockToken createAndLock(String name, LockTimeout timeout, LockInfo lockInfo) throws NotAuthorizedException {
    File dest = new File(this.getFile(), name);
    createEmptyFile(dest);
    FsFileResource newRes = new FsFileResource(host, factory, dest);
    LockResult res = newRes.lock(timeout, lockInfo);
    return res.getLockToken();
  }
View Full Code Here

        LockTimeout timeout = new LockTimeout( 100l );
        LockInfo lockInfo = new LockInfo( LockInfo.LockScope.NONE, LockInfo.LockType.READ, "me", LockInfo.LockDepth.ZERO );
        FsResource resource = new FsFileResource( null, null, new File( File.pathSeparator ) );

        // lock it
        LockResult res = lockManager.lock( timeout, lockInfo, resource );
        assertNotNull( res );
        assertTrue( res.isSuccessful() );

        // check is locked
        LockToken token = lockManager.getCurrentToken( resource );
        assertNotNull( token );
        assertEquals( token.tokenId, res.getLockToken().tokenId );

        // unlock
        lockManager.unlock( token.tokenId, resource );

        // check removed
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug(String.format("Lock: %s", resourceXmldbUri));
        }
       
        LockResult lr = null;
        try {
            org.exist.dom.LockToken existLT = existDocument.lock(inputToken);

            // Process result
            LockToken mltonLT = convertToken(existLT);
View Full Code Here

       
        if(LOG.isDebugEnabled()) {
            LOG.debug(String.format("Refresh: %s token=%s", resourceXmldbUri, token));
        }

        LockResult lr = null;
        try {
            org.exist.dom.LockToken existLT = existDocument.refreshLock(token);

            // Process result
            LockToken mltonLT = convertToken(existLT);
View Full Code Here

        LockInfo lockInfo = new LockInfo(LockInfo.LockScope.NONE, LockInfo.LockType.READ, token, LockInfo.LockDepth.ZERO);
        LockTimeout lockTime = new LockTimeout(Long.MAX_VALUE);

        LockToken lockToken = new LockToken(token, lockInfo, lockTime);

        return new LockResult(LockResult.FailureReason.PRECONDITION_FAILED, lockToken);
    }
View Full Code Here

   */
  public LockToken createAndLock( String name, LockTimeout timeout, LockInfo lockInfo ) throws NotAuthorizedException {
    File dest = new File( this.getRealFile(), name );
    createEmptyFile( dest );
    OverEncryptedFileResource newRes = new OverEncryptedFileResource( host, factory, dest, ownerId, true,false);
    LockResult res = newRes.lock( timeout, lockInfo );
    return res.getLockToken();
  }
View Full Code Here

  }

  public LockResult lock(LockTimeout timeout, LockInfo lockInfo)
      throws NotAuthorizedException, PreConditionFailedException,
      LockedException {
    return new LockResult(null, new LockToken(new ObjectId().toString(),
        lockInfo, timeout));
  }
View Full Code Here

  }

  public LockResult lock(LockTimeout timeout, LockInfo lockInfo)
      throws NotAuthorizedException, PreConditionFailedException,
      LockedException {
    return new LockResult(null, new LockToken(new ObjectId().toString(),
        lockInfo, timeout));
  }
View Full Code Here

TOP

Related Classes of com.bradmcevoy.http.LockResult

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.