com.snowflake.client.core

## Class IncidentUtil

- java.lang.Object
- - com.snowflake.client.core.IncidentUtil

    public class IncidentUtil
    extends Object

Author:
  jrosen

### Field Summary

Fields
`static String` `CLIENT_BUILD_ID`
`static String` `CLIENT_INFO`
`static String` `CLIENT_TYPE`
`static String` `CLIENT_VERSION`
`static String` `DETAIL`
`static String` `INC_DUMP_FILE_EXT`
`static String` `INC_DUMP_FILE_NAME`
`static String` `INCIDENT_ID`
`static String` `INCIDENT_INFO`
`static String` `INCIDENT_REPORT`
`static String` `INCIDENT_TYPE`
`static String` `JOB_ID`
`static String` `REPORTER`
`static String` `REQUEST_ID`
`static String` `SIGNATURE`
`static String` `STACKTRACE`
`static String` `THROTTLE_SIGNATURE`
`static String` `TIMESTAMP`

### Constructor Summary

Constructors
Constructor and Description
`IncidentUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `dumpVmMetrics(String incidentId)` Dumps JVM metrics for this process.
`static void` `generateIncident(SFSession session, String signature, String detail, String requestId, String jobUuid, Throwable cause)`
`static void` `generateIncident(String sessionToken, String serverUrl, String signature, String detail, String requestId, String jobUuid, Throwable cause)` Generates an incident report based on the parameters passed in and triggers an incident with the EventHandler
`static SFException` `generateIncidentWithException(SFSession session, String requestId, String jobUuid, ErrorCode errorCode, Object... params)` Creates an SFException without a cause to be thrown and generates/triggers an incident based on that exception.
`static SFException` `generateIncidentWithException(SFSession session, String requestId, String jobUuid, Throwable cause, ErrorCode errorCode, Object... params)`
`static SFException` `generateIncidentWithException(String sessionToken, String serverUrl, String requestId, String jobUuid, ErrorCode errorCode, Object... params)`
`static SFException` `generateIncidentWithException(String sessionToken, String serverUrl, String requestId, String jobUuid, Throwable cause, ErrorCode errorCode, Object... params)` Creates an SFException to be thrown and generates/triggers an incident based on that exception.
`static String` `oneLiner(Throwable thrown)` Produce a one line description of the throwable, suitable for error message and log printing.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CLIENT_TYPE

    public static final String CLIENT_TYPE

See Also:
  Constant Field Values

#### CLIENT_VERSION

    public static final String CLIENT_VERSION

See Also:
  Constant Field Values

#### CLIENT_BUILD_ID

    public static final String CLIENT_BUILD_ID

See Also:
  Constant Field Values

#### INCIDENT_ID

    public static final String INCIDENT_ID

See Also:
  Constant Field Values

#### STACKTRACE

    public static final String STACKTRACE

See Also:
  Constant Field Values

#### REQUEST_ID

    public static final String REQUEST_ID

See Also:
  Constant Field Values

#### JOB_ID

    public static final String JOB_ID

See Also:
  Constant Field Values

#### SIGNATURE

    public static final String SIGNATURE

See Also:
  Constant Field Values

#### REPORTER

    public static final String REPORTER

See Also:
  Constant Field Values

#### DETAIL

    public static final String DETAIL

See Also:
  Constant Field Values

#### INCIDENT_TYPE

    public static final String INCIDENT_TYPE

See Also:
  Constant Field Values

#### TIMESTAMP

    public static final String TIMESTAMP

See Also:
  Constant Field Values

#### INCIDENT_REPORT

    public static final String INCIDENT_REPORT

See Also:
  Constant Field Values

#### CLIENT_INFO

    public static final String CLIENT_INFO

See Also:
  Constant Field Values

#### INCIDENT_INFO

    public static final String INCIDENT_INFO

See Also:
  Constant Field Values

#### THROTTLE_SIGNATURE

    public static final String THROTTLE_SIGNATURE

See Also:
  Constant Field Values

#### INC_DUMP_FILE_NAME

    public static final String INC_DUMP_FILE_NAME

See Also:
  Constant Field Values

#### INC_DUMP_FILE_EXT

    public static final String INC_DUMP_FILE_EXT

See Also:
  Constant Field Values

### Constructor Detail

#### IncidentUtil

    public IncidentUtil()

### Method Detail

#### generateIncidentWithException

    public static SFException generateIncidentWithException(SFSession session,
                                                            String requestId,
                                                            String jobUuid,
                                                            ErrorCode errorCode,
                                                            Object... params)

Creates an SFException without a cause to be thrown and generates/triggers an incident based on that exception.

Parameters:
  `session` - session that will generate incident
  `requestId` - request id
  `jobUuid` - job uuid
  `errorCode` - error code that caused the incident
  `params` - option parameters
Returns:
  generated SFException

#### generateIncidentWithException

    public static SFException generateIncidentWithException(SFSession session,
                                                            String requestId,
                                                            String jobUuid,
                                                            Throwable cause,
                                                            ErrorCode errorCode,
                                                            Object... params)

#### generateIncidentWithException

    public static SFException generateIncidentWithException(String sessionToken,
                                                            String serverUrl,
                                                            String requestId,
                                                            String jobUuid,
                                                            Throwable cause,
                                                            ErrorCode errorCode,
                                                            Object... params)

Creates an SFException to be thrown and generates/triggers an incident based on that exception.

Parameters:
  `sessionToken` - session token
  `serverUrl` - snowflake url
  `requestId` - request id
  `jobUuid` - job uuid
  `cause` - cause of the incident
  `errorCode` - error code of the incident
  `params` - optional parameters
Returns:
  generated SFException

#### generateIncidentWithException

    public static SFException generateIncidentWithException(String sessionToken,
                                                            String serverUrl,
                                                            String requestId,
                                                            String jobUuid,
                                                            ErrorCode errorCode,
                                                            Object... params)

#### generateIncident

    public static void generateIncident(SFSession session,
                                        String signature,
                                        String detail,
                                        String requestId,
                                        String jobUuid,
                                        Throwable cause)

#### generateIncident

    public static void generateIncident(String sessionToken,
                                        String serverUrl,
                                        String signature,
                                        String detail,
                                        String requestId,
                                        String jobUuid,
                                        Throwable cause)

Generates an incident report based on the parameters passed in and triggers an incident with the EventHandler

Parameters:
  `sessionToken` - session token
  `serverUrl` - server url
  `signature` - incident signature
  `detail` - incident detail
  `requestId` - request id
  `jobUuid` - job uuid
  `cause` - cause of incident

#### oneLiner

    public static String oneLiner(Throwable thrown)

Produce a one line description of the throwable, suitable for error message and log printing.

Parameters:
  `thrown` - thrown object
Returns:
  description of the thrown object

#### dumpVmMetrics

    public static void dumpVmMetrics(String incidentId)

Dumps JVM metrics for this process.

Parameters:
  `incidentId` - incident id