|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.services.ejb3.FilesEJB
@RolesAllowed(value={}) public class FilesEJB
EJB implementation of the Files
interface.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Files |
---|
NAME |
Constructor Summary | |
---|---|
FilesEJB()
|
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(File file)
Create a new CCC file. |
|
ResourceSummary |
createTextFile(File file)
Create a new text file 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. |
|
PagedCollection<File> |
getPagedImages(java.util.UUID folderId,
int pageNo,
int pageSize)
List all images of the given folder id. |
|
protected IRepositoryFactory |
getRepoFactory()
Accessor. |
|
protected javax.ejb.TimerService |
getTimerService()
Accessor. |
|
File |
retrieve(java.util.UUID fileId)
Get the representation of an existing CCC file. |
|
void |
retrieve(java.util.UUID file,
StreamAction action)
Process the contents of a file with an action. |
|
void |
retrieveRevision(java.util.UUID file,
int revision,
StreamAction action)
Process the contents of a file revision with an action. |
|
void |
retrieveWorkingCopy(java.util.UUID file,
StreamAction action)
Process the contents of a file's working copy with an action. |
|
protected
|
sudoExecute(Command<T> command,
java.util.UUID actorId,
java.util.Date happenedOn)
Execute a command on behalf of another user. |
|
void |
update(java.util.UUID id,
File file)
Update an existing CCC file. |
|
ResourceSummary |
updateFile(java.util.UUID fileId,
File file)
Update an existing CCC file. |
|
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 FilesEJB()
Method Detail |
---|
@RolesAllowed(value="FILE_READ") public PagedCollection<File> getPagedImages(java.util.UUID folderId, int pageNo, int pageSize)
getPagedImages
in interface Files
folderId
- The id of the folder.pageNo
- The page to display.pageSize
- The number of results per page.
@PermitAll public ResourceSummary create(File file)
create
in interface Files
file
- The file to create.
@RolesAllowed(value="FILE_UPDATE") public ResourceSummary updateFile(java.util.UUID fileId, File file)
updateFile
in interface Files
fileId
- The id of the file to update.file
- The changes to apply.
@RolesAllowed(value="FILE_UPDATE") public void update(java.util.UUID id, File file)
update
in interface Files
id
- The ID of the file to update.file
- The new file representation.@RolesAllowed(value="FILE_CREATE") public ResourceSummary createTextFile(File file)
createTextFile
in interface Files
file
- The textFile details.
@PermitAll public File retrieve(java.util.UUID fileId)
retrieve
in interface Files
fileId
- The ID of the file to get.
@PermitAll public void retrieve(java.util.UUID file, StreamAction action)
retrieve
in interface Files
file
- The file's ID.action
- The action to perform.@PermitAll public void retrieveRevision(java.util.UUID file, int revision, StreamAction action)
retrieveRevision
in interface Files
file
- The file's ID.revision
- The file revision to retrieve.action
- The action to perform.@PermitAll public void retrieveWorkingCopy(java.util.UUID file, StreamAction action)
retrieveWorkingCopy
in interface Files
file
- The file's ID.action
- The action to perform.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 |