Examples of ApiKey


Examples of org.fluxtream.core.domain.ApiKey

    @Path("/{connector}")
    @Produces({MediaType.APPLICATION_JSON})
    public Response deleteUpdateTasks(@PathParam("connector") String connectorName) {
        try{
            long guestId = AuthHelper.getGuestId();
            ApiKey apiKey = guestService.getApiKey(guestId, Connector.getConnector(connectorName));
            connectorUpdateService.flushUpdateWorkerTasks(apiKey, false);
            return Response.ok("successfully deleted pending update tasks for " + connectorName).build();
        }
        catch (Exception e){
            return Response.serverError().entity("Failed to get update tasks: " + e.getMessage()).build();
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

    public Response getUpdates(@PathParam("connector") String connectorName,
                               @QueryParam("pageSize") int pageSize,
                               @QueryParam("page") int page) {
        try {
            long guestId = AuthHelper.getGuestId();
            final ApiKey apiKey = guestService.getApiKey(guestId, Connector.getConnector(connectorName));
            final List<ApiUpdate> updates = connectorUpdateService.getUpdates(apiKey, pageSize, page);
            final ApiUpdatesModel updatesModel = new ApiUpdatesModel(connectorName,
                    updates, !nonRepeatableUpdateQueriesConnectors.contains(connectorName));
            return Response.ok(gson.toJson(updatesModel)).build();
        }
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

    private void addDefaultWidgets(final long guestId, Dashboard dashboard) {
        List<ApiKey> keys = guestService.getApiKeys(guestId);
        Iterator<ApiKey> eachKey = keys.iterator();
        List<String> widgetNames = new ArrayList<String>();
        while (eachKey.hasNext()) {
            ApiKey key = eachKey.next();
            if(key!=null && key.getConnector()!=null && key.getConnector().getName()!=null) {
                String defaultWidgetKey = key.getConnector().getName() + ".defaultWidget";
                String widgetName = widgetProperties.getString(defaultWidgetKey);
                if (widgetName!=null) {
                    widgetNames.add(widgetName);
                }
            }
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

                    }
                }
            }
        }
        else {
            final ApiKey apiKey = findConnectorApiKeyByPrettyName(guestId, connectorPrettyName);
            if (apiKey != null && apiKey.getConnector() != null) {
                final Connector connector = apiKey.getConnector();
                final ObjectType desiredObjectType = findObjectTypeByName(connector, objectTypeName);

                if (desiredObjectType == null) {
                    final Map<ObjectType, List<AbstractFacet>> facetsByObjectType = facetFinderStrategy.find(apiKey, tagFilter);
                    if ((facetsByObjectType != null) && (!facetsByObjectType.isEmpty())) {
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

    @Secured({ "ROLE_ADMIN" })
    @RequestMapping("/admin/{guestId}/{apiKeyId}/{objectTypes}/historyUpdate")
    public ModelAndView forceConnectorInstanceHistoryUpdate(@PathVariable("guestId") long guestId,
                                                            @PathVariable("apiKeyId") long apiKeyId,
                                                            @PathVariable("objectTypes") int objectTypes) {
        final ApiKey apiKey = guestService.getApiKey(apiKeyId);
        connectorUpdateService.updateConnectorObjectType(apiKey, objectTypes, true, true);
        return new ModelAndView(String.format("redirect:/admin/%s/%s", guestId, apiKeyId));
    }
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

    @Secured({ "ROLE_ADMIN" })
    @RequestMapping("/admin/{guestId}/{apiKeyId}/{objectTypes}/refresh")
    public ModelAndView refreshConnectorInstance(@PathVariable("guestId") long guestId,
                                                 @PathVariable("apiKeyId") long apiKeyId,
                                                 @PathVariable("objectTypes") int objectTypes) {
        final ApiKey apiKey = guestService.getApiKey(apiKeyId);
        connectorUpdateService.updateConnectorObjectType(apiKey, objectTypes, true, false);
        return new ModelAndView(String.format("redirect:/admin/%s/%s", guestId, apiKeyId));
    }
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

                                     @PathVariable("UID") Long uid) throws IOException, UnexpectedHttpResponseCodeException {
        if (!checkForPermissionAccess(uid)){
            uid = null;
        }
        // TODO: this is really going to be problematic...
        ApiKey apiKey = guestService.getApiKey(uid, Connector.getConnector("bodytrack"));
        String user_id = guestService.getApiKeyAttribute(apiKey, "user_id");
        String bodyTrackUrl = "http://localhost:3000/users/" + user_id + "/log_items/get";
        String pstr = request.getQueryString();
        if (pstr != null) {
            bodyTrackUrl += "?" + pstr;
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

      @PathVariable("Offset") String offset) throws IOException, UnexpectedHttpResponseCodeException {
        if (!checkForPermissionAccess(uid)){
            uid = null;
        }
        //TODO: WARNING!
        ApiKey apiKey = guestService.getApiKey(uid, Connector.getConnector("bodytrack"));
        String user_id = guestService.getApiKeyAttribute(apiKey, "user_id");
    String bodyTrackUrl = "http://localhost:3000/photos/" + user_id + "/"
        + level + "." + offset + ".json";
    String pstr = request.getQueryString();
    if (pstr != null) {
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

                                        @PathVariable("PhotoSpec") String photoSpec) throws IOException, UnexpectedHttpResponseCodeException {
        if (!checkForPermissionAccess(uid)){
            uid = null;
        }
        //TODO: WARNING!
        ApiKey apiKey = guestService.getApiKey(uid, Connector.getConnector("bodytrack"));
        String user_id = guestService.getApiKeyAttribute(apiKey, "user_id");
        String bodyTrackUrl = "http://localhost:3000/users/" + user_id + "/logphotos/" + photoSpec + ".jpg";
        String pstr = request.getQueryString();
        if (pstr != null) {
            bodyTrackUrl += "?" + pstr;
View Full Code Here

Examples of org.fluxtream.core.domain.ApiKey

  public void bodyTrackSources(HttpServletResponse response,
      @PathVariable("UID") Long uid) throws IOException, UnexpectedHttpResponseCodeException {
        if (!checkForPermissionAccess(uid)){
            uid = null;
        }
        ApiKey apiKey = guestService.getApiKey(uid, Connector.getConnector("bodytrack"));
        String user_id = guestService.getApiKeyAttribute(apiKey, "user_id");
    String tunnelUrl = "http://localhost:3000/users/" + user_id + "/sources";
    writeTunnelResponse(tunnelUrl, response);
  }
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.