String loginName = cmd.getUserNameLevel();
if (loginName == null || loginName.length() < 1 || loginName.startsWith("?"))
throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' with '" + loginName + "' is invalid");
I_AdminSubject subjectInfo = glob.getAuthenticate().getSubjectInfoByName(new SessionName(glob, loginName));
if (subjectInfo == null)
throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid client name in '" + cmd.getCommand() + "' client '" + loginName + "' is unknown");
String pubSessionId = cmd.getSessionIdLevel();
if (pubSessionId == null || pubSessionId.length() < 1)
throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid public session ID in '" + cmd.getCommand() + "'.");
if (pubSessionId.startsWith("?")) {
// for example "/node/heron/joe/?uptime"
/*String ret = ""+*/setInvoke(cmd.getKey(), subjectInfo, I_AdminSubject.class, cmd.getArgs());
log.info("Set " + cmd.getCommandStripAssign() + "=" + cmd.getArgsString());
return cmd.getArgsString();
}
String sessionAttr = cmd.getSessionAttrLevel();
if (sessionAttr == null || sessionAttr.length() < 1 || sessionAttr.startsWith("?")==false)
throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "Please pass a command which has a valid session attribute in '" + cmd.getCommand() + "'.");
if (sessionAttr.startsWith("?")) {
// for example "client/joe/ses17/?queue/callback/maxEntries"
I_AdminSession sessionInfo = subjectInfo.getSessionByPubSessionId(Long.parseLong(pubSessionId));
if (sessionInfo == null)
throw new XmlBlasterException(glob, ErrorCode.USER_ILLEGALARGUMENT, ME, "The public session ID '" + pubSessionId + "' in '" + cmd.getCommand() + "' is unknown.");
/*String ret = ""+*/setInvoke(cmd.getKey(), sessionInfo, I_AdminSession.class, cmd.getArgs());
log.info("Set " + cmd.getCommandStripAssign() + "=" + cmd.getArgsString());
return cmd.getArgsString();