Package org.apache.uima.aae.deployment

Examples of org.apache.uima.aae.deployment.ProcessCasErrors


      buf.append("<li bindent=\"20\">MaxRetries: " + getGetMetadataErrors.getMaxRetries()
              + " ; Timeout: " + getGetMetadataErrors.getTimeout() + " ; ErrorAction: "
              + getGetMetadataErrors.getErrorAction() + "</li>");
    }

    ProcessCasErrors processCasErrors = obj.getProcessCasErrors();
    if (processCasErrors != null) {
      buf.append("<li><b>ProcessCasErrors</b></li>");
      if (isAsyncAggErrorConfig) {
        buf.append("<li bindent=\"20\">CAS Max Retries: " + processCasErrors.getMaxRetries()
              + " ; CAS Timeout: " + processCasErrors.getTimeout()
              + " ; CAS Continue On Failure: " + processCasErrors.isContinueOnRetryFailure() + "</li>");
        buf.append("<li bindent=\"20\">Delegate Threshold Count: " + processCasErrors.getThresholdCount()
                + " ; Delegate Threshold Window: " + processCasErrors.getThresholdWindow()
                + " ; Delegate Threshold Action: " + processCasErrors.getThresholdAction() + "</li>");
      } else {
        buf.append("<li bindent=\"20\">Threshold Count: " + processCasErrors.getThresholdCount()
                + " ; Threshold Window: " + processCasErrors.getThresholdWindow()
                + " ; Threshold Action: " + processCasErrors.getThresholdAction() + "</li>");
       
      }
    }

    CollectionProcessCompleteErrors collProcessCompleteErrors = obj
