|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensorshell.usermap.SensorShellMap
public class SensorShellMap
Allows for lazy instantiation of SensorShells for user tool accounts. This class abstracts the use of the UserMap class so that sensors for applicable tool sensors won't have to manage it.
The SensorShellMap
is meant to only derive SensorShells for a specific tool.
Queries for SensorShells are done by giving an account name to the getUserShell
method. This account name must be specific to the tool of the SensorShellMap
instance.
Note that the "tool" name is used in a case-insensitive fashion.
Constructor Summary | |
---|---|
SensorShellMap(java.lang.String tool)
Instantiate this class which initializes the UserMap used to get SensorShells for users and also sets the Hackystat host for the SensorShells. |
|
SensorShellMap(java.lang.String tool,
java.io.File userMapFile)
A package private constructor meant to be used only by Junit test cases. |
Method Summary | |
---|---|
java.util.Set<java.lang.String> |
getToolAccounts(java.lang.String tool)
Returns the set of tool account names associated with this tool in the usermaps file. |
java.lang.String |
getUserMapFile()
Returns the UserMap file name associated with this SensorShellMap. |
SensorShell |
getUserShell(java.lang.String toolAccount)
Gets the SensorShell instance for a Hackystat user with an account for the given tool. |
SensorShell |
getUserShell(java.lang.String toolAccount,
java.util.Properties properties)
Gets the SensorShell instance for a Hackystat user with an account for the given tool. |
boolean |
hasUserShell(java.lang.String toolAccount)
Returns true if toolAccount is known so that a corresponding SensorShell can be retrieved. |
void |
validateHackystatInfo(java.lang.String tool)
Validates the hackystat user, password, and sensorbase associated with tool. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SensorShellMap(java.lang.String tool) throws SensorShellMapException
tool
- The specific tool that this SensorShellMap will provide SensorShells for.
SensorShellMapException
- Indicates that the usermaps.xml file is not found.public SensorShellMap(java.lang.String tool, java.io.File userMapFile) throws SensorShellMapException
tool
- The specific tool that this SensorShellMap will provide SensorShells for.userMapFile
- The UserMap.xml file.
SensorShellMapException
- Indicates that the UserMap.xml file is not found.Method Detail |
---|
public boolean hasUserShell(java.lang.String toolAccount)
toolAccount
- The toolAccount for the tool in this instance, such as "johnson".
public java.util.Set<java.lang.String> getToolAccounts(java.lang.String tool)
tool
- The tool of interest.
public java.lang.String getUserMapFile()
public void validateHackystatInfo(java.lang.String tool) throws SensorShellMapException
tool
- The tool of interest.
SensorShellMapException
- Thrown if user map info cannot be validated.public SensorShell getUserShell(java.lang.String toolAccount) throws SensorShellMapException
toolAccount
- The name of the account for the given tool. This is not the same as the
Hackystat account name although it may be the same.
SensorShellMapException
- When the user account and/or tool is undefined.public SensorShell getUserShell(java.lang.String toolAccount, java.util.Properties properties) throws SensorShellMapException
toolAccount
- The name of the account for the given tool. This is not the same as the
Hackystat account name although it may be the same.properties
- A properties instance holding SensorShell properties to be used to
initialize the underlying SensorShell if it requires instantiation. If null, then no
additional properties are required.
SensorShellMapException
- When the user account and/or tool is undefined.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |