com.ibm.pim.organization
Interface Organization

All Superinterfaces:
AttributeOwner

public interface Organization
extends AttributeOwner

Interface for Organization object. Organization belongs to an OrganizationHierarchy and groups users.

Since:
6.0.0

Field Summary
static java.lang.String copyright
           
 
Method Summary
 void addChild(Organization childOrganization)
          Adds a organization as a child of this organization.
 void associateUser(User user)
          Associates a user with this Organization.
 void delete()
          Deletes the given organization.
 void disassociateUser(User user)
          Disassociate a user from this Organization.
 java.util.Collection<Organization> getChildren()
          Returns the categories immediately below this organization.
 PIMCollection<Organization> getDescendents()
          Returns all the descendents of this organization.
 java.lang.String getDisplayName()
          Returns the name of this Category object
 java.util.Collection<java.lang.String> getFullPaths(boolean includeRootName)
          Returns the full name paths of this Organization.
 java.util.Collection<java.lang.String> getFullPaths(java.lang.String delimiter, boolean includeRootName)
          Returns the full name paths of this Organization.
 OrganizationHierarchy getHierarchy()
          Returns the OrganiztionHierarchy object containing this Organization object.
 int[] getLevels()
          Returns the levels of this organization in an array of Integers.
 Organization getParent()
          Returns this organization's parent.
 java.util.Collection<Organization> getParents()
          Returns the parent categories of the given Organization.
 PIMCollection<User> getUsers()
          Returns a collection of users belonging to this Organization
 boolean hasChildren()
          Determines if the given organization has any children.
 boolean isRoot()
          Identifies whether this Organization is the root Organization of the OrganizationHierarchy it lives within
 void removeChild(Organization childOrganization)
          Remove the given child Organization from this organization's children.
 ValidationErrors validate()
          Validates the organization.
 
Methods inherited from interface com.ibm.pim.attribute.AttributeOwner
getAttributeChangesComparedTo, getAttributeChangesSinceLastSave, getAttributeInstance, getAttributeValue, getLastModifiedTimeMillis, getOriginalAttributeOwner, getRootAttributeInstance, getRootAttributeInstances, getSpecs, isComparable, setAttributeValue
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

associateUser

void associateUser(User user)
Associates a user with this Organization. This method has no effect if the user is already associated with the organization.

Parameters:
user - User to associate with
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have equivalent of Permission.HIERARCHY_MODIFY_HIERARCHY_NODE_ATTRIBUTES
java.lang.IllegalArgumentException - if any of the parameters is null

disassociateUser

void disassociateUser(User user)
Disassociate a user from this Organization. This method has no effect if the user is not associated with the organization.

Parameters:
user - User to disassociate with
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have equivalent of Permission.HIERARCHY_MODIFY_HIERARCHY_NODE_ATTRIBUTES
java.lang.IllegalArgumentException - if any of the parameters is null

getUsers

PIMCollection<User> getUsers()
Returns a collection of users belonging to this Organization

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.

getDisplayName

java.lang.String getDisplayName()
                                throws PIMInternalException
Returns the name of this Category object

Returns:
The name of the Category object as a String
Throws:
PIMInternalException - if an internal error occurs

addChild

void addChild(Organization childOrganization)
Adds a organization as a child of this organization. No error is returned if the organization already exists as a child.

Parameters:
childOrganization - the organization to be added as a child
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have equivalent of Permission.HIERARCHY_RECATEGORIZE_HIERARCHY_NODES
java.lang.IllegalArgumentException - if any of the parameters is null
java.lang.IllegalStateException - if any API object passed as a parameter that has not yet been saved.

delete

void delete()
Deletes the given organization. Save method on the containing Hierarchy object must be called to persist this deletion to the database.

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have equivalent of Permission.HIERARCHY_DELETE_HIERARCHY_NODES
java.lang.UnsupportedOperationException - if this is a root organization

getChildren

java.util.Collection<Organization> getChildren()
Returns the categories immediately below this organization.

Returns:
a Collection of Organization objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - reserved for future use

getDescendents

PIMCollection<Organization> getDescendents()
Returns all the descendents of this organization.

Returns:
a PIMCollection of Organization objects.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - reserved for future use

getFullPaths

java.util.Collection<java.lang.String> getFullPaths(boolean includeRootName)
Returns the full name paths of this Organization.

Parameters:
includeRootName - If true, the returned full paths include the root organization name.
Returns:
List of paths
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

getFullPaths

java.util.Collection<java.lang.String> getFullPaths(java.lang.String delimiter,
                                                    boolean includeRootName)
Returns the full name paths of this Organization.

Parameters:
delimiter - The delimiter to be used in the full paths that are returned.
includeRootName - If true, the returned full paths include the root organization name.
Returns:
Collection of paths for this Organization
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.IllegalArgumentException - if any of the parameters is null

getHierarchy

OrganizationHierarchy getHierarchy()
Returns the OrganiztionHierarchy object containing this Organization object.

Returns:
the OrganizationHierarchy object to which this Organization object belongs
Throws:
PIMInternalException - if an internal error occurs
PIMAuthorizationException - Reserved for future use

getLevels

int[] getLevels()
Returns the levels of this organization in an array of Integers.

Returns:
List of levels
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

getParent

Organization getParent()
Returns this organization's parent. If there are multiple parents, only the first one is returned.

Returns:
the parent Organization
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.UnsupportedOperationException - if this is a root organization

getParents

java.util.Collection<Organization> getParents()
Returns the parent categories of the given Organization.

Returns:
a collection of all parent categories
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.UnsupportedOperationException - if this is a root organization

hasChildren

boolean hasChildren()
Determines if the given organization has any children.

Returns:
Returns true if the organization has any children.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

isRoot

boolean isRoot()
Identifies whether this Organization is the root Organization of the OrganizationHierarchy it lives within

Returns:
true if this Organization is the root organization of its OrganizationHierarchy, otherwise false
Throws:
PIMInternalException - if an internal error occurs

validate

ValidationErrors validate()
Validates the organization.

Returns:
A ValidationErrors object containing the list of validation errors for this organization or null if no validation errors were found.
Throws:
PIMInternalException - If an internal error occurs.
PIMAuthorizationException - reserved for future use

removeChild

void removeChild(Organization childOrganization)
Remove the given child Organization from this organization's children.

Parameters:
childOrganization - the child organization to remove.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have equivalent of Permission.HIERARCHY_RECATEGORIZE_HIERARCHY_NODES
java.lang.IllegalArgumentException - if any of the parameters is null
java.lang.IllegalStateException - if any API object passed as a parameter that has not yet been saved.