Search in sources :

Example 6 with ElectronicSignatureVerified

use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureVerified in project nikita-noark5-core by HiOA-ABI.

the class ElectronicSignatureVerifiedService method getElectronicSignatureVerifiedOrThrow.

/**
 * Internal helper method. Rather than having a find and try catch in
 * multiple methods, we have it here once. If you call this, be aware
 * that you will only ever get a valid ElectronicSignatureVerified
 * object back. If there is no ElectronicSignatureVerified object,
 * a NoarkEntityNotFoundException exception is thrown
 *
 * @param systemId The systemId of the ElectronicSignatureVerified
 *                 object to retrieve
 * @return the ElectronicSignatureVerified object
 */
private ElectronicSignatureVerified getElectronicSignatureVerifiedOrThrow(@NotNull String systemId) {
    ElectronicSignatureVerified electronicSignatureVerified = electronicSignatureVerifiedRepository.findBySystemId(systemId);
    if (electronicSignatureVerified == null) {
        String info = INFO_CANNOT_FIND_OBJECT + " ElectronicSignatureVerified, using systemId " + systemId;
        logger.error(info);
        throw new NoarkEntityNotFoundException(info);
    }
    return electronicSignatureVerified;
}
Also used : ElectronicSignatureVerified(nikita.common.model.noark5.v4.metadata.ElectronicSignatureVerified) NoarkEntityNotFoundException(nikita.common.util.exceptions.NoarkEntityNotFoundException)

Example 7 with ElectronicSignatureVerified

use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureVerified in project nikita-noark5-core by HiOA-ABI.

the class ElectronicSignatureVerifiedService method findAll.

// All READ operations
/**
 * Retrieve a list of all ElectronicSignatureVerified objects
 *
 * @return list of ElectronicSignatureVerified objects wrapped as a
 * MetadataHateoas object
 */
@Override
public MetadataHateoas findAll() {
    MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) electronicSignatureVerifiedRepository.findAll(), ELECTRONIC_SIGNATURE_VERIFIED);
    metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
    return metadataHateoas;
}
Also used : INikitaEntity(nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(nikita.webapp.security.Authorisation) List(java.util.List) MetadataHateoas(nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)

Example 8 with ElectronicSignatureVerified

use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureVerified in project nikita-noark5-core by HiOA-ABI.

the class ElectronicSignatureVerifiedService method findByDescription.

/**
 * Retrieve all ElectronicSignatureVerified that have a given
 * description.
 * <br>
 * Note, this will be replaced by OData search.
 *
 * @param description Description of object you wish to retrieve. The
 *                    whole text, this is an exact search.
 * @return A list of ElectronicSignatureVerified objects wrapped as a
 * MetadataHateoas object
 */
@Override
public MetadataHateoas findByDescription(String description) {
    MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) electronicSignatureVerifiedRepository.findByDescription(description), ELECTRONIC_SIGNATURE_VERIFIED);
    metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
    return metadataHateoas;
}
Also used : INikitaEntity(nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity) Authorisation(nikita.webapp.security.Authorisation) List(java.util.List) MetadataHateoas(nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)

Aggregations

MetadataHateoas (nikita.common.model.noark5.v4.hateoas.metadata.MetadataHateoas)6 Authorisation (nikita.webapp.security.Authorisation)6 List (java.util.List)3 INikitaEntity (nikita.common.model.noark5.v4.interfaces.entities.INikitaEntity)3 ElectronicSignatureVerified (nikita.common.model.noark5.v4.metadata.ElectronicSignatureVerified)3 NoarkEntityNotFoundException (nikita.common.util.exceptions.NoarkEntityNotFoundException)1 AfterNoarkEntityUpdatedEvent (nikita.webapp.web.events.AfterNoarkEntityUpdatedEvent)1