Package org.projectforge.rest.objects

Examples of org.projectforge.rest.objects.ServerInfo


    if (user == null) {
      log.error("No user given for rest call.");
      throw new IllegalArgumentException("No user given for the rest call: authenticate/getToken.");
    }
    final UserObject userObject = PFUserDOConverter.getUserObject(user);
    final ServerInfo info = new ServerInfo(AppVersion.VERSION.toString());
    info.setUser(userObject);
    Version clientVersion = null;
    if (clientVersionString != null) {
      clientVersion = new Version(clientVersionString);
    }
    if (clientVersion == null) {
      info.setStatus(ServerInfo.STATUS_UNKNOWN);
    } else if (clientVersion.compareTo(new Version("5.0")) < 0) {
      info.setStatus(ServerInfo.STATUS_CLIENT_TO_OLD);
    } else if (clientVersion.compareTo(AppVersion.VERSION) > 0) {
      info.setStatus(ServerInfo.STATUS_CLIENT_NEWER_THAN_SERVER);
    } else {
      info.setStatus(ServerInfo.STATUS_OK);
    }
    final String json = JsonUtils.toJson(info);
    return Response.ok(json).build();
  }
View Full Code Here

TOP

Related Classes of org.projectforge.rest.objects.ServerInfo

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.