com.ibm.portal.app.component
Interface Membership


public interface Membership

Membership is one of the Application Component Interfaces, implemented by an application component. Membership is used to notify a component instance whenever members (people or groups) are added to or removed from the roles defined for the application that contains the component. The component can use this information to grant or revoke access to resources that it manages. Membership is also used to get information about roles that are specific to your component. If your component doesn't define its own roles, you don't need to implement the Membership interface.

* memberRemoved(String, ObjectID, String) will be called to compensate for a failed adding of members to a community role and memberAdded(String, ObjectID, String) will be called to compensate for a failed removal of members from a community role.

Note: The component instance identifier input parameter used in Membership methods is the identifer returned by the Lifecycle.createInstance(ListModel) or the java.io.Reader, com.ibm.portal.ListModel)">Templatable.createFromTemplate(Reader, ListModel) method.

Since:
6.0

Method Summary
 ListModel getComponentRoles(java.lang.String componentID)
          Returns a list of ComponentRole objects used by this component.
 void memberAdded(java.lang.String componentID, ObjectID principalOID, java.lang.String roleID)
          Called when a member (user or group) is added to a community role in the application that contains this component instance.
 void memberRemoved(java.lang.String componentID, ObjectID principalOID, java.lang.String roleID)
          Called when members are removed from a role in the application that contains this component instance.
 

Method Detail

memberAdded

void memberAdded(java.lang.String componentID,
                 ObjectID principalOID,
                 java.lang.String roleID)
                 throws ComponentException
Called when a member (user or group) is added to a community role in the application that contains this component instance. The input parameters include the ObjectID of the added member and the component-specific role assigned to that member. The component-specific roles are those returned by the getComponentRoles(String) method.
Additional information on the principal (e.g. the DN or display name) can be retrieved through the portal user management service com.ibm.portal.um.PumaHome and com.ibm.portal.um.PumaLocator.

Note: memberAdded will not be called unless your getComponentRoles method returns one or more roles.

Parameters:
componentID - The component instance identifier, must not be null.
principalOID - The ObjectID of a new member of the role identified by the roleID parameter, must not be null.
roleID - The role identifier, must not be null.
Throws:
ComponentException - if you throw an exception during this method call the member will not be added to the community role or any other business component that is part of this application.

getComponentRoles

ListModel getComponentRoles(java.lang.String componentID)
Returns a list of ComponentRole objects used by this component. Add component roles by modifying the list. The roles you specify for your component can be mapped to community roles, using the Application Template and the corresponding admin UIs. When roles are mapped in this way, the descriptors you include in the returned list are used to display information about your component's roles in the user interface.

Parameters:
componentID - The component instance identifier, must not be null.
Returns:
ListModel containing ComponentRole objects. The returned list should contain at least one role. Otherwise this interface should not be implemented. If no roles are returned memberAdded or memberRemoved will never be called. The returned value must not be null.

memberRemoved

void memberRemoved(java.lang.String componentID,
                   ObjectID principalOID,
                   java.lang.String roleID)
                   throws ComponentException
Called when members are removed from a role in the application that contains this component instance. The input parameters include the removed member and the component-specific role. The component-specific roles are those returned by the getComponentRoles(String) method.

Note: memberRemoved will not be called unless your getComponentRoles method returns one or more roles.

Parameters:
componentID - The component instance identifier, must not be null.
principalOID - The ObjectID of a member that has been removed from the role identified by the roleID parameter, must not be null.
roleID - The role identifier, must not be null.
Throws:
ComponentException - if you throw an exception during this method call the member will not be removed from the community or any other business component that is part of this application.