use of nikita.common.util.exceptions.NoarkEntityNotFoundException 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;
}
use of nikita.common.util.exceptions.NoarkEntityNotFoundException 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;
}
use of nikita.common.util.exceptions.NoarkEntityNotFoundException in project nikita-noark5-core by HiOA-ABI.
the class FormatService method getFormatOrThrow.
/**
* 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 Format object back. If there is no
* Format object, a NoarkEntityNotFoundException exception is thrown
*
* @param systemId The systemId of the Format object to retrieve
* @return the Format object
*/
private Format getFormatOrThrow(@NotNull String systemId) {
Format format = formatRepository.findBySystemId(systemId);
if (format == null) {
String info = INFO_CANNOT_FIND_OBJECT + " Format, using systemId " + systemId;
logger.error(info);
throw new NoarkEntityNotFoundException(info);
}
return format;
}
use of nikita.common.util.exceptions.NoarkEntityNotFoundException in project nikita-noark5-core by HiOA-ABI.
the class PostalCodeService method getPostalCodeOrThrow.
/**
* 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 PostalCode object back. If there
* is no PostalCode object, a NoarkEntityNotFoundException exception
* is thrown
*
* @param systemId The systemId of the PostalCode object to retrieve
* @return the PostalCode object
*/
private PostalCode getPostalCodeOrThrow(@NotNull String systemId) {
PostalCode postalCode = postalCodeRepository.findBySystemId(systemId);
if (postalCode == null) {
String info = INFO_CANNOT_FIND_OBJECT + " PostalCode, using " + "systemId " + systemId;
logger.error(info);
throw new NoarkEntityNotFoundException(info);
}
return postalCode;
}
use of nikita.common.util.exceptions.NoarkEntityNotFoundException in project nikita-noark5-core by HiOA-ABI.
the class RegistryEntryStatusService method getRegistryEntryStatusOrThrow.
/**
* 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 RegistryEntryStatus object back. If there
* is no RegistryEntryStatus object, a NoarkEntityNotFoundException exception
* is thrown
*
* @param systemId The systemId of the RegistryEntryStatus object to retrieve
* @return the RegistryEntryStatus object
*/
private RegistryEntryStatus getRegistryEntryStatusOrThrow(@NotNull String systemId) {
RegistryEntryStatus RegistryEntryStatus = RegistryEntryStatusRepository.findBySystemId(systemId);
if (RegistryEntryStatus == null) {
String info = INFO_CANNOT_FIND_OBJECT + " RegistryEntryStatus, using " + "systemId " + systemId;
logger.error(info);
throw new NoarkEntityNotFoundException(info);
}
return RegistryEntryStatus;
}
Aggregations