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

All Known Implementing Classes:
PostManagerImpl

@Transactional
public interface PostManager

A manager of posts. Provides methods to create, retrieve, delete or update posts

Author:
ambarthe, ofabre

Method Summary
 java.lang.String createPost(PostTO postTO)
          Add a new post in registry.
 java.util.List<PostTO> getAllPosts(RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry
 PostTO getPost(java.lang.String postId)
          Retrieve the post matching the given id
 java.util.List<PostTO> getPostsNotLinkedToOrganization(java.lang.String orgId, RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry that aren't linked to the given organization
 java.util.List<PostTO> getPostsNotLinkedToPersons(RequestOptionsTO requestOptionsTO)
          Return the list of all posts in the registry that aren't linked to a person
 void removePost(java.lang.String postId)
          Remove the post matching the given id from the registry
 java.util.List<PostTO> searchPost(java.lang.String searchCriteria, java.util.List<PostSearchProperties> searchedProperties, RequestOptionsTO requestOptionsTO)
          Retrieve a list of posts matching the given criteria for the given properties
 java.lang.String updatePost(PostTO postTO)
          Update the post in the registry.
 

Method Detail

createPost

java.lang.String createPost(PostTO postTO)
                            throws OrganizationException
Add a new post in registry. The post name must be specified.

Parameters:
postTO - the PostTO handling data of the Post to add
Returns:
the added Post id
Throws:
OrganizationException - if you try to create a post with no name or a name that already exist

getAllPosts

@Transactional(readOnly=true)
java.util.List<PostTO> getAllPosts(RequestOptionsTO requestOptionsTO)
Return the list of all posts in the registry

Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs in the registry. Not null, could be empty

getPost

@Transactional(readOnly=true)
PostTO getPost(java.lang.String postId)
               throws OrganizationException
Retrieve the post matching the given id

Parameters:
postId - a Post id
Returns:
the PostTO handling data of the Post that match the given id
Throws:
OrganizationException - if you try to retrieve a post that doesn't exist

getPostsNotLinkedToOrganization

java.util.List<PostTO> getPostsNotLinkedToOrganization(java.lang.String orgId,
                                                       RequestOptionsTO requestOptionsTO)
                                                       throws OrganizationException
Return the list of all posts in the registry that aren't 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 in the registry that aren't linked to the given organization
Throws:
OrganizationException - if an error occurs during posts retrieval

getPostsNotLinkedToPersons

java.util.List<PostTO> getPostsNotLinkedToPersons(RequestOptionsTO requestOptionsTO)
                                                  throws OrganizationException
Return the list of all posts in the registry that aren't linked to a person

Parameters:
requestOptionsTO - sort, pagination and case sensitive parameters, could be null
Returns:
the List of all PostTOs in the registry that aren't linked to a person
Throws:
OrganizationException - if an error occurs during posts retrieval

removePost

void removePost(java.lang.String postId)
                throws OrganizationException
Remove the post matching the given id from the registry

Parameters:
postId - a Post id
Throws:
OrganizationException - if no post found for the given id

updatePost

java.lang.String updatePost(PostTO postTO)
                            throws OrganizationException
Update the post in the registry. Post name and id must be specified

Parameters:
postTO - the PostTO handling data of the Post to update
Returns:
the updated post ID
Throws:
OrganizationException - if you try to update a post with a name that already exist or with a null or empty name, or if you try to update a post that doesn't exist

searchPost

@Transactional(readOnly=true)
java.util.List<PostTO> searchPost(java.lang.String searchCriteria,
                                                java.util.List<PostSearchProperties> searchedProperties,
                                                RequestOptionsTO requestOptionsTO)
                                  throws OrganizationException
Retrieve a list of posts 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 PostTO matching the given criteria for the given properties
Throws:
OrganizationException - if you try to search posts without specifying search criteria


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.