org.eclipse.ecf.core.sharedobject

## Interface ISharedObjectManager

All Known Implementing Classes:
  SOManager

    public interface ISharedObjectManager

Manager for creating, disposing, and accessing ISharedObjects from an ISharedObjectContainer.

See Also:
  `ISharedObjectContainer.getSharedObjectManager()`

### Method Summary

All Methods Instance Methods Abstract Methods
`ID` `addSharedObject(ID sharedObjectID, ISharedObject sharedObject, Map properties)` Add an ISharedObject to this container.
`ISharedObjectConnector` `connectSharedObjects(ID sharedObjectFrom, ID[] sharedObjectsTo)` Create an ISharedObjectConnector instance for sending messages from a single ISharedObject to one or more receiver ISharedObjects.
`ID` `createSharedObject(SharedObjectDescription sd)` Create a new ISharedObject within this container from the given SharedObjectDescription.
`void` `disconnectSharedObjects(ISharedObjectConnector connector)` Destroy an ISharedObjectConnector instance.
`ISharedObject` `getSharedObject(ID sharedObjectID)` Get the ISharedObject instance corresponding to the given sharedObjectID.
`List` `getSharedObjectConnectors(ID sharedObjectFrom)` Get the sharedObjectConnectors associated with the given sharedObjectID
`ID[]` `getSharedObjectIDs()` Get the array of SharedObject instances currently contained by this ISharedObjectContainer
`ISharedObject` `removeSharedObject(ID sharedObjectID)` Remove the given sharedObjectID from this ISharedObjectContainer.
`void` `setRemoteAddPolicy(ISharedObjectPolicy policy)` Set this shared object manager's policy for adding remote shared objects.

### Method Detail

#### addSharedObject

    ID addSharedObject(ID sharedObjectID,
                       ISharedObject sharedObject,
                       Map properties)
                throws SharedObjectAddException

Add an ISharedObject to this container.

Parameters:
  `sharedObjectID` - the ID of new SharedObject
  `sharedObject` - the ISharedObject instance to add
  `properties` - the Map associated with the added ISharedObject
Returns:
  ID the sharedObjectID of the added ISharedObject
Throws:
  `SharedObjectAddException` - if the add cannot be accomplished for any reason

#### connectSharedObjects

    ISharedObjectConnector connectSharedObjects(ID sharedObjectFrom,
                                                ID[] sharedObjectsTo)
                                         throws SharedObjectConnectException

Create an ISharedObjectConnector instance for sending messages from a single ISharedObject to one or more receiver ISharedObjects. All specified ISharedObject instances must be contained by this ISharedObjectContainer.

Parameters:
  `sharedObjectFrom` - the ID of the sender ISharedObject
  `sharedObjectsTo` - the ID[] of the receiver ISharedObjects
Returns:
  a valid instance of ISharedObjectConnector. Null if no connector can be made
Throws:
  `SharedObjectConnectException` - thrown if specified sender or receivers do not exist within the context of this container

#### createSharedObject

    ID createSharedObject(SharedObjectDescription sd)
                   throws SharedObjectCreateException

Create a new ISharedObject within this container from the given SharedObjectDescription.

Parameters:
  `sd` - the SharedObjectDescription that describes the SharedObject to be created
Returns:
  ID the sharedObjectID of the added ISharedObject
Throws:
  `SharedObjectCreateException` - if the SharedObject cannot be created

#### disconnectSharedObjects

    void disconnectSharedObjects(ISharedObjectConnector connector)
                          throws SharedObjectDisconnectException

Destroy an ISharedObjectConnector instance.

Parameters:
  `connector` - the connector previously created via connectSharedObjects
Throws:
  `SharedObjectDisconnectException` - thrown if specified connector does not exist in the context of this container

#### getSharedObject

    ISharedObject getSharedObject(ID sharedObjectID)

Get the ISharedObject instance corresponding to the given sharedObjectID.

Parameters:
  `sharedObjectID` - of the desired ISharedObject
Returns:
  ISharedObject found. Return null if ISharedObject not found.

#### getSharedObjectConnectors

    List getSharedObjectConnectors(ID sharedObjectFrom)

Get the sharedObjectConnectors associated with the given sharedObjectID

Returns:
  List of ISharedObjectConnector instances

#### getSharedObjectIDs

    ID[] getSharedObjectIDs()

Get the array of SharedObject instances currently contained by this ISharedObjectContainer

Returns:
  ID[] the IDs of currently contained ISharedObject instances

#### removeSharedObject

    ISharedObject removeSharedObject(ID sharedObjectID)

Remove the given sharedObjectID from this ISharedObjectContainer.

Parameters:
  `sharedObjectID` - the ID of the ISharedObject to remove
Returns:
  ISharedObject removed. Returns null if ISharedObject not found

#### setRemoteAddPolicy

    void setRemoteAddPolicy(ISharedObjectPolicy policy)

Set this shared object manager's policy for adding remote shared objects.

Parameters:
  `policy` - the ISharedObjectPolicy instance to use to check the validity of remote requests to add/replicate a shared object into this container