View Full Code Here


      if (obj instanceof NameValuePair) {
        int id = ((NameValuePair) obj).getId();

        if ( ((NameValuePair) obj).getParent() instanceof ProcessCasErrors) {
          // Blank out Threshold Window and Action if Threshold Count = 0
          ProcessCasErrors pce = (ProcessCasErrors) ((NameValuePair) obj).getParent();
          if (pce.getThresholdCount() == 0) {
            if (id == ProcessCasErrors.KIND_THRESHOLD_WINDOW
                    || id == ProcessCasErrors.KIND_THRESHOLD_ACTION) {
              return "";
            }
          }
        } else if ( ((NameValuePair) obj).getParent() instanceof GetMetadataErrors) {
          // Blank out Error Action if Timeout = 0
          GetMetadataErrors gme = (GetMetadataErrors) ((NameValuePair) obj).getParent();
          if (gme.getTimeout() == 0 && id == GetMetadataErrors.KIND_ERRORACTION) {
            return "";
          }
        }
        return ((NameValuePair) obj).getName();
      }
      return getText(obj);

    } else if (index == COLUMN_VALUE) {
      if (obj instanceof NameValuePair) {
        int id = ((NameValuePair) obj).getId();
       
        if ( ((NameValuePair) obj).getParent() instanceof GetMetadataErrors) {
          if (id == GetMetadataErrors.KIND_TIMEOUT) {
            if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
              return AEDeploymentConstants.ERROR_KIND_STRING_NO_TIMEOUT;             
            }
          } else if (id == GetMetadataErrors.KIND_MAX_RETRIES) {
            if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
              return AEDeploymentConstants.ERROR_KIND_STRING_NO_RETRIES;             
            }
          } else if (id == GetMetadataErrors.KIND_ERRORACTION) {
            // If Timeout=0, blank out action
            GetMetadataErrors gme = (GetMetadataErrors) ((NameValuePair) obj).getParent();
            if (gme.getTimeout() == 0) {
              return "";
            }

          }

        } else if ( ((NameValuePair) obj).getParent() instanceof ProcessCasErrors) {
          ProcessCasErrors pce = (ProcessCasErrors) ((NameValuePair) obj).getParent();
          if (id == ProcessCasErrors.KIND_TIMEOUT) {
            if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
              return AEDeploymentConstants.ERROR_KIND_STRING_NO_TIMEOUT;             
            }
          } else if (id == ProcessCasErrors.KIND_MAX_RETRIES) {
            if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
              return AEDeploymentConstants.ERROR_KIND_STRING_NO_RETRIES;             
            }
          } else if (id == ProcessCasErrors.KIND_THRESHOLD_COUNT) {
            if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
              return AEDeploymentConstants.ERROR_KIND_STRING_NO_THRESHOLD_COUNT;             
            }
          } else if (id == ProcessCasErrors.KIND_THRESHOLD_WINDOW) {
            // Blank out Threshold Window and Action if Threshold Count = 0
            if (pce.getThresholdCount() == 0) {
              return "";
            } else {
              if ( ((NameValuePair) obj).getValue() == Integer.valueOf(0) ) {
                return AEDeploymentConstants.ERROR_KIND_STRING_NO_THRESHOLD_WINDOW;             
              }
            }
          } else if (id == ProcessCasErrors.KIND_THRESHOLD_ACTION) {
            // Blank out Threshold Window and Action if Threshold Count = 0
            if (pce.getThresholdCount() == 0) {
              return "";
            }
          }
         
        } else if ( ((NameValuePair) obj).getParent() instanceof CollectionProcessCompleteErrors) {
View Full Code Here

                GetMetadataErrors getMetadataErrors = (GetMetadataErrors) obj;
                getMetadataErrors.setValueById(id, selection);
                getMetaDataViewer.refresh();

              } else if (obj instanceof ProcessCasErrors) {
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, selection);
                processCasErrorsViewer.refresh();

              } else if (obj instanceof CollectionProcessCompleteErrors) {
                CollectionProcessCompleteErrors completeErrors = (CollectionProcessCompleteErrors) obj;
                completeErrors.setValueById(id, selection);
                collProcessCompleteErrorsViewer.refresh();
              }
              multiPageEditor.setFileDirty();
            }
          });
          editor1.setEditor(spinner, item, 1);

        } else if (nvp.getType() == String.class) {
          final CCombo combo = new CCombo(table, SWT.BORDER | SWT.READ_ONLY);
          combo.setItems(new String[] { "terminate", "disable" }); //$NON-NLS-1$
          combo.setText(item.getText(1));
          combo.pack();
          combo.setFocus();
          combo.addFocusListener(new FocusListener() {

            public void focusGained(FocusEvent e) {
            }

            public void focusLost(FocusEvent e) {
              // Clean up any previous editor control
              Control oldEditor = editor1.getEditor();
              if (oldEditor != null)
                oldEditor.dispose();

              oldEditor = editor2.getEditor();
              if (oldEditor != null)
                oldEditor.dispose();
              combo.dispose();
            }

          });
          combo.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
              String selection = combo.getText();
              item.setText(1, selection);
              int id = nvp.getId();
              if (obj instanceof GetMetadataErrors) {
                GetMetadataErrors getMetadataErrors = (GetMetadataErrors) obj;
                getMetadataErrors.setValueById(id, selection);
                getMetaDataViewer.refresh();

              } else if (obj instanceof ProcessCasErrors) {
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, selection);
                processCasErrorsViewer.refresh();

              } else if (obj instanceof CollectionProcessCompleteErrors) {
                CollectionProcessCompleteErrors completeErrors = (CollectionProcessCompleteErrors) obj;
                completeErrors.setValueById(id, selection);
                collProcessCompleteErrorsViewer.refresh();
              }
              multiPageEditor.setFileDirty();
            }
          });
          editor2.setEditor(combo, item, 1);

        } else if (nvp.getType() == Boolean.class) {
          // Only for ProcessCasErrors
          if (obj instanceof ProcessCasErrors) {
            final CCombo combo = new CCombo(table, SWT.BORDER | SWT.READ_ONLY);
            combo.setItems(new String[] { Boolean.toString(true), Boolean.toString(false) }); //$NON-NLS-1$
            combo.setText(item.getText(1));
            combo.pack();
            combo.setFocus();
            combo.addFocusListener(new FocusListener() {

              public void focusGained(FocusEvent e) {
              }

              public void focusLost(FocusEvent e) {
                // Clean up any previous editor control
                Control oldEditor = editor1.getEditor();
                if (oldEditor != null)
                  oldEditor.dispose();

                oldEditor = editor2.getEditor();
                if (oldEditor != null)
                  oldEditor.dispose();
                combo.dispose();
              }

            });
            combo.addSelectionListener(new SelectionAdapter() {
              public void widgetSelected(SelectionEvent e) {
                String selection = combo.getText();
                int id = nvp.getId();
                item.setText(1,selection);
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, selection);
                processCasErrorsViewer.refresh();
                multiPageEditor.setFileDirty();
              }
            });
            editor2.setEditor(combo, item, 1);
View Full Code Here

                GetMetadataErrors getMetadataErrors = (GetMetadataErrors) obj;
                getMetadataErrors.setValueById(id, selection);
                getMetaDataViewer.refresh();

              } else if (obj instanceof ProcessCasErrors) {
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, selection);
                processCasErrorsViewer.refresh();

              } else if (obj instanceof CollectionProcessCompleteErrors) {
                CollectionProcessCompleteErrors completeErrors = (CollectionProcessCompleteErrors) obj;
                completeErrors.setValueById(id, selection);
                collProcessCompleteErrorsViewer.refresh();
              }
            }
          });
          editor1.setEditor(spinner, item, 1);

        } else if (nvp.getType() == String.class) {
          final CCombo combo = new CCombo(table, SWT.BORDER | SWT.READ_ONLY);
          combo.setItems(new String[] { "terminate", "disable" }); //$NON-NLS-1$
          combo.setText(item.getText(1));
          combo.pack();
          combo.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
              String selection = combo.getText();
              item.setText(1, selection);
              int id = nvp.getId();
              if (obj instanceof GetMetadataErrors) {
                GetMetadataErrors getMetadataErrors = (GetMetadataErrors) obj;
                getMetadataErrors.setValueById(id, selection);
                getMetaDataViewer.refresh();

              } else if (obj instanceof ProcessCasErrors) {
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, selection);
                processCasErrorsViewer.refresh();

              } else if (obj instanceof CollectionProcessCompleteErrors) {
                CollectionProcessCompleteErrors completeErrors = (CollectionProcessCompleteErrors) obj;
                completeErrors.setValueById(id, selection);
                collProcessCompleteErrorsViewer.refresh();
              }
            }
          });
          editor2.setEditor(combo, item, 1);

        } else if (nvp.getType() == Boolean.class) {
          // Only for ProcessCasErrors
          if (obj instanceof ProcessCasErrors) {
            final CCombo combo = new CCombo(table, SWT.BORDER | SWT.READ_ONLY);
            combo.setItems(new String[] { Boolean.toString(true), Boolean.toString(false) }); //$NON-NLS-1$
            combo.setText(item.getText(1));
            combo.pack();
            combo.addSelectionListener(new SelectionAdapter() {
              public void widgetSelected(SelectionEvent e) {
                int id = nvp.getId();
                item.setText(1, combo.getText());
                ProcessCasErrors processCasErrors = (ProcessCasErrors) obj;
                processCasErrors.setValueById(id, combo.getText());
                processCasErrorsViewer.refresh();
              }
            });
            editor2.setEditor(combo, item, 1);
          }
View Full Code Here

        this.parent = parent;
    }
   
    public ProcessCasErrors clone(AsyncAEErrorConfiguration parent)
    {
        ProcessCasErrors clone = new ProcessCasErrors_Impl(parent);
        clone.setThresholdCount(getThresholdCount());
        clone.setThresholdWindow(getThresholdWindow());
        clone.setThresholdAction(getThresholdAction());
        clone.setMaxRetries(getMaxRetries());
        clone.setTimeout(getTimeout());
        clone.setContinueOnRetryFailure(isContinueOnRetryFailure());
       
        return clone;
    }
