Examples of StatusModel


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

            GuestModel guestModel = new GuestModel(guest, false);

            return guestModel;
        }
        catch (Exception e){
            return new StatusModel(false,"Failed to get current guest: " + e.getMessage());
        }
  }
View Full Code Here

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

      property.accumulate("name", propertyName).accumulate("value",
          env.get(propertyName));
      return property.toString();
    }

    StatusModel failure = new StatusModel(false, "property not found: "
        + propertyName);
    return gson.toJson(failure);
  }
View Full Code Here

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

            throws InstantiationException, IllegalAccessException,
                   ClassNotFoundException {

        try {
            metadataService.rebuildMetadata(username);
            StatusModel success = new StatusModel(true, "done");
            return gson.toJson(success);
        } catch (Throwable t) {
            StatusModel failure = new StatusModel(false, ExceptionUtils.getStackTrace(t));
            return gson.toJson(failure);
        }
    }
View Full Code Here

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

                                                        ISODateTimeFormat.dateHourMinuteSecondFraction().withZoneUTC().print(update.ts));
                    }
                }
            }
        }
        StatusModel success = new StatusModel(true, "done");
        return gson.toJson(success);
    }
View Full Code Here

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

            throws InstantiationException, IllegalAccessException,
                   ClassNotFoundException {

        try {
            apiDataService.deleteStaleData();
            StatusModel success = new StatusModel(true, "done");
            return gson.toJson(success);
        } catch (Throwable t) {
            StatusModel failure = new StatusModel(false, ExceptionUtils.getStackTrace(t));
            return gson.toJson(failure);
        }
    }
View Full Code Here

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

            int i=0;
            for (ApiKey upKey : upKeys) {
                i++;
                guestService.setApiKeyAttribute(upKey, "tokenExpires", String.valueOf(System.currentTimeMillis()));
            }
            StatusModel success = new StatusModel(true, i + " (up) tokens have been expired.");
            return gson.toJson(success);
        } catch (Throwable t) {
            StatusModel failure = new StatusModel(false, ExceptionUtils.getStackTrace(t));
            return gson.toJson(failure);
        }
    }
View Full Code Here

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

    public String executeUpdate(@FormParam("jpql") String jpql)
            throws InstantiationException, IllegalAccessException,
                   ClassNotFoundException {
        try {
            int results = jpaDaoService.execute(jpql);
            StatusModel result = new StatusModel(true, results + " rows affected");
            return gson.toJson(result);
        } catch (Exception e) {
            StatusModel failure = new StatusModel(false, "Could not execute query: " + e.getMessage());
            return gson.toJson(failure);
        }

    }
View Full Code Here

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

    @Secured({ "ROLE_ADMIN" })
    @Path("/widgets/refresh")
    @Produces({ MediaType.APPLICATION_JSON })
    public String refreshWidgets() {
        widgetsService.refreshWidgets();
        return gson.toJson(new StatusModel(true, "widgets refreshed"));
    }
View Full Code Here

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

    @Path("/apiKeys/{apiKeyId}")
    @Secured({ "ROLE_ADMIN" })
    @Produces({MediaType.APPLICATION_JSON})
    public StatusModel deleteApiKey(@PathParam("apiKeyId") long apiKeyId) throws IOException {
        guestService.removeApiKey(apiKeyId);
        return new StatusModel(true, "apiKey was deleted");
    }
View Full Code Here

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

    public StatusModel setApiKeyAttributeValue(@PathParam("apiKeyId") long apiKeyId,
                                               @FormParam("attributeKey") String attributeKey,
                                               @FormParam("attributeValue") String attributeValue) throws IOException {
        final ApiKey apiKey = guestService.getApiKey(apiKeyId);
        guestService.setApiKeyAttribute(apiKey, attributeKey, attributeValue);
        return new StatusModel(true, "attribute value was set");
    }
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.