You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Russ <ru...@kikuze.com> on 2002/06/04 03:53:38 UTC

How to achieve non-expiring lock?

Hi,
    I guess the subject says everything.

    I am using Slide API directly and NodeLock's constructor requires an 
expiry date parameter for locking a resource. What value do I need to 
pass in to get a non-expiring lock? Or must I explicitly code to renew 
the lock automatically on expiry?

Russ


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to achieve non-expiring lock?

Posted by Russ <ru...@kikuze.com>.
I see, so it seems that after setting a big value for expiration I will 
need to write extra code to renew the lock. Thanks.

Stephan Michels wrote:

>On Tue, 4 Jun 2002, Russ wrote:
>
>  
>
>>Hi,
>>    I guess the subject says everything.
>>
>>    I am using Slide API directly and NodeLock's constructor requires an
>>expiry date parameter for locking a resource. What value do I need to
>>pass in to get a non-expiring lock? Or must I explicitly code to renew
>>the lock automatically on expiry?
>>    
>>
>
>Take a look into LockMethod.java from the WebDAV server.
>
>                    // Resource type
>                    revisionDescriptor.setResourceType("<lock-null/>");
>
>                    // Creating the revision descriptor
>                    content.create(slideToken, lockInfo_lockSubject,
>                                   revisionDescriptor, null);
>
>                    // HACK
>                    // Setting a max timeout when creating a lock-null
>                    // resource because the associated lock-null wouldn't
>                    // be automatically removed when the lock expires
>                    lockDate = new Date((new Date()).getTime()
>                                        + (MAX_TIMEOUT * 1000));
>
>It seems that you have to set the resource type, and very big value for
>the lock date.
>
>Stephan Michels.
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>  
>


Re: How to achieve non-expiring lock?

Posted by Stephan Michels <st...@vern.chem.tu-berlin.de>.

On Tue, 4 Jun 2002, Russ wrote:

> Hi,
>     I guess the subject says everything.
>
>     I am using Slide API directly and NodeLock's constructor requires an
> expiry date parameter for locking a resource. What value do I need to
> pass in to get a non-expiring lock? Or must I explicitly code to renew
> the lock automatically on expiry?

Take a look into LockMethod.java from the WebDAV server.

                    // Resource type
                    revisionDescriptor.setResourceType("<lock-null/>");

                    // Creating the revision descriptor
                    content.create(slideToken, lockInfo_lockSubject,
                                   revisionDescriptor, null);

                    // HACK
                    // Setting a max timeout when creating a lock-null
                    // resource because the associated lock-null wouldn't
                    // be automatically removed when the lock expires
                    lockDate = new Date((new Date()).getTime()
                                        + (MAX_TIMEOUT * 1000));

It seems that you have to set the resource type, and very big value for
the lock date.

Stephan Michels.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>