Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

oracle.apps.fnd.appltest.diagfwk.cli
Class BaseVerb

java.lang.Object
  extended by oracle.apps.fnd.appltest.diagfwk.cli.BaseVerb
All Implemented Interfaces:
DiagConstants, DiagCmdConstants
Direct Known Subclasses:
ExtractMetadataVerb, HelpVerb, QueryVerb, RegisterVerb, ReportVerb, RunTestVerb, StatusVerb

public abstract class BaseVerb
extends java.lang.Object
implements DiagCmdConstants

Models a verb supported by the Diagnostics Command-Line interface.


Nested Class Summary
 
Nested classes/interfaces inherited from interface oracle.apps.fnd.appltest.diagfwk.common.DiagConstants
DiagConstants.ExecutionMode, DiagConstants.Format, DiagConstants.LinkType, DiagConstants.Status
 
Field Summary
protected static java.lang.String CMD
           
protected static java.lang.String SH
           
 
Fields inherited from interface oracle.apps.fnd.appltest.diagfwk.engine.DiagCmdConstants
DELIM_VALUE, PARAM_APP, PARAM_CHILD_REPORTS, PARAM_CONNECT_STR, PARAM_DB_PWD, PARAM_DB_UN, PARAM_DESTDIR, PARAM_DIR, PARAM_EXEC_MODE, PARAM_EXECID, PARAM_FORMAT, PARAM_HELP, PARAM_LANG, PARAM_MAKESUBDIR, PARAM_MODID, PARAM_MODKEY, PARAM_NTHREADS, PARAM_PREREQ, PARAM_PRINTTOCONSOLE, PARAM_PRINTTREE, PARAM_PWD, PARAM_QUERY, PARAM_RECURSE, PARAM_REGISTER, PARAM_REPORT, PARAM_RUN_LOCALLY, PARAM_RUN_NAME, PARAM_RUNID, PARAM_RUNTEST, PARAM_STATUS, PARAM_TEST, PARAM_TESTFILE, PARAM_TOKEN_INPUT, PARAM_TOKEN_TAG, PARAM_TRANSLATE, PARAM_USERNAME, PARAM_VALIDATE_ONLY, PARAM_WAITFORCOMPLETION, PARAM_WRITETOFILE, PRE_POPULATED_EXECID
 
Fields inherited from interface oracle.apps.fnd.appltest.diagfwk.common.DiagConstants
APPS_MSG_ID_TAG_NAME, CFG_ADR_PROVIDER_CLASS, CFG_CACHE_PROVIDER_CLASS, CFG_CRED_PROVIDER_CLASS, CFG_DAO_FACTORY_CLASS, CFG_DB_CONN_INFO_PROVIDER_CLASS, CFG_DB_CONN_PROVIDER_CLASS, CFG_NLS_PROVIDER_CLASS, CFG_PLSQL_PROVIDER_CLASS, CFG_PROFILE_PROVIDER_CLASS, CFG_SECURITY_PROVIDER_CLASS, CFG_SESSION_INFO_PROVIDER_CLASS, CFG_URL_PROVIDER_FACTORY_CLASS, CFG_WLS_MBEANSRV_CONNINFO_PROVIDER_CLASS, DATA_SECURITY_PERMISSION_ALLOWED, DATA_SECURITY_PERMISSION_NOT_ALLOWED, DELIM_URL, EXEC_MODE_CLI, EXEC_MODE_ESS, EXEC_MODE_INCIDENT, EXEC_MODE_JAVA, EXEC_MODE_UI, EXECUTABLE_TYPE_JAVA, EXECUTABLE_TYPE_PLSQL, EXECUTABLE_TYPE_TESTREF, FORMAT_HTML, FORMAT_XML, GUID_ORACLE_MINUS1, GUID_ORACLE_ZERO, INPUTS_STATUS_ALL_OPT_INPUTS, INPUTS_STATUS_NO_INPUTS, INPUTS_STATUS_REQ_INPUTS_NO_DEFAULTS, INPUTS_STATUS_REQ_INPUTS_W_DEFAULTS, IO_FLAG_I, IO_FLAG_O, JMX_API_BASE_OBJECT_NAME, LINK_EXTERNAL, LINK_INTERNAL, LINK_METALINK, N, NLS_BUNDLE_JAVA_RES, NLS_BUNDLE_MSG_SVC, NLS_BUNDLE_RES_REF, NLS_BUNDLE_XLIFF, NO, NULL, ODF_MBEAN_DOMAIN_NAME, PARAM_MON_INTERVAL, PLSQL_DEBUG_ENABLED_SYSTEM_PROP, PREREQ_TYPE_TAG_VALUE, PREREQ_TYPE_TEST, SECONDS_IN_ONE_DAY, SECONDS_IN_ONE_HOUR, STATUS_CANCELED, STATUS_EXECERROR, STATUS_FAILURE, STATUS_RUNNING, STATUS_SUCCESS, STATUS_WARNING, SYS_PROP_MAX_MONITOR_INTERNVAL, SYS_PROP_MAX_NUM_THREADS, SYSPROP_APPCONNFILE, SYSPROP_DIAG_CONFIG_FILE, TAG_TYPE_DIAG, TAG_TYPE_TAXONOMY, TEST_TYPE_DECL, TEST_TYPE_JAVA, USER_NAME, WEB_APP_NAME_TAG_NAME, Y, YES
 
