Package org.apache.airavata.commons.gfac.type

Examples of org.apache.airavata.commons.gfac.type.HostDescription


        registry.removeHostDescriptor("testHost");
    }


    public void testGetHostDescriptor() throws Exception {
        HostDescription descriptor = new HostDescription(GlobusHostType.type);
        descriptor.getType().setHostName("testHost");
        descriptor.getType().setHostAddress("testHostAddress");
        registry.addHostDescriptor(descriptor);
        HostDescription hostDescriptor = registry.getHostDescriptor("testHost");
        assertNotNull("host descriptor retrieved successfully", hostDescriptor);
        registry.removeHostDescriptor("testHost");
    }
View Full Code Here


        assertNotNull("host descriptor retrieved successfully", hostDescriptor);
        registry.removeHostDescriptor("testHost");
    }

    public void testRemoveHostDescriptor() throws Exception {
        HostDescription descriptor = new HostDescription(GlobusHostType.type);
        descriptor.getType().setHostName("testHost");
        descriptor.getType().setHostAddress("testHostAddress");
        registry.addHostDescriptor(descriptor);
        registry.removeHostDescriptor("testHost");
        assertFalse("host descriptor removed successfully", registry.isHostDescriptorExists("testHost"));
    }
View Full Code Here

        registry.removeHostDescriptor("testHost");
        assertFalse("host descriptor removed successfully", registry.isHostDescriptorExists("testHost"));
    }

    public void testGetHostDescriptors() throws Exception {
        HostDescription descriptor = new HostDescription(GlobusHostType.type);
        descriptor.getType().setHostName("testHost");
        descriptor.getType().setHostAddress("testHostAddress");
        registry.addHostDescriptor(descriptor);
        List<HostDescription> hostDescriptors = registry.getHostDescriptors();
        assertTrue("host descriptors retrieved successfully", hostDescriptors.size() == 1);
        registry.removeHostDescriptor("testHost");
    }
View Full Code Here

        applicationDeploymentDescription.getType().setApplicationName(applicationName);
        applicationDeploymentDescription.getType().setInputDataDirectory("/bin");
        applicationDeploymentDescription.getType().setExecutableLocation("/bin/echo");
        applicationDeploymentDescription.getType().setOutputDataDirectory("/tmp");

        HostDescription hostDescription = new HostDescription(GlobusHostType.type);
        hostDescription.getType().setHostName("testHost");
        hostDescription.getType().setHostAddress("testHostAddress");

        ServiceDescription serviceDescription = new ServiceDescription();
        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
        serviceDescription.getType().setName("testServiceDesc");
View Full Code Here

        applicationDeploymentDescription.getType().setApplicationName(applicationName);
        applicationDeploymentDescription.getType().setInputDataDirectory("/bin");
        applicationDeploymentDescription.getType().setExecutableLocation("/bin/echo");
        applicationDeploymentDescription.getType().setOutputDataDirectory("/tmp");

        HostDescription hostDescription = new HostDescription(GlobusHostType.type);
        hostDescription.getType().setHostName("testHost");
        hostDescription.getType().setHostAddress("testHostAddress");

        ServiceDescription serviceDescription = new ServiceDescription();
        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
        serviceDescription.getType().setName("testServiceDesc");
View Full Code Here

            throw new RuntimeException("Failed : HTTP error code : "
                    + status);
        }

        HostDescriptor hostDescriptor = response.getEntity(HostDescriptor.class);
        HostDescription hostDescription = DescriptorUtil.createHostDescription(hostDescriptor);
        return hostDescription;
    }
View Full Code Here

        HostDescriptionList hostDescriptionList = response.getEntity(HostDescriptionList.class);
        HostDescriptor[] hostDescriptors = hostDescriptionList.getHostDescriptions();

        for (HostDescriptor hostDescriptor : hostDescriptors) {
            HostDescription hostDescription = DescriptorUtil.createHostDescription(hostDescriptor);
            hostDescriptions.add(hostDescription);
        }

        return hostDescriptions;
    }
