|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.GroupsEJB
@RolesAllowed(value={}) public class GroupsEJB
EJB implementation of the Groups
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Groups |
---|
NAME |
Constructor Summary | |
---|---|
GroupsEJB()
|
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. |
|
Group |
create(Group comment)
Create a new group in the system. |
|
protected UserEntity |
currentUser()
Accessor. |
|
protected java.util.UUID |
currentUserId()
Accessor. |
|
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<Group> |
query(java.lang.String name,
int pageNo,
int pageSize)
List available groups. |
|
Group |
retrieve(java.util.UUID id)
Find the group for a given ID. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
Group |
update(java.util.UUID id,
Group group)
Update an existing group in the system. |
|
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 GroupsEJB()
Method Detail |
---|
@RolesAllowed(value="GROUP_CREATE") public Group create(Group comment)
create
in interface Groups
comment
- The new group details.
@RolesAllowed(value="GROUP_READ") public Group retrieve(java.util.UUID id)
retrieve
in interface Groups
id
- The group ID.
@RolesAllowed(value="GROUP_READ") public PagedCollection<Group> query(java.lang.String name, int pageNo, int pageSize)
query
in interface Groups
name
- Filter based on group name. NULL disables filter.pageNo
- The page to display.pageSize
- The number of results per page.
@RolesAllowed(value="GROUP_UPDATE") public Group update(java.util.UUID id, Group group)
update
in interface Groups
id
- The ID of the group to update.group
- The updated group details.
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 |