Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tibco.ax.fw.runtime.util
Interface UserLogAccess

    public interface UserLogAccess

UserLogAccess interface creates an entry in the Audit Log. Users of this interface can get a handle of this implementation from the from the input data and set user-defined state value for a particular entry in the Audit Log. The following script fragment shows how to get and log to the UserLogAccess object from JavaScript:

>      var logClient = job.get("logObj");
>      var PENDING = Packages.com.tibco.ax.fw.util.UserLogAccess.PENDING;
>      logClient.log("STATE_VALUE", PENDING, "Received the file from trading partner.");

The logClient object is available only during the duration of the scripts and is not a serializable or persistent object.

Note: For every invocation of `log(java.lang.String, int, java.lang.String)` within a JavaScript, a new Audit Log entry is created on the Details Panel of the Audit Log Viewer. The very first call to `log(java.lang.String, int, java.lang.String)` during the execution of the Script will create a summary entry in the Audit Log Viewer as a separate row and so it is up to the JavaScript user to mark the status of the summary row appropriately as COMPLETED or ERROR depending on the decisions made in the JavaScript execution.

Field Summary
`static int` | `COMPLETED` COMPLETED status to be specified for the log entry.
`static int` | `ERROR` ERROR status to be specified for the log entry.
`static int` | `PENDING` PENDING status to be specified for the log entry.

Method Summary
`void` | `log(java.lang.String state, int status, java.lang.String desc)` Creates an entry in the Audit Log with the given state, status and description.

Field Detail

### ERROR

    static final int ERROR

  ERROR status to be specified for the log entry. This status would be logged in the Audit Log as ERROR TRANSPORT.

  See Also:
    Constant Field Values

### PENDING

    static final int PENDING

  PENDING status to be specified for the log entry.

  See Also:
    Constant Field Values

### COMPLETED

    static final int COMPLETED

  COMPLETED status to be specified for the log entry.

  See Also:
    Constant Field Values

Method Detail

### log

    void log(java.lang.String state,
             int status,
             java.lang.String desc)
             throws java.lang.Exception

  Creates an entry in the Audit Log with the given state, status and description. status field can be only one of the value defined in `UserLogAccess`.

  Parameters:
    `state` - is the state that is defined in the Audit Log entry. The value cannot be null and an exception will be thrown if the value is null.
    `status` - is a valid value that can be one of the following: `ERROR`, `PENDING` or `COMPLETED`. If an invalid value is set, an exception will be thrown.
    `desc` - is the description that is set for this log entry. The value cannot be null and an exception will be thrown if the value is null.
  Throws:
    `java.lang.Exception` - if state, desc values are null or if the status value is not a valid value. Exception will also be thrown if there are errors due to JDBC SQL connection errors or any errors thrown from the database.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD