Interface ICamelProcessorTxLogHelper

All Known Subinterfaces:
ICdaCamelProcessorTxLogHelper, IGenericCamelProcessorTxLogHelper, IHl7V2CamelProcessorTxLogHelper

  • Field Details

  • Method Details

    • addStepIfTxLogActive

      void addStepIfTxLogActive(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull String theProcedureName)
      If transaction logging was initiated (smile:txLogStart procedure, present before current procedure in route), adds a log step to the transaction log. The step outcome is FAIL if the exchange has failed, otherwise SUCCESS.
      Parameters:
      theExchange - the camel exchange
      theProcedureName - the log-producing procedure name
    • addStepIfTxLogActive

      void addStepIfTxLogActive(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull ITxLogStepsProvider theStepsProvider)
      If transaction logging was initiated (smile:txLogStart procedure, present before current procedure in route), adds step from provider to the transaction log.

      If the exchange has failed, each step's outcome is set to FAIL. Otherwise an outcome already set on a step is kept, and a step without an outcome is set to SUCCESS.

      Parameters:
      theExchange - the camel exchange
      theStepsProvider - the provider of the corresponding transaction log steps
    • addStepIfTxLogActive

      void addStepIfTxLogActive(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull List<TransactionLogStepJson> theLogSteps)
      If transaction logging was initiated (smile:txLogStart procedure, present before current procedure in route), adds the list of steps to the transaction log.

      If the exchange has failed, each step's outcome is set to FAIL. Otherwise an outcome already set on a step is kept, and a step without an outcome is set to SUCCESS.

      Parameters:
      theExchange - the camel exchange
      theLogSteps - the log steps to be added to the transaction log
    • buildTxLogStep

      @Nonnull TransactionLogStepJson buildTxLogStep(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull TransactionLogStepTypeEnum theLogStepType, @Nullable org.apache.commons.lang3.tuple.Pair<String,TransactionLogBodyTypeEnum> theBodyAndType)
      Builds a new transaction log step from provided exchange properties and parameters. The step outcome is left unset; addStepIfTxLogActive(Exchange, List) or addStepIfTxLogActive(Exchange, ITxLogStepsProvider) sets it when the step is added.
      Parameters:
      theExchange - the camel exchange
      theLogStepType - the transaction log step type
      theBodyAndType - A Pair containing the body and the body type or null
      Returns:
      the built transaction log step
    • buildTxLogStep

      @Deprecated @Nonnull default TransactionLogStepJson buildTxLogStep(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull TransactionLogStepTypeEnum theLogStepType, @Nullable org.apache.commons.lang3.tuple.Pair<String,TransactionLogBodyTypeEnum> theBodyAndType, @Nullable TransactionLogOutcomeEnum theOutcome)
      Deprecated.
      use buildTxLogStep(Exchange, TransactionLogStepTypeEnum, Pair) Builds a new transaction log step considering received exchange properties and parameters.
      Parameters:
      theExchange - the camel exchange
      theLogStepType - the transaction log step type
      theBodyAndType - A Pair containing the body and the body type or null
      theOutcome - Ignored.
      Returns:
      the built transaction log step
    • getRequestUrl

      @Nonnull String getRequestUrl(@Nonnull org.apache.camel.Exchange theExchange, @Nonnull String theProcedureName)
      Builds a string containing the received procedure name, including the module id if present in the exchange
      Parameters:
      theExchange - the camel exchange
      theProcedureName - the log-producing procedure name
      Returns:
      a string with the built executing procedure URI
    • isTxLogShowBody

      boolean isTxLogShowBody(@Nonnull org.apache.camel.Exchange theExchange)
      Informs if 'showMsgBody' parameter is present
      Parameters:
      theExchange - the camel exchange
      Returns:
      boolean indicating if 'showMsgBody' parameter is present
    • isTxLogStarted

      boolean isTxLogStarted(@Nonnull org.apache.camel.Exchange theExchange)
      informs if a transaction log is active for the route
      Parameters:
      theExchange - the camel exchange
      Returns:
      boolean indicating if transaction log is active for the route
    • startTxLog

      void startTxLog(@Nonnull org.apache.camel.Exchange theExchange)
      Requests transaction log initiation for the route
      Parameters:
      theExchange - the camel exchange
    • startTxLogForManualCommit

      void startTxLogForManualCommit(@Nonnull org.apache.camel.Exchange theExchange)
      Requests transaction log initiation for the route. This initiates the log before the route is invoked, allowing the caller to add entries to the log before passing control to Camel. The transaction log wil not auto-commit when the route finishes, allowing the caller to continue adding entries after the Camel invocation returns. The log will only commit once **both** the route is complete and the caller has called manualCommitTxLog(Exchange)
      Parameters:
      theExchange - the camel exchange
    • commitTxLog

      void commitTxLog(@Nonnull org.apache.camel.Exchange theExchange)
      Commits the transaction log to configured writers
      Parameters:
      theExchange - the camel exchange
    • manualCommitTxLog

      void manualCommitTxLog(@Nonnull org.apache.camel.Exchange theExchange)
      Allows a transaction log that was initiated with startTxLogForManualCommit(Exchange) to commit. The log may not commit immediately if the route is still processing (async mode).
      Parameters:
      theExchange - the camel exchange
    • clearTxLog

      void clearTxLog(@Nonnull org.apache.camel.Exchange theExchange)
      Discards current transaction logging and marks logging not initiated for the route
      Parameters:
      theExchange - the camel exchange
    • getSettings

      Returns the settings associated with this writer. Event sources can use this to optimize whether to include specific elements in their log entries.
    • getPropertyFromRequestDetails

      @Nullable <T> T getPropertyFromRequestDetails(@Nonnull String theKey, @Nonnull org.apache.camel.Exchange theExchange)
      Obtain a value stored in the exchange request details map
      Parameters:
      theKey - the key for referencing the object to extract from the request details map
      theExchange - the camel exchange encapsulating the request details map
      Returns:
      the value stored in the exchange request details map, or null if not found
    • addPropertyToRequestDetails

      void addPropertyToRequestDetails(@Nonnull String theKey, @Nullable Object theValue, @Nonnull org.apache.camel.Exchange theExchange)
      Store a key/value in the exchange request details map
      Parameters:
      theKey - the key that will reference the object being stored in request details map
      theValue - the object being stored in request details map, or null to remove the key
      theExchange - the camel exchange encapsulating the request details map
    • getCurrentTxLogGuid

      @Nonnull Optional<String> getCurrentTxLogGuid(@Nonnull org.apache.camel.Exchange theExchange)
      Returns the current transaction log guid for the given exchange. NB: it's not enough to start a transaction; a step must be added before a tx guid is generated. If no step has been added, an empty optional will be returned.
      Parameters:
      theExchange - - the exchange
      Returns:
      - the txlog guid, or an empty Optional if no steps have been added yet.