Class EntityServiceImpl<E extends de.digitalcollections.model.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("entityService") public class EntityServiceImpl<E extends de.digitalcollections.model.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.identifiable.resource.FileResource fileResource)voidaddRelatedFileresource(UUID entityUuid, UUID fileResourceUuid)protected URIbuildNotificationUrl(String urlTemplate, UUID entityUuid, de.digitalcollections.model.identifiable.entity.EntityType entityType)Build a notification url by replacing placeholders in the template with the entity's uuid and typeprotected de.digitalcollections.model.filter.FilteringfilteringForActive()EgetByRefId(long refId)List<E>getRandom(int count)List<de.digitalcollections.model.identifiable.resource.FileResource>getRelatedFileResources(E entity)List<de.digitalcollections.model.identifiable.resource.FileResource>getRelatedFileResources(UUID entityUuid)Esave(E entity)List<de.digitalcollections.model.identifiable.resource.FileResource>saveRelatedFileResources(E entity, List<de.digitalcollections.model.identifiable.resource.FileResource> fileResources)Save list of file resources related to an identifiable.List<de.digitalcollections.model.identifiable.resource.FileResource>saveRelatedFileResources(UUID entityUuid, List<de.digitalcollections.model.identifiable.resource.FileResource> fileResources)protected voidsendNotification(String action, String httpVerb, UUID uuid, de.digitalcollections.model.identifiable.entity.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
addRelatedEntity, count, delete, find, find, find, findAllFull, findAllReduced, findByLanguageAndInitial, get, get, get, getByIdentifier, getLanguages, getRelatedEntities, reduceMultilanguageFieldsToGivenLocale, saveRelatedEntities, 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
addRelatedEntity, addRelatedEntity, cleanupLabelFromUnwantedLocales, count, delete, delete, find, find, find, findAllFull, findAllReduced, findByLanguageAndInitial, get, get, get, getByIdentifier, getLanguages, getRelatedEntities, getRelatedEntities, saveRelatedEntities, saveRelatedEntities
-
-
-
-
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.identifiable.resource.FileResource fileResource)
- Specified by:
addRelatedFileresourcein interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
addRelatedFileresource
public void addRelatedFileresource(UUID entityUuid, UUID fileResourceUuid)
- Specified by:
addRelatedFileresourcein interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
addRelatedFileresourcein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
buildNotificationUrl
protected URI buildNotificationUrl(String urlTemplate, UUID entityUuid, de.digitalcollections.model.identifiable.entity.EntityType entityType)
Build a notification url by replacing placeholders in the template with the entity's uuid and type
-
filteringForActive
protected de.digitalcollections.model.filter.Filtering filteringForActive()
-
getByRefId
public E getByRefId(long refId)
- Specified by:
getByRefIdin interfaceEntityService<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
getRandom
public List<E> getRandom(int count)
- Specified by:
getRandomin interfaceEntityService<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
getRelatedFileResources
public List<de.digitalcollections.model.identifiable.resource.FileResource> getRelatedFileResources(E entity)
- Specified by:
getRelatedFileResourcesin interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
getRelatedFileResources
public List<de.digitalcollections.model.identifiable.resource.FileResource> getRelatedFileResources(UUID entityUuid)
- Specified by:
getRelatedFileResourcesin interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
getRelatedFileResourcesin classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
save
public E save(E entity) throws IdentifiableServiceException
- Specified by:
savein interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
savein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>- Throws:
IdentifiableServiceException
-
saveRelatedFileResources
public List<de.digitalcollections.model.identifiable.resource.FileResource> saveRelatedFileResources(E entity, List<de.digitalcollections.model.identifiable.resource.FileResource> fileResources)
Description copied from interface:IdentifiableServiceSave list of file resources related to an identifiable. Prerequisite: file resources have been saved before (exist already)- Specified by:
saveRelatedFileResourcesin interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Parameters:
entity- entity part the file resources are related tofileResources- the file resources that are related to the entity part- Returns:
- the list of the related file resources
-
saveRelatedFileResources
public List<de.digitalcollections.model.identifiable.resource.FileResource> saveRelatedFileResources(UUID entityUuid, List<de.digitalcollections.model.identifiable.resource.FileResource> fileResources)
- Specified by:
saveRelatedFileResourcesin interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
saveRelatedFileResourcesin classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>
-
sendNotification
protected void sendNotification(String action, String httpVerb, UUID uuid, de.digitalcollections.model.identifiable.entity.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.identifiable.entity.Entity>- Overrides:
updatein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>- Throws:
IdentifiableServiceException
-
-