Sun ONE logo     Previous      Contents     Index      Next     
iPlanet Process Manager, Version 6.5 Programmer's Guide



Chapter 4   Cluster Management

This chapter discusses the Java classes used for performing cluster administration tasks. This chapter has the following sections:

Introduction

A Process Manager cluster contains the following components:

  • a corporate user LDAP directory service
  • a configuration LDAP directory service that stores the application definitions
  • a relational database for user data
  • one or more application servers
  • an iPlanet Web Server
  • a mail server for notifications

When deploying an application from Process Builder, application developers must identify the cluster on which to deploy it. All applications in a cluster share the same common database and directories. They access the same Directory Server for their process definitions and they use the same set of cross-application tables in the database, as well as the same corporate users and groups directory.

Using the Process Administrator interface, you can interactively modify a cluster.

You can build Java applications that programmatically perform Process Manager cluster administration tasks. Process Manager has one cluster manager bean, IPMClusterManager. For each separate cluster, there is an IPMCluster bean.

You can use the cluster manager bean to perform administrative tasks such as creating, deleting, joining and unjoining clusters. You can also use the cluster manager bean to get handles to individual clusters beans.

You can use the cluster bean to change properties of the cluster, to access and write to cluster logs, and to retrieve information about the cluster such as getting installed applications, getting path information, getting the finder and getting the deployment manager.

Given an individual cluster bean, you can get individual application beans. Given an application bean, you can access any process instance or work item so long as you have the key, such as the process instance ID.

For details of IPMClusterManager and IPMCluster beans see:

Clusters have properties. These are represented as IPMClusterProperty objects. Many of the methods for working with clusters take IPMClusterProperty objects as arguments. To create cluster property objects, you use IPMClusterPropertyFactory. For details see:

At the end of this chapter, there is a coded example of creating a cluster.

IPMClusterManager

The IPMClusterManager bean can be thought as a manager of all the cluster beans in the application server instance.

The following code shows how to access the cluster manager:


// Get the cluster manager
IPMClusterManager myClusterManager = null;

try {
   javax.naming.Context cxt = new javax.naming.InitialContext();
   IPMClusterManagerHome clManagerHome = (IPMClusterManagerHome)
      cxt.lookup(IPMClusterManager.JNDI_ROOT);
   myClusterManager = clManagerHome.create();
   }

catch( Exception e )
   {
   System.out.println("Cluster manager creation failed" + e);
   }

The IPMClusterManager bean is a stateless session bean that has methods for creating, joining, accessing, unjoining and deleting clusters, and checking LDAP and database connections.

IPMCluster

IPMCluster objects represent individual clusters. For operations such as creating, deleting, joining and unjoining clusters, you call methods on the cluster manager class, IPMClusterManager, rather than calling methods on the cluster itself.

To get access to an IPMCluster method, call the getCluster() method on the IPMClusterManager as illustrated in the following code sample:


// Get the cluster manager
IPMClusterManager myClusterManager = null;

try {
   javax.naming.Context cxt = new javax.naming.InitialContext();
   IPMClusterManagerHome clManagerHome = (IPMClusterManagerHome)
      cxt.lookup(IPMClusterManager.JNDI_ROOT);
   myClusterManager = clManagerHome.create();
   }

catch( Exception e )
   {
   System.out.println("Cluster manager creation failed" + e);
   }

// Get the default cluster in a single cluster implementation
IPMCluster myCluster = myClusterManager.getCluster(
   IPMCluster.DEFAULT);

//Get a specific cluster in a multiple cluster implementation
IPMCluster myCluster = myClusterManager.getCluster(
   IPMCluster.NAME_OF_CLUSTER);


The IPMCluster bean has methods for changing cluster properties, accessing logs and retrieving information about the cluster.

For details for the IPMCluster bean methods, see the javadocs, which can be found in the support\sdk\docs directory of the Process Manager Builder installation.

IPMClusterProperty

The IPMClusterProperty interface is used in various cluster bean APIs. It is used to set and get cluster properties.

