org.ow2.dragon.api.service.organization
Interface OrganizationManager

All Known Implementing Classes:
OrganizationManagerImpl

@Transactional
public interface OrganizationManager

A manager of organization units. Provides methods to create, retrieve, delete or update organization units and to manage categories, identifiers and post related to organizations. Method arguments must be non null, unless the contrary is explicitly specified.

Author:
ambarthe, ofabre - eBM WebSourcing

Method Summary
 void addCategory(java.lang.String orgId, java.lang.String categoryId, java.lang.String categoryValueId)
          Add a category to the given organization.
 void addCategory(java.lang.String orgId, java.lang.String categoryId, java.lang.String categoryValue, java.lang.String categoryDesc)
          Add a category to the given organization.
 void addIdentifier(java.lang.String orgId, java.lang.String identifierId, java.lang.String identifierValue, java.lang.String identifierDesc)
          Add an identifier to the given organization.
 void addPost(java.lang.String organizationId, java.lang.String postId)
          Add the post matching the given postId to the organization unit matching the given organizationId
 java.lang.String createOrganization(OrganizationUnitTO organizationUnitTO)
          Add a new organization unit in registry.
 java.util.List<OrganizationUnitTO> getAllOrganizations(RequestOptionsTO requestOptionsTO)
          Return the list of all organization units in the registry
 java.util.List<OrganizationUnitTO> getAllOrgsWithoutMeAndMyChildren(java.lang.String initialOrg)
          Return the list of all organization units in the registry excluding me and my children
 java.util.List<KeyedRefTO> getCategoriesForOrg(java.lang.String orgId)
          Return all the categories related to the given organization unit.
 java.util.List<KeyedRefTO> getIdentifiersForOrg(java.lang.String orgId)
          Return all identifiers related to the given organization unit.
 OrganizationUnitTO getOrganization(java.lang.String organizationId)
          Retrieve the organization unit matching the given id
 java.util.List<PostTO> getPostsByOrganization(java.lang.String orgId, RequestOptionsTO requestOptionsTO)
          Return the list of all posts that are linked to the given organization
 void removeCategories(java.lang.String orgId, java.util.List<java.lang.String> categoryIds)
          Remove a list of categories from the given organization unit.
 void removeIdentifiers(java.lang.String orgId, java.util.List<java.lang.String> categoryIds)
          Remove a list of identifiers from the given organization unit.
 void removeOrganization(java.lang.String organizationId)
          Remove the organization unit matching the given id from the registry.
 void removePost(java.lang.String organizationId, java.lang.String postId)
          Remove the post matching the given postId from the list of posts of the organization unit matching the given organizationId.
 java.util.List<OrganizationUnitTO> searchOrganization(java.lang.String searchCriteria, java.util.List<OrganizationSearchProperties> searchedProperties, RequestOptionsTO requestOptionsTO)
          Retrieve a list of organization units matching the given criteria for the given properties
 java.lang.String updateOrganization(OrganizationUnitTO organizationUnitTO)
          Update the organization unit in the registry.
 

Method Detail

addPost

void addPost(java.lang.String organizationId,
             java.lang.String postId)
             throws OrganizationException
Add the post matching the given postId to the organization unit matching the given organizationId

Parameters:
organizationId - an OrganizationUnit id
postId - a Post id
Throws:
OrganizationException - if at least one of the given id doesn't exist in database

getPostsByOrganization

java.util.List<PostTO> getPostsByOrganization(java.lang.String orgId,
                                              RequestOptionsTO requestOptionsTO)
                                              throws OrganizationException
Return the list of all posts that are linked to the given organization

Parameters:
orgId - an OrganizationUnit id
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs that are linked to the given organization
Throws:
OrganizationException - if an error occurs during posts retrieval

addCategory

void addCategory(java.lang.String orgId,
                 java.lang.String categoryId,
                 java.lang.String categoryValueId)
                 throws OrganizationException
Add a category to the given organization. The added category is of the type of the category denoted by the categoryId argument and the selected value is denoted by the categoryValueId argument.

Parameters:
orgId - a OrganizationUnit id
categoryId - a Category id
categoryValueId - an identifier of a CategoryValue containing category info to add
Throws:
OrganizationException - if at least one of the given id doesn't exist in database or if you try to add the same category twice

addCategory

void addCategory(java.lang.String orgId,
                 java.lang.String categoryId,
                 java.lang.String categoryValue,
                 java.lang.String categoryDesc)
                 throws OrganizationException
Add a category to the given organization. The added category is of the type of the category denoted by the categoryId argument and the selected value is denoted by the categoryValue argument. The categoryDesc is used to describe the created category

Parameters:
orgId - a OrganizationUnit id
categoryId - a Category id
categoryValue - a category value (UDDI: categoryValue)
categoryDesc - a category description (UDDI: categoryName), could be null or empty
Throws:
OrganizationException - if at least one of the given id doesn't exist in database or if you try to add the same category twice

addIdentifier

void addIdentifier(java.lang.String orgId,
                   java.lang.String identifierId,
                   java.lang.String identifierValue,
                   java.lang.String identifierDesc)
                   throws OrganizationException
