Class EntityServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>
java.lang.Object
de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl<I,R>
de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl<E,EntityRepository<E>>
de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.EntityServiceImpl<E>
- All Implemented Interfaces:
EntityService<E>,IdentifiableService<E>,UniqueObjectService<E>
- Direct Known Subclasses:
AgentServiceImpl,ArticleServiceImpl,CollectionServiceImpl,DigitalObjectServiceImpl,EventServiceImpl,GeoLocationServiceImpl,HeadwordEntryServiceImpl,ItemServiceImpl,ManifestationServiceImpl,ProjectServiceImpl,TopicServiceImpl,WebsiteServiceImpl,WorkServiceImpl
@Service("entityService")
public class EntityServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity>
extends IdentifiableServiceImpl<E,EntityRepository<E>>
implements EntityService<E>
-
Field Summary
FieldsFields inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
identifierServiceFields inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl
repository -
Constructor Summary
ConstructorsConstructorDescriptionEntityServiceImpl(EntityRepository<E> repository, IdentifierService identifierService, UrlAliasService urlAliasService, HookProperties hookProperties, LocaleService localeService, CudamiConfig cudamiConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRelatedFileresource(E entity, de.digitalcollections.model.identifiable.resource.FileResource fileResource) protected URIbuildNotificationUrl(String urlTemplate, UUID entityUuid, de.digitalcollections.model.identifiable.IdentifiableObjectType identifiableObjectType) Build a notification url by replacing placeholders in the template with the entity's uuid and typegetByRefId(long refId) voidPersist anUniqueObject(with validation)protected voidsendNotification(String action, String httpVerb, UUID uuid, de.digitalcollections.model.identifiable.IdentifiableObjectType identifiableObjectType) Send a notification to an external url when an entity has changedvoidUpdates an persistedUniqueObjectMethods inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
addRelatedEntity, find, findByLanguageAndInitial, findRelatedEntities, findRelatedFileResources, getByExampleAndLocale, getByIdentifier, getLanguages, reduceMultilanguageFieldsToGivenLocale, setRelatedEntities, setRelatedFileResources, validateMethods inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl
count, create, delete, delete, getAll, getByExamples, getByExamplesAndFiltering, getRandom, setDefaultSortingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.identifiable.IdentifiableService
addRelatedEntity, cleanupLabelFromUnwantedLocales, findByLanguageAndInitial, findRelatedEntities, findRelatedFileResources, getByExampleAndLocale, getByIdentifier, getLanguages, setRelatedEntities, setRelatedFileResources, validateMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.UniqueObjectService
count, create, delete, delete, find, getAll, getByExample, getByExamples, getByExamplesAndFiltering, getRandom
-
Field Details
-
hookProperties
-
httpClient
-
-
Constructor Details
-
EntityServiceImpl
public EntityServiceImpl(@Qualifier("entityRepositoryImpl") EntityRepository<E> repository, IdentifierService identifierService, UrlAliasService urlAliasService, HookProperties hookProperties, LocaleService localeService, CudamiConfig cudamiConfig)
-
-
Method Details
-
addRelatedFileresource
public void addRelatedFileresource(E entity, de.digitalcollections.model.identifiable.resource.FileResource fileResource) throws ServiceException - Specified by:
addRelatedFileresourcein interfaceIdentifiableService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
addRelatedFileresourcein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity,EntityRepository<E extends de.digitalcollections.model.identifiable.entity.Entity>> - Throws:
ServiceException
-
buildNotificationUrl
protected URI buildNotificationUrl(String urlTemplate, UUID entityUuid, de.digitalcollections.model.identifiable.IdentifiableObjectType identifiableObjectType) Build a notification url by replacing placeholders in the template with the entity's uuid and type -
getByRefId
- Specified by:
getByRefIdin interfaceEntityService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Throws:
ServiceException
-
save
Description copied from interface:UniqueObjectServicePersist anUniqueObject(with validation)- Specified by:
savein interfaceUniqueObjectService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
savein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity,EntityRepository<E extends de.digitalcollections.model.identifiable.entity.Entity>> - Parameters:
entity- theUniqueObject(not yet stored)- Throws:
ServiceException- in case of an errorValidationException- in case of a validation error
-
sendNotification
protected void sendNotification(String action, String httpVerb, UUID uuid, de.digitalcollections.model.identifiable.IdentifiableObjectType identifiableObjectType) Send a notification to an external url when an entity has changed -
update
Description copied from interface:UniqueObjectServiceUpdates an persistedUniqueObject- Specified by:
updatein interfaceUniqueObjectService<E extends de.digitalcollections.model.identifiable.entity.Entity>- Overrides:
updatein classIdentifiableServiceImpl<E extends de.digitalcollections.model.identifiable.entity.Entity,EntityRepository<E extends de.digitalcollections.model.identifiable.entity.Entity>> - Parameters:
entity- theUniqueObject(with set UUID)- Throws:
ServiceException- in case of an errorValidationException- in case of a validation error
-