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..
------------------------------------------------------------------------------

IN JYTHON:
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( )

IN JACL:
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
platformVersion]
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.

------------------------------------------------------------------------------
IN JAX:

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)

javax.management.ObjectName on = new javax.management.ObjectName("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)i.next()) {
String type = on.getKeyProperty("type");
if(type != null && type.equals("Server")) {
nodeSet.add(servers[i].getKeyProperty("node"));
}
}


--------------------------------------------------------------------------------

I am assuming the AdminControl class in JACL/JYTHON is equivalent to the AdminClient class in com.ibm.websphere.management package...am 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..

Thanks
Jay