for (int i = 0, n = contract.getBindings().size(); i < n; i++) {
Binding binding = contract.getBindings().get(i);
extensionProcessor.resolve(binding, resolver);
if (binding instanceof IntentAttachPoint) {
IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
if ( policiedBinding.getType() != null && policiedBinding.getType().isUnresolved() ) {
IntentAttachPointType resolved =
resolver.resolveModel(IntentAttachPointType.class,
policiedBinding.getType());
policiedBinding.setType(resolved);
}
resolveIntents(policiedBinding.getRequiredIntents(), resolver);
PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
}
if (binding instanceof PolicySetAttachPoint) {
PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
resolvePolicySets(policiedBinding.getPolicySets(), resolver);
//validate if attached policysets apply to the binding
resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
//inherit the applicable policysets from parent contract as whatever applies to that
//applies to the binding as well
addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
PolicyValidationUtils.validatePolicySets(policiedBinding);
}
if (binding instanceof OperationsConfigurator) {
OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
resolveIntents(confOp.getRequiredIntents(), resolver);
PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
resolvePolicySets(confOp.getPolicySets(), resolver);
resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
//inherit the applicable policysets from parent binding as whatever applies to that
//applies to the binding as well
addInheritedPolicySets(((PolicySetAttachPoint)binding).getApplicablePolicySets(),
confOp.getApplicablePolicySets());
PolicyValidationUtils.validatePolicySets(confOp, ((PolicySetAttachPoint)binding).getType());
}
}
}
// Resolve callback bindings
if (contract.getCallback() != null) {
resolveIntents(contract.getCallback().getRequiredIntents(), resolver);
resolvePolicySets(contract.getCallback().getPolicySets(), resolver);
resolvePolicySets(contract.getCallback().getApplicablePolicySets(), resolver);
//inherit the contract's policy intents and policysets
addInheritedPolicySets(contract.getApplicablePolicySets(), contract.getCallback().getApplicablePolicySets());
for (int i = 0, n = contract.getCallback().getBindings().size(); i < n; i++) {
Binding binding = contract.getCallback().getBindings().get(i);
extensionProcessor.resolve(binding, resolver);
if (binding instanceof IntentAttachPoint) {
IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
if ( policiedBinding.getType().isUnresolved() ) {
IntentAttachPointType resolved =
resolver.resolveModel(IntentAttachPointType.class,
policiedBinding.getType());
policiedBinding.setType(resolved);
}
resolveIntents(policiedBinding.getRequiredIntents(), resolver);
PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
}
if (binding instanceof PolicySetAttachPoint) {
PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
resolvePolicySets(policiedBinding.getPolicySets(), resolver);
//validate if attached policysets apply to the binding
resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
//inherit the applicable policysets from parent contract as whatever applies to that
//applies to the binding as well
addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
PolicyValidationUtils.validatePolicySets(policiedBinding);
}
if (binding instanceof OperationsConfigurator) {
OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;