Package org.ogce.schemas.gfac.beans

Examples of org.ogce.schemas.gfac.beans.MethodBean


    this.isEditing = true;
    this.editingServiceBean = serviceBean;
    this.serviceNameTextField.setText(serviceBean.getServiceName());
    this.appNameComboBox.setSelectedItem(serviceBean.getApplicationName());
    this.inactivityLimitTextField.setText(Integer.toString(serviceBean.getNotAfterInactiveMinutes()));
    MethodBean methodBean = serviceBean.getMethodBean();
    this.methodNameTextField.setText(methodBean.getMethodName());
    this.methodDescTextField.setText(methodBean.getMethodDescription());
    this.inputNumSpinner.setValue(methodBean.getInputParms().size());
    this.outputNumSpinner.setValue(methodBean.getOutputParms().size());

    this.inputArguments = methodBean.getInputParms();
    this.outputArguments = methodBean.getOutputParms();

    this.addServiceButton.setText("Update Service");
  }
View Full Code Here


      ServiceBean serviceBean = new ServiceBean();
      serviceBean.setServiceName(StringUtil.trimSpaceInString(this.serviceNameTextField.getText()));
      serviceBean.setApplicationName(this.appNameComboBox.getText());
      serviceBean.setNotAfterInactiveMinutes(Integer.parseInt(this.inactivityLimitTextField.getText()));

      MethodBean methodBean = new MethodBean();
      methodBean.setMethodName(StringUtil.trimSpaceInString(this.methodNameTextField.getText()));
      methodBean.setMethodDescription(this.methodDescTextField.getText());

      // input arguments setup
      for (ParamObject paraObject : this.inputArguments) {
        methodBean.addInputParms(paraObject);
      }

      // output arguments setup
      for (ParamObject paraObject : this.outputArguments) {
        methodBean.addOutputParms(paraObject);
      }

      serviceBean.setMethodBean(methodBean);

      /* Register to XRegistry */
 
View Full Code Here

    // ArrayList<MethodBean> operations = serviceInfo.getOperations();
    List<MethodBean> operations = new ArrayList<MethodBean>();
    operations.add(serviceInfo.getMethodBean());

    for (int i = 0; i < operations.size(); i++) {
      MethodBean op = (MethodBean) operations.get(i);

      if (op == null) {
        throw new GFacSchemaException("Operation can not be Null");
      }

      MethodType[] methods = pt.getMethodArray();
      MethodType method = null;
      if (methods != null) {
        for (MethodType oldMethod : methods) {
          if (op.getMethodName().equals(oldMethod.getMethodName())) {
            method = oldMethod;
          }
        }
      }
      if (method == null) {
        method = pt.addNewMethod();
      }
      method.setMethodName(op.getMethodName());
      method.setMethodDescription(op.getMethodDescription());
      ApplicationType appType = method.getApplication();
      if (appType == null) {
        appType = method.addNewApplication();
      }
      appType.setParamValuesOnly(true);
      ApplicationName appNameType = appType.getApplicationName();
      if (appNameType == null) {
        appNameType = appType.addNewApplicationName();
      }
      QName appName = new QName(serviceInfo.getObjectNamespace(),
          serviceInfo.getApplicationName());
      appNameType.setStringValue(appName.getLocalPart());
      appNameType.setTargetNamespace(appName.getNamespaceURI());
      appType.setApplicationDescription(op.getMethodDescription());

      // Boolean parameters from Service screen
      if (op.isStageOutputDataFiles()) {
        method.setStageOutputDataFiles(true);
      }

      if (op.isForceFileStagingToWorkDir()) {
        method.setForceFileStagingToWorkDir(true);
      }

      if (op.isUseLEADNameListFile()) {
        appType.setUseLEADNameListFile(true);
      }

      if (op.isUseLEADNameListPropertiesFile()) {
        appType.setUseLEADNameListPropertiesFile(true);
      }

      InputParameterType[] inputs = method.getInputParameterArray();
      HashMap<String, InputParameterType> inputMap = new HashMap<String, InputParameterType>();
      if (inputs != null) {
        for (InputParameterType inputParameterType : inputs) {
          inputMap.put(inputParameterType.getParameterName(),
              inputParameterType);
        }
      }

      OutputParameterType[] outputs = method.getOutputParameterArray();
      HashMap<String, OutputParameterType> outputMap = new HashMap<String, OutputParameterType>();
      if (inputs != null) {
        for (OutputParameterType outputParameterType : outputs) {
          outputMap.put(outputParameterType.getParameterName(),
              outputParameterType);
        }
      }

      ArrayList<ParamObject> inputparams = op.getInputParms();
      for (int y = 0; y < inputparams.size(); y++) {
        ParamObject param = (ParamObject) inputparams.get(y);
        InputParameterType inputParm = inputMap.get(param.getName());
        if (inputParm == null) {
          inputParm = method.addNewInputParameter();
        }
        inputParm.setParameterName(param.getName());
        inputParm.setParameterDescription(param.getDesc());
        InputDataType.Enum type = InputDataType.Enum.forString(param
            .getType());
        inputParm.setParameterType(type);
      }

      ArrayList<ParamObject> outputparams = op.getOutputParms();
      for (int y = 0; y < outputparams.size(); y++) {
        ParamObject param = (ParamObject) outputparams.get(y);
        OutputParameterType outputParm = outputMap.get(param.getName());
        if (outputParm == null) {
          outputParm = method.addNewOutputParameter();
View Full Code Here

    ApplicationType appType = method.getApplication();
    ApplicationName appxbeanName = method.getApplication()
        .getApplicationName();
    String appName = new QName(appxbeanName.getTargetNamespace(),
        appxbeanName.getStringValue()).toString();
    MethodBean methodBean = new MethodBean(method.getMethodName(), method
        .getMethodDescription(), method.isSetStageOutputDataFiles(),
        method.isSetForceFileStagingToWorkDir(), appType
            .isSetUseLEADNameListFile(), appType
            .isSetUseLEADNameListPropertiesFile());

    InputParameterType[] inputparams = method.getInputParameterArray();
    for (int index = 0; index < inputparams.length; index++) {

      InputParameterType inputParameterType = inputparams[index];
      methodBean.addInputParms(new ParamObject(inputParameterType
          .getParameterName(), inputParameterType.getParameterType()
          .toString(), index, inputParameterType
          .getParameterDescription()));

    }

    OutputParameterType[] outparams = method.getOutputParameterArray();
    for (int index = 0; index < outparams.length; index++) {

      OutputParameterType outputParameterType = outparams[index];
      methodBean.addOutputParms(new ParamObject(outputParameterType
          .getParameterName(), outputParameterType.getParameterType()
          .toString(), index, outputParameterType
          .getParameterDescription()));

    }
View Full Code Here

  public void setUp() {
    serviceBean.setServiceName("GfacSchemaServiceTest");
    serviceBean.setApplicationName("GfacSchemaAppTest");
    serviceBean.setServiceDescription("This is for service xml test");

    MethodBean methodBean = new MethodBean();
    methodBean.setMethodName("GfacSchemaMethodTest");
    methodBean.setMethodDescription("This is for method xml test");
    methodBean.addInputParms(new ParamObject("count", "Integer", 0, "number"));
    methodBean.addInputParms(new ParamObject("name", "String", 1, "name"));
    methodBean.addOutputParms(new ParamObject("weight", "Float", 0, "desired weight"));
    serviceBean.setMethodBean(methodBean);
    serviceBean.setNotAfterInactiveMinutes(15);
  }
View Full Code Here

TOP

Related Classes of org.ogce.schemas.gfac.beans.MethodBean

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.