this.parent = parent;
}
public void run() {
try {
ListInvokersResponse listInvokersResponse = this.parent.getHPIClientProtocol().listInvokers(this.parent.getLoginResponse().getSessionId());
if (listInvokersResponse.getStatus().equals(Response.Status.SUCCESS)) {
int listSize = listInvokersResponse.getListInvokers().size();
String[] idsInvokers = null;
if (listSize == 0) {
idsInvokers = new String[]{"The server has not found no invoker."};
} else {
idsInvokers = new String[listSize];
for (int i = 0; i < listSize; i++) {
Invoker invoker = (Invoker) listInvokersResponse.getListInvokers().elementAt(i);
idsInvokers[i] = invoker.getId();
}
}
Image[] imageArray = null;
this.cmdBack = new Command("Back", Command.EXIT, 2);
this.cmdConsultInvoker = new Command("Consult Invoker", Command.ITEM, 1);
this.list = new List("List Invokers", Choice.IMPLICIT, idsInvokers, imageArray);
this.list.setCommandListener(this);
this.list.addCommand(this.cmdBack);
this.list.addCommand(this.cmdConsultInvoker);
this.getDisplay().setCurrent(this.list);
} else {
throw new RuntimeException(listInvokersResponse.getMessage());
}
} catch (Exception e) {
HPIUiAlert.show("Server Message", e.getMessage(), "Done", this.parent.getForm());
}
}