jet.server.api.admin
Interface OrganizationManager


public interface OrganizationManager

Manage organizations.
Client calls jet.server.api.AdminService.getOrganizationManager() to get instance of this interface.

Users can create, update or remove organizations through this interface.


Method Summary
 java.lang.String createOrganization(java.lang.String realmName, java.lang.String orgName, int maxUserNumber, java.lang.String description, java.lang.String submitter)
          Creates a organization.
 JOrganization getOrganization(java.lang.String realmName, java.lang.String orgName, java.lang.String submitter)
          Gets organization by its name.
 java.util.List<JOrganization> getOrganizations(java.lang.String realmName)
          Gets all organizations in the specified realm.
 java.lang.String removeOrganization(java.lang.String realmName, java.lang.String orgName, java.lang.String submitter)
          Removes a exists organization.
 java.lang.String updateOrganization(java.lang.String realmName, java.lang.String orgName, int maxUserNumber, java.lang.String description, java.lang.String submitter)
          Updates a exists organization.
 

Method Detail

getOrganization

JOrganization getOrganization(java.lang.String realmName,
                              java.lang.String orgName,
                              java.lang.String submitter)
                              throws NoSuchOrganizationException,
                                     NoSuchRealmException
Gets organization by its name.

Parameters:
realmName - the realm which the organization defined in.
orgName - the organization name.
submitter - the submitter user id.
Returns:
the organization specified by the orgName.
Throws:
NoSuchOrganizationException - the orgName not exists.
NoSuchRealmException - the realm not exists.

getOrganizations

java.util.List<JOrganization> getOrganizations(java.lang.String realmName)
                                               throws NoSuchRealmException
Gets all organizations in the specified realm.

Parameters:
realmName - the realm which the organization defined in.
Returns:
the list of Organization.
Throws:
NoSuchRealmException - the realm not exists.

createOrganization

java.lang.String createOrganization(java.lang.String realmName,
                                    java.lang.String orgName,
                                    int maxUserNumber,
                                    java.lang.String description,
                                    java.lang.String submitter)
                                    throws OrganizationExistsException,
                                           NoSuchRealmException
Creates a organization.

Parameters:
realmName - the realm which the organization defined in.
orgName - the organization name to create. cannot be null or empty, max length 32 chars, can only include A-Z, a-z, 0-9, space, "-", "_", dot,"&", and excluding reserved name "Default".
maxUserNumber - the maximum user number of the organization, no less than 0, 0 means unlimited.
description - the description of the new create organization, max length is 255 chars.
submitter - the submitter user id.
Returns:
error message string. null means create organization successful, otherwise the message denote the failed reason.
Throws:
OrganizationExistsException - the organization specified by orgName is exists.
NoSuchRealmException - the realm specified by realmName is not exists.

updateOrganization

java.lang.String updateOrganization(java.lang.String realmName,
                                    java.lang.String orgName,
                                    int maxUserNumber,
                                    java.lang.String description,
                                    java.lang.String submitter)
                                    throws NoSuchOrganizationException,
                                           NoSuchRealmException
Updates a exists organization.

Parameters:
realmName - the realm which the organization defined in.
orgName - the organization name to update.
maxUserNumber - the maximum user number of the organization, no less than 0, 0 means unlimited.
description - the description of the new create organization, max length is 255 chars.
submitter - the submitter user id.
Returns:
error message string. null means create organization successful, otherwise the message denote the failed reason.
Throws:
NoSuchOrganizationException - the organization specified by orgName is not exists.
NoSuchRealmException - the realm specified by realmName is not exists.

removeOrganization

java.lang.String removeOrganization(java.lang.String realmName,
                                    java.lang.String orgName,
                                    java.lang.String submitter)
                                    throws NoSuchOrganizationException,
                                           NoSuchRealmException
Removes a exists organization. its related principals (user|group|role) will be removed from security system too.

Parameters:
realmName - the realm which the organization defined in
orgName - the organization name to remove.
submitter - the submitter user id.
Returns:
error message string. null means create organization successful, otherwise the message denote the failed reason.
Throws:
NoSuchOrganizationException - the organization specified by orgName is not exists.
NoSuchRealmException - the realm specified by realmName is not exists.