use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureSecurityLevel in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureSecurityLevelService method findByCode.
/**
* retrieve all ElectronicSignatureSecurityLevel that have a particular code.
* <br>
* Note, this will be replaced by OData search.
*
* @param code The code of the object you wish to retrieve
* @return A list of ElectronicSignatureSecurityLevel objects wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas findByCode(String code) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) electronicSignatureSecurityLevelRepository.findByCode(code), ELECTRONIC_SIGNATURE_SECURITY_LEVEL);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureSecurityLevel in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureSecurityLevelService method generateDefaultElectronicSignatureSecurityLevel.
/**
* Generate a default ElectronicSignatureSecurityLevel object
*
* @return the ElectronicSignatureSecurityLevel object wrapped as a
* ElectronicSignatureSecurityLevelHateoas object
*/
@Override
public ElectronicSignatureSecurityLevel generateDefaultElectronicSignatureSecurityLevel() {
ElectronicSignatureSecurityLevel electronicSignatureSecurityLevel = new ElectronicSignatureSecurityLevel();
electronicSignatureSecurityLevel.setCode(TEMPLATE_ELECTRONIC_SIGNATURE_SECURITY_LEVEL_CODE);
electronicSignatureSecurityLevel.setDescription(TEMPLATE_ELECTRONIC_SIGNATURE_SECURITY_LEVEL_DESCRIPTION);
return electronicSignatureSecurityLevel;
}
use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureSecurityLevel in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureSecurityLevelService method findByDescription.
/**
* Retrieve all ElectronicSignatureSecurityLevel 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 ElectronicSignatureSecurityLevel objects wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas findByDescription(String description) {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) electronicSignatureSecurityLevelRepository.findByDescription(description), ELECTRONIC_SIGNATURE_SECURITY_LEVEL);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureSecurityLevel in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureSecurityLevelService method findAll.
// All READ operations
/**
* Retrieve a list of all ElectronicSignatureSecurityLevel objects
*
* @return list of ElectronicSignatureSecurityLevel objects wrapped as a
* MetadataHateoas object
*/
@Override
public MetadataHateoas findAll() {
MetadataHateoas metadataHateoas = new MetadataHateoas((List<INikitaEntity>) (List) electronicSignatureSecurityLevelRepository.findAll(), ELECTRONIC_SIGNATURE_SECURITY_LEVEL);
metadataHateoasHandler.addLinks(metadataHateoas, new Authorisation());
return metadataHateoas;
}
use of nikita.common.model.noark5.v4.metadata.ElectronicSignatureSecurityLevel in project nikita-noark5-core by HiOA-ABI.
the class ElectronicSignatureSecurityLevelService method getElectronicSignatureSecurityLevelOrThrow.
/**
* 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 ElectronicSignatureSecurityLevel
* object back. If there is no ElectronicSignatureSecurityLevel object,
* a NoarkEntityNotFoundException exception is thrown
*
* @param systemId The systemId of the ElectronicSignatureSecurityLevel
* object to retrieve
* @return the ElectronicSignatureSecurityLevel object
*/
private ElectronicSignatureSecurityLevel getElectronicSignatureSecurityLevelOrThrow(@NotNull String systemId) {
ElectronicSignatureSecurityLevel electronicSignatureSecurityLevel = electronicSignatureSecurityLevelRepository.findBySystemId(systemId);
if (electronicSignatureSecurityLevel == null) {
String info = INFO_CANNOT_FIND_OBJECT + " ElectronicSignatureSecurityLevel, using systemId " + systemId;
logger.error(info);
throw new NoarkEntityNotFoundException(info);
}
return electronicSignatureSecurityLevel;
}
Aggregations