Search in sources :

Example 1 with ReplicaSharedObjectDescription

use of org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription in project ecf by eclipse.

the class GenericSharedObject method replicate.

protected void replicate(ID remote) {
    try {
        // Get current group membership
        ID[] group = getContext().getGroupMemberIDs();
        if (group == null || group.length < 1) {
            // we're done
            return;
        }
        ReplicaSharedObjectDescription createInfo = getReplicaDescription(remote);
        if (createInfo != null)
            getContext().sendCreate(remote, createInfo);
        else
            return;
    } catch (IOException e) {
        // $NON-NLS-1$
        log("Exception in replicate", e);
    }
}
Also used : ID(org.eclipse.ecf.core.identity.ID) IOException(java.io.IOException) ReplicaSharedObjectDescription(org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription)

Example 2 with ReplicaSharedObjectDescription

use of org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription in project ecf by eclipse.

the class HelloMessageSharedObject method getReplicaDescription.

protected ReplicaSharedObjectDescription getReplicaDescription(ID remoteID) {
    Object[] remoteArgs = { message, sender };
    HashMap map = new HashMap();
    map.put(ARGS_PROPERTY_NAME, remoteArgs);
    return new ReplicaSharedObjectDescription(getClass(), getID(), getConfig().getHomeContainerID(), map, getNextReplicateID());
}
Also used : HashMap(java.util.HashMap) ReplicaSharedObjectDescription(org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription)

Example 3 with ReplicaSharedObjectDescription

use of org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription in project ecf by eclipse.

the class TestMessagingSharedObject method getReplicaDescription.

/* (non-Javadoc)
	 * @see org.eclipse.ecf.core.sharedobject.BaseSharedObject#getReplicaDescription(org.eclipse.ecf.core.identity.ID)
	 */
protected ReplicaSharedObjectDescription getReplicaDescription(ID receiver) {
    // Put primary state into properties and include in replica description
    final Map properties = new HashMap();
    properties.put(NAME_PROPERTY, name);
    return new ReplicaSharedObjectDescription(this.getClass(), getConfig().getSharedObjectID(), getConfig().getHomeContainerID(), properties);
}
Also used : HashMap(java.util.HashMap) ReplicaSharedObjectDescription(org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription) Map(java.util.Map) HashMap(java.util.HashMap)

Example 4 with ReplicaSharedObjectDescription

use of org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription in project ecf by eclipse.

the class TestSharedObject method getReplicaDescription.

/* (non-Javadoc)
	 * @see org.eclipse.ecf.core.sharedobject.BaseSharedObject#getReplicaDescription(org.eclipse.ecf.core.identity.ID)
	 */
protected ReplicaSharedObjectDescription getReplicaDescription(ID receiver) {
    // Put primary state into properties and include in replica description
    final Map properties = new HashMap();
    properties.put(NAME_PROPERTY, name);
    return new ReplicaSharedObjectDescription(this.getClass(), getConfig().getSharedObjectID(), getConfig().getHomeContainerID(), properties);
}
Also used : HashMap(java.util.HashMap) ReplicaSharedObjectDescription(org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription) Map(java.util.Map) HashMap(java.util.HashMap)

Example 5 with ReplicaSharedObjectDescription

use of org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription in project ecf by eclipse.

the class ShowURLSharedObject method getReplicaDescription.

protected ReplicaSharedObjectDescription getReplicaDescription(ID remoteMember) {
    Object[] args = { receiver, url };
    HashMap map = new HashMap();
    map.put(ARGS_PROPERTY_NAME, args);
    return new ReplicaSharedObjectDescription(getClass(), getID(), getHomeContainerID(), map, getNextReplicateID());
}
Also used : HashMap(java.util.HashMap) GenericSharedObject(org.eclipse.ecf.example.collab.share.GenericSharedObject) ReplicaSharedObjectDescription(org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription)

Aggregations

ReplicaSharedObjectDescription (org.eclipse.ecf.core.sharedobject.ReplicaSharedObjectDescription)11 HashMap (java.util.HashMap)8 Map (java.util.Map)6 IOException (java.io.IOException)4 ID (org.eclipse.ecf.core.identity.ID)3 ArrayList (java.util.ArrayList)2 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)2 URISyntaxException (java.net.URISyntaxException)1 PermissionCollection (java.security.PermissionCollection)1 List (java.util.List)1 PlatformObject (org.eclipse.core.runtime.PlatformObject)1 IConnectHandlerPolicy (org.eclipse.ecf.core.security.IConnectHandlerPolicy)1 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)1 ISharedObjectContainerGroupManager (org.eclipse.ecf.core.sharedobject.ISharedObjectContainerGroupManager)1 ISharedObjectContext (org.eclipse.ecf.core.sharedobject.ISharedObjectContext)1 ISharedObjectPolicy (org.eclipse.ecf.core.sharedobject.security.ISharedObjectPolicy)1 GenericSharedObject (org.eclipse.ecf.example.collab.share.GenericSharedObject)1 SOContainerConfig (org.eclipse.ecf.provider.generic.SOContainerConfig)1 IPublishedService (org.eclipse.ecf.pubsub.IPublishedService)1 PublishedServiceDescriptor (org.eclipse.ecf.pubsub.PublishedServiceDescriptor)1