module:baja/alarm/AlarmArchiveSpace

module:baja/alarm/AlarmArchiveSpace

new (require("baja/alarm/AlarmArchiveSpace"))()

Description:
  • Represents a alarm:AlarmArchiveSpace in BajaScript.

Source:
Extends:

Extends

Methods

ackAlarms(paramsopt, objopt) → {Promise}

Description:
  • Acknowledge a group of alarms by id and/or source

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
ids Array.<String> <optional>

Array of encoded baja:Uuid strings representing alarm ids

srcs Array.<String> <optional>

Array of encoded baja.Ord strings representing sources

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once mapping
has been created.

fail function <optional>

(Deprecated: use Promise) Called if the
mapping cannot be created.

Returns:

Promise resolved when alarms have been acknowledged

Type
Promise

addNote(alarm, note, obj) → {Promise}

Description:
  • Add a note to an alarm record

Source:
Parameters:
Name Type Description
alarm

The alarm record to which to add the note

note
obj
Returns:
Type
Promise

addNoteToAlarms(paramsopt, objopt) → {Promise}

Description:
  • Add notes to a number of alarms by id and/or source.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
ids Array.<String> <optional>

Array of encoded baja:Uuid strings representing alarm ids

srcs Array.<String> <optional>

Array of encoded baja.Ord strings representing sources

a boolean <optional>

value set as true to show that the view is invoked over the alarm archive space

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the request has completed.

fail function <optional>

(Deprecated: use Promise) Called if the request fails.

Returns:

Promise resolved once the call is complete.

Type
Promise

clearAllRecords(objopt) → {Promise}

Description:
  • Clear all the records from the alarm database.

Source:
Parameters:
Name Type Attributes Description
obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the
records have been successfully cleared.

fail function <optional>

(Deprecated: use Promise) Called if the
alarm devices fails to resolve.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

A promise that's resolved once all of the records have
been cleared.

Type
Promise

clearOldRecords(beforeTimeopt, objopt) → {Promise}

Description:
  • Clear all records with a timestamp before the specified time.
    Also update the totalAlarmCount, unackedAlarmCount, openAlarmCount,
    and inAlarmCount properties all BAlarmClasses.

Source:
Parameters:
Name Type Attributes Description
beforeTime baja.AbsTime <optional>

The earliest time to keep in the result.
Records before this time will be removed.

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the
records have been successfully cleared.

fail function <optional>

(Deprecated: use Promise) Called if the alarm
devices fails to resolve.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

A promise that's resolved once all of the records have
been cleared.

Type
Promise

clearRecords(uuids, objopt) → {Promise}

Description:
  • Clear the record with the given uuid.
    Also update the totalAlarmCount, unackedAlarmCount, openAlarmCount,
    and inAlarmCount properties all BAlarmClasses.

Source:
Parameters:
Name Type Attributes Description
uuids Array

An array of encoded uuids to remove from the database

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the
records have been successfully cleared.

fail function <optional>

(Deprecated: use Promise) Called if the alarm
devices fails to resolve.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

A promise that's resolved once all of the records have
been cleared.

Type
Promise

equals(obj) → {Boolean}

Description:
  • Indicates whether some other object is equal to this one.

Source:
Inherited From:
Parameters:
Name Type Description
obj Object

the reference object with which to compare.

Returns:

true if this object is the same as the obj argument; false otherwise.

Type
Boolean

equivalent(obj) → {Boolean}

Description:
  • Equivalence test.

    equivalent() is used to compare if two Objects have equivalent
    state, but might not want to return true for equals since it
    it has implied semantics for many operations. The default
    implementation returns the result of baja.Object#equals.

Source:
Inherited From:
Parameters:
Name Type Description
obj
Returns:
Type
Boolean

forceClear(paramsopt, objopt) → {Promise}

Description:
  • Force alarms clear by id and/or source.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
ids Array.<String> <optional>

Array of encoded baja:Uuid strings representing alarm ids

srcs Array.<String> <optional>

Array of encoded baja.Ord strings representing sources

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the request has completed.

fail function <optional>

(Deprecated: use Promise) Called if the request fails.

Returns:

Promise resolved once the call is complete.

Type
Promise

getAbsoluteOrd() → {baja.Ord}

Description:
  • Return the Space's absolute ORD.

Source:
Inherited From:
Returns:

The absolute ORD.

Type
baja.Ord

getAgents(isopt, batchopt) → {Promise}

Description:
  • Returns a promise that resolves to the agent list for this Object.

Source:
Inherited From:
See:
Parameters:
Name Type Attributes Description
is Array.<String> <optional>

An optional array of filters to add to the
agent query.

batch baja.comm.Batch <optional>

An optional object used to batch network
calls together.

