Examples of Api


Examples of org.apache.synapse.rest.API

            log.debug("Undeployment of the API named : "
                    + artifactName + " : Started");
        }

        try {
            API api = getSynapseConfiguration().getAPI(artifactName);
            if (api != null) {
                getSynapseConfiguration().removeAPI(artifactName);
                if (log.isDebugEnabled()) {
                    log.debug("Undeployment of the API named : "
                            + artifactName + " : Completed");
                }
                log.info("API named '" + api.getName() + "' has been undeployed");
            } else if (log.isDebugEnabled()) {
                log.debug("API " + artifactName + " has already been undeployed");
            }
        } catch (Exception e) {
            handleSynapseArtifactDeploymentError(
View Full Code Here

Examples of org.apache.synapse.rest.API

        if (log.isDebugEnabled()) {
            log.debug("Restoring the API with name : " + artifactName + " : Started");
        }

        try {
            API api = getSynapseConfiguration().getAPI(artifactName);
            OMElement apiElement = APISerializer.serializeAPI(api);
            if (api.getFileName() != null) {
                String fileName = getServerConfigurationInformation().getSynapseXMLLocation()
                        + File.separator + MultiXMLConfigurationBuilder.REST_API_DIR
                        + File.separator + api.getFileName();
                writeToFile(apiElement, fileName);
                if (log.isDebugEnabled()) {
                    log.debug("Restoring the API with name : " + artifactName + " : Completed");
                }
                log.info("API named '" + artifactName + "' has been restored");
View Full Code Here

Examples of org.apache.synapse.rest.API

            defineEndpointTemplate(config, elem, properties);
        }
    }

    public static void defineAPI(SynapseConfiguration config, OMElement elem) {
        API api = APIFactory.createAPI(elem);
        config.addAPI(api.getName(), api);
    }
View Full Code Here

Examples of org.apache.synapse.rest.API

    public void testAPISerialization1() throws Exception {
        String xml = "<api name=\"test\" context=\"/dictionary\" xmlns=\"http://ws.apache.org/ns/synapse\">" +
                "<resource url-mapping=\"/admin/view\" inSequence=\"in\" outSequence=\"out\"/></api>";
        OMElement om = AXIOMUtil.stringToOM(xml);
        API api = APIFactory.createAPI(om);
        OMElement out = APISerializer.serializeAPI(api);
        assertXMLEqual(xml, out.toString());
    }
View Full Code Here

Examples of org.apache.synapse.rest.API

    public void testAPISerialization2() throws Exception {
        String xml = "<api name=\"test\" context=\"/dictionary\" hostname=\"apache.org\" port=\"8243\"" +
                " xmlns=\"http://ws.apache.org/ns/synapse\"><resource url-mapping=\"/admin/view\" " +
                "inSequence=\"in\" outSequence=\"out\"/></api>";
        OMElement om = AXIOMUtil.stringToOM(xml);
        API api = APIFactory.createAPI(om);
        OMElement out = APISerializer.serializeAPI(api);
        assertXMLEqual(xml, out.toString());
    }
View Full Code Here

Examples of org.apache.synapse.rest.API

    public void testAPISerialization3() throws Exception {
        String xml = "<api name=\"test\" context=\"/dictionary\" hostname=\"apache.org\" port=\"8243\"" +
                " xmlns=\"http://ws.apache.org/ns/synapse\"><resource url-mapping=\"/admin/view\" " +
                "inSequence=\"in\"><outSequence><log/><send/></outSequence></resource></api>";
        OMElement om = AXIOMUtil.stringToOM(xml);
        API api = APIFactory.createAPI(om);
        OMElement out = APISerializer.serializeAPI(api);
        assertXMLEqual(xml, out.toString());
    }
View Full Code Here

Examples of org.apache.synapse.rest.API

    public void testAPISerialization4() throws Exception {
        String xml = "<api name=\"test\" context=\"/dictionary\" hostname=\"apache.org\" port=\"8243\"" +
                " xmlns=\"http://ws.apache.org/ns/synapse\"><resource url-mapping=\"/admin/view\" " +
                "outSequence=\"out\"><inSequence><log/><send/></inSequence></resource></api>";
        OMElement om = AXIOMUtil.stringToOM(xml);
        API api = APIFactory.createAPI(om);
        OMElement out = APISerializer.serializeAPI(api);
        assertXMLEqual(xml, out.toString());
    }
View Full Code Here

Examples of org.apache.synapse.rest.API

                "<resource url-mapping=\"/admin/*\"><inSequence><log/><send/></inSequence><outSequence>" +
                "<log/><send/></outSequence></resource><resource uri-template=\"/{char}/{word}\">" +
                "<inSequence><send/></inSequence><faultSequence><log level=\"full\"/></faultSequence>" +
                "</resource></api>";
        OMElement om = AXIOMUtil.stringToOM(xml);
        API api = APIFactory.createAPI(om);
        OMElement out = APISerializer.serializeAPI(api);
        assertXMLEqual(xml, out.toString());
    }
View Full Code Here

Examples of org.cloudi.API

    
    public Task(final int thread_index)
    {
        try
        {
            this.api = new API(thread_index);
        }
        catch (API.InvalidInputException e)
        {
            e.printStackTrace(API.err);
            System.exit(1);
View Full Code Here

Examples of org.jclouds.rest.annotations.Api

   }

   @Test
   public void testReadRunList() throws IOException {
      ChefApi chefApi = createMock(ChefApi.class);
      Api api = createMock(Api.class);

      RunListForGroup fn = new RunListForGroup(new BootstrapConfigForGroup("jclouds", chefApi), json);
      DatabagItem config = new DatabagItem("foo",
            "{\"tomcat6\":{\"ssl_port\":8433},\"run_list\":[\"recipe[apache2]\",\"role[webserver]\"]}");
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.