test_class.declarator: validator = new CmsDJValidator()
test_class.modifier: private final
test_class.original_string: private final CmsDJValidator validator = new CmsDJValidator();
test_class.type: CmsDJValidator
test_class.var_name: validator
test_class.file: cmsdal/src/test/java/com/oneops/cms/util/CmsDJValidatorTest.java
test_class.identifier: CmsDJValidatorTest
test_case.body: @Test
  	public void testEmptyName(){
  		CmsRfcCI rfcCi = new CmsRfcCI();
  		rfcCi.setCiName("");
  		CIValidationResult result = this.validator.validateRfcCi(rfcCi);
  		assertTrue(result.getErrorMsg().startsWith("CI Name can not be empty!"),"unex:"+result.getErrorMsg());
  		assertEquals(result.isValidated(),false);
  	}
test_case.class_method_signature: CmsDJValidatorTest.testEmptyName()
test_case.full_signature: @Test public void testEmptyName()
test_case.identifier: testEmptyName
test_case.invocations: setCiName validateRfcCi assertTrue startsWith getErrorMsg getErrorMsg assertEquals isValidated
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testEmptyName()
focal_class.declarator: cmsMdProcessor
focal_class.modifier: private
focal_class.original_string: private CmsMdProcessor cmsMdProcessor;
focal_class.type: CmsMdProcessor
focal_class.var_name: cmsMdProcessor
focal_class.declarator: cmsNsProcessor
focal_class.modifier: private
focal_class.original_string: private CmsNsProcessor cmsNsProcessor;
focal_class.type: CmsNsProcessor
focal_class.var_name: cmsNsProcessor
focal_class.declarator: cmsCrypto
focal_class.modifier: private
focal_class.original_string: private CmsCrypto cmsCrypto;
focal_class.type: CmsCrypto
focal_class.var_name: cmsCrypto
focal_class.file: cmsdal/src/main/java/com/oneops/cms/util/CmsDJValidator.java
focal_class.identifier: CmsDJValidator
focal_class.class_method_signature: CmsDJValidator.setCmsMdProcessor(CmsMdProcessor cmsMdProcessor)
focal_class.full_signature: public void setCmsMdProcessor(CmsMdProcessor cmsMdProcessor)
focal_class.identifier: setCmsMdProcessor
focal_class.modifiers: public
focal_class.parameters: (CmsMdProcessor cmsMdProcessor)
focal_class.return: void
focal_class.signature: void setCmsMdProcessor(CmsMdProcessor cmsMdProcessor)
focal_class.class_method_signature: CmsDJValidator.setCmsNsProcessor(CmsNsProcessor cmsNsProcessor)
focal_class.full_signature: public void setCmsNsProcessor(CmsNsProcessor cmsNsProcessor)
focal_class.identifier: setCmsNsProcessor
focal_class.modifiers: public
focal_class.parameters: (CmsNsProcessor cmsNsProcessor)
focal_class.return: void
focal_class.signature: void setCmsNsProcessor(CmsNsProcessor cmsNsProcessor)
focal_class.class_method_signature: CmsDJValidator.setCmsCrypto(CmsCrypto cmsCrypto)
focal_class.full_signature: public void setCmsCrypto(CmsCrypto cmsCrypto)
focal_class.identifier: setCmsCrypto
focal_class.modifiers: public
focal_class.parameters: (CmsCrypto cmsCrypto)
focal_class.return: void
focal_class.signature: void setCmsCrypto(CmsCrypto cmsCrypto)
focal_class.class_method_signature: CmsDJValidator.validateRfcCi(CmsRfcCI rfcCi)
focal_class.full_signature: public CIValidationResult validateRfcCi(CmsRfcCI rfcCi)
focal_class.identifier: validateRfcCi
focal_class.modifiers: public
focal_class.parameters: (CmsRfcCI rfcCi)
focal_class.return: CIValidationResult
focal_class.signature: CIValidationResult validateRfcCi(CmsRfcCI rfcCi)
focal_class.class_method_signature: CmsDJValidator.validateRfcCiAttrs(CmsRfcCI rfcCi)
focal_class.full_signature: public CIValidationResult validateRfcCiAttrs(CmsRfcCI rfcCi)
focal_class.identifier: validateRfcCiAttrs
focal_class.modifiers: public
focal_class.parameters: (CmsRfcCI rfcCi)
focal_class.return: CIValidationResult
focal_class.signature: CIValidationResult validateRfcCiAttrs(CmsRfcCI rfcCi)
focal_class.class_method_signature: CmsDJValidator.validateRfcRelation(CmsRfcRelation rfcRelation, int fromClassId, int toClassId)
focal_class.full_signature: public CIValidationResult validateRfcRelation(CmsRfcRelation rfcRelation, int fromClassId, int toClassId)
focal_class.identifier: validateRfcRelation
focal_class.modifiers: public
focal_class.parameters: (CmsRfcRelation rfcRelation, int fromClassId, int toClassId)
focal_class.return: CIValidationResult
focal_class.signature: CIValidationResult validateRfcRelation(CmsRfcRelation rfcRelation, int fromClassId, int toClassId)
focal_class.class_method_signature: CmsDJValidator.validateRfcRelationAttrs(CmsRfcRelation rfcRelation)
focal_class.full_signature: public CIValidationResult validateRfcRelationAttrs(CmsRfcRelation rfcRelation)
focal_class.identifier: validateRfcRelationAttrs
focal_class.modifiers: public
focal_class.parameters: (CmsRfcRelation rfcRelation)
focal_class.return: CIValidationResult
focal_class.signature: CIValidationResult validateRfcRelationAttrs(CmsRfcRelation rfcRelation)
focal_class.class_method_signature: CmsDJValidator.encryptRfcAttrs(Map<String, CmsClazzAttribute> clazzAttrsMap, CmsRfcCI rfcCi, CIValidationResult encResult)
focal_class.full_signature: private void encryptRfcAttrs(Map<String, CmsClazzAttribute> clazzAttrsMap, CmsRfcCI rfcCi, CIValidationResult encResult)
focal_class.identifier: encryptRfcAttrs
focal_class.modifiers: private
focal_class.parameters: (Map<String, CmsClazzAttribute> clazzAttrsMap, CmsRfcCI rfcCi, CIValidationResult encResult)
focal_class.return: void
focal_class.signature: void encryptRfcAttrs(Map<String, CmsClazzAttribute> clazzAttrsMap, CmsRfcCI rfcCi, CIValidationResult encResult)
focal_class.class_method_signature: CmsDJValidator.rfcCisEqual(CmsRfcCI ci1, CmsRfcCI ci2)
focal_class.full_signature: public boolean rfcCisEqual(CmsRfcCI ci1, CmsRfcCI ci2)
focal_class.identifier: rfcCisEqual
focal_class.modifiers: public
focal_class.parameters: (CmsRfcCI ci1, CmsRfcCI ci2)
focal_class.return: boolean
focal_class.signature: boolean rfcCisEqual(CmsRfcCI ci1, CmsRfcCI ci2)
focal_class.class_method_signature: CmsDJValidator.rfcAttrsEqual(CmsRfcAttribute attr1, CmsRfcAttribute attr2)
focal_class.full_signature: public boolean rfcAttrsEqual(CmsRfcAttribute attr1, CmsRfcAttribute attr2)
focal_class.identifier: rfcAttrsEqual
focal_class.modifiers: public
focal_class.parameters: (CmsRfcAttribute attr1, CmsRfcAttribute attr2)
focal_class.return: boolean
focal_class.signature: boolean rfcAttrsEqual(CmsRfcAttribute attr1, CmsRfcAttribute attr2)
focal_class.class_method_signature: CmsDJValidator.equalStrs(String str1, String str2)
focal_class.full_signature: public boolean equalStrs(String str1, String str2)
focal_class.identifier: equalStrs
focal_class.modifiers: public
focal_class.parameters: (String str1, String str2)
focal_class.return: boolean
focal_class.signature: boolean equalStrs(String str1, String str2)
focal_class.class_method_signature: CmsDJValidator.getClazz(String clazzName)
focal_class.full_signature: private CmsClazz getClazz(String clazzName)
focal_class.identifier: getClazz
focal_class.modifiers: private
focal_class.parameters: (String clazzName)
focal_class.return: CmsClazz
focal_class.signature: CmsClazz getClazz(String clazzName)
focal_class.class_method_signature: CmsDJValidator.getRelationClazz(String relationName)
focal_class.full_signature: private CmsRelation getRelationClazz(String relationName)
focal_class.identifier: getRelationClazz
focal_class.modifiers: private
focal_class.parameters: (String relationName)
focal_class.return: CmsRelation
focal_class.signature: CmsRelation getRelationClazz(String relationName)
focal_class.class_method_signature: CmsDJValidator.getRelationClazzWithTargets(String relationName, int fromClassId, int toClassId)
focal_class.full_signature: private CmsRelation getRelationClazzWithTargets(String relationName, int fromClassId, int toClassId)
focal_class.identifier: getRelationClazzWithTargets
focal_class.modifiers: private
focal_class.parameters: (String relationName, int fromClassId, int toClassId)
focal_class.return: CmsRelation
focal_class.signature: CmsRelation getRelationClazzWithTargets(String relationName, int fromClassId, int toClassId)
focal_class.class_method_signature: CmsDJValidator.getNs(String nsPath)
focal_class.full_signature: private CmsNamespace getNs(String nsPath)
focal_class.identifier: getNs
focal_class.modifiers: private
focal_class.parameters: (String nsPath)
focal_class.return: CmsNamespace
focal_class.signature: CmsNamespace getNs(String nsPath)
focal_method.body: public CIValidationResult validateRfcCi(CmsRfcCI rfcCi) {
  		
  		CIValidationResult result = new CIValidationResult();
  		result.setValidated(true);
  
  		if (rfcCi.getCiName() == null || rfcCi.getCiName().length()==0) {
  			result.setValidated(false);
  			result.setErrorMsg("CI Name can not be empty!");
  			return result;
  		}
  		
  		CmsClazz clazz = getClazz(rfcCi.getCiClassName());
  		if (clazz == null) {
  			result.setValidated(false);
  			result.setErrorMsg("There is no class definition for " + rfcCi.getCiClassName());
  			return result;
  		}
  		rfcCi.setCiClassId(clazz.getClassId());
  		
  		if (rfcCi.getNsId() == 0) {
  			CmsNamespace ns = getNs(rfcCi.getNsPath());
  			if (ns == null) {
  				result.setValidated(false);
  				result.setErrorMsg("The namespace must be specified");
  				return result;
  			}
  			rfcCi.setNsId(ns.getNsId());
  		}
  		Map<String, CmsClazzAttribute> clazzAttrsMap = new HashMap<String, CmsClazzAttribute>(); 
  		for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) {
  			clazzAttrsMap.put(clazzAttr.getAttributeName(), clazzAttr);
  		}
  
  		//validate attributes
  		// if it's add then first lets check if all required attrs present
  		if ("add".equalsIgnoreCase(rfcCi.getRfcAction())) {
  			for (CmsClazzAttribute clazzAttr : clazz.getMdAttributes()) {
  				if (clazzAttr.getIsMandatory() && (rfcCi.getAttribute(clazzAttr.getAttributeName()) == null)) {
  					result.setValidated(false);
  					result.addErrorMsg("Attribute " + clazzAttr.getAttributeName() + " is required for ci type of " + clazz.getClassName());
  				}
  			}
  		}
  		// now lets check if some attrs does not belongs here
  		for (CmsRfcAttribute attr : rfcCi.getAttributes().values()) {
  			if (!clazzAttrsMap.containsKey(attr.getAttributeName())) {
  				result.setValidated(false);
  				result.addErrorMsg("Attribute " + attr.getAttributeName() + " is not defined in class " + clazz.getClassName());
  			} else {
  				attr.setAttributeId(clazzAttrsMap.get(attr.getAttributeName()).getAttributeId());
  			}
  		}
  		
  		if (!result.isValidated()) return result;
  		
  		encryptRfcAttrs(clazzAttrsMap, rfcCi, result);		
  
  		return result;
  	}
focal_method.class_method_signature: CmsDJValidator.validateRfcCi(CmsRfcCI rfcCi)
focal_method.full_signature: public CIValidationResult validateRfcCi(CmsRfcCI rfcCi)
focal_method.identifier: validateRfcCi
focal_method.invocations: setValidated getCiName length getCiName setValidated setErrorMsg getClazz getCiClassName setValidated setErrorMsg getCiClassName setCiClassId getClassId getNsId getNs getNsPath setValidated setErrorMsg setNsId getNsId getMdAttributes put getAttributeName equalsIgnoreCase getRfcAction getMdAttributes getIsMandatory getAttribute getAttributeName setValidated addErrorMsg getAttributeName getClassName values getAttributes containsKey getAttributeName setValidated addErrorMsg getAttributeName getClassName setAttributeId getAttributeId get getAttributeName isValidated encryptRfcAttrs
focal_method.modifiers: public
focal_method.parameters: (CmsRfcCI rfcCi)
focal_method.return: CIValidationResult
focal_method.signature: CIValidationResult validateRfcCi(CmsRfcCI rfcCi)