Examples of ServerStatus


Examples of net.sf.l2j.gameserver.gameserverpackets.ServerStatus

   * @param id
   * @param value
   */
  public void sendServerStatus(int id, int value)
  {
    ServerStatus ss = new ServerStatus();
    ss.addAttribute(id,value);
    try
    {
      sendPacket(ss);
    }
    catch (IOException e)
View Full Code Here

Examples of net.sf.l2j.gameserver.gameserverpackets.ServerStatus

            AuthResponse aresp = new AuthResponse(decrypt);
            _serverID = aresp.getServerId();
            _serverName = aresp.getServerName();
            Config.saveHexid(_serverID, hexToString(_hexID));
            _log.info("Registered on login as Server "+_serverID+" : "+_serverName);
            ServerStatus st = new ServerStatus();
            if(Config.SERVER_LIST_BRACKET)
            {
              st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET,ServerStatus.ON);
            }
            else
            {
              st.addAttribute(ServerStatus.SERVER_LIST_SQUARE_BRACKET,ServerStatus.OFF);
            }
            if(Config.SERVER_LIST_CLOCK)
            {
              st.addAttribute(ServerStatus.SERVER_LIST_CLOCK,ServerStatus.ON);
            }
            else
            {
              st.addAttribute(ServerStatus.SERVER_LIST_CLOCK,ServerStatus.OFF);
            }
            if(Config.SERVER_LIST_TESTSERVER)
            {
              st.addAttribute(ServerStatus.TEST_SERVER,ServerStatus.ON);
            }
            else
            {
              st.addAttribute(ServerStatus.TEST_SERVER,ServerStatus.OFF);
            }
            if(Config.SERVER_GMONLY)
            {
              st.addAttribute(ServerStatus.SERVER_LIST_STATUS,ServerStatus.STATUS_GM_ONLY);
            }
            else
            {
              st.addAttribute(ServerStatus.SERVER_LIST_STATUS,ServerStatus.STATUS_AUTO);
            }
            sendPacket(st);
            if(L2World.getInstance().getAllPlayersCount() > 0)
            {
              FastList<String> playerList = new FastList<String>();
View Full Code Here

Examples of net.sf.l2j.loginserver.gameserverpackets.ServerStatus

    {
      if (Config.DEBUG)
      {
        _log.info("ServerStatus received");
      }
      @SuppressWarnings("unused")
      ServerStatus ss = new ServerStatus(data,getServerId()); //will do the actions by itself
    }
    else
    {
      forceClose(LoginServerFail.NOT_AUTHED);
    }
View Full Code Here

Examples of org.eclipse.orion.server.core.ServerStatus

      fetch(remotesArray.getJSONObject(1).getString(ProtocolConstants.KEY_LOCATION));

      // secondary
      request = getGetRequest(remotesArray.getJSONObject(1).getString(ProtocolConstants.KEY_LOCATION));
      response = webConversation.getResponse(request);
      ServerStatus status = waitForTask(response);
      assertTrue(status.toString(), status.isOK());
      JSONObject remote = status.getJsonData();

      // checkout remote branch: secondary/branch
      String remoteBranchName = remote.getJSONArray(ProtocolConstants.KEY_CHILDREN).getJSONObject(0).getString(ProtocolConstants.KEY_NAME);
      if (!remoteBranchName.equals("secondary/branch"))
        remoteBranchName = remote.getJSONArray(ProtocolConstants.KEY_CHILDREN).getJSONObject(1).getString(ProtocolConstants.KEY_NAME);
      assertEquals("secondary/branch", remoteBranchName);
      response = branch(branchesLocation, "branch", remoteBranchName);
      JSONObject branch = new JSONObject(response.getText());
      JSONArray remoteBranchLocations = branch.getJSONArray(GitConstants.KEY_REMOTE);
      assertEquals(1, remoteBranchLocations.length());
      assertEquals("secondary", remoteBranchLocations.getJSONObject(0).getString(ProtocolConstants.KEY_NAME));
      assertEquals("secondary/branch", remoteBranchLocations.getJSONObject(0).getJSONArray(ProtocolConstants.KEY_CHILDREN).getJSONObject(0).getString(ProtocolConstants.KEY_NAME));

      // origin
      request = getGetRequest(remotesArray.getJSONObject(0).getString(ProtocolConstants.KEY_LOCATION));
      response = webConversation.getResponse(request);
      status = waitForTask(response);
      assertTrue(status.toString(), status.isOK());
      remote = status.getJsonData();

      // checkout remote branch: origin/test
      JSONArray remoteChildren = remote.getJSONArray(ProtocolConstants.KEY_CHILDREN);
      assertEquals(2, remoteChildren.length());
      remoteBranchName = remoteChildren.getJSONObject(0).getString(ProtocolConstants.KEY_NAME);
View Full Code Here

Examples of org.graylog2.plugin.ServerStatus

        // Do not use a PID file if the user requested not to
        if (!commandLineArguments.isNoPidFile()) {
            savePidFile(commandLineArguments.getPidFile());
        }

        final ServerStatus serverStatus = injector.getInstance(ServerStatus.class);
        serverStatus.initialize();

        // register node by initiating first ping. if the node isn't registered, loading persisted inputs will fail silently, for example
        Ping.Pinger pinger = injector.getInstance(Ping.Pinger.class);
        pinger.ping();
View Full Code Here

Examples of org.graylog2.plugin.ServerStatus

        if (!commandLineArguments.isNoPidFile()) {
            savePidFile(commandLineArguments.getPidFile());
        }

        // Le server object. This is where all the magic happens.
        final ServerStatus serverStatus = injector.getInstance(ServerStatus.class);
        serverStatus.initialize();

        ActivityWriter activityWriter = null;
        ServiceManager serviceManager = null;
        try {
            activityWriter = injector.getInstance(ActivityWriter.class);
            serviceManager = injector.getInstance(ServiceManager.class);
        } catch (ProvisionException e) {
            for (Message message : e.getErrorMessages()) {
                if (message.getCause() instanceof MongoException) {
                    LOG.error(UI.wallString("Unable to connect to MongoDB. Is it running and the configuration correct?"));
                    System.exit(-1);
                }
            }

            LOG.error("Guice error", e);
            System.exit(-1);
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
            System.exit(-1);
        }

        final ActivityWriter finalActivityWriter = activityWriter;
        final ServiceManager finalServiceManager = serviceManager;
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                String msg = "SIGNAL received. Shutting down.";
                LOG.info(msg);
                finalActivityWriter.write(new Activity(msg, Main.class));

                GracefulShutdown shutdown = injector.getInstance(GracefulShutdown.class);
                shutdown.runWithoutExit();
                finalServiceManager.stopAsync().awaitStopped();
            }
        });

        // Register this node.
        final NodeService nodeService = injector.getInstance(NodeService.class);
        nodeService.registerServer(serverStatus.getNodeId().toString(), configuration.isMaster(), configuration.getRestTransportUri());

        if (configuration.isMaster() && !nodeService.isOnlyMaster(serverStatus.getNodeId())) {
            LOG.warn("Detected another master in the cluster. Retrying in {} seconds to make sure it is not "
                    + "an old stale instance.", configuration.getStaleMasterTimeout());
            try {
                Thread.sleep(configuration.getStaleMasterTimeout());
            } catch (InterruptedException e) { /* nope */ }
           
            if (!nodeService.isOnlyMaster(serverStatus.getNodeId())) {
                // All devils here.
                String what = "Detected other master node in the cluster! Starting as non-master! "
                        + "This is a mis-configuration you should fix.";
                LOG.warn(what);
                activityWriter.write(new Activity(what, Main.class));

                // Write a notification.
                final NotificationService notificationService = injector.getInstance(NotificationService.class);
                Notification notification = notificationService.buildNow()
                        .addType(Notification.Type.MULTI_MASTER)
                        .addSeverity(Notification.Severity.URGENT);
                notificationService.publishIfFirst(notification);

                configuration.setIsMaster(false);
            } else {
                LOG.warn("Stale master has gone. Starting as master.");
            }
        }
       
        // Enable local mode?
        if (commandLineArguments.isLocal() || commandLineArguments.isDebug()) {
            // In local mode, systemstats are sent to localhost for example.
            LOG.info("Running in local mode");
            serverStatus.setLocalMode(true);
        }

        // Are we in stats mode?
        if (commandLineArguments.isStats()) {
            LOG.info("Printing system utilization information.");
            serverStatus.setStatsMode(true);
        }


        if (!commandLineArguments.performRetention()) {
            configuration.setPerformRetention(false);
View Full Code Here

Examples of org.hoteia.qalingo.core.domain.ServerStatus

                String valueJMSMessage = tm.getText();
               
                if(StringUtils.isNotEmpty(valueJMSMessage)){
                    final SyncServeurMessageJms syncServeurMessageJms = xmlMapper.getXmlMapper().readValue(valueJMSMessage, SyncServeurMessageJms.class);
                   
                    ServerStatus serverStatus = new ServerStatus();
                    serverStatus.setLastCheckReceived(new Date());
                    serverStatus.setServerName(syncServeurMessageJms.getServerName());
                    serverStatus.setServerIp(syncServeurMessageJms.getServerIp());
                   
                    serverService.saveOrUpdateServerStatus(serverStatus, valueJMSMessage);
                   
                    if (logger.isDebugEnabled()) {
                        logger.debug("Processed message, value: " + valueJMSMessage);
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.ServerStatus

    private boolean stopServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STARTED);
        if (server != null) {
            System.out.println("\nStopping server " + server.getServerName() + "\n");
            ServerStatus status = client.stopServer(server.getHostName(), server.getServerName(), -1, TimeUnit.SECONDS);
            System.out.println("Stop executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.ServerStatus

    private boolean startServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STOPPED, ServerStatus.DISABLED);
        if (server != null) {
            System.out.println("\nStarting server " + server.getServerName() + "\n");
            ServerStatus status = client.startServer(server.getHostName(), server.getServerName());
            System.out.println("Start executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.domain.ServerStatus

    private boolean restartServer() throws Exception {
        ServerIdentity server = chooseServer(ServerStatus.STARTED);
        if (server != null) {
            System.out.println("\nRestarting server " + server.getServerName() + "\n");
            ServerStatus status = client.restartServer(server.getHostName(), server.getServerName(), -1, TimeUnit.SECONDS);
            System.out.println("Restart executed. Server status is " + status);
        }
        return continuePrompt();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.