When creating an IPMCluster, you first need to create an IPMClusterProperty and then use the setValue() method to set the cluster properties, as listed in the section "Setting Properties When Creating Clusters". The section, "Other Cluster Properties", lists cluster properties that specify URLs for accessing various Process Manager components as well as other cluster properties and pre-defined variables.

Getting and Setting Property Values

To retrieve or set properties, use the methods:

  • getValue
  • setValue
  • getProperties

For information on the property value settings, see the javadocs, which can be found in the support\sdk\docs directory of the Process Manager Builder installation.

Setting Properties When Creating Clusters

This section describes how to set properties on creation of a cluster, and then lists the properties that must be set.

To create an IPMClusterProperty, use the create() method on IPMClusterPropertyFactory as follows:

IPMClusterProperty prop1 = PMClusterPropertyFactory.create ( );

To get the existing IPMClusterProperty for a cluster, call getClusterProperty() on the cluster, as follows:

IPMClusterProperty myProp = myCluster.getClusterProperty();



Note

All properties listed in the following tables are public static int



Table 4-1    Cluster and Configuration Properties 

Property

Description

CLUSTER_DN

 

Distinguished name (DN) of the cluster entry

 

CLUSTER_NAME

 

Name of a cluster (when using a multiple cluster implementation).

 

CONFIGURATION_DIRECTORY_SERVER

 

Host name where the configuration directory resides

 

CONFIGURATION_DIRECTORY_PORT

 

Port number for the configuration directory

 

CONFIGURATION_DIRECTORY_BIND_ DN

 

Bind DN of the configuration directory

 

CONFIGURATION_DIRECTORY_BIND_ DN_ PASSWORD

 

Bind DN password of the configuration directory

 

Table 4-2    Corporate Directory Properties 

Property

Description

CORPORATE_DIRECTORY_SERVER

 

Host name where the corporate directory resides

 

CORPORATE_DIRECTORY_PORT

 

Corporate directory port number

 

CORPORATE_DIRECTORY_BASE

 

Corporate directory base, for example:

ou=People, o=iplanet.com

 

CORPORATE_DIRECTORY_BIND_DN

 

Corporate directory BIND DN, for example:

cn=Directory Manager

This property is optional when creating a cluster.

 

CORPORATE_DIRECTORY_BIND_DN_ PASSWORD

 

Corporate directory BIND DN Password.

This property is optional when creating a cluster.

 

Table 4-3    Database Properties 

Property

Description

DATABASE_DRIVER_IDENTIFIER

 

Driver name used to register a third-party jdbc driver

 

DATABASE_IDENTIFIER

 

Database identifier when a native database driver is used

 

DATABASE_NAME

 

Database name (optional if the database type is ORACLE)

 

DATABASE_PASSWORD

 

Database user password

 

DATABASE_TYPE

 

The Database Type. The value can be:
IPMClusterProperty.INFORMIX
IPMClusterProperty.ORACLE
IPMClusterProperty.SYBASE

 

DATABASE_URL

 

URL that specifies the subprotocol (the database connectivity mechanism), the database and list of properties

 

DATABASE_USER_NAME

 

the database user name

 

DATASOURCE_NAME

 

JNDI Name used for the database when you registered your datasource with the iPlanet Application Server

 

Table 4-4    General Properties 

Property

Description

ADMIN_USERS

 

Comma-separated list of LDAP user IDs of people who have administrative permission to access Process Administrator and Process Business Manager interfaces for this particular cluster, and to deploy applications to this cluster. You must provide at least one LDAP user ID in this field.

This property is needed only when using a multiple cluster implementation.

 

DESCRIPTION

 

Description of the cluster

 

PRETTY_NAME

 

Pretty name of the cluster that appears in the Builder.

This property is optional when creating a cluster.

 

SMTP_SERVER

 

SMTP server host name.

This property is optional when creating a cluster.

 

SMTP_PORT

 

SMTP port number .

This property is optional when creating a cluster.

 

SMTP_REPLY_TO

 

SMTP reply to.

This property is optional when creating a cluster.

 

Other Cluster Properties

