|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.sensorshell.usermap.UserMap
class UserMap
Gets hackystat information for a specific tool by parsing a predefined xml file located in the user's .hackystat/usermap directory. The file should be named 'UserMaps.xml'. It is important to keep in mind that this code is working client-side, not on the Hackystat server.
Instantiation of UserMap
will parse the assumed xml file and derive a mapping from
specific tool accounts for users to their Hackystat information.
Developers should not have to directly use this class at all. They should only have to interface
with the SensorShellMap
class which manages an instance of this class.
If the UserMap.xml file does not exist, an empty UserMap is returned.
The "tool" string is always compared in a case-insensitive fashion. The User, ToolAccount, Password, and Sensorbase are case-sensitive.
Nested Class Summary | |
---|---|
(package private) static class |
UserMap.UserMapKey
Keys in the user map used to access information. |
Constructor Summary | |
---|---|
UserMap()
Creates the user map and initializes the user mappings. |
|
UserMap(java.io.File userMapFile)
This constructor initializes the user mappings from a given file. |
Method Summary | |
---|---|
(package private) java.lang.String |
get(java.lang.String tool,
java.lang.String toolAccount,
UserMap.UserMapKey key)
Gets the value of the given UserMapKey associated with the given tool and
toolAccount, or null if not found. |
(package private) java.util.Set<java.lang.String> |
getToolAccounts(java.lang.String tool)
Returns the set of tool account names for the passed tool. |
(package private) java.lang.String |
getUserMapFile()
Returns the usermap.xml file path, which may or may not exist. |
(package private) boolean |
hasUser(java.lang.String tool,
java.lang.String toolAccount)
Returns true if there is a defined userKey for the given Tool and ToolAccount. |
void |
validateHackystatUsers(java.lang.String tool)
A method that will check all of the mappings associated with the given tool and throw an error if (a) any of the sensorbases could not be contacted, and/or (b) any of the users did not appear to be registered. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
UserMap() throws SensorShellMapException
SensorShellMapException
- Thrown if the UserMap.xml cannot be parsed.UserMap(java.io.File userMapFile) throws SensorShellMapException
userMapFile
- A UserMap.xml file.
SensorShellMapException
- Occurs if UserMap.xml is invalid.Method Detail |
---|
public void validateHackystatUsers(java.lang.String tool) throws SensorShellMapException
tool
- The tool of interest.
SensorShellMapException
- The exception thrown if any errors are discovered.java.lang.String get(java.lang.String tool, java.lang.String toolAccount, UserMap.UserMapKey key)
UserMapKey
associated with the given tool and
toolAccount, or null if not found.
tool
- The tool name. This is case-insensitive.toolAccount
- The tool account name. This is case-insensitive.key
- The USER, PASSWORD, or SENSORBASE key representing the desired value.
boolean hasUser(java.lang.String tool, java.lang.String toolAccount)
tool
- A Tool, such as "Jira".toolAccount
- A Tool account, such as "johnson".
java.lang.String getUserMapFile()
java.util.Set<java.lang.String> getToolAccounts(java.lang.String tool)
tool
- The tool of interest.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |