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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract boolean
    canObserve(long identityId, String objectId)
    Checks whether the user can watch an object
    abstract long
    Retrieves the identity Id of the target audience for which the observation will be possible
    Retrieves a specific Observed Object to watch/unwatch at the same time than the original content type.
    abstract String
     
    abstract long
    getSpaceId(String objectId)
    Retrieves the Space Id of the target space for which which the observation will be possible

    Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

    getDescription, getName, setDescription, setName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ObserverPlugin

      public ObserverPlugin()
  • Method Details

    • getObjectType

      public abstract String 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 - Identity id
      objectId - 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:
      Identity Id 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:
      Space Id 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:
      ObserverObject if extended by the plugin with the identified object, else null
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - thrown when the object doesn't exists