|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SharedEntityAccessor
Provides an abstraction for accessing SharedEntity objects. This class abstracts away the details of the SharedEntity
implementation to those components that need it. For instance, the AjaxFavouriteControl
uses SharedEntityAccessors
to ensure that it will continue to work without change for any SharedEntity.
Nested Class Summary | |
---|---|
static interface |
SharedEntityAccessor.Factory
Factory to retrieve a SharedEntityAccessor for a given SharedEntity |
static interface |
SharedEntityAccessor.RetrievalDescriptor
Used when getting a Collection of shared entities . |
Method Summary | |
---|---|
void |
adjustFavouriteCount(SharedEntity entity,
int adjustmentValue)
Adjusts the favourite counts for a given entity. |
CloseableIterable |
get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result. |
CloseableIterable |
getAll()
Get all sharable entities this accessor can see. |
SharedEntity |
getSharedEntity(Long entityId)
This will call back to ask for a SharedEntity based on id. |
SharedEntity |
getSharedEntity(User user,
Long entityId)
This is called to get SharedEntity by id If the user is allows to see it |
SharedEntity.TypeDescriptor |
getType()
Returns the type that this object can work with. |
boolean |
hasPermissionToUse(User user,
SharedEntity entity)
Returns true if the user has permission to use the SharedEntity |
Method Detail |
---|
SharedEntity.TypeDescriptor getType()
void adjustFavouriteCount(SharedEntity entity, int adjustmentValue)
entity
- the entity to adjustadjustmentValue
- the value to adjust by.SharedEntity getSharedEntity(Long entityId)
SharedEntity
based on id.
entityId
- the id of the SharedEntity
SharedEntity
or null if it cant be foundSharedEntity getSharedEntity(User user, Long entityId)
SharedEntity
by id If the user is allows to see it
user
- the user in playentityId
- the id of the SharedEntity
SharedEntity
if it exists and the user can see it and null otherwiseboolean hasPermissionToUse(User user, SharedEntity entity)
SharedEntity
user
- the user in playentity
- the SharedEntity
to check
CloseableIterable getAll()
sharable entities
this accessor can see.
CloseableIterable
of SharedEntity
'sCloseableIterable get(SharedEntityAccessor.RetrievalDescriptor descriptor)
sharable entities
from a search result.
descriptor
- retrieval descriptor
CloseableIterable
of SharedEntity
's
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |