return keybuf.toString();
}
private ProfileLocator stringToLocator(String locstr) throws Exception
{
ProfileLocator locator = Profiler.createLocator();
String entity = null;
if (logger.isDebugEnabled())
logger.debug("DatabasePsmlManagerService: Creating locator for string: " + locstr);
StringTokenizer dollarTokens = new StringTokenizer(locstr, "$");
while (dollarTokens.hasMoreTokens())
{
String dollarToken = dollarTokens.nextToken().trim();
StringTokenizer colonTokens = new StringTokenizer(dollarToken, ":");
String colonToken = colonTokens.nextToken();
if (colonToken.equals("User"))
{
entity = colonTokens.nextToken().trim();
locator.setUser(JetspeedSecurity.getUser(entity));
}
else if (colonToken.equals("Group"))
{
entity = colonTokens.nextToken().trim();
locator.setGroup(JetspeedSecurity.getGroup(entity));
}
else if (colonToken.equals("Role"))
{
entity = colonTokens.nextToken().trim();
locator.setRole(JetspeedSecurity.getRole(entity));
}
else if (colonToken.equals("Page"))
{
entity = colonTokens.nextToken().trim();
locator.setName(entity);
}
else if (colonToken.equals("MediaType"))
{
entity = colonTokens.nextToken().trim();
locator.setMediaType(entity);
}
else if (colonToken.equals("Country"))
{
entity = colonTokens.nextToken().trim();
locator.setCountry(entity);
}
else if (colonToken.equals("Language"))
{
entity = colonTokens.nextToken().trim();
locator.setLanguage(entity);
}
}
if (logger.isDebugEnabled())
logger.debug("DatabasePsmlManagerService: Returning locator for string: " + locatorToString(locator));