Examples of ApplicationDescriptionType


Examples of edu.indiana.extreme.namespaces.x2004.x01.gFac.ApplicationDescriptionType

        return new QName(serviceName.getTargetNamespace(), serviceName.getStringValue());
    }

    public static ApplicationDescriptionType parseAppeDesc(String appDescAsStr) throws XregistryException {
        try {
            ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(
                    new StringReader(appDescAsStr)).getApplicationDescription();
            appDesc.validate();
            return appDesc;
        } catch (XmlException e) {
            throw new XregistryException(e);
        } catch (IOException e) {
            throw new XregistryException(e);
View Full Code Here

Examples of edu.indiana.extreme.namespaces.x2004.x01.gFac.ApplicationDescriptionType

     *
     * @see xregistry.impl.DocumentRegistry#registerAppDesc(java.lang.String,
     *      java.lang.String)
     */
    public String registerAppDesc(String user, String appDescAsStr) throws XregistryException {
        ApplicationDescriptionType appDesc = DocParser.parseAppeDesc(appDescAsStr);
        String appName = DocParser.getAppName(appDesc.getApplicationName()).toString();
        String hostName = appDesc.getDeploymentDescription().getHostName();
        String resourceID = ResourceUtils.getResourceID(DocType.AppDesc, appName,hostName );
       
        // INSERT INTO appdesc_table(resourceid,qname,host_name,appdesc_str)
        // VALUES (?, ?, ?, ?)
        return registerResource(user, resourceID, ADD_APP_DESC_SQL, new SqlParam[] {
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

    }

    public static void removeAppDesc(RegistryService registryService, String appDescAsStr)
            throws GfacException {
        try {
            ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(
                    appDescAsStr).getApplicationDescription();
            registryService.removeAppDesc(appDesc.getApplicationName().getStringValue(), appDesc
                    .getDeploymentDescription().getHostName());
        } catch (XmlException e) {
            throw new GfacException(e,FaultCode.LocalError);
        }
    }
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

     * @throws GfacException
     */
  public Object getBeanObjectInfo(RegistryService regService, String applicationName, String hostName, ApplicationBean bean) throws GfacException {
    String appDescStr = regService.getAppDesc(applicationName, hostName);
    if (appDescStr != null) {
      ApplicationDescriptionType appDescriptionType = GfacUtils.parseAppDescirption(new StringReader(appDescStr));
      return getBean(appDescriptionType,bean);
    } else {
      throw new GfacException("Applcation  " + applicationName + " on " + hostName + " does not exist",FaultCode.InvaliedLocalArgumnet);
    }
  }
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

  }
 
  public static String simpleAppXMLRequest(ApplicationBean appInfo) throws GfacException {
    ApplicationDescriptionDocument appDescDoc = ApplicationDescriptionDocument.Factory.newInstance();

    ApplicationDescriptionType appType = appDescDoc.getApplicationDescription();
    if (appType == null) {
      appType = appDescDoc.addNewApplicationDescription();
    }
    ApplicationDescriptionType.ApplicationName appName = appType.getApplicationName();
    if (appName == null) {
      appName = appType.addNewApplicationName();
    }
    appName.setStringValue(appInfo.getApplicationName().trim());
    appName.setTargetNamespace(appInfo.getObjectNamespace());
    DeploymentDescriptionType deployment = appType.getDeploymentDescription();
    if (deployment == null) {
      deployment = appType.addNewDeploymentDescription();
    }
    deployment.setHostName(appInfo.getHostName().trim());
    deployment.setExecutable(appInfo.getExecutable());
    if (appInfo.getWorkDir() != null) {
      deployment.setWorkDir(appInfo.getWorkDir());
    }
    if (appInfo.getTmpDir() != null) {
      deployment.setTmpDir(appInfo.getTmpDir());
    }
    if (appInfo.getJobType() != null) {
      appType.setJobType(org.ogce.schemas.gfac.documents.JobTypeType.Enum.forString(appInfo.getJobType()));
    }
    if (appInfo.getLeadNameListFile() != null) {
      deployment.setLeadNameListFile(appInfo.getLeadNameListFile());
    }

    if (appInfo.getMaxWallTime() != null) {
      appType.setMaxWallTime(Integer.valueOf(appInfo.getMaxWallTime()));
    }

    if (appInfo.getPcount() != null) {
      appType.setCount(Integer.valueOf(appInfo.getPcount()));
    }

    if (appInfo.getQueue() != null) {
      appType.addNewQueue().setQueueName(appInfo.getQueue());
    }
    if (appInfo.getProjectName() != null) {
      appType.addNewProject().setProjectName(appInfo.getProjectName());
    }
    if (appInfo.getRslparmName() != null && appInfo.getRslparmValue() != null && appInfo.getRslparmName() != "") {
      RSLParmType rslParmType = appType.addNewRslparm();
      rslParmType.setName(appInfo.getRslparmName());
      rslParmType.setStringValue(appInfo.getRslparmValue());
    }if (appInfo.getMinMemory() != null) {
      appType.setMinMemory(appInfo.getMinMemory());
    }
    if (appInfo.getHostCount() != null) {
      appType.setHostCount(appInfo.getHostCount());
    }
    try {
      SchemaValidator validator = new SchemaValidator(appType);
      validator.validate();
    } catch (GFacSchemaException e) {
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

    ApplicationDescriptionDocument appDescDoc = template;
    if (appDescDoc == null) {
      appDescDoc = ApplicationDescriptionDocument.Factory.newInstance();
    }

    ApplicationDescriptionType appType = appDescDoc.getApplicationDescription();
    if (appType == null) {
      appType = appDescDoc.addNewApplicationDescription();
    }
    ApplicationDescriptionType.ApplicationName appName = appType.getApplicationName();
    if (appName == null) {
      appName = appType.addNewApplicationName();
    }
    appName.setStringValue(appInfo.getApplicationName().trim());
    appName.setTargetNamespace(appInfo.getObjectNamespace());
    DeploymentDescriptionType deployment = appType.getDeploymentDescription();
    if (deployment == null) {
      deployment = appType.addNewDeploymentDescription();
    }
    deployment.setHostName(appInfo.getHostName().trim());
    deployment.setExecutable(appInfo.getExecutable());
    if (appInfo.getWorkDir() != null) {
      deployment.setWorkDir(appInfo.getWorkDir());
    }
    if (appInfo.getTmpDir() != null) {
      deployment.setTmpDir(appInfo.getTmpDir());
    }
    if (appInfo.getJobType() != null) {
      appType.setJobType(org.ogce.schemas.gfac.documents.JobTypeType.Enum.forString(appInfo.getJobType()));
    }
    if (appInfo.getLeadNameListFile() != null) {
      deployment.setLeadNameListFile(appInfo.getLeadNameListFile());
    }

    if (appInfo.getMaxWallTime() != null) {
      appType.setMaxWallTime(Integer.valueOf(appInfo.getMaxWallTime()));
    }

    if (appInfo.getPcount() != null) {
      appType.setCount(Integer.valueOf(appInfo.getPcount()));
    }

    if (appInfo.getQueue() != null) {
      appType.addNewQueue().setQueueName(appInfo.getQueue());
    }
    if (appInfo.getProjectName() != null) {
      appType.addNewProject().setProjectName(appInfo.getProjectName());
    }
    if (appInfo.getRslparmName() != null && appInfo.getRslparmValue() != null && appInfo.getRslparmName() != "") {
      RSLParmType rslParmType = appType.addNewRslparm();
      rslParmType.setName(appInfo.getRslparmName());
      rslParmType.setStringValue(appInfo.getRslparmValue());
    }if (appInfo.getMinMemory() != null) {
      appType.setMinMemory(appInfo.getMinMemory());
    }
    if (appInfo.getHostCount() != null) {
      appType.setHostCount(appInfo.getHostCount());
    }
    try {
      SchemaValidator validator = new SchemaValidator(appType);
      validator.validate();
    } catch (GFacSchemaException e) {
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

                HostDescriptionType hostDesc = HostDescriptionDocument.Factory.parse(
                    sb.toString()).getHostDescription();
                documentName = hostDesc.getHostName();
                }else if(documentType.equals(ServiceConstants.SEARCH_APPLICATION)){
                ApplicationUtils.createObject(context.getRegService(), sb.toString());
                ApplicationDescriptionType appType = ApplicationDescriptionDocument.Factory.parse(sb.toString()).getApplicationDescription();
                documentName = appType.getApplicationName().getStringValue();
                }else if(documentType.equals(ServiceConstants.SEARCH_SERVICE)){
                ServiceUtils.createObject(context.getRegService(), sb.toString());
                ServiceMapType serviceMap =  ServiceMapDocument.Factory.parse(sb.toString()).getServiceMap();
                documentName = serviceMap.getService().getServiceName().getStringValue();
                }else{
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

    }

    public static ApplicationDescriptionType parseAppDescirption(Reader reader)
            throws GFacSchemaException {
        try {
            ApplicationDescriptionType appDesc = ApplicationDescriptionDocument.Factory.parse(
                    reader).getApplicationDescription();
            SchemaValidator validator = new SchemaValidator(appDesc);
            validator.validate();
            return appDesc;
        } catch (XmlException e) {
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

public class ApplicationUtils {

  public static ApplicationBean simpleApplicationBeanRequest(String appDescStr)
      throws XmlException {

    ApplicationDescriptionType applicationDescriptionType = ApplicationDescriptionDocument.Factory
        .parse(appDescStr).getApplicationDescription();

    ApplicationBean appBean = new ApplicationBean();

    appBean.setHostName(applicationDescriptionType
        .getDeploymentDescription().getHostName());
    ApplicationName appXbeanName = applicationDescriptionType
        .getApplicationName();

    appBean.setApplicationName(appXbeanName.getStringValue());

    appBean.setObjectNamespace(appXbeanName.getTargetNamespace());
    appBean.setExecutable(applicationDescriptionType
        .getDeploymentDescription().getExecutable());
    appBean.setWorkDir(applicationDescriptionType
        .getDeploymentDescription().getWorkDir());
    appBean.setTmpDir(applicationDescriptionType.getDeploymentDescription()
        .getTmpDir());
    if (applicationDescriptionType.isSetProject()) {
      appBean.setProjectName(applicationDescriptionType.getProject()
          .getProjectName());

    }
    if (applicationDescriptionType.getJobType() != null) {
      appBean.setJobType(applicationDescriptionType.getJobType()
          .toString());
    }

    if (applicationDescriptionType.getQueue() != null) {
      appBean.setQueue(applicationDescriptionType.getQueue()
          .getQueueName());
    }

    if (applicationDescriptionType.isSetCount()) {
      appBean.setPcount(applicationDescriptionType.getCount());
    }

    if (applicationDescriptionType.isSetMaxWallTime()) {
      appBean.setMaxWallTime(applicationDescriptionType.getMaxWallTime());
    }
    if (applicationDescriptionType.isSetMinMemory()) {
      appBean.setMinMemory(applicationDescriptionType.getMinMemory());
    }
    if (applicationDescriptionType.getHostCount() > 0) {
      appBean.setHostCount(applicationDescriptionType.getHostCount());
    }
    if (applicationDescriptionType.getRslparmArray() != null) {
      RSLParmType[] rslParmType = applicationDescriptionType
          .getRslparmArray();
      for (RSLParmType rslParmType2 : rslParmType) {
        appBean.setRslparmName(rslParmType2.getName());
        appBean.setRslparmValue(rslParmType2.getStringValue());
      }
    }
    if (applicationDescriptionType.getDeploymentDescription()
        .getLeadNameListFile() != null) {
      appBean.setLeadNameListFile(applicationDescriptionType
          .getDeploymentDescription().getLeadNameListFile());
    }

    return appBean;
  }
View Full Code Here

Examples of org.ogce.schemas.gfac.documents.ApplicationDescriptionType

  public static String simpleAppXMLRequest(ApplicationBean appInfo) throws GFacSchemaException {

    ApplicationDescriptionDocument appDescDoc = ApplicationDescriptionDocument.Factory
        .newInstance();

    ApplicationDescriptionType appType = appDescDoc
        .addNewApplicationDescription();

    ApplicationName appName = appType.addNewApplicationName();

    appName.setStringValue(appInfo.getApplicationName().trim());
    appName.setTargetNamespace(appInfo.getObjectNamespace());
    DeploymentDescriptionType deployment = appType
        .getDeploymentDescription();
    if (deployment == null) {
      deployment = appType.addNewDeploymentDescription();
    }
    deployment.setHostName(appInfo.getHostName().trim());
    deployment.setExecutable(appInfo.getExecutable());
    if (appInfo.getWorkDir() != null) {
      deployment.setWorkDir(appInfo.getWorkDir());
    }
    if (appInfo.getTmpDir() != null) {
      deployment.setTmpDir(appInfo.getTmpDir());
    }
    if (appInfo.getJobType() != null) {
      appType.setJobType(Enum.forString(appInfo.getJobType()));
    }
    if (appInfo.getLeadNameListFile() != null) {
      deployment.setLeadNameListFile(appInfo.getLeadNameListFile());
    }

    if (appInfo.getMaxWallTime() != null) {
      appType.setMaxWallTime(Integer.valueOf(appInfo.getMaxWallTime()));
    }

    if (appInfo.getPcount() != null) {
      appType.setCount(Integer.valueOf(appInfo.getPcount()));
    }

    if (appInfo.getQueue() != null) {
      appType.addNewQueue().setQueueName(appInfo.getQueue());
    }
    if (appInfo.getProjectName() != null) {
      appType.addNewProject().setProjectName(appInfo.getProjectName());
    }
    if (appInfo.getRslparmName() != null
        && appInfo.getRslparmValue() != null
        && appInfo.getRslparmName() != "") {
      RSLParmType rslParmType = appType.addNewRslparm();
      rslParmType.setName(appInfo.getRslparmName());
      rslParmType.setStringValue(appInfo.getRslparmValue());
    }
    if (appInfo.getMinMemory() != null) {
      appType.setMinMemory(appInfo.getMinMemory());
    }
    if (appInfo.getHostCount() != null) {
      appType.setHostCount(appInfo.getHostCount());
    }
   
    SchemaValidator validator = new SchemaValidator(appType);
    validator.validate();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.