iWay Sentinel Classes

In this section:

There is a set of classes iWay Sentinel makes available in scripts. All classes passed into the $ method must be singular and lower-case, as shown in Introduction. Below is a list of classes hat can be passed into $ and their methods.


Top of page

x
Common Fields

All of these classes (except package) have this set of fields that can be consumed in a script.

The following table lists and describes these common fields.

Field Name

Description

name

The name of the object.

description

The object description.

created

Indicates when the object was created.

modified

Indicates when the object was modified.

id

The auto-assigned unique ID.

asof

Indicates the last time the object was checked or accessed.


Top of page

x
Common Fields That Can be Monitored

Objects that can be monitored include server, application, and channel. All of these objects have a set of common fields.

The following table lists and describes these common fields that can be monitored.

Field Name

Description

responseTime

Applicable only for servers. Indicates the time it takes to ping a server. Does not account for propagation time.

queueSize

The number of messages in queues.

messagesInprocess

The number in messages active or in process.

messagesCompleted

The number of successful messages processed.

messagesFailed

The number of successful messages failed.

maxThroughput

The objects maximum message throughput in seconds.

throughput

The objects current message throughput since last query.

health

The health of the object.

status

The connectivity status for a server, which is represented by the UP/DOWN indicator for applications and channels.


Top of page

x
server

An object that represents an instance of an iSM master, typically the base configuration. Servers must be registered in SPOG/Sentinel either manually or by an import script. A server requires an Envoy for it to communicate with iWay Sentinel. Servers are referenced by their name or alias you provide during registration, and not by their URLs. As a result, you can register the same server under different aliases and SPOG/Sentinel will treat them as separate servers.

Fields

Field Name

Description

url

The URL to a server Envoy.

username

The user name to the server.

password

The password to the server.

version

The server version.

host

The host name where the server resides.

envoyPort

The Envoy port on the server.

consolePort

The console port of the server.

hostUsername

The host user name.

hostPassword

The host password.

Methods

Method Name

Description

list()

Returns a list of all servers registered in iWay Sentinel.

property(serverName, key, value)

Sets a server property or Special Register (SREG). This does not set a value in any property file on the server.

remove(serverName)

Removes the server from iWay Sentinel.

get(serverName)

Gets a server.

start(serverName)

Starts a server (Windows only and requires PsService installed on the SPOG/Sentinel host). Also requires the server to be running as a service.

stop(serverName)

Stops a running server.

restart(serverName)

Restarts a running server (Windows only). Also requires the server to be running as a service.


Top of page

x
application

An object that represents an application deployed in a Server. You can have an application with the same name deployed into different servers, so you typically must have the server of the application when referencing it.

Fields

Field Name

Description

server

The server name of the application.

version

The server version of the application.

Methods

Method Name

Description

list()

Gets all applications for all servers.

property(serverName, applicationName, key, value)

Sets an iSM property in the application.

start(serverName, applicationName)

Starts an application.

stop(serverName, applicationName)

Stops an application.

get(serverName, applicationName)

Gets an application.

channels(serverName, applicationName)

Gets the channels of an application.

deploy(serverName, applicationName, applicationArtifactIIA, port, template, description, overwrite)

Deploys an iWay Integration Application (iIA) to a server to become an application.

undeploy(serverName, applicationName)

Undeploys an application.

redeploy(serverName, applicationName)

Redeploys an application that has already been published into the server.


Top of page

x
channel

An object that represents the channels in an application. You need the server and application name to reference it.

Fields

Field Name

Description

uptime

The length of time the channel has been up.

type

The type of listener the channel is configured to use.

workerCount

The number of workers the channel is configured to use.

Methods

Method Name

Description

list()

Returns all changes from all applications in all servers registered in SPOG/Sentinel.

start(id)

Starts a channel by its ID. You must know the application of the channel in order to get the ID of the channel.

stop(id)

Stops a channel by its ID.

property(serverName, applicationName, channelName, key, value)

Sets an iSM property on the channel.


Top of page

x
group

An object that represents groups in SPOG/Sentinel. Groups can contain servers, applications, users and artifacts.

Fields

Field Name

servers

users

artifacts

applications

Methods

Method Name

Description

upsert(group)

Inserts or updates a group. Takes a group object.

get(groupName)

Returns a group.

list()

Returns an array of all groups.

delete(groupName)

Delete a group from SPOG/Sentinel.


Top of page

x
user

An object that represents a user in SPOG/Sentinel.

Fields

Field Name

Description

roles

User roles in SPOG/Sentinel.

password

Password to SPOG/Sentinel.

Methods

Method Name

Description

upsert(user)

Inserts or updates a user in SPOG/Sentinel.

get(userName)

Returns a user.

list()

Returns all users.

delete(userName)

Delete a user from SPOG/Sentinel.


Top of page

x
task

An object that represents the sentinel backend task processing.

Fields

Field Name

Description

active

If true, then the task is queued for execution.

continuous

If true, then the task is executed repeatedly.

script

The name of the JavaScript artifact that the task will execute.

schedules

A complex object that defines the delay and wait period for executions.

params

The parameters of the task it will set when executing a script.

Methods

Method Name

Description

list()

Returns all tasks.

upsert(task)

Takes a task object and inserts or updates it.

get(taskId)

Returns a task.

delete(taskId)

Returns a task.


Top of page

x
artifact

An object that represents a file uploaded into the file browser in SPOG. Artifacts are referenced by file name only and not by its directory path. When requesting an artifact from a script, do not provide its directory path.

Fields

Field Name

Description

path

The directory path of the artifact.

mimeType

The mime type of the artifact.

Methods

Method Name

Description

get(artifactName)

Gets an artifact by name, not by path.


Top of page

x
package

An object that represents a package that can be used to apply changes to an existing Server or Application.

Fields

This object does not exist.

Methods

Method Name

Description

publish(serverName, artifactName)

Publishes a package to a server.

deploy(serverName, artifactName)

Deploys a package to a server.


Top of page

x
Script Host

The host can be referenced by the code listed and described in the following table.

Code

Description

$("#")

Returns the script host.

$("#").progress

A numeric value between 0 - 100 that sets the progress of a running script.

$("#").stop

A boolean value that can be set by SPOG requesting for your script to stop executing.

$("#").log("hello!")

A function that will enter a task message in the activity feed in SPOG.

Available variables include logger, which is an Apache commons logger.


iWay Software