View Full Code Here

      // ((NameValuePair) objs[1]).setStatusFlags(status);
      ((NameValuePair) objs[2]).setStatusFlags(status);
      return objs;

    } else if (inputElement instanceof ProcessCasErrors) {
      ProcessCasErrors processCasErrors = (ProcessCasErrors) inputElement;
      AsyncAEErrorConfiguration parent = processCasErrors.getParent();
      DeploymentMetaData_Impl parentMetaData = parent.gParentObject();
     
      if (parent instanceof AsyncAggregateErrorConfiguration) {
        count = 6;
      } else {
        count = 3;
      }
      objs = new Object[count];
     
      // Set names
      String nameThresholdCount;
      String nameThresholdWindow;
      String nameThresholdAction;
     
      if (count == 6) {
        // For AsyncAggregateErrorConfiguration
        objs[0] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_MAX_RETRIES,
                ProcessCasErrors.NAME_MAX_RETRIES,
                processCasErrors.getMaxRetries(), Integer.class);
        objs[1] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_TIMEOUT,
                ProcessCasErrors.NAME_TIMEOUT,
                processCasErrors.getTimeout(), Integer.class);
        objs[2] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_CONTINUE_ON_RETRY,
                ProcessCasErrors.NAME_CONTINUE_ON_RETRY,
                processCasErrors.isContinueOnRetryFailure(),
                Boolean.class);
        if ( (parentMetaData instanceof AEDeploymentMetaData)
                && !((AEDeploymentMetaData) parentMetaData).isAsync() ) {
          ((NameValuePair) objs[0]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
          ((NameValuePair) objs[2]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
         
        }

        nameThresholdCount = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_COUNT;
        nameThresholdWindow = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_WINDOW;
        nameThresholdAction = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_ACTION;
      } else {
        // For AsyncPrimitiveErrorConfiguration
        nameThresholdCount = ProcessCasErrors.NAME_THRESHOLD_COUNT;
        nameThresholdWindow = ProcessCasErrors.NAME_THRESHOLD_WINDOW;
        nameThresholdAction = ProcessCasErrors.NAME_THRESHOLD_ACTION;
      }
      objs[count-3] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_COUNT,
              nameThresholdCount,
              processCasErrors.getThresholdCount(), Integer.class);
      objs[count-2] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_WINDOW,
              nameThresholdWindow,
              processCasErrors.getThresholdWindow(), Integer.class);
      objs[count-1] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_ACTION,
              nameThresholdAction,
              processCasErrors.getThresholdAction(), String.class);
     
      if (processCasErrors.getThresholdCount() == 0) {
        status = NameValuePair.STATUS_NON_EDITABLE;
        ((NameValuePair) objs[count-2]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
        ((NameValuePair) objs[count-1]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
      } else {
        // For Async Primitive Error
        if (processCasErrors.getParent() instanceof AsyncPrimitiveErrorConfiguration) {
          ((NameValuePair) objs[count-1]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
        }
      }
      return objs;
View Full Code Here

      buf.append("<li bindent=\"20\">MaxRetries: " + getGetMetadataErrors.getMaxRetries()
              + " ; Timeout: " + getGetMetadataErrors.getTimeout() + " ; ErrorAction: "
              + getGetMetadataErrors.getErrorAction() + "</li>");
    }

    ProcessCasErrors processCasErrors = obj.getProcessCasErrors();
    if (processCasErrors != null) {
      buf.append("<li><b>ProcessCasErrors</b></li>");
      if (isAsyncAggErrorConfig) {
        buf.append("<li bindent=\"20\">CAS Max Retries: " + processCasErrors.getMaxRetries()
              + " ; CAS Timeout: " + processCasErrors.getTimeout()
              + " ; CAS Continue On Failure: " + processCasErrors.isContinueOnRetryFailure() + "</li>");
        buf.append("<li bindent=\"20\">Delegate Threshold Count: " + processCasErrors.getThresholdCount()
                + " ; Delegate Threshold Window: " + processCasErrors.getThresholdWindow()
                + " ; Delegate Threshold Action: " + processCasErrors.getThresholdAction() + "</li>");
      } else {
        buf.append("<li bindent=\"20\">Threshold Count: " + processCasErrors.getThresholdCount()
                + " ; Threshold Window: " + processCasErrors.getThresholdWindow()
                + " ; Threshold Action: " + processCasErrors.getThresholdAction() + "</li>");
       
      }
    }

    CollectionProcessCompleteErrors collProcessCompleteErrors = obj
View Full Code Here

      objs[1] = "Timeout: " + getMetadataErrors.getTimeout();
      objs[2] = "Error Action: " + getMetadataErrors.getErrorAction();
      return objs;

    } else if (parent instanceof ProcessCasErrors) {
      ProcessCasErrors processCasErrors = (ProcessCasErrors) parent;
      objs = new Object[6];
      objs[0] = "MaxRetries: " + processCasErrors.getMaxRetries();
      objs[1] = "Timeout: " + processCasErrors.getTimeout();
      objs[2] = "ContinueOnRetryFailure: " + processCasErrors.isContinueOnRetryFailure();
      objs[3] = "Threshold Count: " + processCasErrors.getThresholdCount();
      objs[4] = "Threshold Window: " + processCasErrors.getThresholdWindow();
      objs[5] = "Threshold Action: " + processCasErrors.getThresholdAction();
      return objs;

    } else if (parent instanceof CollectionProcessCompleteErrors) {
      CollectionProcessCompleteErrors completeErrors = (CollectionProcessCompleteErrors) parent;
      objs = new Object[2];
View Full Code Here

      // ((NameValuePair) objs[1]).setStatusFlags(status);
      ((NameValuePair) objs[2]).setStatusFlags(status);
      return objs;

    } else if (inputElement instanceof ProcessCasErrors) {
      ProcessCasErrors processCasErrors = (ProcessCasErrors) inputElement;
      AsyncAEErrorConfiguration parent = processCasErrors.getParent();
      DeploymentMetaData_Impl parentMetaData = parent.gParentObject();
     
      if (parent instanceof AsyncAggregateErrorConfiguration) {
        count = 6;
      } else {
        count = 3;
      }
      objs = new Object[count];
     
      // Set names
      String nameThresholdCount;
      String nameThresholdWindow;
      String nameThresholdAction;
     
      if (count == 6) {
        // For AsyncAggregateErrorConfiguration
        objs[0] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_MAX_RETRIES,
                ProcessCasErrors.NAME_MAX_RETRIES,
                processCasErrors.getMaxRetries(), Integer.class);
        objs[1] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_TIMEOUT,
                ProcessCasErrors.NAME_TIMEOUT,
                processCasErrors.getTimeout(), Integer.class);
        objs[2] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_CONTINUE_ON_RETRY,
                ProcessCasErrors.NAME_CONTINUE_ON_FAILURE,
                processCasErrors.isContinueOnRetryFailure(),
                Boolean.class);
        if ( (parentMetaData instanceof AEDeploymentMetaData)
                && !((AEDeploymentMetaData) parentMetaData).isAsync() ) {
          ((NameValuePair) objs[0]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
          // ((NameValuePair) objs[2]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
         
        }

        nameThresholdCount = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_COUNT;
        nameThresholdWindow = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_WINDOW;
        nameThresholdAction = ProcessCasErrors.NAME_DELEGATE_THRESHOLD_ACTION;
      } else {
        // For AsyncPrimitiveErrorConfiguration
        nameThresholdCount = ProcessCasErrors.NAME_THRESHOLD_COUNT;
        nameThresholdWindow = ProcessCasErrors.NAME_THRESHOLD_WINDOW;
        nameThresholdAction = ProcessCasErrors.NAME_THRESHOLD_ACTION;
      }
      objs[count-3] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_COUNT,
              nameThresholdCount,
              processCasErrors.getThresholdCount(), Integer.class);
      objs[count-2] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_WINDOW,
              nameThresholdWindow,
              processCasErrors.getThresholdWindow(), Integer.class);
      objs[count-1] = new NameValuePair(processCasErrors, ProcessCasErrors.KIND_THRESHOLD_ACTION,
              nameThresholdAction,
              processCasErrors.getThresholdAction(), String.class);
     
      if (processCasErrors.getThresholdCount() == 0) {
        status = NameValuePair.STATUS_NON_EDITABLE;
        ((NameValuePair) objs[count-2]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
        ((NameValuePair) objs[count-1]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
      } else {
        // For Async Primitive Error
        if (processCasErrors.getParent() instanceof AsyncPrimitiveErrorConfiguration) {
          ((NameValuePair) objs[count-1]).setStatusFlags(NameValuePair.STATUS_NON_EDITABLE);
        }
      }
      return objs;
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.deployment.ProcessCasErrors

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.