yankeebushsoftware
asked on
What does this code snippet do in Java?
What does this code do? Can someone put some comments in it so I can understand it
public String getNodeAttribute(long nodeId, String attributeName) throws ManagementSupportException {
TEServiceStub.GetNodeAttri bute request = new TEServiceStub.GetNodeAttri bute();
request.setAttributeName(a ttributeNa me);
request.setNodeID(nodeId);
TEServiceStub.GetNodeAttri buteRespon se response = null;
try {
response = stub.getNodeAttribute(requ est);
} catch (RemoteException e) {
logger.warn("Fail to call TEService :" + e);
throw new ManagementSupportException ("Fail to call TEService :" + e);
}
if(!response.getStatus().g etSuccess( )) {
logger.warn("TEService return failure while call getNodeAttribute()");
throw new ManagementSupportException ("TEServic e return failure while call getNodeAttribute()");
}
return response.getAttributeValue ();
}
public String getNodeAttribute(long nodeId, String attributeName) throws ManagementSupportException
TEServiceStub.GetNodeAttri
request.setAttributeName(a
request.setNodeID(nodeId);
TEServiceStub.GetNodeAttri
try {
response = stub.getNodeAttribute(requ
} catch (RemoteException e) {
logger.warn("Fail to call TEService :" + e);
throw new ManagementSupportException
}
if(!response.getStatus().g
logger.warn("TEService return failure while call getNodeAttribute()");
throw new ManagementSupportException
}
return response.getAttributeValue
}
Looks like a code to call a web-service or something of that sort using a proxy. Difficult to tell without knowing what TEServiceStub and GetNodeAttribute are.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think this should have been a split - I was the first one to say it calls a web service method.