|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.platform.AblePlatformPreferences
This class encapsulates and provides (mostly read-only) access to
the end-user's platform operating preferences as read from a
physical properties file named by AblePlatform.PropertiesFileName
(ableplatform.preferences
at the time of this writing);
the properties file is expected to reside in the directory
specified by the System property able.prefdir
, or
failing that, the directory specified by the System property
user.home
(system properties may be overriden by using
the -D
parameter on a Java program's start command).
If no property file is found in either location, a default property
file containing default values is written to disk, but most likely
this will not work satifactorily in the user's operating
environment.
The platform preference file contains information about such things as:
An example, but non-working, preference file
is shipped in ABLE's example
directory. For the
latest specifics of a platform preference file refer to the
Platform Guide.
Inner Class Summary | |
---|---|
class |
AblePlatformPreferences.AgentPoolEntry_
This class encapsulates the definition of a single agent pool as found in a platform preference file. |
class |
AblePlatformPreferences.PrincipalEntry_
This class encapsulates the definition of a single Principal as found in a platform preference file. |
class |
AblePlatformPreferences.ServiceEntry_
This class encapsulates the definition of a single platform Service as found in a platform preference file. |
class |
AblePlatformPreferences.TrustLevelEntry_
This class encapsulates the definition of a single TrustLevel as found in a platform preference file. |
Field Summary | |
---|---|
static int |
TRUSTLEVEL_EQUAL_TO
TrustLevel comparison operator: equal to. |
static int |
TRUSTLEVEL_GREATER_THAN
TrustLevel comparison operator: greater than. |
static int |
TRUSTLEVEL_GREATER_THAN_OR_EQUAL_TO
TrustLevel comparison operator: greater than or equal to. |
static int |
TRUSTLEVEL_LESS_THAN
TrustLevel comparison operator: less than. |
static int |
TRUSTLEVEL_LESS_THAN_OR_EQUAL_TO
TrustLevel comparison operator: less than or equal to. |
static int |
TRUSTLEVEL_NOT_EQUAL_TO
TrustLevel comparison operator: not equal to. |
Constructor Summary | |
---|---|
AblePlatformPreferences()
Instantiates preference objects from a Properties file read from disk. |
Method Summary | |
---|---|
boolean |
compareTrustLevel(java.lang.String theTrustLevelAlias1,
int theComparison,
java.lang.String theTrustLevelAlias2)
Compares two trust levels by alias. |
java.util.Vector |
configuredForAns(java.lang.String theAgentPoolAlias)
Determines whether the specified AgentPool is configured to run the Agent Naming Service, and if it is, returns the ServiceEntry_ for that service. |
AblePlatformPreferences.AgentPoolEntry_ |
configuredHostPort(java.lang.String theHostName,
java.lang.String theIpAddress,
java.lang.String thePort)
Determines whether the system specified by the input parameters matches an AgentPool definition in the platform preference file, and if so, returns the matching AgentPool. |
java.util.Vector |
configuredServices()
Gets all services configured to run anywhere on the platform. |
java.util.Vector |
configuredServices(java.lang.String theAgentPoolAlias)
Gets all services configured to run in the specified AgentPool. |
static java.lang.String |
Copyright()
Gets the copyright statement of this class. |
java.util.Hashtable |
getAgentPools()
Gets the collection of AgentPool definitions as specified in the end-user's preference file. |
java.lang.String |
getCryptographyAlgorithm()
Gets the cryptography algorithm as defined in the end-user's preference file. |
java.lang.String |
getCryptographyProvider()
Gets the cryptography provider as specified in the end-user's preference file. |
java.util.Hashtable |
getPermittedAgents()
Gets a collection of all agents that are permitted to run on this platform. |
java.lang.String |
getPlatformName()
Gets the name of the platform as defined in the end-user's preference file. |
java.util.Hashtable |
getPrincipals()
Gets the collection of Kerberos principal definitions as specified in the end-user's preference file. |
java.lang.String |
getServiceFactoryClassName(java.lang.String theServiceAlias)
Gets the class name of the factory that can create the specified service. |
java.lang.String |
getServiceIpAddress(java.lang.String theServiceAlias)
Gets the configured IP address of where the specified service is to run. |
java.util.Hashtable |
getServiceList()
Gets the collection of service definitions as specified in the end-user's preference file. |
java.lang.String |
getServicePort(java.lang.String theServiceAlias)
Gets the configured port of where the specified service is to run. |
java.util.Vector |
getServices()
Gets the collection of service names (service types) as specified in the end-user's preference file; note that each service type must match exactly (except for case) the type as it is defined in the actual service. |
java.util.Hashtable |
getTrustLevels()
Gets the collection of trust level definitions as specified in the end-user's preference file. |
java.lang.String |
portOfLocalAgentPool()
Gets the port at which the current AgentPool runs. |
java.lang.String |
principalOfAgentPool(java.lang.String theAgentPoolAlias)
Gets the principal under which the specified AgentPool runs. |
java.lang.String |
principalOfLocalAgentPool()
Gets the principal under which the current AgentPool runs. |
java.lang.String |
principalOfService(java.lang.String theServiceAlias)
Gets the principal under which the specified service runs. |
void |
readPropertiesFile()
Loads up the current set of working preferences from a physical properties file. |
void |
setLocalAgentPool(java.lang.String theAgentPoolAlias)
Any Agent (or other code) introduced into the platform from a command line environment rather than by Agent Lifecycle Services must use this method (once; subsequent calls are ignored) to associate itself with a particular AgentPool and the AgentPool's principal. |
java.lang.String |
trustLevelOfPrincipal(java.lang.String thePrincipal)
Gets the configured trust level of the specified principal. |
void |
updatePreferenceVariablesAndWritePropertiesFile(AblePlatformPreferences theNewPreferences)
When security is off, changes all current working preferences to the values contained in the specified preferences object. |
void |
writePropertiesFile()
Saves the current set of working preferences to a physical properties file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TRUSTLEVEL_EQUAL_TO
compareTrustLevel(String,int,String)
public static final int TRUSTLEVEL_LESS_THAN
compareTrustLevel(String,int,String)
public static final int TRUSTLEVEL_LESS_THAN_OR_EQUAL_TO
compareTrustLevel(String,int,String)
public static final int TRUSTLEVEL_GREATER_THAN
compareTrustLevel(String,int,String)
public static final int TRUSTLEVEL_GREATER_THAN_OR_EQUAL_TO
compareTrustLevel(String,int,String)
public static final int TRUSTLEVEL_NOT_EQUAL_TO
compareTrustLevel(String,int,String)
Constructor Detail |
public AblePlatformPreferences()
This package's properties file is first looked for in the directory as specified by the system property contained in the variable Able.PropertiesFileDirectoryProperty and if the named property isn't set, then in the user's home directory. If there is no properties file in either location, a default properties file is created.
Method Detail |
public final void setLocalAgentPool(java.lang.String theAgentPoolAlias)
theAgentPoolAlias
- The alias of an AgentPool configured in the
platform preference file.public final java.lang.String getPlatformName()
AblePlatform.DefaultPlatformName
if no platform name has
been specified.public final java.lang.String getCryptographyAlgorithm()
DSA
if no algorithm has been
specified.public final java.lang.String getCryptographyProvider()
public final java.util.Hashtable getPrincipals()
Principal.n.Alias
) are the keys to the collection
and PrincipalEntry_
objects are elements of the
collection; if no principals are defined in the preference file,
the returned collection is empty.public final java.util.Hashtable getTrustLevels()
TrustLevel.n.Alias
) are the keys to the collection
and TrustLevelEntry_
objects are elements of the
collection; if no trust levels are defined in the preference
file, the returned collection is empty.public final java.util.Hashtable getAgentPools()
AgentPool.n.Alias
) are the keys to the collection
and AgentPoolEntry_
objects are elements of the
collection; if no agent pools are defined in the preference file,
the returned collection is empty.public final java.util.Vector getServices()
public final java.util.Hashtable getServiceList()
ServiceEntry_
objects are
elements of the collection; if no services are defined in the
preference file, the returned collection is empty.public final java.util.Hashtable getPermittedAgents()
Agent.n.Alias
) are the keys to the collection and
AbleAgentClassDescription
objects are the elements
of the collection; if no agents are defined in the preference
file, the return collection is empty.public void readPropertiesFile()
writePropertiesFile()
public void writePropertiesFile()
readPropertiesFile()
public void updatePreferenceVariablesAndWritePropertiesFile(AblePlatformPreferences theNewPreferences)
When security is on all calls to this method are ignored.
theNewPreferences
- A preferences object containing replacement values for
the current set of working preferences.
public final java.util.Vector configuredForAns(java.lang.String theAgentPoolAlias)
theAgentPoolAlias
- The alias of an AgentPool defined in the platform
preference file. This alias is normally obtained with
a call to configuredHostPort().
public final AblePlatformPreferences.AgentPoolEntry_ configuredHostPort(java.lang.String theHostName, java.lang.String theIpAddress, java.lang.String thePort)
theHostName
- The name of the system.
theIpAddress
- The system's IP address.
thePort
- The system's port number.
configuredServices(String)
call.
If no matching AgentPool definition is found,
null is returned.public final java.util.Vector configuredServices()
public final java.util.Vector configuredServices(java.lang.String theAgentPoolAlias)
theAgentPoolAlias
- The alias of an AgentPool defined in the platform
preference file. This alias is normally obtained with
a call to
configuredHostPort(String,String,String)
.
public final java.lang.String principalOfAgentPool(java.lang.String theAgentPoolAlias)
theAgentPoolAlias
- The alias of an AgentPool defined in the platform
preference file.
public final java.lang.String principalOfLocalAgentPool()
public final java.lang.String portOfLocalAgentPool()
public final java.lang.String principalOfService(java.lang.String theServiceAlias)
theServiceAlias
- The alias of a service defined in the platform
preference file. This alias is normally obtained with
a call to configuredServices(String)
.
public final java.lang.String getServiceFactoryClassName(java.lang.String theServiceAlias)
theServiceAlias
- The alias of a service defined in the platform
preference file.
public final java.lang.String getServiceIpAddress(java.lang.String theServiceAlias)
theServiceAlias
- The alias of a service defined in the platform
preference file.
public final java.lang.String getServicePort(java.lang.String theServiceAlias)
theServiceAlias
- The alias of a service defined in the platform
preference file.
public final java.lang.String trustLevelOfPrincipal(java.lang.String thePrincipal)
A principal is defined in the platform preference file, and then associated with a trust level, also defined in the file. Each principal may be at more than one trust level. Order of trust is assumed in the order that the trust levels are listed in the preferences file. The trust level of a principal will be the trust level that it appears in first, which will also be the hightest trust level that it is part of since order is implied.
thePrincipal
- A principal defined in the platform preference file.
public final boolean compareTrustLevel(java.lang.String theTrustLevelAlias1, int theComparison, java.lang.String theTrustLevelAlias2)
theTrustLevelAlias1
- The alias of the first trust level to compare.theComparison
- The type of comparison to perform between the two
specified trust levels. The specified value must be a
valid TRUSTLEVEL_nnn comparison operator.theTrustLevelAlias2
- The alias of the second trust level to compare.TRUSTLEVEL_EQUAL_TO
,
TRUSTLEVEL_LESS_THAN
,
TRUSTLEVEL_LESS_THAN_OR_EQUAL_TO
,
TRUSTLEVEL_GREATER_THAN
,
TRUSTLEVEL_GREATER_THAN_OR_EQUAL_TO
,
TRUSTLEVEL_NOT_EQUAL_TO
public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |