# JavaScript API Reference for Oracle ADF Faces

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81451-01
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |

SUMMARY: FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

# oracle.adf.view.js.profiling
Class AdfCheckpoint

    org.ecmascript.object.Object
       |
       +--oracle.adf.view.js.profiling.AdfCheckpoint

    public class AdfCheckpoint
    extends Object

A checkpoint that will be used to record profile data. To get an instance, use the `AdfCheckpoint.getCheckpoint()` method.

Since:
  1.0

## Field Summary
`private static Boolean` | `_checkpointEnabled` Tells whether or not new checkpoints are enabled by default or not.
`private static Object` | `_checkpoints` A map of all the checkpoints
`private static String` | `_NULL_ID` Prefix used to replace a null id on the checkpoint overrides and disabled indexes for start() and stop().
`private static Object` | `_overrides` Specifies exceptions to the _checkpointEnabled flag.
`private static Number` | `_uid` This is a counter for the unique ids that are served back from the start method.

### Fields inherited from org.ecmascript.object.Object
`constructor, prototype`

## Constructor Summary
`private` | `AdfCheckpoint(Object id, Object group)` Use `AdfCheckpoint.getCheckpoint()` to get an instance.

## Method Summary
`public static Object` | `getCheckpoint(String id, String group)` Returns a checkpoint for a specified id and optional group.
`public Object` | `getDescription()` Returns the description for this AdfCheckpoint if one is desired.
`public Object` | `getGroup()` Returns the group of this checkpoint.
`public static Object` | `getGroupCheckpoints(Object group)` Returns all of the checkpoints for a particular group.
`public Object` | `getId()` Returns the id of this object.
`private static Object` | `_getKey(Object id, Object group)` Returned a key representation of this id and group
`private Object` | `_init(String id, String group)` Initializes the checkpoint.
`public Object` | `isEnabled()` Returns whether or not the current checkpoint is enabled or disabled.
`private static Object` | `_isEnabled(String id, String group)` Tells whether or not a checkpoint corresponding to this id and optionally this group is enabled or disabled.
`public static Object` | `removeCheckpointOverride(String id, String group)` Removes a checkpoint override and allows the checkpoints to function according to the {@link #_checkpointEnabled} flag.
`public static Object` | `setCheckpointOverride(String id, String group, Boolean enabled)` Sets an override for a checkpoint.
`public static Object` | `setCheckpointsEnabled(Boolean enabled)` Sets whether checkpoints are enabled by default or not.
`public Object` | `setDescription(String desc)` Sets the description for this AdfCheckpoint if one is desired.
`public Object` | `start(Object callingMethod, Array params)` Starts a data collection point on the current AdfCheckpoint.
`public Object` | `stop(String uid)` Stops the collection of stats for a particular start.
`public Object` | `toString()` Returns a String representation for this AdfCheckpoint in the form of "id|group".

## Field Detail

### _checkpointEnabled

`private static Boolean _checkpointEnabled`
  Tells whether or not new checkpoints are enabled by default or not.

### _checkpoints

`private static Object _checkpoints`
  A map of all the checkpoints

### _NULL_ID

`private static String _NULL_ID`
  Prefix used to replace a null id on the checkpoint overrides and disabled indexes for start() and stop().

### _overrides

`private static Object _overrides`
  Specifies exceptions to the _checkpointEnabled flag.

### _uid

`private static Number _uid`
  This is a counter for the unique ids that are served back from the start method.

## Constructor Detail

### AdfCheckpoint

`private AdfCheckpoint(Object id,
Object group)`
  Use `AdfCheckpoint.getCheckpoint()` to get an instance.
  Parameters:

    `id` |  |
    `group` |  |

## Method Detail

### getCheckpoint

`public static Object getCheckpoint(String id,
String group)`
  Returns a checkpoint for a specified id and optional group. If this checkpoint has been created then it will be returned. If it has not then this method will create a new checkpoint and returned to the user. It is important to note that for any given group, the id's will be unique. Therefore "myID" in group "instrumentation" will be different from "myID" with no group specified.
  Parameters:

    `id` | - | the id of this checkpoint
    `group` | - | the optional group of this checkpoint

  Return:
    `Object` - a AdfCheckpoint for this id and group
  Throws:
    `Error` if asserts are enabled and when id is null

### getDescription

`public Object getDescription()`
  Returns the description for this AdfCheckpoint if one is desired. There may be only one description per AdfCheckpoint.
  Return:
    `Object` - the description of checkpoint.

### getGroup

`public Object getGroup()`
  Returns the group of this checkpoint. This checkpoint must be initialized for this method to function. Objects returned from `getCheckpoint(String, String)` should already be initialized.
  Return:
    `Object` - the group or `null` if this item has no group
  Throws:
    `Error` if asserts are enabled and if the checkpoint has not been initialized

### getGroupCheckpoints

`public static Object getGroupCheckpoints(Object group)`
  Returns all of the checkpoints for a particular group.
  Parameters:

    `group` |  |

  Return:
    `Object` - an Array of AdfCheckpoints for this group
  Throws:
    `Error` if asserts are enabled and when the group is null

### getId

`public Object getId()`
  Returns the id of this object. This object must be initialized for this method to work. Objects returned from `getCheckpoint(String, String)` should already be initialized.
  Return:
    `Object` - the id
  Throws:
    `Error` if asserts are enabled and if the checkpoint has not been initialized

### _getKey

`private static Object _getKey(Object id,
Object group)`
  Returned a key representation of this id and group
  Parameters:

    `id` |  |
    `group` |  |

  Return:
    `Object` - a String with a key

### _init

`private Object _init(String id,
String group)`
  Initializes the checkpoint. This is used with the derrived classes.
  Parameters:

    `id` | - | the id of this checkpoint
    `group` | - | the optional group of this checkpoint

  Return:
    `Object`

### isEnabled

`public Object isEnabled()`
  Returns whether or not the current checkpoint is enabled or disabled. This is determined by `setCheckpointsEnabled(Boolean)` and `setCheckpointOverride(String, String, Boolean)`.
  Return:
    `Object` - true if this checkpoint is currently enabled

### _isEnabled

`private static Object _isEnabled(String id,
String group)`
  Tells whether or not a checkpoint corresponding to this id and optionally this group is enabled or disabled.
  Parameters:

    `id` | - | the id of the checkpoint
    `group` | - | the optional group of the checkpoint

  Return:
    `Object`

### removeCheckpointOverride

`public static Object removeCheckpointOverride(String id,
String group)`
  Removes a checkpoint override and allows the checkpoints to function according to the `_checkpointEnabled` flag.
  Parameters:

    `id` | - | the id of the checkpoint override to remove. If this is null then the group checkpoint override will be removed but individual overrides will not.
    `group` | - | the group of the checkpoint override to remove. If this is null then it pertains only to those checkpoints which do NOT have a group.

  Return:
    `Object`

### setCheckpointOverride

`public static Object setCheckpointOverride(String id,
String group,
Boolean enabled)`
  Sets an override for a checkpoint. This override is used instead of the `_checkpointEnabled` flag.
  Parameters:

    `id` | - | the id of the checkpoint to override. If this is null then the override will pertain to every checkpoint in the group.
    `group` | - | the group of the checkpoints to override. If this is null then it pertains only to those checkpoints which do NOT have a group.
    `enabled` | - | the value for the checkpoint override. If this is `true` then the checkpoint will be enabled. If this is `false` then the checkpoint is not enabled.

  Return:
    `Object`
  Throws:
    `Error` if asserts are enabled and when override is null

### setCheckpointsEnabled

`public static Object setCheckpointsEnabled(Boolean enabled)`
  Sets whether checkpoints are enabled by default or not.
  Parameters:

    `enabled` | - | `true` if checkpoints are to be enabled by default.

  Return:
    `Object`
  Throws:
    `Error` if asserts are enabled and when override is null

### setDescription

`public Object setDescription(String desc)`
  Sets the description for this AdfCheckpoint if one is desired. There may be only one description per checkpoint.
  Parameters:

    `desc` | - | the description of checkpoint.

  Return:
    `Object`

### start

`public Object start(Object callingMethod,
Array params)`
  Starts a data collection point on the current AdfCheckpoint. It will return a uid that MUST be used in order to stop the profiler.
  Parameters:

    `callingMethod` | - | an optional parameter specifying the method that this start is being called from.
    `params` | - | an option array of parameters that were used to call the method that this start is being called from.

  Return:
    `Object` - a uid which must be used in the `stop(String)` method

### stop

`public Object stop(String uid)`
  Stops the collection of stats for a particular start.
  Parameters:

    `uid` | - | a string containing the uid that was returned from the start method when it was called. This will stop the profiling.

  Return:
    `Object`
  Throws:
    `Error` if asserts are enabled and if uid is null or if the checkpoint does not exist.

### toString

`public Object toString()`
  Returns a String representation for this AdfCheckpoint in the form of "id|group".
  Return:
    `Object` - the string of this checkpoint

SUMMARY: FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Fusion Middleware Javascript API Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81451-01
PREV NEXT | FRAMES NO FRAMES Warning: private items are visible |

Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.