xmlBlaster 2.2.0 API

org.xmlBlaster.engine.admin
Class CommandWrapper

java.lang.Object
  extended by org.xmlBlaster.engine.admin.CommandWrapper

public final class CommandWrapper
extends java.lang.Object

Holds the command partially preparsed, this is an immutable object.

Examples what we need to parse:

   /node/heron/?freeMem
   /node/heron/sysprop/?java.vm.version
   /node/heron/client/joe/ses17/?queue/callback/maxEntries
 

See the command requirement for a detailed description.

Since:
0.79f
Author:
xmlBlaster@marcelruff.info
See Also:
CommandWrapperTest

Field Summary
(package private)  java.lang.String[] args
          "sysprop/?call[auth]=true" this is "true" for "sysprop/?setSomtthing=true&17" it is "true", "17"
private  java.lang.String argsString
          "true&17"
(package private)  java.lang.String clusterNodeId
          The second level -> "heron"
private  java.lang.String cmd
          The original command (modified to be absolute)
(package private)  java.lang.String fifth
          The fifth level -> "client/joe/17" or "client/joe/session/17" or "client/joe/?maxSessions"
(package private)  java.lang.String fourth
          The fourth level -> "client/joe"
private  ServerScope glob
           
(package private)  java.lang.String key
          "sysprop/?call[auth]=true" this is "call[auth]"
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  java.lang.String myStrippedClusterNodeId
           
(package private)  java.lang.String root
          The first level -> "node"
(package private)  java.lang.String sixth
          The sixth level -> "client/joe/ses17/?queue/callback/maxEntries"
(package private)  java.lang.String tail
          The rest of the command -> "?java.vm.version"
(package private)  java.lang.String third
          The third level -> "?freeMem" or "sysprop" or "client" or "topic"
 
Constructor Summary
CommandWrapper(ServerScope glob, java.lang.String command)
          this constructor is currently used for the get
 
Method Summary
 java.lang.String[] getArgs()
           
 java.lang.String getArgsString()
           
 java.lang.String getClusterNodeId()
          /node/heron/client/joe/ses17/?queue/callback/maxEntries
 java.lang.String getCommand()
           
 java.lang.String getCommandStripAssign()
           
 java.lang.String getFifthLevel()
          /node/heron/client/joe/ses17/?queue/callback/maxEntries
 java.lang.String getKey()
           
 java.lang.String getRoot()
          /node/heron/client/joe/ses17/?callback/queue/maxEntries
 java.lang.String getSessionAttrLevel()
          /node/heron/client/joe/ses17/?callback/queue/maxEntries
 java.lang.String getSessionIdLevel()
          /node/heron/client/joe/ses17/?queue/callback/maxEntries
 java.lang.String getStrippedClusterNodeId()
          Returns the cluster node id with removed "/" chars (if any where there).
 java.lang.String getTail()
           
 java.lang.String getThirdLevel()
          /node/heron/client/joe/ses17/?queue/callback/maxEntries
 java.lang.String getUserNameLevel()
           /node/heron/client/joe/ses17/?queue/callback/maxEntries /node/heron/topic/?hello
private  void parse()
           
private  void parseKeyValue()
          set client/publish/1/?addRemoteProperty=arg1&arg2
 void setArgs(java.lang.String[] args)
           
static java.lang.String stripCommand(ServerScope glob, java.lang.String command)
          Strips a given command (the oid of a queryKey before any any modification) by removing the starting '__cmd:' subtring.
 java.lang.String toXml()
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private final java.lang.String ME

glob

private final ServerScope glob

log

private static java.util.logging.Logger log

cmd

private final java.lang.String cmd
The original command (modified to be absolute)


myStrippedClusterNodeId

private final java.lang.String myStrippedClusterNodeId

root

java.lang.String root
The first level -> "node"


clusterNodeId

java.lang.String clusterNodeId
The second level -> "heron"


third

java.lang.String third
The third level -> "?freeMem" or "sysprop" or "client" or "topic"


fourth

java.lang.String fourth
The fourth level -> "client/joe"


fifth

java.lang.String fifth
The fifth level -> "client/joe/17" or "client/joe/session/17" or "client/joe/?maxSessions"


sixth

java.lang.String sixth
The sixth level -> "client/joe/ses17/?queue/callback/maxEntries"


tail

java.lang.String tail
The rest of the command -> "?java.vm.version"


key

java.lang.String key
"sysprop/?call[auth]=true" this is "call[auth]"


args

java.lang.String[] args
"sysprop/?call[auth]=true" this is "true" for "sysprop/?setSomtthing=true&17" it is "true", "17"


argsString

private java.lang.String argsString
"true&17"

Constructor Detail

CommandWrapper

public CommandWrapper(ServerScope glob,
                      java.lang.String command)
               throws XmlBlasterException
this constructor is currently used for the get

Parameters:
glob -
command - the oid must be adjusted inside if the qosData is null.
Throws:
XmlBlasterException
Method Detail

parse

private void parse()
            throws XmlBlasterException
Throws:
XmlBlasterException

getStrippedClusterNodeId

public final java.lang.String getStrippedClusterNodeId()
Returns the cluster node id with removed "/" chars (if any where there).

Returns:
"http:myserver:3412" instead of "http://myserver:3412", names like "heron.mycomp.com" are untouched

getRoot

public final java.lang.String getRoot()
/node/heron/client/joe/ses17/?callback/queue/maxEntries

Returns:
"node"

getClusterNodeId

public final java.lang.String getClusterNodeId()
/node/heron/client/joe/ses17/?queue/callback/maxEntries

Returns:
e.g. "heron"

getThirdLevel

public final java.lang.String getThirdLevel()
/node/heron/client/joe/ses17/?queue/callback/maxEntries

Returns:
The third level of a command like "client", "sysprop", "topic", "?uptime"

getUserNameLevel

public final java.lang.String getUserNameLevel()
 /node/heron/client/joe/ses17/?queue/callback/maxEntries
 /node/heron/topic/?hello
 

Returns:
"joe" or "?hello" in the above example

getSessionIdLevel

public final java.lang.String getSessionIdLevel()
/node/heron/client/joe/ses17/?queue/callback/maxEntries

Returns:
"ses17" in the above example

getFifthLevel

public final java.lang.String getFifthLevel()
/node/heron/client/joe/ses17/?queue/callback/maxEntries

Returns:
"ses17" in the above example

getSessionAttrLevel

public final java.lang.String getSessionAttrLevel()
/node/heron/client/joe/ses17/?callback/queue/maxEntries

Returns:
"?queue/callback/maxEntries" in the above example

getTail

public final java.lang.String getTail()
Returns:
The fourth level and deeper, e.g. "?java.vm.version", "joe/?sessionList" or null

getArgs

public final java.lang.String[] getArgs()
                                 throws XmlBlasterException
Returns:
If set() is invoked the value behind the "=" "sysprop/?trace[core]=true" would return 'true' Lenght is guaranteed to be >= 1
Throws:
XmlBlasterException - if no value found

getKey

public final java.lang.String getKey()
                              throws XmlBlasterException
Returns:
If set() is invoked the value before the "=" "sysprop/?trace[core]=true" would return 'trace[core]'
Throws:
XmlBlasterException - if no value found

parseKeyValue

private void parseKeyValue()
                    throws XmlBlasterException
set client/publish/1/?addRemoteProperty=arg1&arg2

Throws:
XmlBlasterException

getCommand

public final java.lang.String getCommand()
Returns:
The original command, with added absolute path if the original was relative, e.g. /node/heron/?runlevel

getCommandStripAssign

public final java.lang.String getCommandStripAssign()
                                             throws XmlBlasterException
Returns:
The original command, with added absolute path if the original was relative and stripped "=bla" at the end.
Throws:
XmlBlasterException

toXml

public final java.lang.String toXml()
Dump state of this object into a XML ASCII string.


toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Parameters:
extraOffset - indenting of tags for nice output

stripCommand

public static java.lang.String stripCommand(ServerScope glob,
                                            java.lang.String command)
                                     throws XmlBlasterException
Strips a given command (the oid of a queryKey before any any modification) by removing the starting '__cmd:' subtring. So for example the input string '__cmd:/node/heron/?numClients' will be stripped to '/node/heron/?numClients'.

Parameters:
glob -
command - the input string (the original oid) to be stripped.
Returns:
Throws:
XmlBlasterException

getArgsString

public java.lang.String getArgsString()
Returns:
Returns the argsString.

setArgs

public void setArgs(java.lang.String[] args)
Parameters:
argsString - The argsString to set.

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.