Package io.meeds.social.observe.plugin
Class ObserverPlugin
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
io.meeds.social.observe.plugin.ObserverPlugin
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public abstract class ObserverPlugin
extends org.exoplatform.container.component.BaseComponentPlugin
A plugin that will be used by
ObserverService to check the edit and
access permission of observed objects-
Field Summary
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleancanObserve(long identityId, String objectId) Checks whether the user can watch an objectabstract longgetAudienceId(String objectId) Retrieves the identity Id of the target audience for which the observation will be possiblegetExtendedObserverObject(String objectId) Retrieves a specific Observed Object to watch/unwatch at the same time than the original content type.abstract Stringabstract longgetSpaceId(String objectId) Retrieves the Space Id of the target space for which which the observation will be possibleMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Constructor Details
-
ObserverPlugin
public ObserverPlugin()
-
-
Method Details
-
getObjectType
- Returns:
- object types that plugin handles
-
canObserve
public abstract boolean canObserve(long identityId, String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Checks whether the user can watch an object- Parameters:
identityId-IdentityidobjectId- object technical unique identifier- Returns:
- true if the user can access to an object, else false.
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
getAudienceId
public abstract long getAudienceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves the identity Id of the target audience for which the observation will be possible- Parameters:
objectId- Object Identifier- Returns:
IdentityId as long- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
getSpaceId
public abstract long getSpaceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves the Space Id of the target space for which which the observation will be possible- Parameters:
objectId- Object Identifier- Returns:
SpaceId as long- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
getExtendedObserverObject
public ObserverObject getExtendedObserverObject(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves a specific Observed Object to watch/unwatch at the same time than the original content type. Usefull for Activty Stream with Specific Activity Types for example.- Parameters:
objectId- Object Identifier- Returns:
ObserverObjectif extended by the plugin with the identified object, else null- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-