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

    • Constructor Detail

      • EntityServiceImpl

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

      • 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​(UUID entityUuid,
                                           UUID fileResourceUuid)
        Specified by:
        addRelatedFileresource in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      • buildNotificationUrl

        protected URI buildNotificationUrl​(String urlTemplate,
                                           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 List<E> getRandom​(int count)
        Specified by:
        getRandom in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      • getRelatedFileResources

        public 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 List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources​(UUID entityUuid)
        Specified by:
        getRelatedFileResources in interface EntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
      • saveRelatedFileResources

        public List<de.digitalcollections.model.api.identifiable.resource.FileResource> saveRelatedFileResources​(E entity,
                                                                                                                 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 List<de.digitalcollections.model.api.identifiable.resource.FileResource> saveRelatedFileResources​(UUID entityUuid,
                                                                                                                 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​(String action,
                                        String httpVerb,
                                        UUID uuid,
                                        de.digitalcollections.model.api.identifiable.entity.enums.EntityType entityType)
        Send a notification to an external url when an entity has changed