@Override public void validate(Policy policy) throws Exception { if (this.policyType == null) { // Policy type is either setup by Id or by using our Internal name. // In the case of the MetadataPolicyConvertor its name must be what is // in front of the JSON property- x_Convertor prefix. e.g. MetadataPolicy_Converter this.policyType = this.policyApi.retrievePolicyType(policy.typeId); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate(policy, policyType); }
@Override public void validate(Policy policy) throws Exception { if(this.policyType==null){ // Policy type is either setup by Id or by using our Internal name. // In the case of the MetadataPolicyConvertor its name must be what is // in front of the JSON property- x_Convertor prefix. e.g. MetadataPolicy_Converter this.policyType = this.policyApi.retrievePolicyType( policy.typeId ); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate( policy, policyType ); }
@Override public void validate(Policy policy) throws Exception { if (this.policyType == null) { // as the custom policies can have any internal_name we need to use ID, instead of internal_name this.policyType = this.policyApi.retrievePolicyType(policy.typeId); } // Validate the json in this policy against the schema held for the given policyType. policyApi.validate(policy, policyType); }
private void addPolicyType(EnvironmentSnapshotImpl environmentSnapshot, Long policyTypeId){ if(environmentSnapshot.getPolicyTypes().containsKey(policyTypeId)) { return; } PolicyType policyType = policyApi.retrievePolicyType(policyTypeId); environmentSnapshot.getPolicyTypes().put(policyTypeId, policyType); }