z/OS MVS Programming: Product Registration
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Registering and deregistering a product using Java

z/OS MVS Programming: Product Registration
SA38-0698-00

The IFAEDJReg class provides access to the z/OS® product registration and deregistration services through Java™. The IFAEDJReg class allows Java programs to use the product registration services by wrapping the system IFAEDREG (register) and IFAEDDRG (deregister) callable services.

A product is identified through various parameters such as product name, product owner, and feature name. These fields are set in the IFAEDJReg object and then the register method can be called.

After a successful registration, a registration token (also referred to as a product token) is returned by the system. This token is used by the deregister method to deregister the product.

The registration or deregistration return code provided by the system is returned by the methods.

The product registration Java support requires that the following Java level or higher be installed:
  • IBM® SDK for z/OS Java 2 Technology Edition, Version 1.4 PTF UQ93743, product number 5655-I56

To run an application that uses the product registration Java classes, you must add the jar file containing the product registration classes to your path, and add the native library to your libpath.

Note in the examples below, the default installation paths are shown. If you have changed the default by adding a path prefix, modify the commands accordingly.

Add the /usr/include/java_classes/ifaedjreg.jar file to your application classpath. In the z/OS UNIX System Services shell, this can be done with the command:
export CLASSPATH=/usr/include/java_classes/ifaedjreg.jar:$CLASSPATH  
Add the path to the native library /usr/lib/java_runtime/libifaedjreg.so to your library path (LIBPATH). In the z/OS Unix System Services shell, this can be done with the command:
export LIBPATH=/usr/lib/java_runtime:$LIBPATH

The documentation for the using the methods in the Java classes is contained in the Javadoc for the IFAEDJReg class. The Java doc is installed to /usr/include/java_classes/ifadjregDoc.jar by default.

All of the Javadoc files for product registration have been included in the jar. To view the Javadoc, it is necessary to download the jar file in binary to your workstation, unjar the file to make the individual files accessible, and then use your browser to open the index.html file.

Example: Registering a product using Java

The product name "TESTPROD" with product owner "IBM" and product number 9999-999 is to be registered. If the product is disabled, the program will exit. Registration is done using the system service IFAEDREG.
IFAEDJReg reg = new IFAEDJReg();
reg.setRegisterType(IFAEDJReg.IFAEDREG_TYPE_STANDARD + IFAEDJReg.IFAEDREG_TYPE_NOTFOUNDDISABLED);
reg.setProductName("TESTPROD");
reg.setProductOwner("IBM");
reg.setProductID("9999-999");
int rc = reg.register(); // Invoke registration service
if (rc != IFAEDJReg.IFAEDREG_SUCCESS) {
  System.out.println("TESTPROD registration failed due to the return code from IFAEDJReg, rc="+rc);
  System.exit(1);
} 

Example: Deregistering a product using Java

A previously registered product is to be deregistered. The same object that was used during registration is used for the deregistration. Deregistration is done using the system service IFAEDDRG.
nt rc = reg.deregister(); // Invoke deregistration service
if (rc != IFAEDJReg.IFAEDDRG_SUCCESS) {
  System.out.println("TESTPROD deregistration failed due to the return code from IFAEDJReg, rc="+rc);
  System.exit(2);
} 

Go to the previous page




Copyright IBM Corporation 1990, 2014