コード例 #1
0
  //	 ---------------------------------------------------------------------------------------
  // Function Name : forwardAcknowledgeComplete
  // Date Written : 29/03/2009
  // Author : Utsav Turray
  // Input Parameters : none
  // Output Parameters : None
  // Return Values : None
  // Description : To acknowledge the forwarded data
  //
  // ---------------------------------------------------------------------------------------
  public static void forwardAcknowledgeComplete(
      CmdRowData tempData, String strLocalCabinet, String strDestinationCabinet) {
    ServiceConfiguration.serviceLog.info("############################");
    ServiceConfiguration.serviceLog.info(
        "#Forward and Acknowledge Process Started for UID "
            + tempData.getUID()
            + "  Source : "
            + tempData.getSource());
    DMSXmlResponse xmlResponse = new DMSXmlResponse();
    String inputXML = "";
    String outputXML = "";
    String statusValue = "";
    String destination = strDestinationCabinet.toLowerCase();

    try {

      inputXML =
          ServiceConfiguration.getForwardAckXML(
              tempData.getUID(),
              SynchConstants.B_ACK_STATE_SENT,
              SynchConstants.B_ACK_STATE_SENT_MESSAGE,
              destination);
      ServiceConfiguration.serviceXMLLog.info(inputXML);
      outputXML =
          ServiceConfiguration.executeRemoteXML(tempData.getStatusFlag(), destination, inputXML);
      ServiceConfiguration.serviceXMLLog.info("OutputXML " + outputXML);
      xmlResponse.setXmlString(outputXML);
      statusValue = xmlResponse.getVal("Status");
      if (statusValue.equalsIgnoreCase("0")) {
        UnderProcessFile.getReference()
            .setProperty(tempData.getUID(), SynchConstants.PROCESSED_ACK_SENT);
        inputXML =
            ServiceConfiguration.getForwardAckXML(
                tempData.getUID(),
                SynchConstants.PROCESSED_ACK_SENT,
                SynchConstants.B_ACK_STATE_RCVD_MESSAGE,
                strLocalCabinet);
        outputXML = ServiceConfiguration.executeLocalXML(inputXML);
        xmlResponse.setXmlString(outputXML);
        statusValue = xmlResponse.getVal("Status");
        if (statusValue.equalsIgnoreCase("0")) {
          ServiceConfiguration.serviceLog.info(
              "#Process and Acknowlged Completed Sucessfully# for UID "
                  + tempData.getUID()
                  + "  Source : "
                  + tempData.getSource());
        } else {
          ServiceConfiguration.serviceLog.info(
              "#Process and Acknowledge Process failed for UID "
                  + tempData.getUID()
                  + "  Source : "
                  + tempData.getSource());
        }
        if (statusValue.equalsIgnoreCase("0")) { // if local
          // update is
          // successful
          // then clear
          // the
          // Processing
          // File
          UnderProcessFile.getReference().remove(tempData.getUID());
        } else {
          // WE KEEP THE VALUE IN THE PROCESS FILE TO BE SAME
          // STATE SO THAT IT CAN BE UPDATED LATER..
        }
      } else {
        ServiceConfiguration.serviceLog.info(
            "#Unable to Acknowledge the Synchronization Request for :- "
                + tempData.getUID()
                + "  Source : "
                + tempData.getSource());
        String error = xmlResponse.getVal("Error");
        try {
          inputXML =
              ServiceConfiguration.getUpdateSynchDataXML(
                  tempData.getUID(),
                  SynchConstants.PROCESSED_STATE,
                  "Unable to Acknowledge the Synchronization Request");
          outputXML = ServiceConfiguration.executeLocalXML(inputXML);
          xmlResponse.setXmlString(outputXML);
          statusValue = xmlResponse.getVal("Status");
        } catch (IOException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
          // Error Handling
        } catch (NGException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
        }
      }

    } catch (NGException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);

    } catch (IOException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
    }
  }
