|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.CommentsEJB
@RolesAllowed(value={}) public class CommentsEJB
EJB implementation of the Comments
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Comments |
---|
NAME |
Constructor Summary | |
---|---|
CommentsEJB()
|
Method Summary | ||
---|---|---|
protected void |
checkPermission(java.lang.String... permissions)
Check that the current user has ONE OF the specified permissions. |
|
protected void |
checkRead(ResourceEntity r)
Check that a resource is readable by a user. |
|
protected void |
checkWrite(ResourceEntity r)
Check that a resource is write-able by a user. |
|
CommandFactory |
commands()
Accessor. |
|
Comment |
create(Comment comment)
Create a new comment in CCC. |
|
protected UserEntity |
currentUser()
Accessor. |
|
protected java.util.UUID |
currentUserId()
Accessor. |
|
void |
delete(java.util.UUID commentId)
Delete an existing comment. |
|
protected
|
execute(Command<T> command)
Execute a command on behalf of the current user. |
|
protected java.util.Collection<? extends ResourceEntity> |
filterAccessibleTo(UserEntity u,
java.util.List<? extends ResourceEntity> resources)
Filter a collection of resources based on accessibility. |
|
protected IRepositoryFactory |
getRepoFactory()
Accessor. |
|
protected javax.ejb.TimerService |
getTimerService()
Accessor. |
|
PagedCollection<Comment> |
query(java.util.UUID resourceId,
CommentStatus status,
java.lang.String sort,
SortOrder sortOrder,
int pageNo,
int pageSize)
List existing comments. |
|
Comment |
retrieve(java.util.UUID commentId)
Retrieve the comment using its ID. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
Comment |
update(java.util.UUID commentId,
Comment comment)
Update the specified comment. |
|
protected UserEntity |
userForId(java.util.UUID userId)
Look up the user for the specified ID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommentsEJB()
Method Detail |
---|
@RolesAllowed(value="COMMENT_CREATE") public Comment create(Comment comment)
create
in interface Comments
comment
- The comment to create.
@RolesAllowed(value="COMMENT_READ") public Comment retrieve(java.util.UUID commentId)
retrieve
in interface Comments
commentId
- The comment's ID.
@RolesAllowed(value="COMMENT_UPDATE") public Comment update(java.util.UUID commentId, Comment comment)
update
in interface Comments
commentId
- The comment's ID.comment
- The updated comment.
@RolesAllowed(value="COMMENT_DELETE") public void delete(java.util.UUID commentId)
delete
in interface Comments
commentId
- The comment's ID.@RolesAllowed(value="COMMENT_READ") public PagedCollection<Comment> query(java.util.UUID resourceId, CommentStatus status, java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
query
in interface Comments
resourceId
- Filter comments by resource. NULL will return all.status
- Filter comments based on status. NULL will return all.sort
- The field to sort on.sortOrder
- The order results be sorted in.pageNo
- The page of results to return.pageSize
- The number of results in a page.
protected IRepositoryFactory getRepoFactory()
public CommandFactory commands()
protected final javax.ejb.TimerService getTimerService()
protected final <T> T sudoExecute(Command<T> command, java.util.UUID actorId, java.util.Date happenedOn)
T
- The command's return type.command
- The command to execute.actorId
- The actor executing the command.happenedOn
- When the command was executed.
protected final <T> T execute(Command<T> command)
T
- The command's return type.command
- The command to execute.
protected UserEntity userForId(java.util.UUID userId)
userId
- The user's ID.
protected UserEntity currentUser()
protected java.util.UUID currentUserId()
protected void checkRead(ResourceEntity r)
r
- The resource to check.protected void checkWrite(ResourceEntity r)
r
- The resource to check.protected void checkPermission(java.lang.String... permissions)
permissions
- The permissions to check.protected java.util.Collection<? extends ResourceEntity> filterAccessibleTo(UserEntity u, java.util.List<? extends ResourceEntity> resources)
u
- The user reading the collection.resources
- The un-filtered collection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |