private void addSchema() throws IOException, RegistryException { SchemaManager schemaManager = new SchemaManager(governance); String schemaFilePath = ProductConstant.getResourceLocations(ProductConstant.GREG_SERVER_NAME) + File.separator + "schema" + File.separator; Schema schema = schemaManager.newSchema( FileManager.readFile(schemaFilePath + "Person.xsd").getBytes(), "Person.xsd"); schemaManager.addSchema(schema); schema = schemaManager.getSchema(schema.getId()); Resource resource = governance.get(schema.getPath()); resource.addProperty("z", "30"); governance.put(schema.getPath(), resource); }
private void addPolicy() throws RegistryException, IOException { PolicyManager policyManager = new PolicyManager(governance); String policyFilePath = ProductConstant.getResourceLocations(ProductConstant.GREG_SERVER_NAME) + File.separator + "policy" + File.separator; Policy policy = policyManager.newPolicy( FileManager.readFile(policyFilePath + "UTPolicy.xml").getBytes(), "UTPolicy.xml"); policyManager.addPolicy(policy); policy = policyManager.getPolicy(policy.getId()); Resource resource = governance.get(policy.getPath()); resource.addProperty("abcxyzpqr", "40"); governance.put(policy.getPath(), resource); }
private void addWSDL() throws IOException, RegistryException { WsdlManager wsdlManager = new WsdlManager(governance); Wsdl wsdl; String wsdlFilePath = ProductConstant.getResourceLocations(ProductConstant.GREG_SERVER_NAME) + File.separator + "wsdl" + File.separator; wsdl = wsdlManager.newWsdl( FileManager.readFile(wsdlFilePath + "echo.wsdl").getBytes(), "echo.wsdl"); wsdlManager.addWsdl(wsdl); wsdl = wsdlManager.getWsdl(wsdl.getId()); Resource resource = governance.get(wsdl.getPath()); resource.addProperty("y", "20"); governance.put(wsdl.getPath(), resource); }