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
 void removePost(java.lang.String postId)
          Remove the post matching the given id from the registry
 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

removePost

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

Parameters:
postId - a Post 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


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.