Home » Modeling » EMF » User control in CDO
User control in CDO [message #952799] |
Sun, 21 October 2012 20:00 |
UmaShankar Subramani Messages: 194 Registered: December 2011 Location: SWEDEN |
Senior Member |
|
|
Hi,
How difficult it would be to introduce some sort of User Control into CDO. For example, if there are 3 concurrent clients client-1, client-2 and client-3. Three colors are given for all three clients, for example client-1(blue) client-2(red) client-3(orange). If the client-1 locks a model, for everyone else, the lock should be shown in blue color. So that, everyone knows that it is locked by client-1.
To implement such thing, should I do it from scratch or, CDO has some in-built support for this?
|
|
|
Re: User control in CDO [message #952838 is a reply to message #952799] |
Sun, 21 October 2012 20:45 |
|
Am 21.10.2012 22:00, schrieb UmaShankar Subramani:
> Hi,
>
> How difficult it would be to introduce some sort of User Control into CDO. For example, if there are 3 concurrent
> clients client-1, client-2 and client-3. Three colors are given for all three clients, for example client-1(blue)
> client-2(red) client-3(orange). If the client-1 locks a model, for everyone else, the lock should be shown in blue
> color. So that, everyone knows that it is locked by client-1.
>
> To implement such thing, should I do it from scratch or, CDO has some in-built support for this?
I'm off for the EclipseCon now. I'll keep a flag on this thread and answer next week.
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
|
|
| |
Re: User control in CDO [message #961264 is a reply to message #952799] |
Sun, 28 October 2012 05:49 |
|
Am 21.10.2012 22:00, schrieb UmaShankar Subramani:
> Hi,
>
> How difficult it would be to introduce some sort of User Control into CDO. For example, if there are 3 concurrent
> clients client-1, client-2 and client-3. Three colors are given for all three clients, for example client-1(blue)
> client-2(red) client-3(orange). If the client-1 locks a model, for everyone else, the lock should be shown in blue
> color. So that, everyone knows that it is locked by client-1.
>
> To implement such thing, should I do it from scratch or, CDO has some in-built support for this?
CDO has strong support for locking and lock notifications which you've found out already:
/**
* A client-side representation of <i>all</i> the locks on a single CDOObject.
* <p>
* As an individual lock is always owned by view, which in turn is owned by a session, the methods on this interface
* return instances of {@link CDOLockOwner} which carry that information.
* <p>
*
* @author Caspar De Groot
* @since 4.1
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @apiviz.landmark
* @apiviz.has {@link java.lang.Object} oneway - - lockedObject
* @apiviz.owns {@link CDOLockOwner} - - readLockOwners
* @apiviz.has {@link CDOLockOwner} oneway - - writeLockOwner
* @apiviz.has {@link CDOLockOwner} oneway - - writeOptionOwner
*/
public interface CDOLockState
{
/**
* Gets a unique identifier for the object that is locked; typically a {@link CDOID} or a {@link CDOIDAndBranch},
* depending on whether branching support is enabled or not
*
* @return the identifier
*/
public Object getLockedObject();
/**
* If the 'others' argument is <code>false</code>, this method returns <code>true</code> if this lock is currently
* held by the <i>requesting</i> CDOView, <code>false</code> otherwise.
* <p>
* If the 'others' argument is <code>true</code>, this method returns <code>true</code> if this lock is currently held
* by <i>another</i> view (i.e. any view different from the requesting one), <code>false</code> otherwise.
*/
public boolean isLocked(LockType lockType, CDOLockOwner lockOwner, boolean others);
public Set<CDOLockOwner> getReadLockOwners();
public CDOLockOwner getWriteLockOwner();
public CDOLockOwner getWriteOptionOwner();
}
With the CDORemoteSessionManager you can find out the user of another session:
/**
* Represents a remote session that is connected to the same repository as the
* {@link CDORemoteSessionManager#getLocalSession() local session} that the {@link #getManager() remote session manager}
* points to.
*
* @author Eike Stepper
* @since 2.0
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface CDORemoteSession extends Comparable<CDORemoteSession>
{
/**
* Returns the remote session manager that manages this remote session.
*/
public CDORemoteSessionManager getManager();
/**
* Returns the session ID of this remote session.
*/
public int getSessionID();
/**
* Returns the user ID of this remote session.
*/
public String getUserID();
/**
* Returns <code>true</code> if this remote session is subscribed to changes in the set of remote sessions and
* delivers {@link MessageReceived custom data events}, <code>false</code> otherwise.
*/
public boolean isSubscribed();
/**
* Sends a unicast message to this remote session if it is subscribed.
*
* @return <code>true</code> if the server received the custom data message, <code>false</code> otherwise.
* <b>Note:</b> No assumption must be made on whether the recipient session received the message and was able
* to handle it adequately!
* @throws CDOException
* if this remote session is not subscribed.
* @see #isSubscribed()
* @since 3.0
*/
public boolean sendMessage(CDORemoteSessionMessage message);
}
There's also support for security/access control:
<!-- Example http://bugs.eclipse.org/380629
<securityManager type="default" realmPath="/security"/>
<securityManager type="annotation" realmPath="/security"/>
-->
It's up to you how you use these mechanisms in your user interface.
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
|
|
|
Re: User control in CDO [message #961271 is a reply to message #952799] |
Sun, 28 October 2012 05:49 |
|
Am 21.10.2012 22:00, schrieb UmaShankar Subramani:
> Hi,
>
> How difficult it would be to introduce some sort of User Control into CDO. For example, if there are 3 concurrent
> clients client-1, client-2 and client-3. Three colors are given for all three clients, for example client-1(blue)
> client-2(red) client-3(orange). If the client-1 locks a model, for everyone else, the lock should be shown in blue
> color. So that, everyone knows that it is locked by client-1.
>
> To implement such thing, should I do it from scratch or, CDO has some in-built support for this?
CDO has strong support for locking and lock notifications which you've found out already:
/**
* A client-side representation of <i>all</i> the locks on a single CDOObject.
* <p>
* As an individual lock is always owned by view, which in turn is owned by a session, the methods on this interface
* return instances of {@link CDOLockOwner} which carry that information.
* <p>
*
* @author Caspar De Groot
* @since 4.1
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @apiviz.landmark
* @apiviz.has {@link java.lang.Object} oneway - - lockedObject
* @apiviz.owns {@link CDOLockOwner} - - readLockOwners
* @apiviz.has {@link CDOLockOwner} oneway - - writeLockOwner
* @apiviz.has {@link CDOLockOwner} oneway - - writeOptionOwner
*/
public interface CDOLockState
{
/**
* Gets a unique identifier for the object that is locked; typically a {@link CDOID} or a {@link CDOIDAndBranch},
* depending on whether branching support is enabled or not
*
* @return the identifier
*/
public Object getLockedObject();
/**
* If the 'others' argument is <code>false</code>, this method returns <code>true</code> if this lock is currently
* held by the <i>requesting</i> CDOView, <code>false</code> otherwise.
* <p>
* If the 'others' argument is <code>true</code>, this method returns <code>true</code> if this lock is currently held
* by <i>another</i> view (i.e. any view different from the requesting one), <code>false</code> otherwise.
*/
public boolean isLocked(LockType lockType, CDOLockOwner lockOwner, boolean others);
public Set<CDOLockOwner> getReadLockOwners();
public CDOLockOwner getWriteLockOwner();
public CDOLockOwner getWriteOptionOwner();
}
With the CDORemoteSessionManager you can find out the user of another session:
/**
* Represents a remote session that is connected to the same repository as the
* {@link CDORemoteSessionManager#getLocalSession() local session} that the {@link #getManager() remote session manager}
* points to.
*
* @author Eike Stepper
* @since 2.0
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface CDORemoteSession extends Comparable<CDORemoteSession>
{
/**
* Returns the remote session manager that manages this remote session.
*/
public CDORemoteSessionManager getManager();
/**
* Returns the session ID of this remote session.
*/
public int getSessionID();
/**
* Returns the user ID of this remote session.
*/
public String getUserID();
/**
* Returns <code>true</code> if this remote session is subscribed to changes in the set of remote sessions and
* delivers {@link MessageReceived custom data events}, <code>false</code> otherwise.
*/
public boolean isSubscribed();
/**
* Sends a unicast message to this remote session if it is subscribed.
*
* @return <code>true</code> if the server received the custom data message, <code>false</code> otherwise.
* <b>Note:</b> No assumption must be made on whether the recipient session received the message and was able
* to handle it adequately!
* @throws CDOException
* if this remote session is not subscribed.
* @see #isSubscribed()
* @since 3.0
*/
public boolean sendMessage(CDORemoteSessionMessage message);
}
There's also support for security/access control:
<!-- Example http://bugs.eclipse.org/380629
<securityManager type="default" realmPath="/security"/>
<securityManager type="annotation" realmPath="/security"/>
-->
It's up to you how you use these mechanisms in your user interface.
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
|
|
|
Re: User control in CDO [message #961279 is a reply to message #952799] |
Sun, 28 October 2012 05:49 |
|
Am 21.10.2012 22:00, schrieb UmaShankar Subramani:
> Hi,
>
> How difficult it would be to introduce some sort of User Control into CDO. For example, if there are 3 concurrent
> clients client-1, client-2 and client-3. Three colors are given for all three clients, for example client-1(blue)
> client-2(red) client-3(orange). If the client-1 locks a model, for everyone else, the lock should be shown in blue
> color. So that, everyone knows that it is locked by client-1.
>
> To implement such thing, should I do it from scratch or, CDO has some in-built support for this?
CDO has strong support for locking and lock notifications which you've found out already:
/**
* A client-side representation of <i>all</i> the locks on a single CDOObject.
* <p>
* As an individual lock is always owned by view, which in turn is owned by a session, the methods on this interface
* return instances of {@link CDOLockOwner} which carry that information.
* <p>
*
* @author Caspar De Groot
* @since 4.1
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @apiviz.landmark
* @apiviz.has {@link java.lang.Object} oneway - - lockedObject
* @apiviz.owns {@link CDOLockOwner} - - readLockOwners
* @apiviz.has {@link CDOLockOwner} oneway - - writeLockOwner
* @apiviz.has {@link CDOLockOwner} oneway - - writeOptionOwner
*/
public interface CDOLockState
{
/**
* Gets a unique identifier for the object that is locked; typically a {@link CDOID} or a {@link CDOIDAndBranch},
* depending on whether branching support is enabled or not
*
* @return the identifier
*/
public Object getLockedObject();
/**
* If the 'others' argument is <code>false</code>, this method returns <code>true</code> if this lock is currently
* held by the <i>requesting</i> CDOView, <code>false</code> otherwise.
* <p>
* If the 'others' argument is <code>true</code>, this method returns <code>true</code> if this lock is currently held
* by <i>another</i> view (i.e. any view different from the requesting one), <code>false</code> otherwise.
*/
public boolean isLocked(LockType lockType, CDOLockOwner lockOwner, boolean others);
public Set<CDOLockOwner> getReadLockOwners();
public CDOLockOwner getWriteLockOwner();
public CDOLockOwner getWriteOptionOwner();
}
With the CDORemoteSessionManager you can find out the user of another session:
/**
* Represents a remote session that is connected to the same repository as the
* {@link CDORemoteSessionManager#getLocalSession() local session} that the {@link #getManager() remote session manager}
* points to.
*
* @author Eike Stepper
* @since 2.0
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface CDORemoteSession extends Comparable<CDORemoteSession>
{
/**
* Returns the remote session manager that manages this remote session.
*/
public CDORemoteSessionManager getManager();
/**
* Returns the session ID of this remote session.
*/
public int getSessionID();
/**
* Returns the user ID of this remote session.
*/
public String getUserID();
/**
* Returns <code>true</code> if this remote session is subscribed to changes in the set of remote sessions and
* delivers {@link MessageReceived custom data events}, <code>false</code> otherwise.
*/
public boolean isSubscribed();
/**
* Sends a unicast message to this remote session if it is subscribed.
*
* @return <code>true</code> if the server received the custom data message, <code>false</code> otherwise.
* <b>Note:</b> No assumption must be made on whether the recipient session received the message and was able
* to handle it adequately!
* @throws CDOException
* if this remote session is not subscribed.
* @see #isSubscribed()
* @since 3.0
*/
public boolean sendMessage(CDORemoteSessionMessage message);
}
There's also support for security/access control:
<!-- Example http://bugs.eclipse.org/380629
<securityManager type="default" realmPath="/security"/>
<securityManager type="annotation" realmPath="/security"/>
-->
It's up to you how you use these mechanisms in your user interface.
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
|
|
|
Goto Forum:
Current Time: Tue Sep 24 16:42:50 GMT 2024
Powered by FUDForum. Page generated in 0.02872 seconds
|