main/ucb/source/ucp/webdav/SerfSession.cxx
// -------------------------------------------------------------------
// LOCK (refresh existing lock from SerfLockStore)
// -------------------------------------------------------------------
LOCK (refresh existing lock from SerfLockStore)
LOCK ( refresh existing lock from SerfLockStore )
bool SerfSession::LOCK( SerfLock * pLock,
                        sal_Int32 & rlastChanceToSendRefreshRequest )
{
    osl::Guard< osl::Mutex > theGuard( m_aMutex );
    rtl::OUString inPath = pLock->getResourcePath();
    boost::shared_ptr<SerfRequestProcessor> aReqProc( createReqProc( inPath ) );
    apr_status_t status = APR_SUCCESS;
    DAVPropertyValue outLock;
    TimeValue startCall;
    osl_getSystemTime( &startCall );
    aReqProc->processLockRefresh( inPath, pLock->getLock(), outLock, status);
    HandleError will handle the error and throw an exception, if needed
    HandleError( aReqProc );
    uno::Sequence< ucb::Lock >      aLocks;
    outLock.Value >>= aLocks;
    ucb::Lock aLock = aLocks[0];
     if ok, update the lastchance refresh time in lock
    rlastChanceToSendRefreshRequest
        = lastChanceToSendRefreshRequest( startCall, static_cast< sal_Int32 >(aLock.Timeout) );
    return true;
}
bool SerfSession :: LOCK ( SerfLock * pLock , sal_Int32 & rlastChanceToSendRefreshRequest ) { osl :: Guard < osl :: Mutex > theGuard ( m_aMutex ) ; rtl :: OUString inPath = pLock -> getResourcePath ( ) ; boost :: shared_ptr < SerfRequestProcessor > aReqProc ( createReqProc ( inPath ) ) ; apr_status_t status = APR_SUCCESS ; DAVPropertyValue outLock ; TimeValue startCall ; osl_getSystemTime ( & startCall ) ; aReqProc -> processLockRefresh ( inPath , pLock -> getLock ( ) , outLock , status ) ; HandleError ( aReqProc ) ; uno :: Sequence < ucb :: Lock > aLocks ; outLock . Value >>= aLocks ; ucb :: Lock aLock = aLocks [ 0 ] ; rlastChanceToSendRefreshRequest = lastChanceToSendRefreshRequest ( startCall , static_cast < sal_Int32 > ( aLock . Timeout ) ) ; return true ; }
LOCK (refresh existing lock from SerfLockStore)
LOCK ( refresh existing lock from SerfLockStore )
// the returned property, a sequence of locks // only the first is used // refresh existing lock. // TODO: possible enhancement as the following: // - use an interaction handler to alert the user if the lock was not refreshed, //   offering to try again with a new session, asking the user for credential, if necessary. //   This may happen if the WebDAV server goes off-line for whatever reason, or the connection is dropped for time-out //   To implement this behavior, some redesigning of the current session implementation may be needed. // //HandleError will handle the error and throw an exception, if needed // if ok, update the lastchance refresh time in lock