当前位置: 首页>>代码示例>>Java>>正文


Java LockInfo类代码示例

本文整理汇总了Java中org.apache.jackrabbit.webdav.lock.LockInfo的典型用法代码示例。如果您正苦于以下问题:Java LockInfo类的具体用法?Java LockInfo怎么用?Java LockInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LockInfo类属于org.apache.jackrabbit.webdav.lock包,在下文中一共展示了LockInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refreshLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock refreshLock( LockInfo lockInfo, String lockToken )
    throws DavException
{
    if ( !exists() )
    {
        throw new DavException( DavServletResponse.SC_NOT_FOUND );
    }
    ActiveLock lock = getLock( lockInfo.getType(), lockInfo.getScope() );
    if ( lock == null )
    {
        throw new DavException( DavServletResponse.SC_PRECONDITION_FAILED,
                                "No lock with the given type/scope present on resource " + getResourcePath() );
    }

    lock = lockManager.refreshLock( lockInfo, lockToken, this );

    return lock;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:ArchivaDavResource.java

示例2: testLockIfResourceUnlockable

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testLockIfResourceUnlockable()
    throws Exception
{
    assertEquals( 0, resource.getLocks().length );

    LockInfo info = new LockInfo( Scope.SHARED, Type.WRITE, "/", 0, false );
    try
    {
        lockManager.createLock( info, resource );
        fail( "Did not throw dav exception" );
    }
    catch ( Exception e )
    {
        // Simple lock manager will die
    }
    assertEquals( 0, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java

示例3: testRefreshLockThrowsExceptionIfNoLockIsPresent

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testRefreshLockThrowsExceptionIfNoLockIsPresent()
    throws Exception
{
    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );

    assertEquals( 0, resource.getLocks().length );

    try
    {
        lockManager.refreshLock( info, "notoken", resource );
        fail( "Did not throw dav exception" );
    }
    catch ( DavException e )
    {
        assertEquals( DavServletResponse.SC_PRECONDITION_FAILED, e.getErrorCode() );
    }

    assertEquals( 0, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:21,代码来源:DavResourceTest.java

示例4: testUnlockThrowsDavExceptionIfNotLocked

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testUnlockThrowsDavExceptionIfNotLocked()
    throws Exception
{
    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );

    assertEquals( 0, resource.getLocks().length );

    lockManager.createLock( info, resource );

    assertEquals( 1, resource.getLocks().length );

    try
    {
        lockManager.releaseLock( "BLAH", resource );
        fail( "Did not throw DavException" );
    }
    catch ( DavException e )
    {
        assertEquals( DavServletResponse.SC_LOCKED, e.getErrorCode() );
    }

    assertEquals( 1, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:25,代码来源:DavResourceTest.java

示例5: refreshLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock refreshLock(LockInfo lockInfo, String lockToken) throws DavException{
	if(lockable){
		if (!exists()) {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
        }
        ActiveLock lock = getLock(lockInfo.getType(), lockInfo.getScope());
        if (lock == null) {
            throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "No lock with the given type/scope present on resource " + getResourcePath());
        }
        lock = lockManager.refreshLock(lockInfo, lockToken, this);
        /* since lock has infinite lock (simple) or undefined timeout (jcr)
           return the lock as retrieved from getLock. */
        return lock;
	}else{
		throw new UnsupportedOperationException();	
	}
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:18,代码来源:RegistryResource.java

示例6: testLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testLock()
    throws Exception
{
    assertEquals( 0, resource.getLocks().length );

    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
    lockManager.createLock( info, resource );

    assertEquals( 1, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:12,代码来源:DavResourceTest.java

示例7: testGetLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testGetLock()
    throws Exception
{
    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );
    lockManager.createLock( info, resource );

    assertEquals( 1, resource.getLocks().length );

    // Lock should exist
    assertNotNull( resource.getLock( Type.WRITE, Scope.EXCLUSIVE ) );

    // Lock should not exist
    assertNull( resource.getLock( Type.WRITE, Scope.SHARED ) );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:16,代码来源:DavResourceTest.java

示例8: lock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock lock(LockInfo lockInfo) throws DavException {
	if(lockable){
		 if (isLockable(lockInfo.getType(), lockInfo.getScope())) {
                return lockManager.createLock(lockInfo, this);
        } else {
            throw new DavException(DavServletResponse.SC_PRECONDITION_FAILED, "Unsupported lock type or scope.");
        }
	}else{
		throw new UnsupportedOperationException();	
	}
      
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:13,代码来源:RegistryResource.java

示例9: lock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock lock( LockInfo arg0 )
    throws DavException
{
    return null;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:ArchivaVirtualDavResource.java

示例10: refreshLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public ActiveLock refreshLock( LockInfo arg0, String arg1 )
    throws DavException
{
    return null;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:ArchivaVirtualDavResource.java

示例11: testRefreshLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testRefreshLock()
    throws Exception
{
    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );

    assertEquals( 0, resource.getLocks().length );

    lockManager.createLock( info, resource );

    assertEquals( 1, resource.getLocks().length );

    ActiveLock lock = resource.getLocks()[0];

    lockManager.refreshLock( info, lock.getToken(), resource );

    assertEquals( 1, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java

示例12: testUnlock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Test
public void testUnlock()
    throws Exception
{
    LockInfo info = new LockInfo( Scope.EXCLUSIVE, Type.WRITE, "/", 0, false );

    assertEquals( 0, resource.getLocks().length );

    lockManager.createLock( info, resource );

    assertEquals( 1, resource.getLocks().length );

    ActiveLock lock = resource.getLocks()[0];

    lockManager.releaseLock( lock.getToken(), resource );

    assertEquals( 0, resource.getLocks().length );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:DavResourceTest.java

示例13: lock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public
@Nullable
ActiveLock lock( @Nullable LockInfo lockInfo ) throws DavException {
    return lockManager.createLock( lockInfo, this );
}
 
开发者ID:openCage,项目名称:niodav,代码行数:7,代码来源:DavPath.java

示例14: refreshLock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
@Override
public
@Nullable
ActiveLock refreshLock( @Nullable LockInfo lockInfo, @Nullable String lockToken ) throws DavException {
    return lockManager.refreshLock( lockInfo, lockToken, this );
}
 
开发者ID:openCage,项目名称:niodav,代码行数:7,代码来源:DavPath.java

示例15: lock

import org.apache.jackrabbit.webdav.lock.LockInfo; //导入依赖的package包/类
public ActiveLock lock(LockInfo reqLockInfo)
    throws DavException {
    // nothing is lockable at the moment
    throw new PreconditionFailedException("Resource not lockable");
}
 
开发者ID:1and1,项目名称:cosmo,代码行数:6,代码来源:DavResourceBase.java


注:本文中的org.apache.jackrabbit.webdav.lock.LockInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。