Add an identifier to the given organization. The added identifier is of the type of the identifier system denoted by the identifierId argument and the identifier value is denoted by the identifierValue argument.

Parameters:
orgId - an OrganizationUnit id
identifierId - an Identifier system id
identifierValue - an identifier value
identifierDesc - an identifier description, could be null or empty
Throws:
OrganizationException - if at least one of the given id doesn't exist in database

getCategoriesForOrg

@Transactional(readOnly=true)
java.util.List<KeyedRefTO> getCategoriesForOrg(java.lang.String orgId)
                                               throws OrganizationException
Return all the categories related to the given organization unit. Categories are keyed references as specified in the UDDI specification

Parameters:
orgId - an OrganizationUnit id
Returns:
a List of categories ( KeyedRefTO )
Throws:
OrganizationException - if not organization found for the given id

removeCategories

void removeCategories(java.lang.String orgId,
                      java.util.List<java.lang.String> categoryIds)
                      throws OrganizationException
Remove a list of categories from the given organization unit.

Parameters:
orgId - an OrganizationUnit id
categoryIds - a List of category ids
Throws:
OrganizationException - if no organization found for the given id

getIdentifiersForOrg

@Transactional(readOnly=true)
java.util.List<KeyedRefTO> getIdentifiersForOrg(java.lang.String orgId)
                                                throws OrganizationException
Return all identifiers related to the given organization unit. Identifiers are keyed references as specified in the UDDI specification

Parameters:
orgId - an OrganizationUnit id
Returns:
a List of identifiers ( KeyedRefTO )
Throws:
OrganizationException - if no organization found for the given id

removeIdentifiers

void removeIdentifiers(java.lang.String orgId,
                       java.util.List<java.lang.String> categoryIds)
                       throws OrganizationException
Remove a list of identifiers from the given organization unit.

Parameters:
orgId - an OrganizationUnit id
categoryIds - a List of identifier ids
Throws:
OrganizationException - if no organization found for the given id

createOrganization

java.lang.String createOrganization(OrganizationUnitTO organizationUnitTO)
                                    throws OrganizationException
Add a new organization unit in registry. The organization name and city must be specified.

Parameters:
organizationUnitTO - the OrganizationUnitTO handling data of the OrganizationUnit to create
Returns:
the id of the added OrganizationUnit
Throws:
OrganizationException - if you try to create an organization with name/city that already exists or an organization without name and city

getAllOrganizations

@Transactional(readOnly=true)
java.util.List<OrganizationUnitTO> getAllOrganizations(RequestOptionsTO requestOptionsTO)
Return the list of all organization units in the registry

Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all OrganizationUnitTO in the registry, couldn't be null, can be empty

getAllOrgsWithoutMeAndMyChildren

@Transactional(readOnly=true)
java.util.List<OrganizationUnitTO> getAllOrgsWithoutMeAndMyChildren(java.lang.String initialOrg)
                                                                    throws OrganizationException
Return the list of all organization units in the registry excluding me and my children

Returns:
the List of all OrganizationUnitTO in the registry excluding me and my children
Throws:
OrganizationException - if an error occurs during organization units retrieval

getOrganization

@Transactional(readOnly=true)
OrganizationUnitTO getOrganization(java.lang.String organizationId)
                                   throws OrganizationException
Retrieve the organization unit matching the given id

Parameters:
organizationId - an OrganizationUnit id
Returns:
the OrganizationUnitTO handling data of the OrganizationUnit that matches the given id
Throws:
OrganizationException - if no organization found for the given id

removeOrganization

void removeOrganization(java.lang.String organizationId)
Remove the organization unit matching the given id from the registry.

Parameters:
organizationId - an OrganizationUnit id

removePost

void removePost(java.lang.String organizationId,
                java.lang.String postId)
                throws OrganizationException
Remove the post matching the given postId from the list of posts of the organization unit matching the given organizationId. The post isn't removed from the registry and can be re-affected to any organization

Parameters:
organizationId - an OrganizationUnit id
postId - a Post id
Throws:
OrganizationException - if no organization found for the given id

searchOrganization

@Transactional(readOnly=true)
java.util.List<OrganizationUnitTO> searchOrganization(java.lang.String searchCriteria,
                                                                    java.util.List<OrganizationSearchProperties> searchedProperties,
                                                                    RequestOptionsTO requestOptionsTO)
                                                      throws OrganizationException
Retrieve a list of organization units matching the given criteria for the given properties

Parameters:
searchCriteria - the search criteria (a String containing criteria separated with whitespaces), mustn't be empty
searchedProperties - the searched properties, mustn't be empty
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
a List of OrganizationUnitTO matching the given criteria for the given properties
Throws:
OrganizationException - if you try to search orgs without specifying search criteria

updateOrganization

java.lang.String updateOrganization(OrganizationUnitTO organizationUnitTO)
                                    throws OrganizationException
Update the organization unit in the registry.

Parameters:
organizationUnitTO - the OrganizationUnitTO handling data of the OrganizationUnit to update
Returns:
the updated organization unit ID
Throws:
OrganizationException - if an error occurs during organization unit update : organization to update doesn't exist or have the same name and city as an other registered organization


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.