com.sapportals.portal.pcd.gl

Interface ILockHandle


public interface ILockHandle

Provides access to the lock of a unit. Through this interface, applications can

Lock handles can be retrieved from IUnit.getLockHandle().

This interface is not intended to be implemented by clients.


Field Summary
static String LOCK_APPLICATION_ID
          Lock-Application-Id which is used for all locks in the Pcd GL
 
Method Summary
 ILock create(String userId, String sessionId, String description)
          Creates a new lock in the lock registry and returns a new instance of ILock) for the pcd unit to which this ILockHandle instance refers.
 ILock get()
          Returns a lock object for an existing lock for the Pcd unit.
 long getConfiguredLockLifespan()
          Return the configured value for the lifespan of a lock.
 long getConfiguredProtectionSpan()
          Returns the configured value for the protection span of a lock.
 

Field Detail

LOCK_APPLICATION_ID

static final String LOCK_APPLICATION_ID
Lock-Application-Id which is used for all locks in the Pcd GL

See Also:
Constant Field Values
Method Detail

getConfiguredProtectionSpan

long getConfiguredProtectionSpan()
                                 throws LockingException
Returns the configured value for the protection span of a lock. It is the protection span of a lock that has just been created (by calling create(java.lang.String, java.lang.String, java.lang.String)) or refreshed (by calling ILock.refresh(java.lang.String, java.lang.String) or ILock.getStateAndRefresh(java.lang.String, java.lang.String)).

Returns:
the maximum protection span of a lock in milliseconds
Throws:
LockingException - if the lock registry is not accessible, or some problem occured during LockHandle initialization
See Also:
getConfiguredLockLifespan()

getConfiguredLockLifespan

long getConfiguredLockLifespan()
                               throws LockingException
Return the configured value for the lifespan of a lock. It is the lifespan of a lock that has just been created (by calling create(java.lang.String, java.lang.String, java.lang.String)) or refreshed (by calling ILock.refresh(java.lang.String, java.lang.String) or ILock.getStateAndRefresh(java.lang.String, java.lang.String)). Locks that are older than the lifespan are automatically released.

Returns:
the maximum lifespan of a lock in milliseconds
Throws:
LockingException - if the lock registry is not accessible, or some problem occured during LockHandle initialization
See Also:
getConfiguredProtectionSpan()

create

ILock create(String userId,
             String sessionId,
             String description)
             throws LockingException
Creates a new lock in the lock registry and returns a new instance of ILock) for the pcd unit to which this ILockHandle instance refers. The lock will be owned by the provided user and session. The description can be used to store additional data for administrative purposes; this parameter is not considered by the lock service.
If a lock exists already for this pcd unit a LockingException will be thrown.

Parameters:
userId - id of the current user
sessionId - id of the current session
description - additional descriptive information about the lock
Returns:
the lock object representing the new lock
Throws:
LockingException - if the lock registry is not accessible, or
if a lock already exists

get

ILock get()
          throws LockingException
Returns a lock object for an existing lock for the Pcd unit. Owner and session of this lock can then be retrieved by using ILock.getUserId() and ILock.getSessionId().

Returns:
an active lock object for the current PCD object
Throws:
LockingException - if the lock registry is not accessible, or
if no lock exists
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-BASIS-API [sap.com] tc/epbc/pcd/gl/api - EP-PIN
[sap.com] EP-BASIS-API [sap.com] tc/epbc/pcd/gl/api api EP-PIN
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM
[sap.com] EP-BASIS [sap.com] tc/epbc/pcd/pars/srvgldeprecated api BC-PIN-PCD


Copyright 2011 SAP AG Complete Copyright Notice