View Full Code Here

        StAXOMBuilder builder = new StAXOMBuilder(reader);
        OMElement documentElement = builder.getDocumentElement();
        Iterator server = documentElement.getChildrenWithName(new QName("server"));
        while (server.hasNext()) {
            OMElement next = (OMElement) server.next();
            HostDescription hostDescription;
            if (next.getFirstChildWithName(new QName("gram.endpoint")) != null) {
                hostDescription = new HostDescription(GlobusHostType.type);
                ((GlobusHostType) hostDescription.getType()).addGlobusGateKeeperEndPoint(next.getFirstChildWithName(new QName("gram.endpoint")).getText());
                ((GlobusHostType) hostDescription.getType()).addGridFTPEndPoint(next.getFirstChildWithName(new QName("gridftp.endpoint")).getText());
            } else {
                hostDescription = new HostDescription(HostDescriptionType.type);
            }
            (hostDescription.getType()).setHostName(next.getFirstChildWithName(new QName("name")).getText());
            (hostDescription.getType()).setHostAddress(next.getFirstChildWithName(new QName("host")).getText());
            hostDescriptions.add(hostDescription);
        }
        return hostDescriptions;
    }
View Full Code Here

    applicationContext.setHostDescription(getHostDesc());
    return applicationContext;
  }

  protected HostDescription getHostDesc() {
    HostDescription host = new HostDescription(UnicoreHostType.type);
    host.getType().setHostAddress("zam1161v01.zam.kfa-juelich.de");
    host.getType().setHostName("DEMO-INTEROP-SITE");
    ((UnicoreHostType) host.getType())
        .setUnicoreBESEndPointArray(hostArray);
    ((UnicoreHostType) host.getType())
        .setGridFTPEndPointArray(new String[] { gridftpAddress });
    return host;
  }
View Full Code Here

  }

  private void setupDescriptors() throws AiravataAPIInvocationException,
      DescriptorAlreadyExistsException, IOException {
    DescriptorBuilder descriptorBuilder = airavataAPI.getDescriptorBuilder();
    HostDescription hostDescription = descriptorBuilder.buildHostDescription(HostDescriptionType.type, "localhost2",
                "127.0.0.1");

        log("Adding host description ....");
        airavataAPI.getApplicationManager().addHostDescription(hostDescription);
        Assert.assertTrue(airavataAPI.getApplicationManager().isHostDescriptorExists(hostDescription.getType().getHostName()));
       
        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
        inputParameters.add(descriptorBuilder.buildInputParameterType("data1", "data1", DataType.STRING));
        inputParameters.add(descriptorBuilder.buildInputParameterType("data2", "data2", DataType.STRING));

        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
        outputParameters.add(descriptorBuilder.buildOutputParameterType("out", "out", DataType.STD_OUT));

        ServiceDescription serviceDescription = descriptorBuilder.buildServiceDescription("comma_app", "comma_app",
                inputParameters, outputParameters);
       
        ServiceDescription serviceDescription2 = descriptorBuilder.buildServiceDescription("echo_app", "echo_app",
                inputParameters, outputParameters);

        log("Adding service description ...");
        airavataAPI.getApplicationManager().addServiceDescription(serviceDescription);
        Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
                serviceDescription.getType().getName()));
       
        airavataAPI.getApplicationManager().addServiceDescription(serviceDescription2);
        Assert.assertTrue(airavataAPI.getApplicationManager().isServiceDescriptorExists(
                serviceDescription2.getType().getName()));

        // Deployment descriptor
        File executable = getFile("src/test/resources/comma_data.sh");
        Runtime.getRuntime().exec("chmod +x "+executable.getAbsolutePath());
    ApplicationDescription applicationDeploymentDescription = descriptorBuilder
                .buildApplicationDeploymentDescription("comma_app_localhost", executable.getAbsolutePath(), "/tmp");
    ApplicationDescription applicationDeploymentDescription2 = descriptorBuilder
                .buildApplicationDeploymentDescription("echo_app_localhost", "/bin/echo", "/tmp");

        log("Adding deployment description ...");
        airavataAPI.getApplicationManager().addApplicationDescription(serviceDescription, hostDescription,
                applicationDeploymentDescription);

        Assert.assertTrue(airavataAPI.getApplicationManager().isApplicationDescriptorExists(
                serviceDescription.getType().getName(), hostDescription.getType().getHostName(),
                applicationDeploymentDescription.getType().getApplicationName().getStringValue()));
       
        airavataAPI.getApplicationManager().addApplicationDescription(serviceDescription2, hostDescription,
                applicationDeploymentDescription2);

        Assert.assertTrue(airavataAPI.getApplicationManager().isApplicationDescriptorExists(
                serviceDescription2.getType().getName(), hostDescription.getType().getHostName(),
                applicationDeploymentDescription2.getType().getApplicationName().getStringValue()));
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.commons.gfac.type.HostDescription

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.