com.ibm.able.platform
Class ServerStartupHelper

java.lang.Object
  |
  +--com.ibm.able.platform.ServerStartupHelper

public class ServerStartupHelper
extends java.lang.Object

The ServerStartupHelper is used by the iSeries C++ startup code to help bring up the platform on an iSeries.

Most of these method will be used for JNI calls to get information on the platform being started.


Constructor Summary
ServerStartupHelper(java.lang.String[] args)
          Create a new ServerStartupHelper
 
Method Summary
 java.lang.String areVerifiableServicesUsed()
          When running in secure mode, a platform must be using the verifiable services.
static java.lang.String Copyright()
          Determine the copyright of this class.
 void deregisterJob(java.lang.String[] jobInfoArray)
          Deregister the job that the String array represents.
 java.lang.String getAnsPort()
          Method getAnsPort
 java.lang.String getHostInfo()
          Method getHostInfo
 java.lang.String getJobInfo(java.lang.String[] args)
          This method returns a string representation of the local eServer job specified by the first element of the String[] passed in: the port.
 java.lang.String getJobServicePort()
          Metod getJobServicePort.
 java.lang.String getPrincipalInfo()
          Returns a string which holds all of the principal information for each local host The format should be port1?princ1?port2?princ2?port3?princ3?...
 java.lang.String getSecureSetting()
          Method getSecureSetting.
 void getVerifiableAgentName()
          This will get a VerifiableAgentName from the VerifiableAgentNamingService of the platform being started, and then create an AbleSecuritySupport Object.
 java.lang.String isServiceRunning(java.lang.String[] args)
          This method checks to see if the Job or AgentNaming Services are running.
 void registerJob(java.lang.String[] jobInfoArray)
          Register the job that the String array represents.
 void terminatePlatformSupport()
          This will end the AblePlatformSupportImpl object that this has been dealing with and starting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerStartupHelper

public ServerStartupHelper(java.lang.String[] args)
                    throws ServerStartupException
Create a new ServerStartupHelper

A ServierStartupHelper will be used by C++ or other applications that do not have direct reference to the Java parts of the platform. These are intended to be used for JNI calls to make it easy to find out information about the platform being started.

Parameters:
args - String array containing two arguments:
  • The implementation of an AbleEServerJobIfc that will be used.
  • The port of the platform that needs help starting up.

Throws:
ServerStartupException -

On any error calling isJobAndNamingServicesConfigured.

On any error calling loadLocalInfoFromPreferences where the local information from the preferences file will be loaded.

Method Detail

getHostInfo

public java.lang.String getHostInfo()
                             throws ServerStartupException
Method getHostInfo

Returns:
The poolInfo string that was created in loadLocalInfoFromPreferences.

Throws:
ServerStartupException - If poolInfoStringBuf has not been created.

getJobServicePort

public java.lang.String getJobServicePort()
                                   throws ServerStartupException
Metod getJobServicePort.

Returns:
The port of the Job Service of this platform

getAnsPort

public java.lang.String getAnsPort()
                            throws ServerStartupException
Method getAnsPort

Returns:
The port of the Agent Naming Service of this platform

isServiceRunning

public java.lang.String isServiceRunning(java.lang.String[] args)
                                  throws ServerStartupException
This method checks to see if the Job or AgentNaming Services are running.

Parameters:
String - array containing two arguments:
  • How long to wait before checking if the service is running.
  • Which service to check 1 = Job Service, 2 = Naming Service .

Returns:
String telling if the service is running or not
  • "RUNNING" if the service is running.
  • "NOT_RUNNING" if the service is not running.

Throws:
ServerStartupException - if there was an error contacting the service.

registerJob

public void registerJob(java.lang.String[] jobInfoArray)
                 throws ServerStartupException
Register the job that the String array represents. The type of AbleEServerJobIfc we are using will know how to pull the Job info out of the string array.

Parameters:
String[] - containing the job info. Example: If it was an iSereis job, it would expect the String array to be in this format: {port,number,user,name}

deregisterJob

public void deregisterJob(java.lang.String[] jobInfoArray)
                   throws ServerStartupException
Deregister the job that the String array represents. The type of AbleEServerJobIfc we are using will know how to pull the Job info out of the string array.

Parameters:
String[] - containing the job info. Example: If it was an iSereis job, it would expect the String array to be in this format: {port,number,user,name}

getJobInfo

public java.lang.String getJobInfo(java.lang.String[] args)
                            throws ServerStartupException
This method returns a string representation of the local eServer job specified by the first element of the String[] passed in: the port.

It will be up to the implementation of the AbleEServerJobIfc that is being used to know the proper way to return the string if the job object is valid or not.

Parameters:
args - String array whose first element is the local port of a registered job whose job info should be returned.

Returns:
A String containing the job info of the job registered to the local port specified in args[0].

Throws:
ServerStartupException -

On any error getting job info from the Job Service.

On any remote error.


getPrincipalInfo

public java.lang.String getPrincipalInfo()
                                  throws ServerStartupException
Returns a string which holds all of the principal information for each local host The format should be port1?princ1?port2?princ2?port3?princ3?... etc.

This string was created in the loadLocalInfoFromPreferences method.

Returns:
String holding the principal info of the platform

Throws:
ServerStartupException -  

getSecureSetting

public java.lang.String getSecureSetting()
Method getSecureSetting.
Returns:
String telling weather the platform is secure or not: "ON" or "OFF"

areVerifiableServicesUsed

public java.lang.String areVerifiableServicesUsed()
When running in secure mode, a platform must be using the verifiable services. This method will check that the platform is configured to be using these services. "TRUE" will be returned if this is the case. "FALSE" if not.

Returns:
String telling if the platform is secure or not: "TRUE" or "FALSE".

terminatePlatformSupport

public void terminatePlatformSupport()
                              throws ServerStartupException
This will end the AblePlatformSupportImpl object that this has been dealing with and starting. It will call terminatePlatformSupport on this AblePlatformSupportImpl. It will take the platform down nicely and persist info so it can be brought back up easily on the next startup.

Throws:
ServerStartupException -  

getVerifiableAgentName

public void getVerifiableAgentName()
                            throws ServerStartupException
This will get a VerifiableAgentName from the VerifiableAgentNamingService of the platform being started, and then create an AbleSecuritySupport Object.

Throws:
ServerStartupException -

If the VerifiableAgentNamingService is not running.

On all errors creating the new VerifiableAgentName.

If a principal was not defined for this host.


Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.