Package org.structr.websocket

Examples of org.structr.websocket.StructrWebSocket


      final App app    = StructrApp.getInstance();
      try (final Tx tx = app.tx()) {

        final List<SyncableInfo> syncables = CloudService.doRemote(new SingleTransmission<>(new ListSyncables(type), username, password, host, port.intValue()), new WebsocketProgressListener(getWebSocket(), key));
        final StructrWebSocket webSocket   = getWebSocket();
        if (syncables != null) {

          final List<GraphObject> result = new LinkedList<>();
          for (final SyncableInfo info : syncables) {

            final GraphObjectMap map = new GraphObjectMap();
            map.put(GraphObject.id,               info.getId());
            map.put(NodeInterface.name,           info.getName());
            map.put(File.size,                    info.getSize());
            map.put(GraphObject.type,             info.getType());
            map.put(GraphObject.lastModifiedDate, info.getLastModified());

            // check for existance
            map.put(isSynchronized, isSynchronized(info));

            result.add(map);
          }

          webSocketData.setResult(result);
          webSocket.send(webSocketData, true);
        }

      } catch (FrameworkException fex) {

        getWebSocket().send(MessageBuilder.status().code(400).message(fex.getMessage()).build(), true);
View Full Code Here


    if ((username != null) && (password != null)) {

      try {

        StructrWebSocket socket = this.getWebSocket();
        Authenticator auth = socket.getAuthenticator();

        user = auth.doLogin(socket.getRequest(), username, password);

        if (user != null) {

          final String sessionId = webSocketData.getSessionId();
          if (sessionId == null) {
View Full Code Here

TOP

Related Classes of org.structr.websocket.StructrWebSocket

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.