AdminConfig

 



Contents

  1. attributes
  2. checkin
  3. convertToCluster
  4. create
  5. createClusterMember
  6. createDocument
  7. createUsingTemplate
  8. defaults
  9. deleteDocument
  10. existsDocument
  11. extract
  12. getid
  13. getObjectName
  14. getSaveMode
  15. getValidationLevel
  16. getValidationSeverityResult
  17. hasChanges
  18. help
  19. installResourceAdapter
  20. list
  21. listTemplates
  22. modify
  23. parents
  24. queryChanges
  25. remove
  26. required
  27. reset
  28. save
  29. setSaveMode
  30. setValidationLevel
  31. show
  32. showall
  33. showAttribute
  34. types
  35. validate
  36. getCrossDocumentValidationEnabled
  37. setCrossDocumentValidationEnabled

 


Available Commands

 


attributes

Returns a list of the top level attributes for a given type.

Parameter: object type

 

Example usage:

Using Jacl

$AdminConfig attributes ApplicationServer

Using Jython

print AdminConfig.attributes('ApplicationServer')

 

Example output

"properties Property*" "serverSecurity ServerSecurity" 
"server Server@" "id Long" "stateManagement StateManageable" 
"name String" "moduleVisibility EEnumLiteral(MODULE, 
COMPATIBILITY, SERVER, APPLICATION)" "services Service*" 
"statisticsProvider StatisticsProvider" 

 


checkin

Checks a file, that the document URI describes, into the configuration repository. This method only applies to deployment manager configurations.

 

Parameters

document URI, filename, opaque object

 

Returns

nothing

 

Example usage:

Using Jacl

$AdminConfig checkin cells/MyCell/Node/MyNode/serverindex.xml /path/to/file $obj

Using Jython

AdminConfig.checkin('cells/MyCell/Node/MyNode/serverindex.xml', '/path/to/file', obj)

The document URI is relative to the root of the configuration repository, for example...

$WAS_HOME/config/WebSphere/AppServer/config

The file specified by filename is used as the source of the file to check. The opaque object is an object that the extract command of the AdminConfig object returns by a prior call.

 


convertToCluster

Converts a server so that it is the first member of a new ServerCluster.

 

Parameters

server ID, cluster name

Returns the configuration ID of the new cluster

 

Example usage:

Using Jacl

set serverid [$AdminConfig getid /Server:servername/]
$AdminConfig convertToCluster $serverid myCluster

Using Jython

serverid = AdminConfig.getid('/Server:servername/') AdminConfig.convertToCluster(serverid, 'myCluster')

 

Example output

