|
AR System Java Plug-in API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bmc.arsys.pluginsvr.plugins.ARPluginContext
public class ARPluginContext
Provides the contextual information for each plugin call. Provides access to login information for the call that led to this plugin call. Also provides access to common plugin server functionality that plugins will need, like access to configuration info for a given plugin, logging methods to log into the plugin server log etc. This class can also be used to create a ARServerUser that can be used to make api calls as the user who triggered this api call.
| Field Summary | |
|---|---|
static int |
AR_INTERNAL_REQ_CONFIG
Used as eventId in ARPlugin.onEvent(ARPluginContext, int) to indicate that ar.cfg has serverInfo changed. |
static int |
PLUGIN_LOG_LEVEL_ERROR
Logging level for warning messages. |
static int |
PLUGIN_LOG_LEVEL_FATAL
Logging level for fatal messages |
static int |
PLUGIN_LOG_LEVEL_INFO
Logging level for informational messages. |
static int |
PLUGIN_LOG_LEVEL_WARNING
Logging level for warning messages. |
| Constructor Summary | |
|---|---|
ARPluginContext()
Default Constructor |
|
ARPluginContext(String user,
String guid,
String authString)
Constructor |
|
ARPluginContext(String user,
String guid,
String authString,
String[] args,
ARPluginInfo info)
Constructor |
|
| Method Summary | |
|---|---|
String |
getARConfigEntry(String key)
If the server configuration file was loaded from a path relative to the install path specified in the command line argument, this call will return values for tags configured in the ar.conf or ar.cfg file. |
String |
getAuthString()
Returns the authentication string for this user session |
String[] |
getCmdLineArgs()
Returns the command line arguments that the plugin server was started with. |
String |
getConfigItem(ARPluginInfo id,
String key)
If ARPluginInfo == null, get the supported value of a configuration item for plugin server element in the pluginsvr_config.xml file. |
String |
getConfigItem(String key)
Get the value of a configuration item for this plug-in from the <userDefined> element in the pluginsvr_config.xml file. |
ARPluginInfo |
getPluginInfo()
Return the identification information about the plugin in the current context |
Map<Object,Object> |
getPluginInstanceLocalInfo()
Set a map of plug-in instance stateful information that plug-in would want to keep. |
String |
getRemoteHostCharSet()
The remote host character set for current request. |
String |
getUser()
Returns the user name for the api call that resulted in this plugin call. |
String |
getUserSessionGuid()
Returns the session specific guid for this user session, that can be used for authentication purposes along with the user name to make AR API calls to the AR Server in the midst of a plugin call. |
boolean |
isPluginsvrStarted()
Check if current instance of java plug-in server is started and ready to take rpc calls |
void |
logMessage(ARPluginInfo info,
int level,
String message)
Given the identification of the plugin, the level and message to log, log all relevant info into the plugin log file, depending on the log level configuration of the plugin server. |
void |
logMessage(int level,
String message)
Given the level and message to log, log all relevant info including current plugin info, into the plugin log file, depending on the log level configuration of the plugin server. |
void |
setConfigItem(ARPluginInfo id,
String key,
String value)
Set the value of a configuration item for the identified plug-in from the <userDefined> element in the pluginsvr_config.xml file. |
void |
setConfigItem(String key,
String value)
Set the value of a configuration item for this plug-in from the <userDefined> element in the pluginsvr_config.xml file. |
void |
setPluginInstanceLocalInfo(Map<Object,Object> pluginInstanceLocalInfo)
Set the plug-in instance local info back to plug-in server, so that next call to this same plug-in instance will contain them, no matter what thread calling this instance. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PLUGIN_LOG_LEVEL_INFO
public static final int PLUGIN_LOG_LEVEL_WARNING
public static final int PLUGIN_LOG_LEVEL_ERROR
public static final int PLUGIN_LOG_LEVEL_FATAL
public static final int AR_INTERNAL_REQ_CONFIG
ARPlugin.onEvent(ARPluginContext, int) to indicate that ar.cfg has serverInfo changed. User can call
getConfigItem(ARPluginInfo, String) to get the value of the
given key from ar.cfg.
| Constructor Detail |
|---|
public ARPluginContext(String user,
String guid,
String authString)
user - the user's nameguid - the user's GUIDauthString - the user's authentication string
public ARPluginContext(String user,
String guid,
String authString,
String[] args,
ARPluginInfo info)
user - the user's nameguid - the user's GUIDauthString - the user's authentication stringargs - the arguments the Plug-in Server was started withinfo - the ARPluginInfo instance the for this plug-inpublic ARPluginContext()
| Method Detail |
|---|
public String[] getCmdLineArgs()
public ARPluginInfo getPluginInfo()
public String getUser()
getUser in interface com.bmc.arsys.api.ARNativeAuthenticationInfopublic String getUserSessionGuid()
getUserSessionGuid in interface com.bmc.arsys.api.ARNativeAuthenticationInfo
public void logMessage(ARPluginInfo info,
int level,
String message)
info - ARPluginInfo about the pluginlevel - PLUGIN_LOG_LEVEL_INFO, PLUGIN_LOG_LEVEL_WARNING,
PLUGIN_LOG_LEVEL_ERROR or PLUGIN_LOG_LEVEL_FATALmessage - message to log
public void logMessage(int level,
String message)
level - PLUGIN_LOG_LEVEL_INFO, PLUGIN_LOG_LEVEL_WARNING,
PLUGIN_LOG_LEVEL_ERROR or PLUGIN_LOG_LEVEL_FATALmessage - message to logpublic String getAuthString()
getAuthString in interface com.bmc.arsys.api.ARNativeAuthenticationInfo
public String getConfigItem(ARPluginInfo id,
String key)
id - ARPluginInfo plug-in identification. null indicate the key is for pluginsvr configured key.key - String name of the element in <userDefined> if id is set. Or tag under setConfigItem(com.bmc.arsys.pluginsvr.plugins.ARPluginInfo, java.lang.String, java.lang.String)
public void setConfigItem(ARPluginInfo id,
String key,
String value)
id - ARPluginInfo plug-in identificationkey - String name of the element in <userDefined>value - String value value for the element named in key in the plug-in server
configuration file.getConfigItem(com.bmc.arsys.pluginsvr.plugins.ARPluginInfo, java.lang.String)public String getConfigItem(String key)
key - String name of the element in <userDefined>
setConfigItem(com.bmc.arsys.pluginsvr.plugins.ARPluginInfo, java.lang.String, java.lang.String)
public void setConfigItem(String key,
String value)
key - String name of the element in <userDefined>value - String value for the element named in key in the plug-in server
configuration file.getConfigItem(com.bmc.arsys.pluginsvr.plugins.ARPluginInfo, java.lang.String)public String getARConfigEntry(String key)
key - an AR configuration tag
public String getRemoteHostCharSet()
ARPluggable.initialize(ARPluginContext) methods.
public Map<Object,Object> getPluginInstanceLocalInfo()
public void setPluginInstanceLocalInfo(Map<Object,Object> pluginInstanceLocalInfo)
pluginInstanceLocalInfo - public boolean isPluginsvrStarted()
|
AR System Java Plug-in API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||