サポートと今すぐチャット
サポートとのチャット

InTrust 11.6 - Customization Kit

ADCEnvironment

The object is used for reading InTrust organization parameter settings from agents. This object is available only with the ECMAScript object model.

Methods

NAME

DESCRIPTION

EnumFacets()

Enumerates the facets available for an agent and returns an array of facet names.

GetEnvironmentValue([Facet,] Name)

Returns the value of the specified organization parameter.

The optional Facet string argument is the name of a facet, as returned by the EnumFacets() method. If this argument is not specified, the method returns the organization parameter value from the first available facet.

The Name string argument is the name of the organization parameter value.

GetEnvValueWithDefault([Facet,] Name, DefValue)

Returns the value of the specified organization parameter. This method is different from GetEnvironmentValue() in that you can specify a default return value with the DefValue argument. This default value is returned if the specified organization parameter is not found, so you do not have to perform any exception checks in your code.

The optional Facet string argument is the name of a facet, as returned by the EnumFacets() method. If this argument is not specified, the method returns the organization parameter value from the first available facet.

The Name string argument is the name of the organization parameter value.

The DefValue argument is a string or an integer.

ExpandEnvironmentString(String)

This method expands the name of the supplied InTrust-specific environment variable, such as %ADC_INSTALL_PATH% or %ADC_DATA_PATH%.

Example

Running the following script in a single-server InTrust organization:

var objEnv = new ADCEnvironment();
var Facets = objEnv.EnumFacets();
for(var i = 0; i < Facets.length; i++)
{
   var cputhrottling = objEnv.GetEnvValueWithDefault(Facets[i], "ADC_AgentCPUThrottlingValue", 100);
   Trace(40, "Facet: " + Facets[i]);
   Trace(40, "CPU: " + cputhrottling);
}
var datapath = objEnv.GetEnvironmentValue("adc_data_path");
Trace(40, "Data Path: " + datapath);
var taskpath = objEnv.ExpandEnvironmentString(datapath + "\\tasks");
Trace(40, "Tasks Path: " + taskpath);

will produce results similar to the following in the trace file:

(  392) Thu_Aug_23_21.12.32.437_2007 | 40 | [027035d8] ScriptContext_SM: Facet: {ae146e4d-9fc4-47ae-97e0-bf5cb55b0890} (string)

(  392) Thu_Aug_23_21.12.32.437_2007 | 40 | [027035d8] ScriptContext_SM: CPU: 100 (string)

(  392) Thu_Aug_23_21.12.32.437_2007 | 40 | [027035d8] ScriptContext_SM: Data Path: %ADC_INSTALL_PATH%/data (string)

(  392) Thu_Aug_23_21.12.32.437_2007 | 40 | [027035d8] ScriptContext_SM: Tasks Path: C:\WINNT\ADCAgent/data\tasks (string)

AuditProvider

Non-creatable.

NAME

TYPE

DESCRIPTION

SubmitEventPositionPair(event, position)

method

Submits event and position pair to the audit provider.

LogMessage(messagetext, systemmessage, messageseverity)

method

messageseverity is an integer:

4 = success

3 = information

2 = error

1 = warning

OperationStatus(statustext)

method

Trace(level, msg) method recommended level values:

0 = TraceDisabled

10 = TraceCritical

20 = TraceWarning

30 = TraceNormal

40 = TraceDebug

Example

AuditProvider.SubmitEventPositionPair(new Event(), new Position());

ErrorInfo

This object lets you provide detailed error messages in the InTrust Server log. The object is available only in the object model of audit scripts based on JScript or VBScript.

NAME

TYPE

DESCRIPTION

Number

property

Event ID of the error.

Description

property

Error description.

Raise

method

Submits the error to the InTrust server log; this method has no parameters.

Example

This snippet puts an error event in the InTrust Server log. The message description contains the string "Invalid password".

ErrorInfo.Description = "Invalid password";
ErrorInfo.Raise();

Event

Creatable.

This object is a collection of user-supplied properties.

Example

x = new Event;
x.prop1 = "val1";
x.prop2 = new Date()

関連ドキュメント

The document was helpful.

評価を選択

I easily found the information I needed.

評価を選択