Returns:

A promise that will resolve with the Agent Info.

Type
Promise

getAlarmFields(objopt) → {Promise.<Array.<String>>}

Description:
  • Returns an array of the declared fields in an alarm record

Source:
Parameters:
Name Type Attributes Description
obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once mapping
has been created.

fail function <optional>

(Deprecated: use Promise) Called if the
mapping cannot be created.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object

Returns:

Promise resolved with Array of Strings representing field names

Type
Promise.<Array.<String>>

getDisplayNamesMap(objopt) → {Promise.<Object>}

Description:
  • Returns an object map of alarm class names -> alarm class display names

Source:
Parameters:
Name Type Attributes Description
obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once mapping
has been created.

fail function <optional>

(Deprecated: use Promise) Called if the
mapping cannot be created.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object

Returns:

Promise resolved with map object

Type
Promise.<Object>

getIcon() → {baja.Icon}

Description:
  • Return the Object's Icon.

Source:
Inherited From:
Returns:
Type
baja.Icon

getNavChildren(obj) → {Promise.<Array.<baja.NavNode>>}

Description:
  • Access the Nav Children.

Source:
Inherited From:
Example
container.getNavChildren()
    .then(function (kids) {
      baja.outln('retrieved nav children: ' + kids.join());
    })
    .catch(function (err) {
      baja.error('failed to retrieve nav children: ' + err);
    });
Parameters:
Name Type Description
obj Object

the Object Literal for the method's arguments.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) called when we have
the Nav Children. An array of Nav Children is passed as an argument into
this function.

fail function <optional>

(Deprecated: use Promise) called if the
function fails to complete.

Returns:

a promise that will be resolved
once the nav children have been retrieved.

Type
Promise.<Array.<baja.NavNode>>

getNavDescription() → {String}

Description:
  • Return the Nav Description.

Source:
Inherited From:
Returns:
Type
String

getNavDisplayName() → {String}

Description:
  • Return the Nav Display Name.

Source:
Inherited From:
Returns:
Type
String

getNavIcon() → {baja.Icon}

Description:
  • Return the Nav Icon for this node.

Source:
Inherited From:
Returns:
Type
baja.Icon

getNavName() → {String}

Description:
  • Return the Nav Name.

Source:
Inherited From:
Returns:
Type
String

getNavOrd(paramsopt) → {baja.Ord}

Description:
  • Return the Nav ORD.

    If passing sessionAware, the returned ORD may return session information
    when BajaScript is running in Workbench (most commonly including the IP
    address and fox|foxs schemes). Note that a session-aware ORD is not safe
    to pass directly up to a station for resolution as in an RPC or servlet
    call, as a station won't know how to open a FOX session to itself.

Source:
Inherited From:
Examples

When running in Workbench, connected to a station at ip:1.2.3.4, session information can be retrieved.