Constructor Summary
BaseVerb()
           
 
Method Summary
 void cleanup()
          Performs any cleanup activities required after the execution of the verb has completed.
 void execute()
          This API executes the verb with the given list of parameters.
abstract  DiagCmd getDiagEngineCmd()
          Returns the diagnostics engine command to be executed for this verb.
protected abstract  java.lang.String[] getDuplicateAllowedParamNames()
          Returns an array of parameter names for this verb for which multiple values are allowed.
protected abstract  java.lang.String[] getExpectedParamNames()
          Returns an array of expected parameter names for this verb.
abstract  oracle.apps.fnd.appllcm.sdk.common.ResourceRef getHelpDefinition()
          This API gives the user help on how to run DiagControl with the given verb.
protected  java.lang.String getParam(java.lang.String name)
          Gets the value for the given parameter name
protected  java.lang.String getParam(java.lang.String name, java.lang.String defval)
          Gets the value for the given parameter.
protected  NameValueList getParamList()
           
protected static java.lang.String getShellExtn()
          Gets the script extension for diagctl e.g.
 java.lang.String getVerbName()
          Gets the name of the verb
static void print(oracle.apps.fnd.appllcm.sdk.common.ResourceRef pMsg)
          A utility API for printing output to the console for the user.
static void print(java.lang.String pMsg)
           
static void println(oracle.apps.fnd.appllcm.sdk.common.ResourceRef pMsg)
          A utility API for printing output to the console for the user.
static void println(java.lang.String pMsg)
           
abstract  void processOutput(java.lang.Object o)
          Processes the output object produced by running the command.
protected  boolean requiresDbConn()
          Checks if this CLI-verb requires connection to the database.
protected  void setParamList(NameValueList pList)
           
 void setVerbName(java.lang.String pVerbName)
          Sets the name for this verb
 boolean validateArgs(NameValueList coll)
          This API validates the command line arguments pass to DiagControl.
abstract  boolean validateCmdArgs()
           
protected  void validateDbConnectInfo()
          Validates Database Connection information and Database credentials
protected  void validateDuplicateParams()
          Validates that there are no duplicates specified for parameters specified except for the ones that are supported.
protected  void validateExpectedParams()
          Validates that no unexpected parameters are specified
protected  void validateUnPwdExist()
          Validates that the un and pwd parameters have been specified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SH

protected static final java.lang.String SH
See Also:
Constant Field Values

CMD

protected static final java.lang.String CMD
See Also:
Constant Field Values
Constructor Detail

BaseVerb

public BaseVerb()
Method Detail

validateArgs

public boolean validateArgs(NameValueList coll)
This API validates the command line arguments pass to DiagControl.

