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 Summary
Fields Modifier and Type Field Description protected HookPropertieshookPropertiesprotected HttpClienthttpClient-
Fields inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
repository
-
-
Constructor Summary
Constructors Constructor Description EntityServiceImpl(EntityRepository<E> repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRelatedFileresource(E entity, de.digitalcollections.model.api.identifiable.resource.FileResource fileResource)voidaddRelatedFileresource(UUID entityUuid, UUID fileResourceUuid)protected URIbuildNotificationUrl(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 typeprotected de.digitalcollections.model.api.filter.FilteringfilteringForActive()EgetByRefId(long refId)List<E>getRandom(int count)List<de.digitalcollections.model.api.identifiable.resource.FileResource>getRelatedFileResources(E entity)List<de.digitalcollections.model.api.identifiable.resource.FileResource>getRelatedFileResources(UUID entityUuid)Esave(E entity)List<de.digitalcollections.model.api.identifiable.resource.FileResource>saveRelatedFileResources(E entity, List<de.digitalcollections.model.api.identifiable.resource.FileResource> fileResources)Save list of file resources related to an entity.List<de.digitalcollections.model.api.identifiable.resource.FileResource>saveRelatedFileResources(UUID entityUuid, List<de.digitalcollections.model.api.identifiable.resource.FileResource> fileResources)protected voidsendNotification(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 changedEupdate(E entity)-
Methods inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
count, delete, find, find, find, findAllFull, findAllReduced, findByLanguageAndInitial, get, get, get, getByIdentifier, reduceMultilanguageFieldsToGivenLocale, setDefaultSorting
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.digitalcollections.cudami.server.business.api.service.identifiable.IdentifiableService
cleanupLabelFromUnwantedLocales, count, delete, delete, find, find, find, findAllFull, findAllReduced, findByLanguageAndInitial, get, get, get, getByIdentifier
-
-
-
-
Field Detail
-
hookProperties
@Autowired protected HookProperties hookProperties
-
httpClient
protected HttpClient httpClient
-
-
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:
addRelatedFileresourcein interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
-
addRelatedFileresource
public void addRelatedFileresource(UUID entityUuid, UUID fileResourceUuid)
- Specified by:
addRelatedFileresourcein interfaceEntityService<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:
getByRefIdin interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
-
getRandom
public List<E> getRandom(int count)
- Specified by:
getRandomin interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
-
getRelatedFileResources
public List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources(E entity)
- Specified by:
getRelatedFileResourcesin interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
-
getRelatedFileResources
public List<de.digitalcollections.model.api.identifiable.resource.FileResource> getRelatedFileResources(UUID entityUuid)
- Specified by:
getRelatedFileResourcesin interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>
-
save
public E save(E entity) throws IdentifiableServiceException
- Specified by:
savein interfaceIdentifiableService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>- Overrides:
savein classIdentifiableServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>- Throws:
IdentifiableServiceException
-
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:EntityServiceSave list of file resources related to an entity. Prerequisite: file resources have been saved before (exist already)- Specified by:
saveRelatedFileResourcesin interfaceEntityService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>- Parameters:
entity- entity the fileresources are related tofileResources- 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:
saveRelatedFileResourcesin interfaceEntityService<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
-
update
public E update(E entity) throws IdentifiableServiceException
- Specified by:
updatein interfaceIdentifiableService<E extends de.digitalcollections.model.api.identifiable.entity.Entity>- Overrides:
updatein classIdentifiableServiceImpl<E extends de.digitalcollections.model.api.identifiable.entity.Entity>- Throws:
IdentifiableServiceException
-
-