2728293031323334353637
// get the status of NeuroServer StatusReply statusReply = agent.getStatus(); // get the header of client 0 HeaderReply headerReply = agent.getHeader(0); // get the role of this agent RoleReply roleReply = agent.getRole(); // start watching client 0
119120121122123124125126127128129
} } private void parseHeader(String line) { if (reply == null) { reply = new HeaderReply(); if (line.startsWith("200")) { reply.setResponseCode(ResponseCode.OK); } else if (line.startsWith("400")) { reply.setResponseCode(ResponseCode.ERROR);
31323334353637383940
} public Reply setHeader(NeuroServerHeader header) { if(!header.isValid()) { System.err.println(String.format("Header not valid.")); return new HeaderReply(ResponseCode.ERROR, null); } return executeCommand(Command.SET_HEADER, header.getData()); }