How to determine to which server I am connected in wsadmin?
I found the following code in JYTHON and JACL to do this..I wanted to know how to code a corresponding Java version of the same ...Please read my comments after the two code snippets..

wsadminSvr =
AdminControl.queryNames("node="+AdminControl.getNode( )+",type=Server,*" )
wsadminSvrId = AdminControl.getConfigId(wsadminSvr )
wsadminType = AdminConfig.showAttribute(wsadminSvrId, "serverType" )
wsadminVers = AdminControl.getAttribute(wsadminSvr, "platformVersion" )
wsadminConn = AdminControl.getType( )
wsadminServer = AdminControl.getAttribute(wsadminSvr, "name" )
wsadminNode = AdminControl.getNode( )
wsadminCell = AdminControl.getCell( )
wsadminHost = AdminControl.getHost( )
wsadminPort = AdminControl.getPort( )

set wsadminSvr [$AdminControl queryNames node=[$AdminControl
getNode],type=Server,* ]
set wsadminSvrId [$AdminControl getConfigId $wsadminSvr]
set wsadminType [$AdminConfig showAttribute $wsadminSvrId serverType]
set wsadminVers [$AdminControl getAttribute $wsadminSvr
set wsadminConn [$AdminControl getType]
set wsadminServer [$AdminControl getAttribute $wsadminSvr name]
set wsadminNode [$AdminControl getNode]
set wsadminCell [$AdminControl getCell]
set wsadminHost [$AdminControl getHost]
set wsadminPort [$AdminControl getPort]

wsadminServer will contain "dmgr" or whatever your server name is.


This snippet traverses all the servers on the server node..but does not tell me which server I am currently connected to. (I have attached the actual file which has the entire code, for it for reference) on = new"WebSphere:*");
Set objectNameSet= ac.queryNames(on, null);
// you can check properties like type, name, and process to find a specified ObjectName After you get all the ObjectNames, you can use the following example code to get all the node names:
HashSet nodeSet = new HashSet();
for(Iterator i = objectNameSet.iterator(); i.hasNext(); on =
(ObjectName) {
String type = on.getKeyProperty("type");
if(type != null && type.equals("Server")) {


I am assuming the AdminControl class in JACL/JYTHON is equivalent to the AdminClient class in I correct in assuming this??

If so for some reason I CANNOT find the equivalent function AdminControl.getNode( ) thats available in JACL/JYTHON...the AdminControl class dosnt seem to have this function...consequently I am not sure how I get the equivaalent Java code for the first line in the JACL/JYTHON version..

wsadminSvr =
AdminControl.queryNames("node="+AdminControl.getNode( )+",type=Server,*" )

Can some please help..I would appreciate any input..