This section lists cluster properties that specify URLs for accessing various Process Manager components and cluster properties that specify information about events. It also lists other pre-defined variables.



Note

All properties listed here are public static int



Table 4-5    URL Properties 

Property

Description

DEPLOY_URL

 

URL where Process Manager applications are deployed.

 

EXPRESS_URL

 

URL for the Process Manager Express

 

ADMINISTRATOR_URL

 

URL for the Process Administration interface

 

BUSINESS_URL

 

URL for the Process Business Manager's interface

 

APPLICATION_URL

 

URL for application

 

Table 4-6    Event Properties 

Property

Description

EVENT_USER

 

The cluster uses the EVENT_USER ID when it makes asynchronous requests into the Process Manager Engine, such as when the timer agent checks for expired work items.

This user and password combination should be a valid combination inside the corporate directory.

 

EVENT_USER_PASSWORD

 

Password for the EVENT_USER.

 

Table 4-7    Other Pre-defined Variables 

Property

Description

INFORMIX
ORACLE
SYBASE

 

These are used as the values of the DATABASE_TYPE variable.

 

LOG_INFORMATION
LOG_SECURITY
LOG_ERROR

 

These are used as an argument to the getLog() method on IPMCluster to specify what kind of log to retrieve.

 

PMClusterPropertyFactory

The purpose of this class is to create new IPMClusterProperty objects, which contain the properties for a cluster.


// Create a PMClusterProperty object
IPMClusterProperty prop1 = PMClusterPropertyFactory.create ( ) ;


IPMClusterProperty prop = PMClusterPropertyFactory.create ( );
// Set the various properties of the interface
....
....
...
// look up in JNDI name space to get a handle on the
// IPMClusterManager bean interface
...
....
// maybe then create a cluster
IPMClusterManager.createCluster ( prop ) ;


Code Samples

This section presents the following code samples:

Mount the Cluster Manager and Get the Default Cluster

This code sample gets the cluster manager and the default cluster.


// Get the cluster manager
IPMClusterManager myClusterManager = null;

try {
   javax.naming.Context cxt = new javax.naming.InitialContext();
   IPMClusterManagerHome clManagerHome = (IPMClusterManagerHome)
      cxt.lookup(IPMClusterManager.JNDI_ROOT);
   myClusterManager = clManagerHome.create();
   }

catch( Exception e )
   {
   System.out.println("Cluster manager creation failed" + e);
   }

// Get the default cluster in a single cluster implementation
IPMCluster myCluster = myClusterManager.getCluster(
   IPMCluster.DEFAULT);

// Get a specific cluster in a multiple cluster implementation
IPMCluster myCluster = myClusterManager.getCluster(
   IPMCluster.NAME_OF_CLUSTER);


Create a Cluster

This code sample creates a new cluster.


// Create a PMClusterProperty object
IPMClusterProperty prop1 = PMClusterPropertyFactory.create ( ) ;

// Populate the properties in the PMClusterProperty object
prop1.setValue(IPMClusterProperty.CONFIGURATION_DIRECTORY_SERVER , "westminster");
prop1.setValue(IPMClusterProperty.CONFIGURATION_DIRECTORY_PORT, "4141");

// Continue setting properties
...

// Now create the cluster
IPMCluster cluster1 = myClusterManager.createCluster( prop1 );

Get and Set Cluster Properties

This code sample gets and sets cluster properties.


// myCluster is the default cluster

// Get some properties
IPMClusterProperty myProp = myCluster.getClusterProperty();
String description = myProp.getValue(IPMClusterProperty.DESCRIPTION);

// Change some property values
IPMClusterProperty myProp = myCluster.getClusterProperty();
myProp.setValue(IPMClusterProperty.DESCRIPTION,
   "New cluster description");
myProp.setValue(IPMClusterProperty.SMTP_REPLY_TO ,
   "pmadministrator@iplanet.com");

// Save the changes to the cluster
myProp.changeCluster(myprop);


Previous      Contents     Index      Next     
Copyright 2002 Sun Microsystems, Inc. All rights reserved.


816-6353-10