The Jakarta Project The Jakarta Slide Project

Main

Resources

User's Guide

Administrator's Guide

HOW-TOs

Programmer's Corner

Slide API

Reference

Overview

Locking is an integral part of Slide. Its model resembles in many ways the security model. When a subject (ie. a user) wants to lock a subject (ie. a file), it specifies which actions (ie. read) are locked and for how long.

Slide automatically checks if a subject is locked before every action. Alternatively, the client application can directly check for whether a particular subject is locked or whether it can actually lock a given subject.

Principles

Every SubjectNode can potentially be locked. A lock consist of the following information tuple:

(target subject,      owner subject,    locked action,   duration,    inheritance)

Here are examples of locks :

(/foo/document.txt,  /user/dave,        /actions/read,     10m,       no)
(/foo/document.txt,  /user/dave,        /actions/write,    10m,       no)
(/foo,               /user/john,        /actions/read,     5m,        yes)

Same as permissions, locks granted on an object are inherited (unless specified otherwise during locking) by the children of the object. For example, a lock obtained on object whose URI is /foo would also apply to the object /foo/bar.

Behavior

Slide automatically enforces all locks through the use of helper functions used by the client application. If a subject (ie. a file) is accessed and the action is already locked by another subject (ie. another client) an ObjectLockedException is thrown, which is a checked exception, so the client application will know that an underlying lock check failed, and will take appropriate actions.

Object Model
NodeLock

The NodeLock class represents a lock.

  • Id: Lock Id (unique).
  • Object: Uri of the node associated to the lock.
  • Subject: Lock owner.
  • Type: Action which is locked (to perform the action, the lock Id must be present in the SlideToken).
  • Exclusive: True if the lock is exclusive. Multiple non-exclusive locks can be obtained on the same node for the same action (type).
  • Inheritable: True if the lock also applies to the children of the node it is associated with.


Copyright © 1999-2001, Apache Software Foundation