console.log(services.getNavOrd());
// local:|station:|slot:/Services
console.log(services.getNavOrd({ sessionAware: true });
// ip:1.2.3.4|fox:|station:|slot:/Services

When running in a browser, session information is never present.

console.log(services.getNavOrd());
// local:|station:|slot:/Services
console.log(services.getNavOrd({ sessionAware: true });
// local:|station:|slot:/Services
Parameters:
Name Type Attributes Description
params object <optional>
Properties
Name Type Attributes Description
sessionAware boolean <optional>

include session information if
available

Returns:
Type
baja.Ord

getNavParent() → {baja.NavContainer}

Description:
  • Return the Nav Parent (or null if there's no parent).

Source:
Inherited From:
Returns:
Type
baja.NavContainer

getNavTypeSpec() → {String}

Description:
  • Return the type spec of object this nav node navigates to.

Source:
Inherited From:
Returns:

The nav type spec.

Type
String

getNotes(paramsopt, objopt) → {Promise.<String>}

Description:
  • Returns notes for an alarm record.

Source:
Parameters:
Name Type Attributes Description
params Object <optional>
Properties
Name Type Attributes Description
uuid Array.<String> <optional>

Encoded baja:Uuid string representing an alarm id

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once mapping
has been created.

fail function <optional>

(Deprecated: use Promise) Called if the
mapping cannot be created.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object

Returns:

Promise resolved with a notes string

Type
Promise.<String>

getPermissions() → {baja.Permissions}

Source:
Since:
  • Niagara 4.14
Inherited From:
Throws:

if this node is not a BIProtected

Type
Error
Returns:
Type
baja.Permissions

getPermissionsMap(alarmClasses, objopt) → {Promise.<Object>}

Description:
  • Returns an object map of alarm class names -> alarm class permissions

Source:
Since:
  • Niagara 4.9
Parameters:
Name Type Attributes Description
alarmClasses Array.<String>

The alarm class names for displayed alarms.

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once mapping
has been created.

fail function <optional>

(Deprecated: use Promise) Called if the
mapping cannot be created.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object

Returns:

Promise resolved with map object

Type
Promise.<Object>

getRecordCount(timeRange, filterSet, objopt) → {Promise}

Description:
  • Query the alarm archive database for the count of alarm records within the given time range.

Source:
Parameters:
Name Type Attributes Description
timeRange baja.Simple

the bql:DynamicTimeRange to query

filterSet
obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the request has completed.

fail function <optional>

(Deprecated: use Promise) Called if the request fails.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

A promise that's resolved with the count of alarm records.

Type
Promise

getSingleSourceSummary(params, objopt) → {Promise}

Description:
  • Query summary alarms for a single source.

Source:
Parameters:
Name Type Attributes Description
params Object
Properties
Name Type Attributes Description
offset Number

The query offset for the cursor. This is the index of where the cursor starts.

limit Number

The limit to the number of records downloaded.

source

The alarm source.

ord

The ORD for the recipient to query alarms from.

filterSet <optional>

An optional filter set.

timeRange <optional>

An optional time range filter.

column String <optional>

An optional column name to sort by. This can be an alarm record property name
or prefixed with 'alarmData.' if sorting via an alarm data facets column. If not specified, the alarm data
will be sorted by timestamp.

sortDesc Boolean <optional>

An optional flag used to indicate whether to sort by descending or ascending order.
If not specified, the data will sort by descending order.

obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the request has completed.

fail function <optional>

(Deprecated: use Promise) Called if the request fails.

Returns:

Promise resolved once the call is complete.

Type
Promise

getType() → {Type}

Description:
  • Get the type of this instance.

Source:
Inherited From:
Returns:
Type
Type

getTypeDisplayName(cxopt) → {Promise.<string>|string}

Description:
  • Gets the friendly type display name for this object.

Source:
Since:
  • Niagara 4.10
Inherited From:
See:
  • baja.Type#getDisplayName
Parameters:
Name Type Attributes Description
cx Object <optional>

a context to be passed down to Type

Returns:

If no context is provided, the type
display name is returned synchronously as a string. If context provided,
the type display name is resolved via a promise as a string.

Type
Promise.<string> | string

queryAlarmDatabase(timeRange, limit, offset, filterSet, sortDescending, columnName, objopt) → {Promise}

Description:
  • Query the alarm database for the given time range

Source:
Parameters:
Name Type Attributes Description
timeRange baja.Simple

the bql:DynamicTimeRange to query

limit
offset
filterSet
sortDescending
columnName
obj Object <optional>

The object literal.

Properties
Name Type Attributes Description
ok function <optional>

(Deprecated: use Promise) Called once the request has completed.

fail function <optional>

(Deprecated: use Promise) Called if the request fails.

batch baja.comm.Batch <optional>

if defined, any network calls will be
batched into this object.

Returns:

A promise that's resolved once all of the records have
been retrieved

Type
Promise

toString(cxopt) → {String|Promise.<String>}

Description:
  • Returns the String representation of this Object.

    When implementing toString() on one of your own Objects, it should
    adhere to the following contract.

    • When called with no arguments, it must return a string directly.
    • It can also be called with an object literal. In this case, it may
      return a Promise to be resolved with a string, or it may return a string
      directly as normal. This case is sort of analogous to
      javax.baja.sys.Localizable#toString(Context).

    Therefore, when calling toString() on an Object of unknown Type using an
    object literal as an argument, it's important to wrap the call in
    Promise.resolve().

Source:
Inherited From:
Examples

When no context is passed, toString() must always return a string directly.

var bool = comp.get('boolean');
baja.outln(bool.toString()); // 'false'

When a context is passed, some Objects may return a Promise.

var bool = comp.get('boolean');
bool.toString({ trueText: 'Yes', falseText: 'No' })
  .then(function (str) {
    baja.outln(str); // 'No'
  });

If you don't know the type of the Object, use Promise.resolve() for safety.

var displayFacets = comp.get('displayFacets'),
    value = comp.get('value');
Promise.resolve(value.toString(displayFacets.toObject()))
  .then(function (str) {
    baja.outln(str); // formatted according to displayFacets
  });
Parameters:
Name Type Attributes Description
cx Object <optional>

optional context information to be used when
formatting the string

Returns:

a string (if no context passed), or
either a string or a Promise (if context passed).

Type
String | Promise.<String>

valueOf() → {*}

Description:
  • Return the inner value of the object.

    By default the object's instance is returned.

Source:
Inherited From:
Returns:

the inner value of the object or just the object's instance.

Type
*