myCluster(cells/cell/clusters/myCluster:cluster.xml#ClusterMember_2

 


create

Creates configuration objects.

 

Example usage:

Using Jacl

set JDBCProviderID [$AdminConfig getid /JDBCProvider:JDBCProvider/]
$AdminConfig create DataSource $JDBCProviderID {{name ds1}}

Using Jython with string attributes

JDBCProviderID = AdminConfig.getid('/JDBCProvider:JDBCProvider/')
AdminConfig.create('DataSource', JDBCProviderID, '[[name ds1]]')

Using Jython with object attributes

JDBCProviderID = AdminConfig.getid('/JDBCProvider:JDBCProvider/')
AdminConfig.create('DataSource', JDBCProviderID, [['name', 'ds1']])

 

Example output

ds1(cells/cell/nodes/node1/servers/server:resources.xml#DataSource_6)

 


createClusterMember

Creates a new server as a member of an existing cluster.

This method creates a new server object on the node that the node id parameter specifies. This server is created as a new member of the existing cluster specified by the cluster id parameter, and contains attributes specified in the member attributes parameter. The server is created using the server template specified by the template id attribute, and contains the name specified by the memberName attribute. The memberName attribute is required.

 

Returns

the configuration ID of the new cluster member

Example usage...

Using Jacl

set clid [$AdminConfig getid /ServerCluster:myCluster/]
set nodeid [$AdminConfig getid /Node:node/]
$AdminConfig createClusterMember $clid $nodeid {{memberName newMem1} {weight 5}}

Using Jython with string attributes

clid = AdminConfig.getid('/ServerCluster:myCluster/') 
nodeid = AdminConfig.getid('/Node:node/')
AdminConfig.createClusterMember(clid, nodeid, '[[memberName newMem1] [weight 5]]')

Using Jython with object attributes

clid = AdminConfig.getid('/ServerCluster:myCluster/') 
nodeid = AdminConfig.getid('/Node:node/') 
AdminConfig.createClusterMember(clid, nodeid, [['memberName', 'newMem1'], ['weight', 5]])

 

Example output

myCluster(cells/cell/clusters/myCluster:cluster.xml#ClusterMember_2)

 


createDocument

Creates a new document in the configuration repository.

The documentURI parameter names the document to create in the repository. The filename parameter must be a valid local file name where the contents of the document exist.

 

Parameters

documentURI, filename

Returns nothing

 

Example usage:

Using Jacl

$AdminConfig createDocument cells/cell/myfile.xml /path/to/filename

Using Jython

AdminConfig.createDocument('cells/cell/myfile.xml', '/path/to/filename')

 


createUsingTemplate

Creates a type of object with the given parent, using a template.

 

Returns

the configuration ID of a new object

 

Example usage:

Using Jacl

set node [$AdminConfig getid /Node:node/]
set templ [$AdminConfig listTemplates JDBCProvider "DB2 JDBC Provider (XA)"]
$AdminConfig createUsingTemplate JDBCProvider $node {{name newdriver}} $templ 

Using Jython using string attributes

node = AdminConfig.getid('/Node:node/')
templ = AdminConfig.listTemplates('JDBCProvider', "DB2 JDBC Provider (XA)")
AdminConfig.createUsingTemplate('JDBCProvider', node, '[[name newdriver]]', templ)

Using Jython using object attributes

node = AdminConfig.getid('/Node:node/')
templ = AdminConfig.listTemplates('JDBCProvider', "DB2 JDBC Provider (XA)")
AdminConfig.createUsingTemplate('JDBCProvider', node, [['name', 'newdriver']], templ)

 


defaults

Displays the default values for attributes of a given type.

This method displays all of the possible attributes contained by an object of a specific type. If the attribute has a default value, this method also displays the type and default value for each attribute.

 

Parameters

type

Returns a string containing a list of attributes with its type and value

 

Example usage:

Using Jacl

$AdminConfig defaults TuningParams

Using Jython

print AdminConfig.defaults('TuningParams')

 

Example output

Attribute                       Type                            Default
 usingMultiRowSchema             Boolean                         false
 maxInMemorySessionCount         Integer                         1000
 allowOverflow                   Boolean                         true
 scheduleInvalidation            Boolean                         false
 writeFrequency                  ENUM
 writeInterval                   Integer                         120
 writeContents                   ENUM
 invalidationTimeout             Integer                         30
 invalidationSchedule            InvalidationSchedule

 


deleteDocument

Deletes a document from the configuration repository.

The documentURI parameter names the document that will be deleted from the repository.

 

Parameters

documentURI

Returns nothing

 

Example usage:

Using Jacl

$AdminConfig deleteDocument cells/cell/myfile.xml

Using Jython

AdminConfig.deleteDocument('cells/cell/myfile.xml')

 


existsDocument

Tests for the existence of a document in the configuration repository.

The documentURI parameter names the document to test in the repository.

 

Parameters

documentURI

Returns a true value if the document exists

 

Example usage:

Using Jacl

$AdminConfig existsDocument cells/cell/myfile.xml

Using Jython

AdminConfig.existsDocument('cells/cell/myfile.xml')

 

Example output

1

 


extract

Extracts a configuration repository file described by document URI and places it in the file named by filename.

Note that this method only applies to deployment manager configurations.

 

Parameters

document URI, filename

Returns an opaue java.lang.Object to use when checking in the file

 

Example usage:

Using Jacl

set obj [$AdminConfig extract cells/MyCell/Node/MyNode/serverindex.xml /path/to/filename] 

Using Jython

obj = AdminConfig.extract('cells/MyCell/Node/MyNode/serverindex.xml',  '/path/to/filename')

The document URI is relative to the root of the configuration repository, for example...

$WAS_HOME/config

If the file specified by filename exists, the extracted file replaces it.

 


getid

Returns the configuration id of an object.

 

Parameters

containment path

Returns the configuration id for an object described by the given containment path

 

Example usage:

Using Jacl

$AdminConfig getid /Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/

Using Jython

AdminConfig.getid('/Cell:testcell/Node:testNode/JDBCProvider:Db2JdbcDriver/')

 

Example output

Db2JdbcDriver(cells/testcell/nodes/testnode/resources.xml#JDBCProvider_1)

 


getObjectName

Returns a string version of the object name for the corresponding running MBean.

This method returns an empty string if there is no corresponding running MBean.

 

Parameters

configuration id

Returns a string containing the object name

 

Example usage:

Using Jacl

set server [$AdminConfig getid /Node:node/Server:server/]
$AdminConfig getObjectName $server

Using Jython

server = AdminConfig.getid('/Node:node/Server:server/')
AdminConfig.getObjectName(server)

 


getSaveMode

Returns the mode used when you invoke a save command.

Possible values include the following...

 

Parameters

nothing

Returns a string containing the current save mode setting

 

Example usage:

Using Jacl

$AdminConfig getSaveMode

Using Jython

print AdminConfig.getSaveMode()

 

Example output

rollbackOnConflict

 


getValidationLevel

Returns the validation used when files are extracted from the repository.

 

Parameters

nothing

Returns a string containing the validation level

 

Example usage:

Using Jacl

$AdminConfig getValidationLevel

Using Jython

AdminConfig.getValidationLevel()

 

Example output

WASX7189I: Validation level set to HIGH

 


getValidationSeverityResult

Returns the number of validation messages with the given severity from the most recent validation.

 

Parameters

severity

Returns a string indicating the number of validation messages of the given severity

 

Example usage:

Using Jacl

$AdminConfig getValidationSeverityResult 1

Using Jython

AdminConfig.getValidationSeverityResult(1)

 

Example output

16

 


hasChanges

Returns true if unsaved configuration changes exist.

 

Parameters

nothing

Returns a string indicating if unsaved configuration changes exist

 

Example usage:

Using Jacl

$AdminConfig hasChanges

Using Jython

AdminConfig.hasChanges()

 

Example output

1

 


help

Displays static help information for the AdminConfig object.

 

Parameters

nothing Returns a list of options

 

Example usage:

Using Jacl

$AdminConfig help

Using Jython

print AdminConfig.help()

 


installResourceAdapter

Installs a J2C resource adapter with the given RAR file name and an option string in the node.

The RAR file name is the fully qualified file name that resides in the node that you specify. The valid options include the following...

  • rar.name

  • rar.desc

  • rar.archivePath

  • rar.classpath

  • rar.nativePath

All options are optional. The rar.name option is the name for the J2CResourceAdapter. If you do not specify this option, the display name in the rar deployment descriptor is used. If that is not specified, the RAR file name is used. The rar.desc option is a description of the J2CResourceAdapter. The rar.archivePath is the name of the path where the file is to be extracted. If you do not specify this option, the archive will be extracted to the $\{CONNECTOR_INSTALL_ROOT\} directory. The rar.classpath is the additional class path.

 

Parameters

rar file name, node, options

Returns the configuration id of new J2CResourceAdapter object

 

Example usage:

Using Jacl

$AdminConfig installResourceAdapter /path/mine.rar \
    {-rar.name myResourceAdapter -rar.desc "My rar file"} node

Using Jython

print AdminConfig.installResourceAdapter('/path/mine.rar', \
    '[-rar.name  myResourceAdapter -rar.desc "My rar file"]', 'node')

 

Example output

myResourceAdapter(cells/cell/nodes/node:resources.xml#J2CResourceAdapter_1)

 


list

Returns a list of objects of a given type, possibly scoped by a parent.

 

Example usage:

Using Jacl

$AdminConfig list JDBCProvider

Using Jython

print AdminConfig.list('JDBCProvider')

 


listTemplates

Displays a list of template object IDs.

 

Returns

a list of template IDs

 

Example usage:

Using Jacl

$AdminConfig listTemplates JDBCProvider

Using Jython

print AdminConfig.listTemplates('JDBCProvider')

This example displays a list of all JDBCProvider templates available on the system.

 


modify

Supports modification of object attributes.

 

Returns

nothing.

 

Example usage:

Using Jacl

$AdminConfig modify CF1(cells/cell/nodes/node1/servers/deploymentmgr/resources.xml#QCF1) \
    {{userID newID} \
     {password newPW}}

Using Jython with string attributes

AdminConfig.modify('CF1(cells/cell/nodes/node1/servers/deploymentmgr/resources.xml#QCF1)', \
    '[[userID newID] \
    [password newPW]]')

Using Jython with object attributes

AdminConfig.modify('CF1(cells/cell/nodes/node1/servers/deploymentmgr/resources.xml#QCF1)', \
    [['userID', 'newID'], \
    ['password', 'newPW']])

 


parents

Obtains information about object types.

 

Parameters

object type

Returns a list of object types

 

Example usage:

Using Jacl

$AdminConfig parents JDBCProvider

Using Jython

AdminConfig.parents('JDBCProvider')

 

Example output

Cell
Node
Server

 


queryChanges

Returns a list of unsaved configuration files.

 

Parameters

nothing

Returns a string containing a list of files with unsaved changes

 

Example usage:

Using Jacl

$AdminConfig queryChanges

Using Jython

AdminConfig.queryChanges()

 

Example output

WASX7146I: The following configuration files contain unsaved changes...
cells/cell/nodes/node/servers/server/resources.xml"

 


remove

Removes a configuration object.

 

Parameters

object

Returns nothing

 

Example usage:

Using Jacl

$AdminConfig remove ds1(cells/cell/nodes/node1/servers/server:resources.xml#DataSource_6)

Using Jython

AdminConfig.remove('ds1(cells/cell/nodes/node1/servers/server:resources.xml#DataSource_6)')

 


required

Displays the required attributes contained by an object of a certain type.

 

Parameters

type

Returns a string containing a list of required attributes with its type

 

Example usage:

Using Jacl

$AdminConfig required URLProvider

Using Jython

print AdminConfig.required('URLProvider')

 

Example output

Attribute                       Type
streamHandlerClassName          String
protocol                        String

 


reset

Resets the temporary workspace that holds updates to the configuration.

 

Parameters

nothing Returns nothing

 

Example usage:

Using Jacl

$AdminConfig reset

Using Jython

AdminConfig.reset()

 


save

Saves changes in the configuration repository.

 

Parameters

nothing Returns nothing

 

Example usage:

Using Jacl

$AdminConfig save

Using Jython

AdminConfig.save()

 


setSaveMode

Allows you to toggle the behavior of the save command. The default is rollbackOnConflict. When a conflict is discovered while saving, the unsaved changes are not committed. The alternative is overwriteOnConflict which saves the changes to the configuration repository even if there are conflicts.

 

Parameters

mode

Returns nothing

 

Example usage:

Using Jacl

$AdminConfig setSaveMode overwriteOnConflict

Using Jython

AdminConfig.setSaveMode('overwriteOnConflict')

 


setValidationLevel

Sets the validation used when files are extracted from the repository.

There are five validation levels: none, low, medium, high, or highest.

Parameter: level

 

Returns

a string containing the validation level setting

 

Example usage:

Using Jacl

$AdminConfig setValidationLevel high

Using Jython

AdminConfig.setValidationLevel('high')

 

Example output

WASX7189I: Validation level set to HIGH

 


show

Returns the top level attributes of the given object.

 

Returns

a string containing the attribute value

 

Example usage:

Using Jacl

$AdminConfig show Db2JdbcDriver(cells/cell/nodes/node1/resources.xm#JDBCProvider_1)

 

Example output

with Jacl

{name "Sample Datasource"} {description "Data source for the Sample entity beans"}  

Using Jython

print AdminConfig.show('Db2JdbcDriver(cells/cell/nodes/node1/resources.xm#JDBCProvider_1)')

 


showall

Recursively shows the attributes of a given configuration object.

 

Returns

a string containing the attribute value

 

Example usage:

Using Jacl

$AdminConfig showall "Default Datasource(cells/cell/nodes/node1/servers/server:resources.xml#DS1)

 


showAttribute

Displays only the value for the single attribute that you specify. The output of this command is different from the output of the show command when a single attribute is specified. The showAttribute command does not display a list that contains the attribute name and value. It only displays the attribute value.

 

Parameters

config id, attribute

 

Returns

a string containing the attribute value

 

Example usage:

Using Jacl

set ns [$AdminConfig getid /Node:node/]
$AdminConfig showAttribute $ns hostName

Using Jython

ns = AdminConfig.getid('/Node:node/')
print AdminConfig.showAttribute(ns, 'hostName')

 

Example output

node

 


types

Returns a list of the configuration object types that you can manipulate.

 

Example usage:

Using Jacl

$AdminConfig types

Using Jython

print AdminConfig.types()

 

Example output

AdminService
Agent
ApplicationConfig
ApplicationDeployment
ApplicationServer
AuthMechanism
AuthenticationTarget
AuthorizationConfig
AuthorizationProvider
AuthorizationTableImpl
BackupCluster
CMPConnectionFactory
CORBAObjectNameSpaceBinding
Cell
CellManager
Classloader
ClusterMember
ClusteredTarget
CommonSecureInteropComponent

 


validate

Invokes validation.

This command requests configuration validation results based on the files in your workspace, the value of the cross-document validation enabled flag, and the validation level setting. Optionally, you can specify a configuration ID to set the scope. If you specify a configuration ID, the scope of this request is the object named by the config id parameter.

 

Parameters

config id (optional)

 

Returns

a string containing results of validation

 

Example usage:

Using Jacl

$AdminConfig validate

Using Jython

print AdminConfig.validate()

 

Example output

WASX7193I: Validation results are logged in $WAS_HOME/logs/wsadmin.valout: Total number of messages: 16
WASX7194I: Number of messages of severity 1: 16

 


getCrossDocumentValidationEnabled

Returns a message with the current cross-document enablement setting. This method returns true if cross-document validation is enabled.

 

Example usage:

Using Jacl

$AdminConfig getCrossDocumentValidationEnabled

Using Jython

print AdminConfig.getCrossDocumentValidationEnabled()

 


setCrossDocumentValidationEnabled

Sets the cross-document validation enabled mode. Values include true or false.

 

Returns

nothing

 

Example usage:

Using Jacl

$AdminConfig setCrossDocumentValidationEnabled true

Using Jython

AdminConfig.setCrossDocumentValidationEnabled('true')

 


Obtain Config IDs using Jacl

To obtain a configuration ID...

set var [$AdminConfig getid /type:name/]

To look for all the server configuration IDs that reside in node...

set nodeServers [$AdminConfig getid /Node:node/Server:/]

To look for the server configuration ID residing in node...

set server [$AdminConfig getid /Node:node/Server:server/]

To look for all the server configuration IDs...

set servers [$AdminConfig getid /Server:/]

To obtain a list of configuration IDs...

set var [$AdminConfig list type]
or

set var [$AdminConfig list type scopeId]

To look for all the server configuration IDs...

set servers [$AdminConfig list Server]

To look for all the server configuration IDs in node...

set scopeid [$AdminConfig getid /Node:node/]
set nodeServers [$AdminConfig list Server $scopeid]

To retrieve a single element from a list...

set allServers [$AdminConfig getid /Server:/]
set aServer [lindex $allServers 0]

 


Obtain Config IDs using Jacl

To obtain a configuration ID...

var = AdminConfig.getid('/type:name/')

To look for all the server configuration IDs that reside in node...

nodeServers = AdminConfig.getid('/Node:node/Server:/')

To look for the server configuration ID residing in node...

server = AdminConfig.getid('/Node:node/Server:server/')
To look for all the server configuration IDs...

servers = AdminConfig.getid('/Server:/')

To obtain a list of configuration IDs...

var = AdminConfig.list('type')

or

AdminConfig.list('type', 'scopeId')

To look for all the server configuration IDs...

servers = AdminConfig.list('Server')

To look for all the server configuration IDs in node...

scopeid = AdminConfig.getid('/Node:node/')
nodeServers = AdminConfig.list('Server', scopeid)

To retrieve the first configuration ID from the server object list:

allServers = AdminConfig.getid('/Server:/')

import  java
lineSeparator = java.lang.System.getProperty('line.separator')

arrayAllServers = allServers.split(lineSeparator)
aServer = arrayAllServers[0]