Package edu.indiana.extreme.xbaya.xregistry

Examples of edu.indiana.extreme.xbaya.xregistry.XRegistryAccesser


  /**
   *
   */
  protected void save() {
    XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
        SearchAndEditWindow.this.engine);

    String content = null;
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    if (this.docTypeComboBox.getText().equals("Host")) {

      content = xregistryAccesser.getHostDesc(this.list.getSelectedValue()
          .getQname().toString());

      int returnVal = chooser.showOpenDialog(this.dialog.getDialog());
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        String filePath = chooser.getSelectedFile().getAbsolutePath()
            + "/HostDescription.xml";
        this.writeStringToFile(filePath, content);
      }
     
    } else if (this.docTypeComboBox.getText().equals("Application")) {

      content = xregistryAccesser.getApplicationDesc(this.list
          .getSelectedValue().getQname().toString(), this.list
          .getSelectedValue().getDescription());

      int returnVal = chooser.showOpenDialog(this.dialog.getDialog());
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        String filePath = chooser.getSelectedFile().getAbsolutePath()
            + "/ApplicationDescription.xml";
        this.writeStringToFile(filePath, content);
      }

    } else {

      content = xregistryAccesser.getServiceDesc(this.list
          .getSelectedValue().getQname());

      int returnVal = chooser.showOpenDialog(this.dialog.getDialog());
      if (returnVal == JFileChooser.APPROVE_OPTION) {
        String filePath = chooser.getSelectedFile().getAbsolutePath()
View Full Code Here


  /**
   * edit an entry
   */
  public void edit() {
    XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
        SearchAndEditWindow.this.engine);

    if (this.docTypeComboBox.getText().equals("Host")) {
      // Update Host
      this.hide();

      HostDescriptionRegistrationWindow hostWindow = HostDescriptionRegistrationWindow
          .getInstance();

      if (!hostWindow.isEngineSet()) {
        hostWindow.setXBayaEngine(this.engine);
      }

      HostBean hostBean = xregistryAccesser.getHostBean(this.list
          .getSelectedValue().getQname().toString());
      if (hostBean != null) {
       
        hostBean.setHostName(this.list
              .getSelectedValue().getQname().getLocalPart());
       
        hostWindow.show(hostBean);
      } else {
        this.engine.getErrorWindow().error(this.dialog.getDialog(), "Cannot get value from Xregistry");
      }
    } else if (this.docTypeComboBox.getText().equals("Application")) {
      // Update Application
      this.hide();

      ApplicationDescriptionRegistrationWindow appWindow = ApplicationDescriptionRegistrationWindow
          .getInstance();

      if (!appWindow.isEngineSet()) {
        appWindow.setXBayaEngine(this.engine);
      }

      ApplicationBean appBean = xregistryAccesser.getApplicationBean(
          this.list.getSelectedValue().getQname().toString(),
          this.list.getSelectedValue().getDescription());

      if (appBean != null) {
       
        appBean.setApplicationName(this.list.getSelectedValue().getQname().getLocalPart());
        appBean.setObjectNamespace(this.list.getSelectedValue().getQname().getNamespaceURI());
        appBean.setHostName(this.list.getSelectedValue().getDescription());
       
        appWindow.show(appBean);
      } else {
        this.engine.getErrorWindow().error(this.dialog.getDialog(), "Cannot get value from Xregistry");
      }
    } else {
      // Update Service
      this.hide();

      ServiceDescriptionRegistrationWindow serviceWindow = ServiceDescriptionRegistrationWindow
          .getInstance();

      if (!serviceWindow.isEngineSet()) {
        serviceWindow.setXBayaEngine(this.engine);
      }

      ServiceBean serviceBean = xregistryAccesser
          .getServiceBean(this.list.getSelectedValue().getQname());
      if (serviceBean != null) {
       
        serviceBean.setServiceName(this.list.getSelectedValue().getQname().getLocalPart());
        serviceBean.setObjectNamespace(this.list.getSelectedValue().getQname().getNamespaceURI());
View Full Code Here

  /**
   * delete an entry
   */
  public void delete() {

    XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
        SearchAndEditWindow.this.engine);

    if (this.docTypeComboBox.getText().equals("Host")) {
      // Delete Host
      List<OGCEXRegistrySearchResult> hostDescs = this.list
          .getSelectedValues();

      try {
        for (OGCEXRegistrySearchResult hostDesc : hostDescs) {
          xregistryAccesser.deleteHostDescription(hostDesc.getQname()
              .toString());
        }
      } catch (XRegistryClientException e) {
        this.engine.getErrorWindow().error(this.dialog.getDialog(), e.getMessage(), e);
      }

      this.list.removeSelectedRows();
    } else if (this.docTypeComboBox.getText().equals("Application")) {
      // Delete Application
      List<OGCEXRegistrySearchResult> appDescs = this.list
          .getSelectedValues();
      try {
        for (OGCEXRegistrySearchResult appDesc : appDescs) {
          xregistryAccesser.deleteAppDescription(appDesc.getQname(),
              appDesc.getDescription());
        }
      } catch (XRegistryClientException e) {
        this.engine.getErrorWindow().error(this.dialog.getDialog(), e.getMessage(), e);
      }

      this.list.removeSelectedRows();
    } else {
      // Delete Service
      List<OGCEXRegistrySearchResult> serviceDescs = this.list
          .getSelectedValues();
      try {
        for (OGCEXRegistrySearchResult serviceDesc : serviceDescs) {
          xregistryAccesser.deleteServiceDescrption(serviceDesc
              .getQname());
        }
      } catch (Exception e) {       
        this.engine.getErrorWindow().error(this.dialog.getDialog(), e.getMessage(), e);
      }
View Full Code Here

    new Thread() {
      @SuppressWarnings( { "unchecked" })
      @Override
      public void run() {
        try {
          XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
              SearchAndEditWindow.this.engine);

          String searchType = SearchAndEditWindow.this.docTypeComboBox
              .getText();
          String searchKeyWord = SearchAndEditWindow.this.nameTextField
              .getText();

          final Map resultList;
          if (searchType.equals("Host")) {
            resultList = xregistryAccesser
                .getHostDescByName(searchKeyWord);
          } else if (searchType.equals("Application")) {
            resultList = xregistryAccesser
                .getApplicationDescByName(searchKeyWord);
          } else {
            resultList = xregistryAccesser
                .getServiceDescByName(searchKeyWord);
          }
          final Set<QName> keys = resultList.keySet();

          SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

    this.parameterPanel.getContentPanel().removeAll();
    this.parameterTextFields.clear();
  }

  private Object[] initHostNameList() {
    XRegistryAccesser xRegAccesser = new XRegistryAccesser(this.engine);
    HostDescData[] hostDataList = xRegAccesser.searchHostByName("");
    List<String> nameList = new ArrayList<String>();
    nameList.add("");
    for (HostDescData hostData : hostDataList) {
      nameList.add(hostData.getName().toString());
    }
View Full Code Here

     */   
    LeadResourceMapping mapping = null;
    String host = this.resourceSelectionComboBox.getText();
    if (host != null && !host.isEmpty()) {
      System.out.println("YEAHHH");
      XRegistryAccesser xregistryAccesser = new XRegistryAccesser(this.engine);

      HostDescriptionRegistrationWindow hostWindow = HostDescriptionRegistrationWindow.getInstance();

      if (!hostWindow.isEngineSet()) {
        hostWindow.setXBayaEngine(this.engine);
      }

      HostBean hostBean = xregistryAccesser.getHostBean(host);
     
      mapping = new LeadResourceMapping(host);
      try{
        mapping.setGatekeeperEPR(new URI(hostBean.getGateKeeperendPointReference()));
      }catch(Exception e){
View Full Code Here

    return window;
  }

  private Object[] initHostNameList() {
    XRegistryAccesser xRegAccesser = new XRegistryAccesser(this.engine);
    HostDescData[] hostDataList = xRegAccesser.searchHostByName("");
    List<String> nameList = new ArrayList<String>();
    for (HostDescData hostData : hostDataList) {
      nameList.add(hostData.getName().toString());
    }
    return nameList.toArray();
View Full Code Here

      if (!this.procsCountTextField.getText().equals("")) {
        appBean.setPcount(new Integer(Integer.parseInt(this.procsCountTextField.getText())));
      }

      /* Register to XRegistry */
      XRegistryAccesser xRegAccesser = new XRegistryAccesser(this.engine);

      if (!this.isEditing) {
        xRegAccesser.registerApplication(appBean);
      } else {
        /* Delete old application bean */
        QName qName = new QName(this.editingAppBean.getObjectNamespace(), this.editingAppBean.getApplicationName());
        xRegAccesser.deleteAppDescription(qName, this.editingAppBean.getHostName());

        /* Register new application bean */
        xRegAccesser.registerApplication(appBean);

        this.isEditing = false;
        this.addApplicationButton.setText("Add Application");
      }

View Full Code Here

        hostBean.setJdkPath(this.jdkPathTextField.getText());
        hostBean.setJdkName(this.jdkNameComboBox.getText());
      }

      /* Register to XRegistry */
      XRegistryAccesser xRegAccesser = new XRegistryAccesser(this.engine);

      if (!this.isEditing) {
        xRegAccesser.registerHost(hostBean);
      } else {
        /* Delete old host bean */
        xRegAccesser.deleteHostDescription(this.editingHostBean
            .getHostName());

        /* Register new host bean */
        xRegAccesser.registerHost(hostBean);

        this.isEditing = false;
        this.addHostButton.setText("Add Host");
      }

View Full Code Here

    new Thread() {
      @Override
      public void run() {
        try {
          XRegistryAccesser xregistryAccesser = new XRegistryAccesser(
              OGCEXRegistryLoaderWindow.this.engine);

          final Map<QName, OGCEResourceData> resultList = xregistryAccesser
              .getOGCEWorkflowTemplateList();
          final Set<QName> keys = resultList.keySet();

          SwingUtilities.invokeLater(new Runnable() {
            public void run() {
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.xregistry.XRegistryAccesser

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.