+

Search Tips   |   Advanced Search

Resource configuration scripts

The scripting library provides multiple script procedures to automate the application server configurations. Use the mail, URL, and resource environment configuration scripts to create and configure resources in the environment. We can run each script individually or combine procedures to create custom automation scripts.

The mail, URL, and resource management script procedures are located in a app_server_root/scriptLibraries/resources/ directory.

Beginning with Version 7, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the server scope. We can write our own custom scripts to configure resources at the cell, node, or cluster level.

Avoid trouble: Do not edit the script procedures in the script library. To write custom script library procedures, use the scripts in the app_server_root/scriptLibraries directory as Jython syntax samples. Save the custom scripts to a new subdirectory to avoid overwriting the library.gotcha

Fast path: Beginning with Fix Pack 5, the Jython script library provides script functions for JDBC providers, JMS resources, and resource providers at the cell, node, server, or cluster scope. Resource providers include mail providers, URL providers, and resource environment providers. You do not have to write custom scripts to configure resources at a particular scope.

The example usage scripts and the script syntax are split on multiple lines for printing purposes.

Use the following script procedures to configure the mail settings:

Use the following script procedures to configure your resource environment settings:

Use the following script procedures to configure your URL provider settings:

Use the following script procedures to configure additional Java Enterprise Edition (Java EE) resources:


Format for the scope argument

The scope format applies to the scripts in the script library that have the scope argument.

A cell is optional on node, server, and cluster scopes. A node is required on the server scope.

We can delimit the type by using a comma (,) or a colon (:). We can use lower case for the type (cell=, node=, server=, or cluster=.)

The examples in the following table are split on multiple lines for publishing purposes.

