|
Re: [CDO] Get locked_areas from CDO [message #1006064 is a reply to message #1006054] |
Tue, 29 January 2013 17:03 |
|
Am 29.01.2013 17:10, schrieb Tommaso De Sica:
> Goodevening,
>
> I need to retrieve lock_areas from CDO DB, because I want to know the user associated with a particular ID.
With "ID" are you referring to a durableLockingID like in CDOSession.openTransaction(String durableLockingID)?
Maybe you're looking for this server method:
org.eclipse.emf.cdo.common.lock.IDurableLockingManager.getLockArea(String)
You can find a usage example in org.eclipse.emf.cdo.internal.server.bundle.CDOCommandProvider.locks(CommandInterpreter):
protected void locks(final CommandInterpreter interpreter)
{
final InternalRepository repository = getRepository(interpreter,
"Syntax: cdo locks <repository-name> [<username-prefix>]");
final String userIDPrefix = nextArgument(interpreter, null);
new WithAccessor()
{
@Override
protected void doExecute(IStoreAccessor accessor)
{
repository.getLockingManager().getLockAreas(userIDPrefix, new IDurableLockingManager.LockArea.Handler()
{
public boolean handleLockArea(LockArea area)
{
interpreter.println(area.getDurableLockingID());
interpreter.println(INDENT + "userID = " + area.getUserID());
interpreter.println(INDENT + "branch = " + area.getBranch());
interpreter.println(INDENT + "timeStamp = " + CDOCommonUtil.formatTimeStamp(area.getTimeStamp()));
interpreter.println(INDENT + "readOnly = " + area.isReadOnly());
interpreter.println(INDENT + "locks = " + area.getLocks());
return true;
}
});
}
}.execute(repository);
}
If you need the infos at the client side you'll have to write a custom IQueryHandler and contribute it to the repository.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03644 seconds