Package com.commander4j.db

Examples of com.commander4j.db.JDBInterfaceRequest


      int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete Interface Request [" + interfaceRequestID.toString() + "] ?", "Confirm", JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
      if (n == 0)
      {

        JDBInterfaceRequest ir = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
        ir.delete(interfaceRequestID);

      }
    }
  }
View Full Code Here


    query.bindParams();
    listStatement = query.getPreparedStatement();
  }

  private void populateList() {
    JDBInterfaceRequest interfaceRequest = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
    JDBInterfaceRequestTableModel interfaceRequestTable = new JDBInterfaceRequestTableModel(interfaceRequest.getInterfaceRequestResultSet(listStatement));
    TableRowSorter<JDBInterfaceRequestTableModel> sorter = new TableRowSorter<JDBInterfaceRequestTableModel>(interfaceRequestTable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(interfaceRequestTable);
View Full Code Here

  private void updateRecord(String newStatus) {
    int row = jTable1.getSelectedRow();
    if (row >= 0)
    {
      interfaceRequestID = Long.valueOf(jTable1.getValueAt(row, 1).toString());
      JDBInterfaceRequest ir = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
      if (ir.getInterfaceRequestProperties(interfaceRequestID))
      {
        ir.setStatus(newStatus);
        ir.update();
      }
    }

  }
View Full Code Here

            if (status.equals("Error"))
            {

              if (filename.equals("") == false)
              {
                JDBInterfaceRequest ir = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
                ir.write(filename, transactionType, "Inbound File Re-Submit");
              }
            }
          }
        }
      }
