use of org.nhindirect.config.store.CertPolicy in project nhin-d by DirectProject.
the class CertPolicyDaoImpl method updatePolicyAttributes.
@Override
@Transactional(readOnly = false)
public void updatePolicyAttributes(long id, String policyName, PolicyLexicon lexicon, byte[] policyData) throws ConfigurationStoreException {
validateState();
try {
final CertPolicy existingPolicy = this.getPolicyById(id);
if (existingPolicy == null)
throw new ConfigurationStoreException("Policy does not exist");
if (policyData != null && policyData.length > 0)
existingPolicy.setPolicyData(policyData);
if (policyName != null && !policyName.isEmpty())
existingPolicy.setPolicyName(policyName);
if (lexicon != null)
existingPolicy.setLexicon(lexicon);
entityManager.persist(existingPolicy);
entityManager.flush();
} catch (ConfigurationStoreException cse) {
throw cse;
}///CLOVER:OFF
catch (Exception e) {
throw new ConfigurationStoreException("Failed to update certificate policy attributes.", e);
}
///CLOVER:ON
}
Aggregations