Class EntityServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>

java.lang.Object
de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl<E>
de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.EntityServiceImpl<E>
All Implemented Interfaces:
EntityService<E>, IdentifiableService<E>
Direct Known Subclasses:
AgentServiceImpl, ArticleServiceImpl, CollectionServiceImpl, CorporateBodyServiceImpl, DigitalObjectServiceImpl, GeoLocationServiceImpl, HumanSettlementServiceImpl, ItemServiceImpl, PersonServiceImpl, ProjectServiceImpl, TopicServiceImpl, WebsiteServiceImpl, WorkServiceImpl

@Service
public class EntityServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
extends IdentifiableServiceImpl<E>
implements EntityService<E>
  • Field Details

    • hookProperties

      @Autowired protected HookProperties hookProperties
    • httpClient

      protected java.net.http.HttpClient httpClient
  • Constructor Details

    • EntityServiceImpl

      @Autowired public EntityServiceImpl​(@Qualifier("entityRepositoryImpl") EntityRepository<E> repository)
  • Method Details

    • addRelatedFileresource

      public void addRelatedFileresource​(E entity, de.digitalcollections.model.api.identifiable.resource.FileResource fileResource)
      Specified by:
      addRelatedFileresource in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • addRelatedFileresource

      public void addRelatedFileresource​(java.util.UUID entityUuid, java.util.UUID fileResourceUuid)
      Specified by:
      addRelatedFileresource in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • buildNotificationUrl

      protected java.net.URI buildNotificationUrl​(java.lang.String urlTemplate, java.util.UUID entityUuid, de.digitalcollections.model.api.identifiable.entity.enums.EntityType entityType)
      Build a notification url by replacing placeholders in the template with the entity's uuid and type
    • filteringForActive

      protected de.digitalcollections.model.api.filter.Filtering filteringForActive()
    • getByRefId

      public E getByRefId​(long refId)
      Specified by:
      getByRefId in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • getRandom

      public de.digitalcollections.model.api.paging.PageResponse<E> getRandom​(int count)
      Specified by:
      getRandom in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • getRelatedFileResources

      public java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources​(E entity)
      Specified by:
      getRelatedFileResources in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • getRelatedFileResources

      public java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources​(java.util.UUID entityUuid)
      Specified by:
      getRelatedFileResources in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • save

      public E save​(E entity) throws IdentifiableServiceException
      Specified by:
      save in interface IdentifiableService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      Overrides:
      save in class IdentifiableServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      Throws:
      IdentifiableServiceException
    • saveRelatedFileResources

      public java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> saveRelatedFileResources​(E entity, java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> fileResources)
      Description copied from interface: EntityService
      Save list of file resources related to an entity. Prerequisite: file resources have been saved before (exist already)
      Specified by:
      saveRelatedFileResources in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      Parameters:
      entity - entity the fileresources are related to
      fileResources - the fileresources that are related to the entity
      Returns:
      the list of the related fileresources
    • saveRelatedFileResources

      public java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> saveRelatedFileResources​(java.util.UUID entityUuid, java.util.List<de.digitalcollections.model.api.identifiable.resource.FileResource> fileResources)
      Specified by:
      saveRelatedFileResources in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
    • sendNotification

      protected void sendNotification​(java.lang.String action, java.lang.String httpVerb, java.util.UUID uuid, de.digitalcollections.model.api.identifiable.entity.enums.EntityType entityType)
      Send a notification to an external url when an entity has changed
    • update

      public E update​(E entity) throws IdentifiableServiceException
      Specified by:
      update in interface IdentifiableService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      Overrides:
      update in class IdentifiableServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      Throws:
      IdentifiableServiceException