Package org.wso2.carbon.governance.api.services

Examples of org.wso2.carbon.governance.api.services.ServiceManager.addService()


      public void addService(ServiceDO serviceDO) throws BAMException {

          BAMConfigurationDSClient client = null;
          try {
              client = BAMUtil.getBAMConfigurationDSClient();
              client.addService(serviceDO);
          } catch (BAMException e) {
              throw e;
          } finally {
              if (client != null) {
                  client.cleanup();
View Full Code Here


        // we should not add the server if it is not in the config tables.
        // unlike in the case with services when operations are added.
        BAMConfigurationDSClient client = null;
        try {
            client = BAMUtil.getBAMConfigurationDSClient();
            client.addService(service);
        } finally {
            if (client != null) {
                client.cleanup();
            }
        }
View Full Code Here

                    service.setServerID(serverID);
                    // This is to guard against occasional race condition of service
                    // being added while operation is also being added.
                    boolean raceCondition = false;
                    try {
                        configurationDSClient.addService(service);
                        BAMConfigurationCache.addService(service);
                    } catch (Exception ignore) {
                        // In this case the service should have already been added
                        // to the DB, thus the following getService
                        // now would definitely retrieve it the service.
View Full Code Here

                                            newResource.setMediaType(org.wso2.carbon.registry.extensions.utils.CommonConstants.SERVICE_MEDIA_TYPE);
                                            Properties properties = new Properties(resource.getProperties());
                                            newResource.setProperties(properties);

                                            Service service = manager.newService(serviceElement);
                                            manager.addService(service);
                                            resourcePath = CommonUtil.computeServicePathWithVersion(resourcePath, parameterMap.get(currentResourcePath));
                                            changed = true;

                                        } else if (action.equals("Demote")) {
                                            return;
View Full Code Here

    public void testAddService() throws Exception {
        ServiceManager serviceManager = new ServiceManager(registry);

        Service service = serviceManager.newService(new QName("http://bang.boom.com/mnm/beep", "MyService"));
        service.addAttribute("testAttribute", "somevalue");
        serviceManager.addService(service);

        String serviceId = service.getId();
        Service newService = serviceManager.getService(serviceId);

        assertEquals(newService.getAttribute("testAttribute"), "somevalue");
View Full Code Here

        ServiceManager serviceManager = new ServiceManager(registry);                                      
        Service service = serviceManager.newService(contentElement);

        service.addAttribute("custom-attribute", "custom-value");
        serviceManager.addService(service);


        // so retrieve it back
        String serviceId = service.getId();
        Service newService = serviceManager.getService(serviceId);
View Full Code Here

                "/_system/governance/wsdls/com/foo/abc.wsdl");
        assertEquals(service.getQName(), newService.getQName());

        Service service2 = serviceManager.newService(new QName("http://baps.paps.mug/done", "meep"));
        service2.addAttribute("custom-attribute", "custom-value2");
        serviceManager.addService(service2);

        Service service3 =  serviceManager.newService(new QName("http://baps.paps.mug/jug", "peem"));
        service3.addAttribute("custom-attribute", "not-custom-value");
        serviceManager.addService(service3);
View Full Code Here

        service2.addAttribute("custom-attribute", "custom-value2");
        serviceManager.addService(service2);

        Service service3 =  serviceManager.newService(new QName("http://baps.paps.mug/jug", "peem"));
        service3.addAttribute("custom-attribute", "not-custom-value");
        serviceManager.addService(service3);

        Service service4 =  serviceManager.newService(new QName("http://baps.dadan.mug/jug", "doon"));
        service4.addAttribute("not-custom-attribute", "custom-value3");
        serviceManager.addService(service4);
View Full Code Here

        service3.addAttribute("custom-attribute", "not-custom-value");
        serviceManager.addService(service3);

        Service service4 =  serviceManager.newService(new QName("http://baps.dadan.mug/jug", "doon"));
        service4.addAttribute("not-custom-attribute", "custom-value3");
        serviceManager.addService(service4);

        Service[] services = serviceManager.findServices(new ServiceFilter() {
            public boolean matches(Service service) throws GovernanceException {
                String attributeVal = service.getAttribute("custom-attribute");
                if (attributeVal != null && attributeVal.startsWith("custom-value")) {
View Full Code Here

        Wsdl wsdl = wsdlManager.newWsdl("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/wsdl/BizService.wsdl");
         wsdlManager.addWsdl(wsdl);

        ServiceManager serviceManager = new ServiceManager(registry);
        Service service = serviceManager.newService(new QName("http://test/org/bang", "myservice"));
        serviceManager.addService(service);

        service.attachWSDL(wsdl);

        Wsdl[] wsdls = service.getAttachedWsdls();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.