1 22 package org.jboss.test.jaxr.scout.util; 23 24 import javax.xml.registry.infomodel.Association ; 25 import javax.xml.registry.infomodel.Concept ; 26 import javax.xml.registry.infomodel.Organization ; 27 import javax.xml.registry.infomodel.Key ; 28 29 33 public class ScoutUtil 34 { 35 public static void validateAssociation(Association a, String sourceOrgName) 36 throws Exception 37 { 38 Organization o = (Organization )a.getSourceObject(); 39 if(o.getName() == null || o.getName().getValue() == null) 40 throw new Exception ("Source OrgName in association is null"); 41 if (!o.getName().getValue().equals(sourceOrgName)) 42 { 43 throw new Exception ("Invalid Source Org in Association"); 44 } 45 o = (Organization )a.getTargetObject(); 46 if(o.getName()== null || o.getName().getValue() == null) 47 throw new Exception ("Target OrgName in association is null");; 48 Concept atype = a.getAssociationType(); 49 if(atype.getName() == null || atype.getName().getValue() ==null) 50 throw new Exception ("Concept stored in Association" ); 51 } 52 } 53 | Popular Tags |