path, configuration ID, and type for a particular scope. The
Scope Containment path Configuration ID Type
Cell /Cell:myCell/
myCell(cells/myCell|
cell.xml#Cell_1)
Cell=myCell or cell=myCell
Node /Cell:myCell/Node:myNode/ or /Node:myNode/
myNode(cells/myCell
/nodes/myNode|
node.xml#Node_1)

    Cell=myCell, Node=myNode

or

Cell=myCell:
Node=myNode
or

    cell=myCell, node=myNode

Server
/Cell:myCell/Node:
myNode/
Server:myServer/
or
/Node:myNode/Server:
myServer/
myServer(cells
/myCell/
nodes/myNode/
servers/myServer|
server.xml#Server_1)

    Cell=myCell, Node=myNode, Server=myServer

or

Node=myNode:
Server=myServer
or

    cell=myCell, Node=myNode, Server=myServer

Cluster
/Cell:myCell/
ServerCluster:
myCluster/
or
/ServerCluster:
myCluster/
myCluster(cells
/myCell/clusters/
myCluster|
cluster.xml
#ServerCluster_1)

    Cell=myCell, Cluster=myCluster

or

Cell=myCell:
Cluster=myCluster
or

    cell=myCell, Cluster=myCluster


createCompleteMailProvider

This script configures additional configuration attributes for the mail provider. A mail provider encapsulates a collection of protocol providers like SMTP, IMAP and POP3, while mail sessions authenticate users and controls user access to messaging systems. Configure our own mail providers and sessions to customize how JavaMail is handled. The script returns the configuration ID of the created mail provider.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
mailProviderName Mail provider that the application server uses for this mail session.
propName Name of the custom property.
propValue Value of the custom property.
protocolName Name of the protocol provider. The application server contains protocol providers for SMTP, IMAP and POP3.
className Implementation class name of the protocol provider.
mailSessionName Administrative name of the JavaMail session object.
JNDIName Specifies the JNDI name for the resource, including any naming subcontexts. This name provides the link between the platform binding information for resources defined in the client application deployment descriptor and the actual resources bound into JNDI by the platform.
mailStoreHost Server that is accessed when receiving the mail. This setting, combined with the mail store user ID and password, represents a valid mail account. For example, if the mail account is john_william@my.company.com, then the mail store host is my.company.com.
mailStoreUser User ID for the given mail account. For example, if the mail account is john_william@my.company.com then the user is john_william.
mailStorePassword Password for the given mail account . For example, if the mail account is john_william@my.company.com then enter the password for ID john_william.

Syntax

Example usage


createCompleteMailProviderAtScope

This script configures additional configuration attributes for the mail provider for the scope specified. A mail provider encapsulates a collection of protocol providers like SMTP, IMAP and POP3, while mail sessions authenticate users and controls user access to messaging systems. Configure our own mail providers and sessions to customize how JavaMail is handled. The script returns the configuration ID of the created mail provider for the specified scope.

To run the script, specify the scope, mail provider name, property name, property value, protocol name, class name, type, mail session name, and JNDI name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
mailProviderName Mail provider that the application server uses for this mail session.
propName Name of the custom property.
propValue Value of the custom property.
protocolName Name of the protocol provider. The application server contains protocol providers for SMTP, IMAP and POP3.
className Implementation class name of the protocol provider.
type Type of protocol provider. Valid options are STORE or TRANSPORT.
mailSessionName Administrative name of the JavaMail session object.
jndiName Specifies the JNDI name for the resource, including any naming subcontexts. This name provides the link between the platform binding information for resources defined in the client application deployment descriptor and the actual resources bound into JNDI by the platform.
otherAttributesList, mailProviderAttributesList, mailSessionAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

The following table contains optional attributes for a mail provider:

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the mail provider.
isolatedClassLoader If set to true, specifies that the mail provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Mail provider type that this mail provider uses.

The following table contains optional attributes for a mail session:

Attributes Description
category Category that can be used to classify or group the resource.
debug Whether debug mode is used for this mail session. The default value is off.
description Specifies a description of the mail provider.
mailFrom Internet email address. If set to true, this mail provider is loaded in its own class loader.

CAUTION:

A provider cannot be isolated when a native library path is specified.

mailStoreHost Server to connect to when receiving mail.
mailStorePort Port to connect to when receiving mail.
mailStoreUser User of a mail account when an incoming mail server requires authentication.
mailStorePassword Password of a mail account when an incoming mail server requires authentication.
mailStoreProtocol Protocol to use when receiving mail.
mailTransportHost Server to connect to when sending mail.
mailTransportPort Port to connect to when sending mail.
mailTransportUser User of a mail account when an outgoing mail server requires authentication.
mailTransportPassword Password of a mail account when an outgoing mail server requires authentication.
mailTransportProtocol Protocol to use when sending mail.
strict Whether the recipient addresses is parsed in compliance with RFC 822. The default value is true.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createMailProvider

This script creates a mail provider in the environment. The application server includes a default mail provider called the built-in provider. If we use the default mail provider you only have to configure the mail session. To use the customized mail provider first create the mail provider and session. The script returns the configuration ID of the created mail provider.

To run the script, specify the node, server, and mail provider names as defined in the following table:

Argument Description
nodeName Name of the node on which to create the mail provider.
serverName Name of the server for which to create the mail provider.
mailProviderName Name to assign to the new mail provider.

Syntax

Example usage


createMailProviderAtScope

This script creates a mail provider in the environment at the scope specified. The application server includes a default mail provider called the built-in provider. If we use the default mail provider you only have to configure the mail session. To use the customized mail provider first create the mail provider and session. The script returns the configuration ID of the created mail provider for the specified scope.

To run the script, specify the scope and mail provider name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
mailProviderName Name to assign to the new mail provider.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the mail provider.
isolatedClassLoader If set to true, specifies that the mail provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Mail provider type that this mail provider uses.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createMailSession

This script creates a new mail session for the mail provider. Mail sessions are represented by the javax.mail.Session class. A mail session object authenticates users, and controls user access to messaging systems. The script returns the configuration ID of the created mail session.

To run the script, specify the node name, server name, mail provider name, mail session name, and Java Naming and Directory Interface (JNDI) name arguments, as defined in the following table:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
mailProviderName Mail provider that the application server uses for this mail session.
mailSessionName Administrative name of the JavaMail session object.
JNDIName Specifies the JNDI name for the resource, including any naming subcontexts. This name provides the link between the platform binding information for resources defined in the client application deployment descriptor and the actual resources bound into JNDI by the platform.

Syntax

Example usage


createMailSessionAtScope

This script creates a new mail session for the mail provider at the scope specified. Mail sessions are represented by the javax.mail.Session class. A mail session object authenticates users, and controls user access to messaging systems. The script returns the configuration ID of the created mail session for the specified scope.

To run the script, specify the scope, mail provider name, mail session name, and Java Naming and Directory Interface (JNDI) name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
mailProviderName Mail provider that the application server uses for this mail session.
mailSessionName Administrative name of the JavaMail session object.
JNDIName Specifies the JNDI name for the resource, including any naming subcontexts. This name provides the link between the platform binding information for resources defined in the client application deployment descriptor and the actual resources bound into JNDI by the platform.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
category Category that can be used to classify or group the resource.
debug Whether debug mode is used for this mail session. The default value is off.
description Specifies a description of the mail provider.
mailFrom Internet email address. If set to true, this mail provider is loaded in its own class loader.

CAUTION:

A provider cannot be isolated when a native library path is specified.

mailStoreHost Server to connect to when receiving mail.
mailStorePort Port to connect to when receiving mail.
mailStoreUser User of a mail account when an incoming mail server requires authentication.
mailStorePassword Password of a mail account when an incoming mail server requires authentication.
mailStoreProtocol Protocol to use when receiving mail.
mailTransportHost Server to connect to when sending mail.
mailTransportPort Port to connect to when sending mail.
mailTransportUser User of a mail account when an outgoing mail server requires authentication.
mailTransportPassword Password of a mail account when an outgoing mail server requires authentication.
mailTransportProtocol Protocol to use when sending mail.
strict Whether the recipient addresses is parsed in compliance with RFC 822. The default value is true.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:

AdminResources.createMailSessionAtScope("/Cell:MY4Cell01/ServerClust
er:c1/", "myMailProvider", "myMailSession", "myMailSession/jndi",  [['category','myCategory'], ['description', 'this is mailsession'], ['debug', 'true'],  ['mailTransportHost', 'test1'], ['mailTransportUser', 'user2'], ['mailTransportPassword', 'password'],  ['mailStoreUser', 'user1'], ['mailStorePassword', 'password'], ['mailStoreHost', 'test2'], ['strict', 'true'],  ['mailFrom', 'tester@mail.com']]))


createProtocolProvider

This script creates a protocol provider in the configuration, which provides the implementation class for a specific protocol to support communication between the JavaMail application and mail servers. The application server contains protocol providers for SMTP, IMAP and POP3. If we require custom providers for different protocols, install them in the application serving environment before configuring the providers. See the JavaMail API design specification for guidelines. After configuring your protocol providers, return to the mail provider page to find the link for configuring mail sessions. The script returns the configuration ID of the created protocol provider.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
mailProviderName Name of the mail provider that the application server uses in association with the protocol provider.
protocolName Name of the protocol provider. The application server contains protocol providers for SMTP, IMAP and POP3.
className Implementation class name of the protocol provider.
type Type of protocol provider. Valid options are STORE or TRANSPORT.

Syntax

Example usage


createProtocolProviderAtScope

This script creates a protocol provider in the configuration at the scope specified. The protocol provider provides the implementation class for a specific protocol to support communication between your JavaMail application and mail servers at the scope specified. The application server contains protocol providers for SMTP, IMAP and POP3. If we require custom providers for different protocols, install them in the application serving environment before configuring the providers. See the JavaMail API design specification for guidelines. After configuring the protocol providers, return to the mail provider page to find the link for configuring mail sessions. The script returns the configuration ID of the created protocol provider for the specified scope.

To run the script, specify the scope mail provider name, protocol name, class name, and type arguments. We can optionally specify the classpath attribute. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
mailProviderName Name of the mail provider that the application server uses in association with the protocol provider.
protocolName Name of the protocol provider. The application server contains protocol providers for SMTP, IMAP and POP3.
className Implementation class name of the protocol provider.
type Type of protocol provider. Valid options are STORE or TRANSPORT.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

attributes. The classpath attribute is also available
Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:

AdminResources.createProtocolProviderAtScope("/Cell:MY4Cell01/Server
Cluster:c1/", "myMailProvider", "myMailProtocol", "com.ibm.mail.myMailProtocol.m
yMailStore", "STORE", [['classpath', 'c:/temp']]))


createCompleteResourceEnvProvider

This script configures a resource environment provider, which encapsulate the referenceables that convert resource environment entry data into resource objects in the configuration. The script returns the configuration ID of the created resource environment provider.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
resourceEnvProviderName Name to assign to the resource environment provider.
propName Name of a custom property to set.
propValue Value of the custom property.
factoryClass Factory that converts resource environment entry data into a class instance for a physical resource.
className Class name for the referenceable.
resourceEnvEntryName Name of the resource environment entry.
JNDIName Specifies the JNDI name for the resource environment entry, including any naming subcontexts. This name is used as the linkage between the platform binding information for resources defined by a module deployment descriptor and actual resources bound into JNDI by the platform.

Syntax

Example usage


createCompleteResourceEnvProviderAtScope

This script configures a resource environment provider at the scope specified. The resource environment provider encapsulates the referenceables that convert resource environment entry data into resource objects in the configuration. The script returns the configuration ID of the created resource environment provider for the specified scope.

To run the script, specify the scope, resource environment provider, custom property name, custom property value, factory class, class name, resoure environment entry, and JNDI name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

arguments. Run the script to configure a resource environment
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
resourceEnvProviderName Name to assign to the resource environment provider.
propName Name of a custom property to set.
propValue Value of the custom property.
factoryClass Factory that converts resource environment entry data into a class instance for a physical resource.
className Class name for the referenceable.
resourceEnvEntryName Name of the resource environment entry.
jndiName Specifies the JNDI name for the resource environment entry, including any naming subcontexts. This name is used as the linkage between the platform binding information for resources defined by a module deployment descriptor and actual resources bound into JNDI by the platform.
otherAttributesList, resourceEnvProviderAttributesList, resourceEnvEntryAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

The following table contains optional attributes for the resource environment provider:

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the resource environment provider.
isolatedClassLoader If set to true, specifies that this resource environment provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Resource provider type that this resource environment provider uses.

The following table contains optional attributes for the resource environment entry:

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the resource provider.
providerType Mail provider type that this resource environment provider uses.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createResourceEnvEntries

This script creates a resource environment entry in the configuration. Within an application server name space, the data contained in a resource environment entry is converted into an object that represents a physical resource. This resource is frequently called an environment resource. The script returns the configuration ID of the created resource environment entry.

To run the script, specify the following arguments:

arguments. Run the script to create a resource environment
Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
resourceEnvProviderName Resource environment provider for this entry. The provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.
resourceEnvEntry Name for the resource environment entry to create.
JNDIName String to use to look up this environment resource using JNDI. This is the string to which you bind resource environment reference deployment descriptors.

Syntax

Example usage


createResourceEnvEntriesAtScope

This script creates a resource environment entry in the configuration at the scope specified. Within an application server name space, the data contained in a resource environment entry is converted into an object that represents a physical resource. This resource is frequently called an environment resource. The script returns the configuration ID of the created resource environment entry for the specified scope.

To run the script, specify the scope the resource environment provider, resource environment entry, and JNDI name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

arguments. Run the script to create a resource environment
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
resourceEnvProviderName Resource environment provider for this entry. The provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects.
resourceEnvEntry Name for the resource environment entry to create.
JNDIName String to use to look up this environment resource using JNDI. This is the string to which you bind resource environment reference deployment descriptors.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the resource provider.
providerType Mail provider type that this resource environment provider uses.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createResourceEnvProvider

This script creates a resource environment provider in the configuration. The resource environment provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects. The script returns the configuration ID of the created Resource environment provider.

To run the script, specify the node name, server name, and resource environment provider name arguments, as defined in the following table:

arguments. Run the script to create a resource environment
Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
resourceEnvProviderName Resource environment provider to create.

Syntax

Example usage


createResourceEnvProviderAtScope

This script creates a resource environment provider in the configuration at the scope specified. The resource environment provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects. The script returns the configuration ID of the created Resource environment provider for the specified scope.

To run the script, specify the scope, and resource environment provider name arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

arguments. Run the script to create a resource environment
Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
resourceEnvProviderName Resource environment provider to create.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the resource environment provider.
isolatedClassLoader If set to true, specifies that this resource environment provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Resource provider type that this resource environment provider uses.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createResourceEnvProviderRef

This script creates a resource environment provider reference in the configuration. Resource environment references are different than resource references. Resource environment references allow the application client to use a logical name to look up a resource bound into the server JNDI namespace. A resource reference allows the application to use a logical name to look up a local JEE resource. The JEE specification does not specify a particular implementation of a resource. The script returns the configuration ID of the created resource environment provider reference ID.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
resourceEnvProviderName Resource environment provider for this reference. The provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects.
factoryClass Class of the factory that converts resource environment entry data into a class instance for a physical resource.
className Class name to associate with the referenceable.

Syntax

Example usage


createResourceEnvProviderRefAtScope

This script creates a resource environment provider reference in the configuration at the scope specified. Resource environment references are different than resource references. Resource environment references allow the application client to use a logical name to look up a resource bound into the server JNDI namespace. A resource reference allows the application to use a logical name to look up a local JEE resource. The JEE specification does not specify a particular implementation of a resource. The script returns the configuration ID of the created resource environment provider reference ID for the specified scope.

To run the script, specify the following arguments:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
resourceEnvProviderName Resource environment provider for this reference. The provider encapsulates the classes that, when implemented, convert resource environment entry data into resource objects.
factoryClass Class of the factory that converts resource environment entry data into a class instance for a physical resource.
className Class name to associate with the referenceable.

Syntax

Example usage


configURLProvider

This script configures a URL provider, which supplies the implementation classes necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
URLProviderName Name of the URL provider to configure.
URLStreamHandlerClass Specifies fully qualified name of a user-defined Java class that extends the java.net.URLStreamHandler class for a particular URL protocol, such as FTP.
URLProtocol Protocol supported by this stream handler. For example, NNTP, SMTP, FTP.
propName Name of the custom property to set for the URL provider.
propValue Value of the custom property to set for the URL provider.
URLName Name of a Uniform Resource Locator (URL) name that points to an Internet or intranet resource. For example: http://www.ibm.com.
JNDIName Specifies the JNDI name. Do not assign duplicate JNDI names across different resource types, such as mail sessions versus URL configurations. Do not assign duplicate JNDI names for multiple resources of the same type in the same scope.
URLSpec String from which to form a URL.

Syntax

Example usage


createCompleteURLProvider

This script creates a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
URLProviderName Name of the URL provider to configure.
URLStreamHandlerClass Specifies fully qualified name of a user-defined Java class that extends the java.net.URLStreamHandler class for a particular URL protocol, such as FTP.
URLProtocol Protocol supported by this stream handler. For example, NNTP, SMTP, FTP.

Syntax

Example usage


createCompleteURLProviderAtScope

This script creates a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider for the specified scope.

To run the script, specify the following arguments:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
URLProviderName Name of the URL provider to configure.
URLStreamHandlerClass Specifies fully qualified name of a user-defined Java class that extends the java.net.URLStreamHandler class for a particular URL protocol, such as FTP.
URLProtocol Protocol supported by this stream handler. For example, NNTP, SMTP, FTP.
propName Name of the custom property to set for the URL provider.
propValue Value of the custom property to set for the URL provider.
URLName Name of a Uniform Resource Locator (URL) name that points to an Internet or intranet resource. For example: http://www.ibm.com.
jndiName Specifies the JNDI name. Do not assign duplicate JNDI names across different resource types, such as mail sessions versus URL configurations. Do not assign duplicate JNDI names for multiple resources of the same type in the same scope.
URLSpec String from which to form a URL.
otherAttributesList, urlProviderAttributesList, urlAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

The following table contains optional attributes for the URL provider:

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the resource environment provider.
isolatedClassLoader If set to true, specifies that this URL provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Specifies the URL provider type that this resource environment provider uses.

The following table contains optional attributes for the URL:

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the resource provider.
providerType Mail provider type that this resource environment provider uses.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

AdminResources.createCompleteURLProviderAtScope("Node=MY4Node09, server=server1", "myURLProvider",  "com.ibm.resource.url1",  "ftp","myProp", "myPropValue", "myURL", "url1/myURL", "myURLSpec", "classpath=c:/temp, description='this
 is my url provider',  nativepath=c:/temp/nativepath, isolatedClassLoader=true", "category=myCategory, description='this is my url'")

The following example script includes optional attributes in a list format:


createURL

This script creates a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
URLProviderName Name of the URL provider to assign the URL to.
URLName Name of the URL to create.
JNDIName Specifies the JNDI name. Do not assign duplicate JNDI names across different resource types, such as mail sessions versus URL configurations. Do not assign duplicate JNDI names for multiple resources of the same type in the same scope.
URLSpec String from which to form a URL.

Syntax

Example usage


createURLAtScope

This script creates a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL for the specified scope.

To run the script, specify the scope, URL provider name, URL name, JNDI name, and URL specification arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
URLProviderName Name of the URL provider to assign the URL to.
URLName Name of the URL to create.
JNDIName Specifies the JNDI name. Do not assign duplicate JNDI names across different resource types, such as mail sessions versus URL configurations. Do not assign duplicate JNDI names for multiple resources of the same type in the same scope.
URLSpec String from which to form a URL.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the URL provider.
providerType Mail provider type that this URL provider uses.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createURLProvider

This script creates a URL provider, which supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
URLProviderName Name of the URL provider to configure.
URLStreamHandlerClass Specifies fully qualified name of a user-defined Java class that extends the java.net.URLStreamHandler class for a particular URL protocol, such as FTP.
URLProtocol Protocol supported by this stream handler. For example, NNTP, SMTP, FTP.

Syntax

Example usage


createURLProviderAtScope

This script creates a URL provider at the scope specified. The URL provider supplies the implementation classes that are necessary for the application server to access a URL through a specific protocol. The default URL provider provides connectivity through protocols that are supported by the IBM Developer Kit. These protocols include HTTP and File Transfer Protocol (FTP), which work for must URLs. The script returns the configuration ID of the created URL provider for the specified scope.

To run the script, specify the scope, URL provider name, URL stream handler class, and URL protocol arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
URLProviderName Name of the URL provider to configure.
URLStreamHandlerClass Specifies fully qualified name of a user-defined Java class that extends the java.net.URLStreamHandler class for a particular URL protocol, such as FTP.
URLProtocol Protocol supported by this stream handler. For example, NNTP, SMTP, FTP.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
classpath List of paths or JAR file names which together form the location for the resource provider classes. Use a semicolon (;) to separate class paths.
description Specifies a description of the resource environment provider.
isolatedClassLoader If set to true, specifies that this URL provider is loaded in its own class loader.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.
providerType Specifies the URL provider type that this resource environment provider uses.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createJAASAuthenticationAlias

This script creates a JAAS authentication alias. The alias identifies the authentication data entry. When configuring resource adapters or data sources, the administrator can specify which authentication data to choose using the corresponding alias. The script returns the configuration ID of the created DB2 Authentication and Authorization Service (JAAS) Authentication Alias.

To run the script, specify the following arguments:

arguments. Run the script to create a JAAS authentication
Argument Description
authAliasName Name of the authentication alias to create.
authAliasID A user identity of the intended security domain. For example, if a particular authentication data entry is used to open a new connection to DB2, this entry contains a DB2 user identity.
authAliasPW Password of the user identity is encoded in the configuration repository.

Syntax

Example usage


createLibraryRef

This script creates a library reference, which defines how to use global libraries. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When we create the shared libraries, set variables for the library files. The script returns the configuration ID of the created library reference.

To run the script, specify the following arguments:

Argument Description
libraryRefName Name of the library reference to create.
applicationName Name of the application to associate with the library reference.

Syntax

Example usage


createSharedLibrary

This script creates a shared library in the configuration. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When we create the shared libraries, set variables for the library files. The script returns the configuration ID of the created library.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
sharedLibName Name to assign to the shared library.
sharedLibClassPath File path where the product searches for classes and resources of the shared library. If a path in the list is a file, the product searches the contents of that .jar or compressed .zip file. If a path in the list is a directory, then the product searches the contents of .jar and .zip files in that directory. For performance reasons, the product searches the directory itself only if the directory contains subdirectories or files other than .jar or .zip files.

Syntax

Example usage


createSharedLibraryAtScope

This script creates a shared library in the configuration at the scope specified. The first step for making a library file available to multiple applications deployed on a server is to create a shared library for each library file that the applications need. When we create the shared libraries, set variables for the library files. The script returns the configuration ID of the created library for the specified scope.

To run the script, specify the scope shared library name and shared library class path arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the mail provider.
sharedLibName Name to assign to the shared library.
sharedLibClassPath File path where the product searches for classes and resources of the shared library. If a path in the list is a file, the product searches the contents of that .jar or compressed .zip file. If a path in the list is a directory, then the product searches the contents of .jar and .zip files in that directory. For performance reasons, the product searches the directory itself only if the directory contains subdirectories or files other than .jar or .zip files.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
description Specifies a description of the shared library.
isolatedClassLoader If set to true, specifies that the URL provider is loaded in its own class loader. The default value is false.

A provider cannot be isolated when a native library path is specified.

nativepath Specifies an optional path to any native libraries, such as *.dll and *.so. Use a semicolon (;) to separate native path entries.

Syntax

Example usage

The following example scripts contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:



createScheduler

This script creates a scheduler in the configuration. Schedulers are persistent and transactional timer services that can run business logic. Each scheduler runs tasks independently and has a programming interface accessible from JEE applications using the JNDI. We can also manage schedulers using a JMX MBean. See the scheduler documentation in the Information Center for details on how to configure and use schedulers. The script returns the configuration ID of the created scheduler.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
schedulerName Name by which this scheduler is known for administrative purposes.
JNDIName Specifies the JNDI name that determines where this scheduler instance is bound in the name space. Clients can look this name up directly, although the use of resource references is recommended.
scheduleCategory Specifies a string that can be used to classify or group this scheduler.
datasourceJNDI Name of the data source where persistent tasks are stored. Any data source available in the name space can be used with a scheduler. Multiple schedulers can share a single data source while using different tables by specifying a table prefix.
tablePrefix String prefix to affix to the scheduler tables. Multiple independent schedulers can share the same database if each instance specifies a different prefix string.
pollInterval Interval, in seconds, that a scheduler polls the database. The default value is appropriate for most applications. Each poll operation can be consuming. If the interval is extremely small and there are many scheduled tasks, polling can consume a large portion of system resources. The default value is 30.
workMgmtJNDI Specifies the JNDI name of the work manager, which is used to manage the number of tasks that can run concurrently with the scheduler. The work manager also can limit the amount of Java EE context applied to the task.

Syntax

Example usage


createSchedulerAtScope

This script creates a scheduler in the configuration at the scope specified. Schedulers are persistent and transactional timer services that can run business logic. Each scheduler runs tasks independently and has a programming interface accessible from Java EE applications using the JNDI. We can also manage schedulers using a JMX MBean. See the scheduler documentation in the Information Center for details on how to configure and use schedulers. The script returns the configuration ID of the created scheduler for the specified scope.

To run the script, specify the scope, scheduler name, JNDI name, JNDI datasource, table prefix, poll interval, JNDI name of the work manager, and scheduler provider ID arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JMS provider.
schedulerName Name by which this scheduler is known for administrative purposes.
JNDIName Specifies the JNDI name that determines where this scheduler instance is bound in the name space. Clients can look this name up directly, although the use of resource references is recommended.
datasourceJNDI Name of the data source where persistent tasks are stored. Any data source available in the name space can be used with a scheduler. Multiple schedulers can share a single data source while using different tables by specifying a table prefix.
tablePrefix String prefix to affix to the scheduler tables. Multiple independent schedulers can share the same database if each instance specifies a different prefix string.
pollInterval Interval, in seconds, that a scheduler polls the database. The default value is appropriate for most applications. Each poll operation can be consuming. If the interval is extremely small and there are many scheduled tasks, polling can consume a large portion of system resources. The default value is 30.
workMgmtJNDI Specifies the JNDI name of the work manager, which is used to manage the number of tasks that can run concurrently with the scheduler. The work manager also can limit the amount of Java EE context applied to the task.
schedulerProviderID Provider ID of this scheduler.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the URL provider.
providerType Resource provider type that this URL provider uses.
datasourceAlias Alias for the user name and password that this URL provider uses to access the data source.
loginConfigName Login configuration name.
securityRole Security role.
useAdminRoles Specifies that when this option and administrative security are both enabled, the user administration roles are enforced. For the user administrative roles to be enforced, use the scheduler JMX commands or APIs to create and modify tasks. If this option is not enabled, all the users can create and modify tasks. The default value is false.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


createWorkManager

This script creates a work manager in the configuration. Work managers contain a pool of threads that are bound into Java Naming and Directory Interface. The script returns the configuration ID of the created work manager.

To run the script, specify the following arguments:

Argument Description
nodeName Name of the node of interest.
serverName Name of the server of interest.
workMgrName Name by which this work manager is known for administrative purposes.
JNDIName Specifies the JNDI name used to look up the work manager in the namespace.
workMgrCategory Specifies a string that we can use to classify or group this work manager.
alarmThreads Desired maximum number of threads used for alarms. The default value is 2.
minThreads Minimum number of threads available in this work manager.
maxThreads Maximum number of threads available in this work manager.
threadPriority Priority of the threads available in this work manager. Every thread has a priority. Threads with higher priority are run before threads with lower priority. For more information about how thread priorities are used, see the API documentation for the setPriority method of the java.lang.Thread class in the Java EE specification.
isGrowable Whether the number of threads in this work manager can be increased. Specify a value of true to indicate that the number of threads can increase.
serviceNames List of services to make available to this work manager.

Syntax

Example usage


createWorkManagerAtScope

This script creates a work manager in the configuration at the scope specified. Work managers contain a pool of threads that are bound into Java Naming and Directory Interface. The script returns the configuration ID of the created work manager for the specified scope.

To run the script, specify the scope work manager name, JNDI name, alarm threads, minimum threads, maximum threads, thread priority, and work manager provider ID arguments. We can optionally specify attributes. The arguments and attributes are defined in the following tables:

Argument Description
scope Specifies a scope of cell, node, server, or cluster for the JMS provider.
workMgrName Name by which this work manager is known for administrative purposes.
JNDIName Specifies the JNDI name used to look up the work manager in the namespace.
alarmThreads Desired maximum number of threads used for alarms. The default value is 2.
minThreads Minimum number of threads available in this work manager.
maxThreads Maximum number of threads available in this work manager.
threadPriority Priority of the threads available in this work manager. Every thread has a priority. Threads with higher priority are run before threads with lower priority. For more information about how thread priorities are used, see the API documentation for the setPriority method of the java.lang.Thread class in the Java EE specification.
workManagerProviderID Configuration ID of the parent work manager provider. The work manager is created at this ID. We can create a work manager under the existing work manager provider or under a new work manager provider. The following wsadmin command is an example of how to retrieve the configuration ID of the existing work manager provider from the server scope:

    workManagerProviderID = AdminConfig.getid(/Cell:myCell/Node:myNode/Server:myServer/WorkManagerProvider:/)

otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Attributes Description
category Category that can be used to classify or group the resource.
description Specifies a description of the URL provider.
providerType Resource provider type that this URL provider uses.
daemonTranClass Transaction class used for the workload classification of daemon work. The daemon work is for the workload manager service.
defTranClass Transaction class name used to classify work run by this work manager instance when the z/OS workload manager service class information is not contained in the work context information.
isDistributable Whether this work manager is distributable. The default value is false.
isGrowable Whether the number of threads in this work manager can be increased. The default value is true.
serviceNames List of services to make available to this work manager.
workReqQFullAction Action taken when the thread pool is exhausted, and the work request queue is full. The default value is 0.
workReqQSize Size of the work request queue. The default value is 0.
workTimeout Number of milliseconds to wait before attempting to release a unit of work. The default value is 0.
referenceable Referenceable, which encapsulates the class name of the factory that converts resource environment entry data into a class instance for a physical resource.
otherAttributesList

Optionally specifies additional attributes in a particular format:

List format

[["attr1", "value1"], ["attr2", "value2"]]

String format

"attr1=value1, attr2=value2"

Syntax

Example usage

The following example script contains required attributes only:

The following example script includes optional attributes in a string format:

The following example script includes optional attributes in a list format:


help

This script displays the script procedures that the AdminResources script library supports. To display detailed help for a specific script, specify the name of the script of interest, as defined in the following table:

Argument Description
script Name of the script of interest.

Syntax

Example usage


Related tasks

  • Use the script library to automate the application serving environment
  • Configure mail providers and sessions
  • Configure new resource environment providers for application clients
  • Configure new URL providers for application clients

  • JDBC configuration scripts
  • J2C configuration scripts
  • JMS configuration scripts
  • JavaMail system properties