public interface

SharedEntityAccessor

com.atlassian.jira.sharing.SharedEntityAccessor<S extends com.atlassian.jira.sharing.SharedEntity>
Known Indirect Subclasses

Class Overview

Provides an abstraction for accessing SharedEntity objects. This class abstracts away the details of the SharedEntity implementation to those components that need it.

Summary

Nested Classes
interface SharedEntityAccessor.Factory Factory to retrieve a SharedEntityAccessor for a given SharedEntity  
interface SharedEntityAccessor.RetrievalDescriptor Used when getting a Collection of shared entities
Public Methods
void adjustFavouriteCount(SharedEntity entity, int adjustmentValue)
Adjusts the favourite counts for a given entity.
EnclosedIterable<S> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result.
EnclosedIterable<S> get(ApplicationUser searcher, SharedEntityAccessor.RetrievalDescriptor descriptor)
Used to get sharable entities from a search result.
EnclosedIterable<S> getAll()
This method is deprecated. This has been moved to the PortalPageManager and deprecated for SearchRequestManager. Since v5.2.
EnclosedIterable<SharedEntity> getAllIndexableSharedEntities()
Get all sharable entities this accessor can see for use in indexing.
S getSharedEntity(ApplicationUser user, Long entityId)
This is called to get SharedEntity by id If the user is allows to see it
S getSharedEntity(Long entityId)
This will call back to ask for a SharedEntity based on id.
TypeDescriptor<S> getType()
Returns the type that this object can work with.
boolean hasPermissionToUse(ApplicationUser user, S entity)
Returns true if the user has permission to use the SharedEntity

Public Methods

public void adjustFavouriteCount (SharedEntity entity, int adjustmentValue)

Adjusts the favourite counts for a given entity. This resulting value must always be greater or equal to one.

Parameters
entity the entity to adjust
adjustmentValue the value to adjust by.

public EnclosedIterable<S> get (SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result.

Parameters
descriptor retrieval descriptor

public EnclosedIterable<S> get (ApplicationUser searcher, SharedEntityAccessor.RetrievalDescriptor descriptor)

Used to get sharable entities from a search result. The entities returned may be modified by the user parameter (e.g. permissions or clause sanitisation).

Parameters
searcher the user performing the search
descriptor retrieval descriptor

public EnclosedIterable<S> getAll ()

This method is deprecated.
This has been moved to the PortalPageManager and deprecated for SearchRequestManager. Since v5.2.

Get all sharable entities this accessor can see.

public EnclosedIterable<SharedEntity> getAllIndexableSharedEntities ()

Get all sharable entities this accessor can see for use in indexing.

public S getSharedEntity (ApplicationUser user, Long entityId)

This is called to get SharedEntity by id If the user is allows to see it

Parameters
user the user in play
entityId the id of the SharedEntity
Returns
  • a SharedEntity if it exists and the user can see it and null otherwise

public S getSharedEntity (Long entityId)

This will call back to ask for a SharedEntity based on id.

Parameters
entityId the id of the SharedEntity
Returns

public TypeDescriptor<S> getType ()

Returns the type that this object can work with.

Returns
  • the type that this object can work with.

public boolean hasPermissionToUse (ApplicationUser user, S entity)

Returns true if the user has permission to use the SharedEntity

Parameters
user the user in play
entity the SharedEntity to check
Returns
  • true if the user has permission to use it