12.4. Registering a Job Module

Custom job plug-ins can be registered through the Certificate Manager Console. Registering a new module involves specifying the name of the module and the full name of the Java™ class that implements the module.
To register a new job module:
  1. Create the custom job class. For this example, the custom job plug-in is called MyJob.java.
  2. Compile the new class.
    javac -d . -classpath $CLASSPATH MyJob.java
  3. Create a directory in the CA's WEB-INF web directory to hold the custom classes, so that the CA can access them.
    mkdir /var/lib/pki/instance_name/ca/webapps/ca/WEB-INF/classes
  4. Copy the new plug-in files into the new classes directory, and set the owner to the Certificate System system user (pkiuser).
    cp -pr com /var/lib/pki/instance_name/ca/webapps/ca/WEB-INF/classes
    
    chown -R pkiuser:pkiuser /var/lib/pki/instance_name/ca/webapps/ca/WEB-INF/classes
  5. Register the plug-in.
    1. Log into the Certificate Manager Console.
      pkiconsole https://server.example.com:8443/ca
    2. In the Configuration tab, select Job Scheduler in the left navigation tree. Select Jobs.
      The Job Instance tab opens, which lists any currently configured jobs. Select the Job Plugin Registration tab.
    3. Click Register to add the new module.
    4. In the Register Job Scheduler Plugin Implementation window, supply the following information:
      • Plugin name. Type a name for the plug-in module.
      • Class name. Type the full name of the class for this module; this is the path to the implementing Java™ class. If this class is part of a package, include the package name. For example, to register a class named customJob that is in a package named com.customplugins, type com.customplugins.customJob.
    5. Click OK.

Note

It is also possible to delete job modules, but this is not recommended.
If it is necessary to delete a module, open the Job Plugin Registration tab as when registering a new module, select the module to delete, and click Delete. When prompted, confirm the deletion.