|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.TemplatesEJB
@RolesAllowed(value={}) public final class TemplatesEJB
EJB implementation of the Templates
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Templates |
---|
NAME |
Constructor Summary | |
---|---|
TemplatesEJB()
Constructor. |
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. |
|
ResourceSummary |
create(Template template)
Create a new template in CCC. |
|
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<Template> |
query(int pageNo,
int pageSize)
List all the templates currently available in CCC. |
|
Template |
retrieve(java.util.UUID templateId)
Retrieve the delta for a template. |
|
Template |
retrieveRevision(java.util.UUID templateId,
int revision)
Retrieve a template revision. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
java.lang.Boolean |
templateNameExists(java.lang.String templateName)
Returns true if template name exists in the template folder. |
|
void |
update(java.util.UUID templateId,
Template delta)
Update the specified template on the server. |
|
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 TemplatesEJB()
Method Detail |
---|
@RolesAllowed(value="TEMPLATE_READ") public java.lang.Boolean templateNameExists(java.lang.String templateName)
templateNameExists
in interface Templates
templateName
- The name to look up.
@RolesAllowed(value="TEMPLATE_READ") public PagedCollection<Template> query(int pageNo, int pageSize)
query
in interface Templates
pageNo
- The page of results to return.pageSize
- The number of results in a page.
@RolesAllowed(value="TEMPLATE_CREATE") public ResourceSummary create(Template template)
create
in interface Templates
template
- The template's details.
@RolesAllowed(value="TEMPLATE_UPDATE") public void update(java.util.UUID templateId, Template delta)
update
in interface Templates
templateId
- The id of the template to update.delta
- The changes to apply.@PermitAll public Template retrieve(java.util.UUID templateId)
retrieve
in interface Templates
templateId
- The template's id.
@PermitAll public Template retrieveRevision(java.util.UUID templateId, int revision)
Templates
retrieveRevision
in interface Templates
templateId
- The template's id.revision
- The revision to fetch.
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 |