Package org.apache.aiaravata.application.catalog.data.resources

Examples of org.apache.aiaravata.application.catalog.data.resources.ComputeResourceResource


            if (computeResourcePreferences != null && !computeResourcePreferences.isEmpty()){
                for (ComputeResourcePreference preference : computeResourcePreferences ){
                    ComputeHostPreferenceResource resource = new ComputeHostPreferenceResource();
                    resource.setGatewayProfile(profileResource);
                    resource.setResourceId(preference.getComputeResourceId());
                    ComputeResourceResource computeHostResource = new ComputeResourceResource();
                    resource.setComputeHostResource((ComputeResourceResource)computeHostResource.get(preference.getComputeResourceId()));
                    resource.setGatewayId(profileResource.getGatewayID());
                    resource.setOverrideByAiravata(preference.isOverridebyAiravata());
                    resource.setPreferredJobProtocol(preference.getPreferredJobSubmissionProtocol());
                    resource.setPreferedDMProtocol(preference.getPreferredDataMovementProtocol());
                    resource.setBatchQueue(preference.getPreferredBatchQueue());
View Full Code Here


            if (computeResourcePreferences != null && !computeResourcePreferences.isEmpty()){
                for (ComputeResourcePreference preference : computeResourcePreferences ){
                    ComputeHostPreferenceResource resource = new ComputeHostPreferenceResource();
                    resource.setGatewayProfile(existingGP);
                    resource.setResourceId(preference.getComputeResourceId());
                    ComputeResourceResource computeHostResource = new ComputeResourceResource();
                    resource.setComputeHostResource((ComputeResourceResource)computeHostResource.get(preference.getComputeResourceId()));
                    resource.setGatewayId(gatewayId);
                    resource.setOverrideByAiravata(preference.isOverridebyAiravata());
                    resource.setPreferredJobProtocol(preference.getPreferredJobSubmissionProtocol());
                    resource.setPreferedDMProtocol(preference.getPreferredDataMovementProtocol());
                    resource.setBatchQueue(preference.getPreferredBatchQueue());
View Full Code Here

    }

  protected String saveComputeResourceDescriptorData(
      ComputeResourceDescription description) throws AppCatalogException {
    //TODO remove existing one
    ComputeResourceResource computeHostResource = saveComputeResource(description);
    saveHostAliases(description, computeHostResource);
    saveIpAddresses(description, computeHostResource);
    saveBatchQueues(description, computeHostResource);
    saveFileSystems(description, computeHostResource);
    saveJobSubmissionInterfaces(description, computeHostResource);
    saveDataMovementInterfaces(description, computeHostResource);
    return computeHostResource.getResourceId();
  }
View Full Code Here

    return computeHostResource.getResourceId();
  }

  protected ComputeResourceResource saveComputeResource(
      ComputeResourceDescription description) throws AppCatalogException {
    ComputeResourceResource computeHostResource = AppCatalogThriftConversion.getComputeHostResource(description);
    computeHostResource.save();
    return computeHostResource;
  }
View Full Code Here

    @Override
    public void addJobSubmissionProtocol(String computeResourceId, JobSubmissionInterface jobSubmissionInterface) throws AppCatalogException {
        try {
          JobSubmissionInterfaceResource jsi = AppCatalogThriftConversion.getJobSubmissionInterface(jobSubmissionInterface);
          jsi.setComputeResourceId(computeResourceId);
          ComputeResourceResource computeResourceResource = new ComputeResourceResource();
          computeResourceResource=(ComputeResourceResource)computeResourceResource.get(computeResourceId);
          jsi.setComputeHostResource(computeResourceResource);
            jsi.save();
        }catch (Exception e){
            logger.error("Error while saving "+jobSubmissionInterface.getJobSubmissionProtocol().toString()+" Job Submission Protocol...", e);
            throw new AppCatalogException(e);
View Full Code Here

    @Override
    public void addDataMovementProtocol(String computeResourceId, DataMovementInterface dataMovementInterface) throws AppCatalogException {
        try {
          DataMovementInterfaceResource dmi = AppCatalogThriftConversion.getDataMovementInterface(dataMovementInterface);
          dmi.setComputeResourceId(computeResourceId);
          ComputeResourceResource computeResourceResource = new ComputeResourceResource();
          computeResourceResource=(ComputeResourceResource)computeResourceResource.get(computeResourceId);
          dmi.setComputeHostResource(computeResourceResource);
          dmi.save();
        }catch (Exception e){
            logger.error("Error while saving "+dataMovementInterface.getDataMovementProtocol().toString()+" data movement Protocol...", e);
            throw new AppCatalogException(e);
View Full Code Here

    }

    @Override
    public ComputeResourceDescription getComputeResource(String resourceId) throws AppCatalogException {
        try {
            ComputeResourceResource resource = new ComputeResourceResource();
            ComputeResourceResource computeResource = (ComputeResourceResource)resource.get(resourceId);
            return AppCatalogThriftConversion.getComputeHostDescription(computeResource);
        }catch (Exception e){
            logger.error("Error while retrieving compute resource...", e);
            throw new AppCatalogException(e);
        }
View Full Code Here

    @Override
    public List<ComputeResourceDescription> getComputeResourceList(Map<String, String> filters) throws AppCatalogException {
        List<ComputeResourceDescription> computeResourceDescriptions = new ArrayList<ComputeResourceDescription>();
        try {
          //TODO check if this is correct way to do this
            ComputeResourceResource resource = new ComputeResourceResource();
            for (String fieldName : filters.keySet() ){
                if (fieldName.equals(AbstractResource.ComputeResourceConstants.HOST_NAME)){
                    List<Resource> resources = resource.get(AbstractResource.ComputeResourceConstants.HOST_NAME, filters.get(fieldName));
                    if (resources != null && !resources.isEmpty()){
                        computeResourceDescriptions = AppCatalogThriftConversion.getComputeDescriptionList(resources);
                    }
                }else {
                    logger.error("Unsupported field name for compute resource.", new IllegalArgumentException());
View Full Code Here

    @Override
    public List<ComputeResourceDescription> getAllComputeResourceList() throws AppCatalogException {
        List<ComputeResourceDescription> computeResourceDescriptions = new ArrayList<ComputeResourceDescription>();
        try {
            ComputeResourceResource resource = new ComputeResourceResource();
            List<Resource> resources = resource.getAll();
            if (resources != null && !resources.isEmpty()){
                computeResourceDescriptions = AppCatalogThriftConversion.getComputeDescriptionList(resources);
            }
        }catch (Exception e){
            logger.error("Error while retrieving compute resource list...", e);
View Full Code Here

    @Override
    public Map<String, String> getAllComputeResourceIdList() throws AppCatalogException {
        try {
            Map<String, String> computeResourceMap = new HashMap<String, String>();
            ComputeResourceResource resource = new ComputeResourceResource();
            List<Resource> allComputeResources = resource.getAll();
            if (allComputeResources != null && !allComputeResources.isEmpty()){
                for (Resource cm : allComputeResources){
                    ComputeResourceResource cmr = (ComputeResourceResource)cm;
                    computeResourceMap.put(cmr.getResourceId(), cmr.getHostName());
                }
            }
            return computeResourceMap;
        }catch (Exception e){
            logger.error("Error while retrieving compute resource list...", e);
View Full Code Here

TOP

Related Classes of org.apache.aiaravata.application.catalog.data.resources.ComputeResourceResource

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.