Package eu.admire.clienttoolkit.core

Examples of eu.admire.clienttoolkit.core.Gateway


            }
            else
            {
                String dispel = GraphConverter.convertToDISPEL(entry.getValue());
                LOG.debug("Remote DISPEL:\n" + dispel);
                Gateway gateway = null;
                GatewayProcess process = null;
                try
                {
                    gateway = GatewayFactory.get(location.getAddress());
                    process = gateway.submit(dispel);
                }
                catch (URISyntaxException e)
                {
                    LOG.error("Remote gateway address is invalid: " +
                            location.getAddress());
View Full Code Here


        if (args.length >= 3)
        {
            Util.setupSecurity(args[2]);
        }
       
        Gateway mGateway = null;
        String address = args[1];
       
        mGateway = GatewayFactory.get(address);           
        System.out.println("Gateway version = " + mGateway.getVersion());
        System.out.println("Gateway Local Data Resources = "
                + mGateway.getGatewayLocalDataResources());
        System.out.println("Gateway All Data Resources = "
                + mGateway.getGatewayAllDataResources());
       
        System.out.println("Gateway = " + mGateway);
        String dispelFile = Util.getFileContentAsString(args[0]);
        System.out.println(dispelFile);
       
        // if ip:port forwarding needs to be done to work around firewall problems
        // on the GATEWAY use the following method
        // mGateway.setForwardAddress(new InetSocketAddress("193.122.18.162", 8310));
       
        GatewayProcess mGatewayProcess = mGateway.submit(dispelFile);
       
        // if ip:port forwarding needs to be done to work around firewall problems
        // on the OGSADAI-USMT use the following method
        // mGatewayProcess.setForwardAddress(new InetSocketAddress("193.122.18.162", 8300));
       
View Full Code Here

        // get all resources from remote gateways
        for (Entry<String, GatewayLocation> gateway: mGatewayNamesToLocations.entrySet())
        {
            try
            {
                Gateway gtw = new GatewayClientREST(
                        new URI(gateway.getValue().getAddress()));
                for (String dataSource: gtw.getGatewayAllDataResources())
                {
                    addDataSourceAndGateway(dataSource, gateway.getKey());
                }
            }
            catch (Throwable e)
View Full Code Here

      //Commented out following expulsion of USMT, might use something
      //similar later
      //SSLClientSettings.setKeystores(keystore);
      //SSLClientSettings.disableHostnameVerification();

      Gateway gw = GatewayFactory.get(url);

      ValidationResult validationResult = gw.validate(Util
          .getFileContentAsString(dispel.getLocation().toString()));

      if (validationResult.getSubmittedGraphs().size() > 0) {

        graph = validationResult.getSubmittedGraphs().get(0);
View Full Code Here

    @Override
    public void run()
    {
        try {
            Gateway gw = GatewayFactory.get(mGatewayURL);

            GatewayProcess gatewayProcess = gw.submit(
                    Util.getFileContentAsString(
                            mDispel.getLocation().toString()));
            GatewayProcessManager.getInstance().register(gatewayProcess,
                    mDispel.getName());
View Full Code Here

        "submit echo;";

  @Test
  public void testSubmittingDISPEL() throws Exception
  {
      Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
      GatewayProcess p = g.submit(DISPEL_REQUEST);
      try
      {
          p.waitForResults();
         
          Map<String, Result> results = p.getResults();
          Result result = results.get("results");
          assertNotNull(result);
          String resultStr = Util.getAsString(result);
          assertEquals("Received wrong result", "[Hello World2!]", resultStr);
         
          Errors e = p.getErrors();
          assertNull("Caught a compile time error", e.getCompiletime());
          assertNull("Caught a runtime error", e.getRuntime());
          assertNull("Caught a registration error", e.getRegistration());
          assertNull("Caught a system error", e.getSystem());
   
          assertEquals(ProcessingStatus.COMPLETED, p.getStatus());
         
            // list all processes and check that this one in the list
          List<String> processes = g.getGatewayProcesses();
          boolean contained = false;
          for (String process : processes)
          {
              if (p.getAddress().endsWith(process))
              {
View Full Code Here

  }

    @Test
    public void testDISPELNoResults() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        String dispelRequest =
            "use uk.org.ogsadai.Echo;\n" +
            "use uk.org.ogsadai.DeliverToNull;\n" +
            "Echo echo = new Echo;\n" +
            "|- \"Hello World2!\" -| => echo.input;\n" +
            "DeliverToNull deliver = new DeliverToNull;\n" +
            "echo.output => deliver.input;\n" +
            "submit echo;";
        GatewayProcess p = g.submit(dispelRequest);
        try
        {
            p.waitForResults();
           
            Map<String, Result> results = p.getResults();
View Full Code Here

    }

    @Test
    public void testUnknownHost() throws Exception
    {
        Gateway g = GatewayFactory.get("http://unknown");
        try
        {
            g.submit(DISPEL_REQUEST);
            TestCase.fail("ServerException expected.");
        }
        catch (ServerException e)
        {
            // expected
View Full Code Here

    }

    @Test
    public void getVersionTest() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        // just test that there is no error
        String version = g.getVersion();
        assertNotNull(version);
    }
View Full Code Here

    }

    @Test
    public void getLocalDataResourcesTest() throws Exception
    {
        Gateway g = GatewayFactory.get(GATEWAY_ADDRESS);
        // just test that there is no error
        List<String> dataResources = g.getGatewayLocalDataResources();
        assertNotNull(dataResources);
    }
View Full Code Here

TOP

Related Classes of eu.admire.clienttoolkit.core.Gateway

Copyright © 2018 www.massapicom. 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.