Package org.apache.airavata.registry.api.impl

Examples of org.apache.airavata.registry.api.impl.JCRRegistry


    @Before
    public void setUp() throws Exception {
        /*
           * Create database
           */
        JCRRegistry jcrRegistry = new JCRRegistry(null,
                "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
                "admin", null);

        /*
           * Host
           */

        URL url = this.getClass().getClassLoader().getResource(GRAM_PROPERTIES);
        Properties properties = new Properties();
        properties.load(url.openStream());
        HostDescription host = new HostDescription();
        host.getType().changeType(GlobusHostType.type);
        host.getType().setHostName(properties.getProperty("gram.name"));
        host.getType().setHostAddress(properties.getProperty("gram.host"));
        ((GlobusHostType) host.getType()).setGridFTPEndPointArray(new String[]{properties.getProperty("gridftp.endpoint")});
        ((GlobusHostType) host.getType()).setGlobusGateKeeperEndPointArray(new String[]{properties.getProperty("globus.endpoints")});


        /*
        * App
        */
        ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription(GramApplicationDeploymentType.type);
        GramApplicationDeploymentType app = (GramApplicationDeploymentType) appDesc.getType();
        app.setCpuCount(1);
        app.setNodeCount(1);
        ApplicationDeploymentDescriptionType.ApplicationName name = appDesc.getType().addNewApplicationName();
        name.setStringValue("EchoLocal");
        app.setExecutableLocation("/bin/echo");
        app.setScratchWorkingDirectory(properties.getProperty("scratch.directory"));
        app.setCpuCount(1);
        ProjectAccountType projectAccountType = ((GramApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
        projectAccountType.setProjectAccountNumber(properties.getProperty("project.name"));

        /*
           * Service
           */
        ServiceDescription serv = new ServiceDescription();
        serv.getType().setName("SimpleEcho");

        InputParameterType input = InputParameterType.Factory.newInstance();
        ParameterType parameterType = input.addNewParameterType();
        parameterType.setName("echo_input");
        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
        inputList.add(input);
        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
                .size()]);

        OutputParameterType output = OutputParameterType.Factory.newInstance();
        ParameterType parameterType1 = output.addNewParameterType();
        parameterType1.setName("echo_output");
        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
        outputList.add(output);
        OutputParameterType[] outputParamList = outputList
                .toArray(new OutputParameterType[outputList.size()]);
        serv.getType().setInputParametersArray(inputParamList);
        serv.getType().setOutputParametersArray(outputParamList);

        /*
           * Save to registry
           */
        jcrRegistry.saveHostDescription(host);
        jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host.getType().getHostName(), appDesc);
        jcrRegistry.saveServiceDescription(serv);
        jcrRegistry.deployServiceOnHost(serv.getType().getName(), host.getType().getHostName());
    }
View Full Code Here


  @Before
  public void setUp() throws Exception {
    /*
     * Create database
     */
    JCRRegistry jcrRegistry = new JCRRegistry(null,
        "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
        "admin", null);

    /*
     * Host
     */
    HostDescription host = new HostDescription();
    host.getType().setHostName("localhost");
    host.getType().setHostAddress("localhost");

    /*
     * App
     */
    ApplicationDeploymentDescription appDesc = new ApplicationDeploymentDescription();
    ApplicationDeploymentDescriptionType app = appDesc.getType();
    ApplicationName name = ApplicationName.Factory.newInstance();
    name.setStringValue("EchoLocal");
    app.setApplicationName(name);
    app.setExecutableLocation("/bin/echo");
    app.setScratchWorkingDirectory("/tmp");
    app.setStaticWorkingDirectory("/tmp");
    app.setInputDataDirectory("/tmp/input");
    app.setOutputDataDirectory("/tmp/output");
    app.setStandardOutput("/tmp/echo.stdout");
    app.setStandardError("/tmp/echo.stdout");

    /*
     * Service
     */
    ServiceDescription serv = new ServiceDescription();
    serv.getType().setName("SimpleEcho");

    List<InputParameterType> inputList = new ArrayList<InputParameterType>();   
    InputParameterType input = InputParameterType.Factory.newInstance();
    input.setParameterName("echo_input");
    input.setParameterType(StringParameterType.Factory.newInstance());   
    inputList.add(input);
    InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
        .size()]);
   
    List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
    OutputParameterType output = OutputParameterType.Factory.newInstance();
    output.setParameterName("echo_output");
    output.setParameterType(StringParameterType.Factory.newInstance());   
    outputList.add(output);
    OutputParameterType[] outputParamList = outputList
        .toArray(new OutputParameterType[outputList.size()]);
   
    serv.getType().setInputParametersArray(inputParamList);
    serv.getType().setOutputParametersArray(outputParamList);

    /*
     * Save to registry
     */
    jcrRegistry.saveHostDescription(host);
    jcrRegistry.saveDeploymentDescription(serv.getType().getName(), host
        .getType().getHostName(), appDesc);
    jcrRegistry.saveServiceDescription(serv);
    jcrRegistry.deployServiceOnHost(serv.getType().getName(), host
        .getType().getHostName());
  }
View Full Code Here

    @Before
  public void setUp() throws Exception {
    /*
     * Create database
     */
        jcrRegistry = new JCRRegistry(null,
        "org.apache.jackrabbit.core.RepositoryFactoryImpl", "admin",
        "admin", null);

    /*
     * Host
 
View Full Code Here

                if (map.size() == 0)
                    map = null;

                try {
                    // TODO pass the url of the registry as the first parameter
                    this.registryService = new JCRRegistry(null, jcrClass, userName, password, map);
                } catch (javax.jcr.RepositoryException e) {
                    e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
                }

                log.info("Default registry service is created");
View Full Code Here

        String port = null;
        try {
            URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
            properties.load(url.openStream());
            Map<String, String> map = new HashMap<String, String>((Map) properties);
            Registry registry = new JCRRegistry(new URI(map.get(ORG_APACHE_JACKRABBIT_REPOSITORY_URI)),map.get(JCR_CLASS),map.get(JCR_USER),map.get(JCR_PASS), map);
            String localAddress = Utils.getIpAddress(context.getAxisConfiguration());
            TransportInDescription transportInDescription = context.getAxisConfiguration().getTransportsIn()
                    .get("http");
            if (transportInDescription != null && transportInDescription.getParameter("port") != null) {
                port = (String) transportInDescription.getParameter("port").getValue();
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.impl.JCRRegistry

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.