public interface OrganizationService
Organization. Can be injected via CDI into managed beans as
follows:
@Inject OrganizationService organizationService;
Concrete implementations do not hold any state, but it's advised to get an instance through CDI or as an EJB.
NOTE: At this moment, it is possible to add organizations to other organizations, but this behavior is currently blocked on the main REST endpoint (see the 'accounts' module).
| Modifier and Type | Method and Description |
|---|---|
Organization |
createOrganization(String name,
String description,
Persona owner)
Creates a new organization and a "SuperUser" membership for the persona.
|
void |
deleteOrganization(Organization organization)
Removes the organization and all related memberships
|
Organization |
get(String id)
Deprecated.
use
getById(UUID) instead. |
Organization |
getById(UUID id)
Retrieves an
Organization based on its ID. |
Organization |
getByName(String name)
Retrieves an
Organization based on its name. |
List<Organization> |
getOrganizationsForPersona(Persona persona)
Retrieves the Organizations to which a given Persona directly is member/owner of.
|
List<Organization> |
getOrganizationsFromMemberships(List<OrganizationMembership> memberships)
Extracts all organizations from a list of memberships.
|
List<Organization> |
getSubOrganizations(Organization organization)
Retrieves all the organizations whose parent is the given organization.
|
void |
transfer(Organization organization,
Persona newOwner)
Transfers the organization from the current owner to the specified persona.
|
List<Organization> getOrganizationsForPersona(Persona persona)
persona - the personaList<Organization> getOrganizationsFromMemberships(List<OrganizationMembership> memberships)
memberships - the list of OrganizationMembershipOrganization extracted from the membershipsOrganization createOrganization(String name, String description, Persona owner)
name - the organization's namedescription - the organization's descriptionowner - the persona that owns the organizationvoid deleteOrganization(Organization organization)
organization - the organization to be removedvoid transfer(Organization organization, Persona newOwner)
organization - the organization to have the ownership changednewOwner - the new ownerOrganization getById(UUID id)
Organization based on its ID.id - the organization's IDOrganization or null if the resource doesn't exists.IllegalArgumentException - if the given ID is nullOrganization getByName(String name)
Organization based on its name.name - the organization's nameOrganization or null if the resource doesn't exists.IllegalArgumentException - if the given name is null@Deprecated Organization get(String id)
getById(UUID) instead.Organization based on its ID.id - the organization's IDOrganization or null if the resource doesn't exists.IllegalArgumentException - if the given ID is nullList<Organization> getSubOrganizations(Organization organization)
organization - the parent organizationCopyright © 2015–2016 Red Hat, Inc.. All rights reserved.