View Full Code Here

  {
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    inter.getInterfaceProperties("Label Data", "Output");
    if (inter.isEnabled() == true)
    {
      JDBInterfaceRequest ir = new JDBInterfaceRequest(getHostID(), getSessionID());
      ir.write(unique, "Label Data");
    } else
    {
      logger.debug("Interface Label Data - Output is DISABLED");
    }
View Full Code Here

    try
    {
      if (cache.containsKey(row)==false)
      {
        mResultSet.absolute(row + 1);
        final JDBInterfaceRequest prow = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
        prow.getPropertiesfromResultSet(mResultSet);
        cache.put(row, prow);
      }
      switch (col)
      {
      case EventTime_Col:
View Full Code Here

    if (dbconnected)
    {

      JeMail mail = new JeMail(getHostID(), getSessionID());
      JDBInterfaceRequest ir = new JDBInterfaceRequest(getHostID(), getSessionID());
      JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
      OutgoingProductionDeclarationConfirmation opdc = new OutgoingProductionDeclarationConfirmation(getHostID(), getSessionID());
      OutgoingDespatchConfirmation odc = new OutgoingDespatchConfirmation(getHostID(), getSessionID());
      OutgoingDespatchPreAdvice opa = new OutgoingDespatchPreAdvice(getHostID(), getSessionID());
      OutgoingEquipmentTracking oet = new OutgoingEquipmentTracking(getHostID(), getSessionID());
      OutgoingPalletStatusChange psc = new OutgoingPalletStatusChange(getHostID(), getSessionID());
      OutgoingPalletSplit ops = new OutgoingPalletSplit(getHostID(), getSessionID());
      OutgoingPalletDelete opd = new OutgoingPalletDelete(getHostID(), getSessionID());
      OutgoingLabelData old = new OutgoingLabelData(getHostID(), getSessionID());
      LinkedList<Long> irqList = new LinkedList<Long>();
      int noOfMessages = 0;

      while (true)
      {

        JWait.milliSec(500);

        if (allDone)
        {
          if (dbconnected)
          {
            Common.hostList.getHost(hostID).disconnect(getSessionID());
          }
          return;
        }

        irqList.clear();
        irqList = ir.getInterfaceRequestIDs();
        noOfMessages = irqList.size();

        if (noOfMessages > 0)
        {
          for (int x = 0; x < noOfMessages; x++)
          {
            JWait.milliSec(100);
            ir.setInterfaceRequestID(irqList.get(x));
            ir.getInterfaceRequestProperties();

            if (ir.getMode().equals("Inbound File Re-Submit"))
            {
              if (inter.getInterfaceProperties(ir.getInterfaceType(), "Input") == true)
              {
                String sourceFile = Common.base_dir + java.io.File.separator + "xml" + java.io.File.separator + "interface" + java.io.File.separator + "error" + java.io.File.separator + ir.getInterfaceType() + java.io.File.separator
                    + ir.getFilename();

                destinationFile = inter.getRealPath() + java.io.File.separator + ir.getFilename();
                renamedDestinationFile = inter.getRealPath() + java.io.File.separator + ir.getFilename().replaceAll(".xml", ".lmx");

                mover.move_File(sourceFile, renamedDestinationFile);
                mover.move_File(renamedDestinationFile, destinationFile);
                ir.delete();

              }
            }

            if (ir.getMode().equals("Normal"))
            {

              errorMessage = "Unknown Outbound Interface Type :" + ir.getInterfaceType();
              messageProcessedOK = false;

              if (ir.getInterfaceType().equals("Production Declaration"))
              {
                messageProcessedOK = opdc.processMessage(ir.getTransactionRef());
                errorMessage = opdc.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Production Declaration", messageProcessedOK.toString());
              }

              if (ir.getInterfaceType().equals("Pallet Status Change"))
              {
                messageProcessedOK = psc.processMessage(ir.getTransactionRef());
                errorMessage = psc.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Pallet Status Change", messageProcessedOK.toString());
              }             

              if (ir.getInterfaceType().equals("Pallet Split"))
              {
                messageProcessedOK = ops.processMessage(ir.getTransactionRef());
                errorMessage = ops.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Pallet Split", messageProcessedOK.toString());
             
             
              if (ir.getInterfaceType().equals("Pallet Delete"))
              {
                messageProcessedOK = opd.processMessage(ir.getTransactionRef());
                errorMessage = opd.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Pallet Delete", messageProcessedOK.toString());
             
             
              if (ir.getInterfaceType().equals("Despatch Confirmation"))
              {
                messageProcessedOK = odc.processMessage(ir.getTransactionRef());
                errorMessage = odc.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Despatch Confirmation", messageProcessedOK.toString());
              }

              if (ir.getInterfaceType().equals("Despatch Pre Advice"))
              {
                messageProcessedOK = opa.processMessage(ir.getTransactionRef());
                errorMessage = opa.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Despatch Pre Advice", messageProcessedOK.toString());
              }

              if (ir.getInterfaceType().equals("Equipment Tracking"))
              {
                messageProcessedOK = oet.processMessage(ir.getTransactionRef());
                errorMessage = oet.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Equipment Tracking", messageProcessedOK.toString());
              }
             
              if (ir.getInterfaceType().equals("Label Data"))
              {
                messageProcessedOK = old.processMessage(ir.getUniqueID());
                errorMessage = oet.getErrorMessage();
                GenericMessageHeader.updateStats("Output","Label Data", messageProcessedOK.toString());
              }

              if (messageProcessedOK == true)
              {
                ir.delete();
              }
              else
              {
                ir.update(irqList.get(x), "Error");
                if (inter.getInterfaceProperties(ir.getInterfaceType(), "Output") == true)
                {
                  if (inter.getEmailError() == true)
                  {
                    String emailaddresses = inter.getEmailAddresses();

                    StringConverter stringConverter = new StringConverter();
                    ArrayConverter arrayConverter = new ArrayConverter(String[].class, stringConverter);
                    arrayConverter.setDelimiter(';');
                    arrayConverter.setAllowedChars(new char[] { '@' });

                    String[] emailList = (String[]) arrayConverter.convert(String[].class, emailaddresses);

                    if (emailList.length > 0)
                    {
                      try
                      {
                        String siteName = Common.hostList.getHost(getHostID()).getSiteDescription();
                        mail.postMail(emailList, "Error Processing Outgoing " + ir.getInterfaceType()+" for ["+siteName+"] on "+JUtility.getClientName(), errorMessage, "", "");
                      }
                      catch (MessagingException e)
                      {

                      }
View Full Code Here

  {
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    inter.getInterfaceProperties("Pallet Split", "Output");
    if (inter.isEnabled() == true)
    {
      JDBInterfaceRequest ir = new JDBInterfaceRequest(getHostID(), getSessionID());
      ir.write(dbTransactionRef, "Pallet Split");
    } else
    {
      logger.debug("Interface Pallet Split - Output is DISABLED");
    }
View Full Code Here

            if (status.equals("Error"))
            {

              if (filename.equals("") == false)
              {
                JDBInterfaceRequest ir = new JDBInterfaceRequest(Common.selectedHostID, Common.sessionID);
                ir.write(filename, transactionType, "Inbound File Re-Submit");
              }
            }
          }
        }
      }
View Full Code Here

  public void submit(long dbTransactionRef) {
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    inter.getInterfaceProperties("Production Declaration", "Output");
    if (inter.isEnabled() == true)
    {
      JDBInterfaceRequest ir = new JDBInterfaceRequest(getHostID(), getSessionID());
      ir.write(dbTransactionRef, "Production Declaration");
    }
    else
    {
      logger.debug("Interface Production Declaration - Output is DISABLED");
    }
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBInterfaceRequest

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.