use of org.nhindirect.config.model.CertPolicyGroupDomainReltn in project nhin-d by DirectProject.
the class RESTSmtpAgentConfig method buildPolicyResolvers.
@Override
protected void buildPolicyResolvers() {
final Map<String, Collection<PolicyExpression>> incomingPrivatePolicies = new HashMap<String, Collection<PolicyExpression>>();
final Map<String, Collection<PolicyExpression>> outgoingPrivatePolicies = new HashMap<String, Collection<PolicyExpression>>();
final Map<String, Collection<PolicyExpression>> incomingPublicPolicies = new HashMap<String, Collection<PolicyExpression>>();
final Map<String, Collection<PolicyExpression>> outgoingPublicPolicies = new HashMap<String, Collection<PolicyExpression>>();
final Map<String, Collection<PolicyExpression>> trustPolicies = new HashMap<String, Collection<PolicyExpression>>();
Collection<CertPolicyGroupDomainReltn> domainReltns = null;
try {
// get all of the policy group to domain relations...
// doing this all in one call for efficiency
domainReltns = policyService.getPolicyGroupDomainReltns();
} catch (Exception e) {
throw new SmtpAgentException(SmtpAgentError.InvalidConfigurationFormat, "WebService error getting certificate policy configuration: " + e.getMessage(), e);
}
if (domainReltns != null) {
for (CertPolicyGroupDomainReltn domainReltn : domainReltns) {
if (domainReltn.getPolicyGroup().getPolicies() != null) {
for (CertPolicyGroupUse policyReltn : domainReltn.getPolicyGroup().getPolicies()) {
if (policyReltn.getPolicyUse().equals(CertPolicyUse.PRIVATE_RESOLVER)) {
if (policyReltn.isIncoming())
addPolicyToMap(incomingPrivatePolicies, domainReltn.getDomain().getDomainName(), policyReltn);
if (policyReltn.isOutgoing())
addPolicyToMap(outgoingPrivatePolicies, domainReltn.getDomain().getDomainName(), policyReltn);
} else if (policyReltn.getPolicyUse().equals(CertPolicyUse.PUBLIC_RESOLVER)) {
if (policyReltn.isIncoming())
addPolicyToMap(incomingPublicPolicies, domainReltn.getDomain().getDomainName(), policyReltn);
if (policyReltn.isOutgoing())
addPolicyToMap(outgoingPublicPolicies, domainReltn.getDomain().getDomainName(), policyReltn);
} else if (policyReltn.getPolicyUse().equals(CertPolicyUse.TRUST)) {
addPolicyToMap(trustPolicies, domainReltn.getDomain().getDomainName(), policyReltn);
}
}
}
}
}
publicPolicyResolverModule = PublicPolicyResolverModule.create(new DomainPolicyResolverProvider(incomingPublicPolicies, outgoingPublicPolicies));
privatePolicyResolverModule = PrivatePolicyResolverModule.create(new DomainPolicyResolverProvider(incomingPrivatePolicies, outgoingPrivatePolicies));
trustPolicyResolverModule = TrustPolicyResolverModule.create(new DomainPolicyResolverProvider(trustPolicies));
}
use of org.nhindirect.config.model.CertPolicyGroupDomainReltn in project nhin-d by DirectProject.
the class EntityModelConversion method toModelCertPolicyGroupDomainReltn.
public static CertPolicyGroupDomainReltn toModelCertPolicyGroupDomainReltn(org.nhindirect.config.store.CertPolicyGroupDomainReltn reltn) {
if (reltn == null)
return null;
final CertPolicyGroupDomainReltn retVal = new CertPolicyGroupDomainReltn();
retVal.setId(reltn.getId());
retVal.setPolicyGroup(toModelCertPolicyGroup(reltn.getCertPolicyGroup()));
retVal.setDomain(toModelDomain(reltn.getDomain()));
return retVal;
}
Aggregations