コード例 #2
0
  /* ----------------------------------------------------------------
  // Function Name    : processAcknowledgeCompletedLocally
  // Date Written     : 29/03/2009
  // Author           : Utsav
  // Input Parameters :
  // Return Values    : void
  // Description      : processAcknowledgeCompleted Implemented
  // ---------------------------------------------------------------- */
  public static void processAcknowledgeCompletedLocally(
      CmdRowData tempData,
      String sourceCabinet,
      String strIntitialState,
      String strSuccessState,
      String strSucessStateMessage) {
    ServiceConfiguration.serviceLog.info("#################################");
    ServiceConfiguration.serviceLog.info("#Acknowledged Locally Started#");
    DMSXmlResponse xmlResponse = new DMSXmlResponse();
    String inputXML = "";
    String outputXML = "";
    String statusValue = "";
    // Error Handling if source is not in that format
    try {
      UnderProcessFile.getReference().setProperty(tempData.getUID(), strIntitialState);
      inputXML =
          ServiceConfiguration.getForwardAckXML(
              tempData.getUID(), strSuccessState, strSucessStateMessage, sourceCabinet);
      ServiceConfiguration.serviceXMLLog.info(inputXML);
      outputXML = ServiceConfiguration.executeLocalXML(inputXML);
      ServiceConfiguration.serviceXMLLog.info("OutputXML " + outputXML);
      xmlResponse.setXmlString(outputXML);
      statusValue = xmlResponse.getVal("Status");
      if (statusValue.equalsIgnoreCase("0")) {
        ServiceConfiguration.serviceLog.info("#Acknowledged  Locally Completed Sucessfully#");
        UnderProcessFile.getReference().remove(tempData.getUID());
      } else {
        ServiceConfiguration.serviceLog.info("#Acknowledged Locally Process Failed#");
        ServiceConfiguration.serviceLog.info(
            "#Acknowledged Locally Locally Process Failed for :- " + tempData.getUID());
        String error = xmlResponse.getVal("Error");
        try {
          inputXML =
              ServiceConfiguration.getUpdateSynchDataXML(
                  tempData.getUID(), strIntitialState, error);
          outputXML = ServiceConfiguration.executeLocalXML(inputXML);
          xmlResponse.setXmlString(outputXML);
          statusValue = xmlResponse.getVal("Status");
        } catch (IOException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
          // Error Handling
        } catch (NGException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
        }
      }

    } catch (NGException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);

    } catch (IOException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
    }
  }
コード例 #3
0
  // ---------------------------------------------------------------------------------------
  // Function Name : selfAcknowledge
  // Date Written : 31/10/2011
  // Author : Ankur Bedi
  // Input Parameters : none
  // Output Parameters : None
  // Return Values : None
  // Description : To self acknowledge after forwarding to destination or after processing of
  // forwarded request from source
  // EDMS3.0-ERC-00033
  // ---------------------------------------------------------------------------------------
  private static void selfAcknowledgeProcessedCall(CmdRowData tempData, String STATE) {

    ServiceConfiguration.serviceLog.info("############################");
    ServiceConfiguration.serviceLog.info(
        "#Self Acknowledge Process Started for UID " + tempData.getUID());

    DMSXmlResponse xmlResponse = new DMSXmlResponse();
    String inputXML = "";
    String outputXML = "";
    String statusValue = "";
    String ACK_STATE = "";
    String ACK_MESSAGE = "";
    String localCabinet = ServiceConfiguration.getProperty("localcabinetname");
    try {

      if (STATE.equalsIgnoreCase(SynchConstants.FORWARDED_STATE)) {

        ACK_STATE = SynchConstants.PROCESSED_ACK;
        ACK_MESSAGE = SynchConstants.PROCESSED_ACK_MESSAGE;
      } else if (STATE.equalsIgnoreCase(SynchConstants.PROCESSED_STATE)) {
        ACK_STATE = SynchConstants.PROCESSED_SYNCHED_ACK;
        ACK_MESSAGE = SynchConstants.PROCESSED_SYNCHED_ACK_MESSAGE;
      } else {
        return;
      }

      inputXML =
          ServiceConfiguration.getForwardAckXML(
              tempData.getUID(), ACK_STATE, ACK_MESSAGE, localCabinet);
      ServiceConfiguration.serviceXMLLog.info(inputXML);
      outputXML = ServiceConfiguration.executeLocalXML(inputXML);
      ServiceConfiguration.serviceXMLLog.info("OutputXML " + outputXML);
      xmlResponse.setXmlString(outputXML);
      statusValue = xmlResponse.getVal("Status");
      if (statusValue.equalsIgnoreCase("0")) {
        UnderProcessFile.getReference().remove(tempData.getUID());
        ServiceConfiguration.serviceLog.info(
            "#Local Acknowlgment Completed Sucessfully# for UID " + tempData.getUID());
      } else {

        ServiceConfiguration.serviceLog.info(
            "#Unable to Local Acknowledge the Synchronization Request for :- " + tempData.getUID());
        String error = xmlResponse.getVal("Error");
        if (error == null) {
          error = "Status:" + statusValue;
        }
        try {

          inputXML = ServiceConfiguration.getUpdateSynchDataXML(tempData.getUID(), STATE, error);
          outputXML = ServiceConfiguration.executeLocalXML(inputXML);
          xmlResponse.setXmlString(outputXML);
          statusValue = xmlResponse.getVal("Status");
        } catch (IOException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
          // Error Handling
        } catch (NGException e) {
          ServiceConfiguration.serviceLog.info(
              "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
          ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
        }
      }

    } catch (NGException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);

    } catch (IOException e) {
      ServiceConfiguration.serviceLog.info(
          "Error Occured!!" + tempData.getUID() + "Printing Stack Trace in Error Log");
      ServiceConfiguration.serviceErrorLog.info("Error Occured!! ", e);
    }
  }