Class MetadataServiceImpl

java.lang.Object
org.exoplatform.social.core.metadata.MetadataServiceImpl
All Implemented Interfaces:
org.exoplatform.social.metadata.MetadataService, org.picocontainer.Startable

public class MetadataServiceImpl extends Object implements org.exoplatform.social.metadata.MetadataService, org.picocontainer.Startable
  • Constructor Details

    • MetadataServiceImpl

      public MetadataServiceImpl(MetadataStorage metadataStorage, org.exoplatform.services.listener.ListenerService listenerService)
  • Method Details

    • createMetadata

      public org.exoplatform.social.metadata.model.Metadata createMetadata(org.exoplatform.social.metadata.model.Metadata metadata, long userIdentityId)
      Specified by:
      createMetadata in interface org.exoplatform.social.metadata.MetadataService
    • updateMetadata

      public org.exoplatform.social.metadata.model.Metadata updateMetadata(org.exoplatform.social.metadata.model.Metadata metadata, long userIdentityId)
      Specified by:
      updateMetadata in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataById

      public org.exoplatform.social.metadata.model.Metadata deleteMetadataById(long metadataId)
      Specified by:
      deleteMetadataById in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataBySpaceId

      public int deleteMetadataBySpaceId(long spaceId)
      Specified by:
      deleteMetadataBySpaceId in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataBySpaceIdAndAudienceId

      public int deleteMetadataBySpaceIdAndAudienceId(long spaceId, long audienceId)
      Specified by:
      deleteMetadataBySpaceIdAndAudienceId in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataByKey

      public org.exoplatform.social.metadata.model.Metadata getMetadataByKey(org.exoplatform.social.metadata.model.MetadataKey metadataKey)
      Specified by:
      getMetadataByKey in interface org.exoplatform.social.metadata.MetadataService
    • createMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem createMetadataItem(org.exoplatform.social.metadata.model.MetadataObject metadataObject, org.exoplatform.social.metadata.model.MetadataKey metadataKey, long userIdentityId) throws org.exoplatform.social.common.ObjectAlreadyExistsException
      Specified by:
      createMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.social.common.ObjectAlreadyExistsException
    • createMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem createMetadataItem(org.exoplatform.social.metadata.model.MetadataObject metadataObject, org.exoplatform.social.metadata.model.MetadataKey metadataKey, Map<String,String> properties, long userIdentityId, boolean broadcast) throws org.exoplatform.social.common.ObjectAlreadyExistsException
      Specified by:
      createMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.social.common.ObjectAlreadyExistsException
    • createMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem createMetadataItem(org.exoplatform.social.metadata.model.MetadataObject metadataObject, org.exoplatform.social.metadata.model.MetadataKey metadataKey, Map<String,String> properties, long userIdentityId) throws org.exoplatform.social.common.ObjectAlreadyExistsException
      Specified by:
      createMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.social.common.ObjectAlreadyExistsException
    • createMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem createMetadataItem(org.exoplatform.social.metadata.model.MetadataObject metadataObject, org.exoplatform.social.metadata.model.MetadataKey metadataKey, Map<String,String> properties, boolean broadcast) throws org.exoplatform.social.common.ObjectAlreadyExistsException
      Specified by:
      createMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.social.common.ObjectAlreadyExistsException
    • createMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem createMetadataItem(org.exoplatform.social.metadata.model.MetadataObject metadataObject, org.exoplatform.social.metadata.model.MetadataKey metadataKey, Map<String,String> properties) throws org.exoplatform.social.common.ObjectAlreadyExistsException
      Specified by:
      createMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.social.common.ObjectAlreadyExistsException
    • updateMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem updateMetadataItem(org.exoplatform.social.metadata.model.MetadataItem metadataItem, long userIdentityId, boolean broadcast)
      Specified by:
      updateMetadataItem in interface org.exoplatform.social.metadata.MetadataService
    • updateMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem updateMetadataItem(org.exoplatform.social.metadata.model.MetadataItem metadataItem, long userIdentityId)
      Specified by:
      updateMetadataItem in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem deleteMetadataItem(long itemId, boolean broadcast) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      deleteMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteMetadataItem

      public org.exoplatform.social.metadata.model.MetadataItem deleteMetadataItem(long itemId, long userIdentityId) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Specified by:
      deleteMetadataItem in interface org.exoplatform.social.metadata.MetadataService
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • deleteMetadataItemsByObject

      public void deleteMetadataItemsByObject(org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      deleteMetadataItemsByObject in interface org.exoplatform.social.metadata.MetadataService
    • deleteByMetadataTypeAndSpaceIdAndCreatorId

      public void deleteByMetadataTypeAndSpaceIdAndCreatorId(String metadataTypeName, long spaceId, long userIdentityId)
      Specified by:
      deleteByMetadataTypeAndSpaceIdAndCreatorId in interface org.exoplatform.social.metadata.MetadataService
    • deleteByMetadataTypeAndCreatorId

      public void deleteByMetadataTypeAndCreatorId(String metadataTypeName, long userIdentityId)
      Specified by:
      deleteByMetadataTypeAndCreatorId in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataItemsByMetadataTypeAndObject

      public void deleteMetadataItemsByMetadataTypeAndObject(String metadataType, org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      deleteMetadataItemsByMetadataTypeAndObject in interface org.exoplatform.social.metadata.MetadataService
    • deleteMetadataItemsByParentObject

      public void deleteMetadataItemsByParentObject(org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      deleteMetadataItemsByParentObject in interface org.exoplatform.social.metadata.MetadataService
    • deleteByMetadataItemsTypeAndUntilCreationDate

      public int deleteByMetadataItemsTypeAndUntilCreationDate(String metadataTypeName, long untilDate)
      Specified by:
      deleteByMetadataItemsTypeAndUntilCreationDate in interface org.exoplatform.social.metadata.MetadataService
    • shareMetadataItemsByObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> shareMetadataItemsByObject(org.exoplatform.social.metadata.model.MetadataObject sourceObject, String targetObjectId, long audienceId, long creatorId)
      Specified by:
      shareMetadataItemsByObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByObject(org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      getMetadataItemsByObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataTypeAndObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataTypeAndObject(String metadataType, org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      getMetadataItemsByMetadataTypeAndObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndObject(String metadataName, String metadataTypeName, String objectType, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndObject(String metadataName, String metadataTypeName, String objectType, String objectId, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceId

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceId(String metadataName, String metadataTypeName, String objectType, long spaceId, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceId in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndSpaceIds

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndSpaceIds(String metadataName, String metadataTypeName, List<Long> spaceIds, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndSpaceIds in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByFilter

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByFilter(org.exoplatform.social.metadata.MetadataFilter filter, long offset, long limit)
      Specified by:
      getMetadataItemsByFilter in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceIds

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceIds(String metadataName, String metadataTypeName, String objectType, List<Long> spaceIds, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndObjectAndSpaceIds in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataNameAndTypeAndObjectAndMetadataItemProperty

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataNameAndTypeAndObjectAndMetadataItemProperty(String metadataName, String metadataTypeName, String objectType, String propertyKey, String propertyValue, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataNameAndTypeAndObjectAndMetadataItemProperty in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataTypeAndCreator

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataTypeAndCreator(String metadataTypeName, long creatorId, long offset, long limit)
      Specified by:
      getMetadataItemsByMetadataTypeAndCreator in interface org.exoplatform.social.metadata.MetadataService
    • countMetadataItemsByMetadataTypeAndCreator

      public int countMetadataItemsByMetadataTypeAndCreator(String metadataTypeName, long creatorId)
      Specified by:
      countMetadataItemsByMetadataTypeAndCreator in interface org.exoplatform.social.metadata.MetadataService
    • countMetadataItemsByMetadataTypeAndAudienceId

      public Map<String,Long> countMetadataItemsByMetadataTypeAndAudienceId(String metadataTypeName, long creatorId, long spaceId)
      Specified by:
      countMetadataItemsByMetadataTypeAndAudienceId in interface org.exoplatform.social.metadata.MetadataService
    • countMetadataItemsByMetadataTypeAndSpacesIdAndCreatorId

      public Map<Long,Long> countMetadataItemsByMetadataTypeAndSpacesIdAndCreatorId(String metadataTypeName, long creatorId, List<Long> spacesId)
      Specified by:
      countMetadataItemsByMetadataTypeAndSpacesIdAndCreatorId in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataNamesByObject

      public Set<String> getMetadataNamesByObject(org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      getMetadataNamesByObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataNamesByMetadataTypeAndObject

      public List<String> getMetadataNamesByMetadataTypeAndObject(String metadataTypeName, String objectType, String objectId)
      Specified by:
      getMetadataNamesByMetadataTypeAndObject in interface org.exoplatform.social.metadata.MetadataService
    • findMetadataNamesByCreator

      public List<String> findMetadataNamesByCreator(String term, String metadataTypeName, long creatorId, long limit)
      Specified by:
      findMetadataNamesByCreator in interface org.exoplatform.social.metadata.MetadataService
    • findMetadataNamesByUserAndQuery

      public List<String> findMetadataNamesByUserAndQuery(String term, String metadataTypeName, Set<Long> audienceIds, long creatorId, long limit)
      Specified by:
      findMetadataNamesByUserAndQuery in interface org.exoplatform.social.metadata.MetadataService
    • findMetadataNamesByAudiences

      public List<String> findMetadataNamesByAudiences(String term, String metadataTypeName, Set<Long> audienceIds, long limit)
      Specified by:
      findMetadataNamesByAudiences in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataItemsByMetadataAndObject

      public List<org.exoplatform.social.metadata.model.MetadataItem> getMetadataItemsByMetadataAndObject(org.exoplatform.social.metadata.model.MetadataKey metadataKey, org.exoplatform.social.metadata.model.MetadataObject object)
      Specified by:
      getMetadataItemsByMetadataAndObject in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataObjectIds

      public List<String> getMetadataObjectIds(String metadataType, String metadataName, String objectType, long offset, long limit)
      Specified by:
      getMetadataObjectIds in interface org.exoplatform.social.metadata.MetadataService
    • addMetadataTypePlugin

      public void addMetadataTypePlugin(org.exoplatform.social.metadata.MetadataTypePlugin metadataTypePlugin)
      Specified by:
      addMetadataTypePlugin in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataTypePluginByName

      public org.exoplatform.social.metadata.MetadataTypePlugin getMetadataTypePluginByName(String name)
      Specified by:
      getMetadataTypePluginByName in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataTypeByName

      public org.exoplatform.social.metadata.model.MetadataType getMetadataTypeByName(String name)
      Specified by:
      getMetadataTypeByName in interface org.exoplatform.social.metadata.MetadataService
    • getMetadataTypes

      public List<org.exoplatform.social.metadata.model.MetadataType> getMetadataTypes()
      Specified by:
      getMetadataTypes in interface org.exoplatform.social.metadata.MetadataService
    • addMetadataPlugin

      public void addMetadataPlugin(org.exoplatform.social.metadata.MetadataInitPlugin metadataInitPlugin)
      Specified by:
      addMetadataPlugin in interface org.exoplatform.social.metadata.MetadataService
    • getMetadatas

      public List<org.exoplatform.social.metadata.model.Metadata> getMetadatas(String metadataTypeName, long limit)
      Specified by:
      getMetadatas in interface org.exoplatform.social.metadata.MetadataService
    • getMetadatasByProperty

      public List<org.exoplatform.social.metadata.model.Metadata> getMetadatasByProperty(String propertyKey, String propertyValue, long limit)
      Specified by:
      getMetadatasByProperty in interface org.exoplatform.social.metadata.MetadataService
    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable