/** * Returns {@code Optional} with the {@link Constants#SERVER_WS_AGENT_HTTP_REFERENCE wsagent/http} * server. * * @return {@code Optional} with the {@link Constants#SERVER_WS_AGENT_HTTP_REFERENCE wsagent/http} * server if the current workspace has a runtime and there is a machine with such server, * otherwise an empty {@code Optional} */ public Optional<ServerImpl> getWsAgentHttpServer() { return getServerByRef(getWsAgentHttpServerReference()); }
/** * Checks whether the provided {@link MachineImpl} contains the {@link * Constants#SERVER_WS_AGENT_HTTP_REFERENCE wsagent/http} server. * * @param machine {@link MachineImpl} to check * @return {@code true} if the given machine contains the {@link * Constants#SERVER_WS_AGENT_HTTP_REFERENCE wsagent/http} server server, otherwise {@code * false} */ public boolean containsWsAgentHttpServer(MachineImpl machine) { return machine.getServers().keySet().contains(getWsAgentHttpServerReference()); }
private void checkServerStatus(ServerImpl server, MachineImpl machine) { if (server.getStatus() == RUNNING) { eventBus.fireEvent(new ServerRunningEvent(server.getName(), machine.getName())); String wsAgentHttpServerRef = wsAgentServerUtil.getWsAgentHttpServerReference(); // fire events for the often used servers if (wsAgentHttpServerRef.equals(server.getName())) { eventBus.fireEvent(new WsAgentServerRunningEvent(machine.getName())); } else if (SERVER_TERMINAL_REFERENCE.equals(server.getName())) { eventBus.fireEvent(new TerminalAgentServerRunningEvent(machine.getName())); } else if (SERVER_EXEC_AGENT_HTTP_REFERENCE.equals(server.getName())) { eventBus.fireEvent(new ExecAgentServerRunningEvent(machine.getName())); } } } }
String wsAgentHttpServerRef = wsAgentServerUtil.getWsAgentHttpServerReference();