Package org.apache.airavata.registry.api

Examples of org.apache.airavata.registry.api.AiravataRegistry


  private static HashMap<String, String> createConfig(URI registryUrl, String username, String password) throws RepositoryException, RegistryException {
    HashMap<String, String> config = new HashMap<String,String>();
    config.put(AiravataClient.JCR,registryUrl.toString());
    config.put(AiravataClient.JCR_USERNAME,username);
    config.put(AiravataClient.JCR_PASSWORD,password);
    AiravataRegistry registryObject = getRegistryObject(registryUrl, username, password);
    if (registryObject!=null){
      List<URI> URLList = registryObject.getEventingServiceURLList();
      config.put(AiravataClient.BROKER,URLList==null || URLList.size()==0? "http://localhost:8080/axis2/services/EventingService":URLList.get(0).toString());
      URLList = registryObject.getMessageBoxServiceURLList();
      config.put(AiravataClient.MSGBOX,URLList==null || URLList.size()==0? "http://localhost:8080/axis2/services/MsgBoxService":URLList.get(0).toString());
      URLList = registryObject.getInterpreterServiceURLList();
      config.put(AiravataClient.WORKFLOWSERVICEURL,URLList==null || URLList.size()==0? "http://localhost:8080/axis2/services/WorkflowInterpretor?wsdl":URLList.get(0).toString());
      config.put(AiravataClient.WITHLISTENER,"true");
    }
    return config;
  }
View Full Code Here


  private static AiravataRegistry getRegistryObject(URI uri, String jcrUsername, String jcrPassword) throws RepositoryException {
    try {
      HashMap<String, String> map = new HashMap<String, String>();
      map.put("org.apache.jackrabbit.repository.uri", uri.toString());
      AiravataRegistry registry = new AiravataJCRRegistry(
          uri,
          "org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory",
          jcrUsername,
          jcrPassword, map);
      return registry;
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(SchedulerImpl.class+
            "." + WorkflowContextHeaderBuilder.getCurrentContextHeader().getWorkflowMonitoringContext().getExperimentId());

    public Provider schedule(InvocationContext context) throws SchedulerException {

        AiravataRegistry registryService = context.getExecutionContext().getRegistryService();

        /*
         * Load Service
         */
        ServiceDescription serviceDesc = null;
        try {
            serviceDesc = registryService.getServiceDescription(context.getServiceName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }

        if (serviceDesc == null)
            throw new SchedulerException("Service Desciption for " + context.getServiceName()
                    + " does not found on resource Catalog " + registryService);

        /*
         * Load host
         */
        HostDescription host = scheduleToHost(registryService, context.getServiceName());

        if (host == null)
            throw new SchedulerException("Host Desciption for " + context.getServiceName()
                    + " does not found on resource Catalog " + registryService);

        /*
         * Load app
         */
        ApplicationDeploymentDescription app = null;
        try {
            app = registryService.getDeploymentDescription(context.getServiceName(),
                    getRegisteredHost(registryService,context.getServiceName()).getType().getHostName());
        } catch (RegistryException e2) {
            e2.printStackTrace();
        }

View Full Code Here

    }

    private void deleteApplicationDescription(JTree tree) throws Exception {
        if (askQuestion("Application descriptions",
                "Are you sure that you want to remove all application descriptions in this registry?")) {
            AiravataRegistry registry = getRegistry();
            List<ApplicationDeploymentDescriptionWrap> descriptions = getApplicationDeploymentDescriptions()
                    .getDescriptions();
            for (ApplicationDeploymentDescriptionWrap descriptionWrap : descriptions) {
                registry.deleteDeploymentDescription(descriptionWrap.getService(), descriptionWrap.getHost(),
                        descriptionWrap.getDescription().getType().getApplicationName().getStringValue());
            }
            refresh();
            reloadTreeNode(tree, this);
        }
View Full Code Here

        // workflow context
        MessageContext<String> workflowContext = context.getMessageContext(WorkflowContextImpl.WORKFLOW_CONTEXT_NAME);

        // registry
        AiravataRegistry registry = context.getExecutionContext().getRegistryService();

        if (outputContext != null && workflowContext != null) {

            String workflowId = workflowContext.getValue(WorkflowContextImpl.WORKFLOW_ID);
            List<ActualParameter> outputs = new ArrayList<ActualParameter>();

            for (Iterator<String> iterator = outputContext.getNames(); iterator.hasNext();) {
                String key = iterator.next();
                outputs.add(outputContext.getValue(key));
            }

            if (registry != null && DataRegistry.class.isAssignableFrom(registry.getClass())) {
                try {
          ((DataRegistry) registry).saveOutput(workflowId, outputs);
        } catch (RegistryException e) {
          log.error(e.getLocalizedMessage(), e);
        }
            } else {
                log.debug("Registry does not support for Data Catalog, CLass: " + registry.getClass());
            }

        } else {
            log.debug("Context is null");
        }
View Full Code Here

    }

    private void deleteServiceDescription(JTree tree) throws Exception {
        if (askQuestion("Applications",
                "Are you sure that you want to remove all applications defined in this registry?")) {
            AiravataRegistry registry = getRegistry();
            List<ServiceDescription> descriptions = getServiceDescriptions().getDescriptions();
            for (ServiceDescription descriptionWrap : descriptions) {
                registry.deleteServiceDescription(descriptionWrap.getType().getName());
            }
            refresh();
            reloadTreeNode(tree, this);
        }
    }
View Full Code Here

    }

    private void deleteHostDescription(JTree tree) throws Exception {
        if (askQuestion("Host descriptions",
                "Are you sure that you want to remove all host descriptions in this registry?")) {
            AiravataRegistry registry = getRegistry();
            List<HostDescription> descriptions = getHostDescriptions().getDescriptions();
            for (HostDescription descriptionWrap : descriptions) {
                registry.deleteHostDescription(descriptionWrap.getType().getHostName());
            }
            refresh();
            reloadTreeNode(tree, this);
        }
    }
View Full Code Here

                try {
            Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
          } catch (InterruptedException e1) {
            e1.printStackTrace();
          }
          AiravataRegistry registry = new AiravataJCRRegistry(
              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
View Full Code Here

        }
      }.start();
    }

    public void shutDown(ConfigurationContext configctx, AxisService service) {
        AiravataRegistry registry =  ((GFacConfiguration)configctx.getProperty(GFAC_CONFIGURATION)).getRegistry();
        String gfacURL = (String) configctx.getProperty(GFAC_URL);
        try {
      registry.deleteGFacDescriptor(gfacURL);
      thread.interrupt();
      try {
          thread.join();
      } catch (InterruptedException e) {
          log.info("GFacURL update thread is interrupted");
View Full Code Here

        public void run() {
            try {
                while (true) {
                    try {
            AiravataRegistry registry = ((GFacConfiguration)context.getProperty(GFAC_CONFIGURATION)).getRegistry();
            String localAddress = (String) this.context.getProperty(GFAC_URL);
            registry.saveGFacDescriptor(localAddress);
            log.info("Updated the GFac URL in to Repository");
            Thread.sleep(GFAC_URL_UPDATE_INTERVAL);
          } catch (RegistryException e) {
            //in case of an registry exception best to retry sooner
            log.error("Error saving GFac descriptor",e);
View Full Code Here

TOP

Related Classes of org.apache.airavata.registry.api.AiravataRegistry

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.