Package org.fluxtream.core.mvc.models

Examples of org.fluxtream.core.mvc.models.StatusModel


            if (!accessAllowed&&coachee==null){
                uid = null;
            }
            return bodyTrackHelper.fetchTile(uid, deviceNickname, channelName, level, offset);
        } catch (Exception e){
            return gson.toJson(new StatusModel(false, "Access Denied"));
        }
    }
View Full Code Here


                uid = null;
            }
            return bodyTrackHelper.listViews(uid);
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

            if (!accessAllowed && coachee==null) {
                uid = null;
            }
            String result = bodyTrackHelper.getView(uid,id);
            return result == null ? gson.toJson(new StatusModel(false,"Failed to get view")) : result;
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

                uid = null;
            }
            return bodyTrackHelper.saveView(uid, name, data);
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

                uid = null;
            }
            return bodyTrackHelper.listSources(uid, coachee);
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

                uid = null;
            }
            return bodyTrackHelper.getSourceInfo(uid, name);
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

    @Produces({ MediaType.APPLICATION_JSON })
    public Response incrementCounter(@PathParam("messageName") String messageName) {
        final long guestId = AuthHelper.getGuestId();
        try {
            final int count = settingsService.incrementDisplayCounter(guestId, messageName);
            StatusModel status = new StatusModel(true, String.format("incremented message '%s' to %s", messageName, count));
            status.payload = count;
            return Response.ok(status).build();
        }
        catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

            Guest guest = AuthHelper.getGuest();

            if (currentPassword!=null) {
                boolean passwordMatched = guestService.checkPassword(guest.getId(), currentPassword);
                if (!passwordMatched) {
                    return Response.ok(gson.toJson(new StatusModel(false, "Wrong Password"))).build();
                }
            }

            if (password1.length()==0 || password2.length()==0)
                return Response.ok(gson.toJson(new StatusModel(false, "Please fill in both password fields"))).build();
            else {
                if (!password1.equals(password2)) {
                    return Response.ok(gson.toJson(new StatusModel(false, "Passwords don't match"))).build();
                }
                if (password1.length()<8) {
                    return Response.ok(gson.toJson(new StatusModel(false, "Your password should be at least 8 characters long"))).build();
                } else {
                    guestService.setPassword(guest.getId(), password1);
                }
            }

            return Response.ok(new StatusModel(true, "settings updated!")).build();
        }
        catch (Exception e){
            return Response.serverError().entity("Failed to save settings: " + e.getMessage()).build();
        }
    }
View Full Code Here

                uid = null;
            }
            return bodyTrackHelper.getAllTagsForUser(uid);
        }
        catch (Exception e) {
            return gson.toJson(new StatusModel(false, "Access Denied"));
        }
    }
View Full Code Here

        try{
            if (!checkForPermissionAccess(uid)){
                uid = null;
            }
            bodyTrackHelper.setDefaultStyle(uid,deviceNickname,channelName,style);
            return gson.toJson(new StatusModel(true, "Channel style set"));
        }
        catch (Exception e){
            return gson.toJson(new StatusModel(false,"Access Denied"));
        }
    }
View Full Code Here

TOP

Related Classes of org.fluxtream.core.mvc.models.StatusModel

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.