Parameters:
coll - Collection of arguments passed to DiagControl
Returns:
A boolean flag stating whether the validation was successful or not.

validateDbConnectInfo

protected void validateDbConnectInfo()
Validates Database Connection information and Database credentials


setVerbName

public void setVerbName(java.lang.String pVerbName)
Sets the name for this verb

Parameters:
pVerbName - name of the verb

getVerbName

public java.lang.String getVerbName()
Gets the name of the verb

Returns:
the name of the verb

validateExpectedParams

protected void validateExpectedParams()
Validates that no unexpected parameters are specified


validateDuplicateParams

protected void validateDuplicateParams()
Validates that there are no duplicates specified for parameters specified except for the ones that are supported.


validateUnPwdExist

protected void validateUnPwdExist()
Validates that the un and pwd parameters have been specified


setParamList

protected void setParamList(NameValueList pList)

getParamList

protected NameValueList getParamList()

validateCmdArgs

public abstract boolean validateCmdArgs()

getHelpDefinition

public abstract oracle.apps.fnd.appllcm.sdk.common.ResourceRef getHelpDefinition()
This API gives the user help on how to run DiagControl with the given verb.

Returns:
String with help usage for apporpiate DiagControl command.

execute

public void execute()
This API executes the verb with the given list of parameters.


getDiagEngineCmd

public abstract DiagCmd getDiagEngineCmd()
Returns the diagnostics engine command to be executed for this verb.


getExpectedParamNames

protected abstract java.lang.String[] getExpectedParamNames()
Returns an array of expected parameter names for this verb. This list of names is used to validate the client's invocation of the verb. If the verb invocation contains any additional parameters that are not specified in this list then a validation error message is thrown.

Returns:
an array of all expected parameter names (required and optional) for this verb.

getDuplicateAllowedParamNames

protected abstract java.lang.String[] getDuplicateAllowedParamNames()
Returns an array of parameter names for this verb for which multiple values are allowed. For such parameters, if clients pass multiple parameters with the same name no validation error is thrown. For parameters that are not listed in this array, if client passes in multiple instances of the same parameter name a validation error is thrown indicating that multiple occurrence of that parameter name are not allowed.

Returns:
an array of parameter names for this verb for which multiple occurrences are allowed.

processOutput

public abstract void processOutput(java.lang.Object o)
Processes the output object produced by running the command. Implementation for each verb may expected a different output object and process it accordingly.

Parameters:
o - output object produced by the command for this verb.

cleanup

public void cleanup()
Performs any cleanup activities required after the execution of the verb has completed.


getParam

protected java.lang.String getParam(java.lang.String name)
Gets the value for the given parameter name

Parameters:
name - name of the parameter
Returns:
value for the parameter

getParam

protected java.lang.String getParam(java.lang.String name,
                                    java.lang.String defval)
Gets the value for the given parameter. If the value of the parameter is null, returns the given default value.


requiresDbConn

protected boolean requiresDbConn()
Checks if this CLI-verb requires connection to the database.

Returns:
true if this verb requires connection to the database. Returns false otherwise.

println

public static void println(oracle.apps.fnd.appllcm.sdk.common.ResourceRef pMsg)
A utility API for printing output to the console for the user. The message printed to the terminal is translated using the detault system Locale returned by Locale.getDefault().

Parameters:
pMsg - output message.

print

public static void print(oracle.apps.fnd.appllcm.sdk.common.ResourceRef pMsg)
A utility API for printing output to the console for the user. The message printed to the terminal is translated using the detault system Locale returned by Locale.getDefault().

Parameters:
pMsg - output message.

print

public static void print(java.lang.String pMsg)

println

public static void println(java.lang.String pMsg)

getShellExtn

protected static java.lang.String getShellExtn()
Gets the script extension for diagctl e.g. "sh" for Unix, "cmd" for Windows.


Oracle Fusion Middleware extensions for Logging and Diagnostics
11g Release 1 (11.1.2)

E22565-02

Copyright © 2011 Oracle. All Rights Reserved.