Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.LockTimeout


    public LockToken getCurrentLock() {
        if( this.lock == null ) return null;
        LockToken token = new LockToken();
        token.info = this.lock.lockInfo;
        token.timeout = new LockTimeout( this.lock.seconds );
        token.tokenId = this.lock.lockId;


        return token;
View Full Code Here


        this.lock = new TLock( lockedUntil.date, UUID.randomUUID().toString(), lockedUntil.seconds, lockInfo );

        LockToken token = new LockToken();
        token.info = lockInfo;
        token.timeout = new LockTimeout( lockedUntil.seconds );
        token.tokenId = this.lock.lockId;

        return LockResult.success( token );
    }
View Full Code Here

    }

    LockToken makeToken() {
        LockToken token = new LockToken();
        token.info = lock.lockInfo;
        token.timeout = new LockTimeout( lock.seconds );
        token.tokenId = lock.lockId;
        return token;
    }
View Full Code Here

   
   
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    XmlWriter xmlWriter = new XmlWriter(out);
    LockInfo lockInfo = new LockInfo(LockInfo.LockScope.EXCLUSIVE, LockInfo.LockType.READ, null, LockInfo.LockDepth.ZERO);
    LockTimeout lockTimeout = new LockTimeout(1000l);
    LockToken token = new LockToken("abc123", lockInfo, lockTimeout);
    Map<String,String> prefixes = new HashMap<String, String>();
   
    valueWriter.writeValue(xmlWriter, "uri", "ns", "aName", locks, "/test", prefixes);
   
View Full Code Here

  public void testWriteValue() {
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    XmlWriter xmlWriter = new XmlWriter(out);
    LockInfo lockInfo = new LockInfo(LockInfo.LockScope.EXCLUSIVE, LockInfo.LockType.READ, null, LockInfo.LockDepth.ZERO);
    LockTimeout lockTimeout = new LockTimeout(1000l);
    LockToken token = new LockToken("abc123", lockInfo, lockTimeout);
    Map<String,String> prefixes = new HashMap<String, String>();
   
    valueWriter.writeValue(xmlWriter, "ns", "pre", "lock", token, "/test", prefixes);
   
View Full Code Here

        lockManager = new FsMemoryLockManager();
    }

   
    public void testLockUnLock() throws NotAuthorizedException {
        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 );
View Full Code Here

        // Special treatment infinite lock
        } else if(timeout == org.exist.dom.LockToken.LOCK_TIMEOUT_INFINITE){
            timeout=Long.MAX_VALUE;
        }

        LockTimeout lt = new LockTimeout(timeout);

        // Token Id
        String id = existLT.getOpaqueLockToken();

        // Return values in Milton object
View Full Code Here

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

        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

TOP

Related Classes of com.bradmcevoy.http.LockTimeout

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.