Package org.jwebsocket.server

Examples of org.jwebsocket.server.TokenServer


          // collect some data to monitor
          Runtime lRT = Runtime.getRuntime();
          lToken.put("totalMem", lRT.totalMemory());
          lToken.put("freeMem", lRT.freeMemory());

          TokenServer lServer = getServer();
          lToken.put("clientCount", lServer.getAllConnectors().size());

          File lFile = new File(".");
          lToken.put("freeDisk", lFile.getFreeSpace());
          lToken.put("totalDisk", lFile.getTotalSpace());
          lToken.put("usableDisk", lFile.getUsableSpace());
View Full Code Here


      ServerConfiguration lServerConfig = new ServerConfig(
          "ts0", // id
          "org.jwebsocket.server.TokenServer", // name
          "-" // jar, needs to be in classpath, i.e. embedded in .jar'/manifest
          );
      mServer = new TokenServer(lServerConfig);

      // link server and engine
      mEngine.addServer(mServer);
      mServer.addEngine(mEngine);
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug("Checking incoming token from " + (aConnector != null ? aConnector.getId() : "[not given]")
          + ": " + aToken.toString() + "...");
    }

    TokenServer lServer = getServer();
    String lUsername = lServer.getUsername(aConnector);

    // TODO: very first security test, replace by user's locked state!
    if ("locked".equals(lUsername)) {
      Token lToken = lServer.createAccessDenied(aToken);
      lServer.sendToken(aConnector, lToken);
      aResponse.rejectMessage();
      return;
    }
  }
View Full Code Here

    if (log.isDebugEnabled()) {
      log.debug("Checking incoming token from " + (aConnector != null ? aConnector.getId() : "[not given]")
          + ": " + aToken.toString() + "...");
    }

    TokenServer lServer = getServer();
    String lUsername = lServer.getUsername(aConnector);

    // TODO: very first security test, replace by user's locked state!
    if( "locked".equals(lUsername) ) {
      Token lToken = lServer.createAccessDenied(aToken);
      lServer.sendToken(aConnector, lToken);
      aResponse.rejectMessage();
      return;
    }
  }
View Full Code Here

  @Override
  public void init() {
    log = Logging.getLogger(WebSocketDemo.class);
    log.info("Adding servlet '" + getClass().getSimpleName() + "' to WebSocket listeners...");
    TokenServer lServer = (TokenServer) JWebSocketFactory.getServer("ts0");
    if (lServer != null) {
      lServer.addListener(this);
    }
  }
View Full Code Here

TOP

Related Classes of org.jwebsocket.server.TokenServer

Copyright © 2018 www.massapicom. 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.