Package org.fluxtream.core.connectors.bodytrackResponders

Examples of org.fluxtream.core.connectors.bodytrackResponders.AbstractBodytrackResponder



            final long startTimeMillis = (long)(LevelOffsetHelper.offsetAtLevelToUnixTime(level, offset) * 1000);
            final long endTimeMillis = (long)(LevelOffsetHelper.offsetAtLevelToUnixTime(level, offset + 1) * 1000);

            final AbstractBodytrackResponder bodytrackResponder = api.getConnector().getBodytrackResponder(beanFactory);
            final List<TimespanModel> timespans = bodytrackResponder.getTimespans(startTimeMillis, endTimeMillis, api, objectTypeName);
            TimespanTileResponse response = new TimespanTileResponse(timespans);
            return Response.ok(gson.toJson(response)).build();

        }
        catch (Exception e) {
View Full Code Here


        return null;
    }

    public AbstractBodytrackResponder getBodytrackResponder(BeanFactory beanFactory){
        try{
            final AbstractBodytrackResponder bean = beanFactory.getBean(bodytrackResponder);
            return bean;
        }
        catch (Exception e){
            System.out.println("COULD NOT INSTANTIATE RESPONDER: " + bodytrackResponder);
            System.out.println("PLEASE CHECK THAT IT HAS THE @Component ANNOTATION!");
View Full Code Here


            final long startTimeMillis = (long)(LevelOffsetHelper.offsetAtLevelToUnixTime(level, offset) * 1000);
            final long endTimeMillis = (long)(LevelOffsetHelper.offsetAtLevelToUnixTime(level, offset + 1) * 1000);

            final AbstractBodytrackResponder bodytrackResponder = api.getConnector().getBodytrackResponder(beanFactory);
            final List<TimespanModel> timespans = bodytrackResponder.getTimespans(startTimeMillis, endTimeMillis, api, objectTypeName);
            TimespanTileResponse response = new TimespanTileResponse(timespans);
            return gson.toJson(response);

        }
        catch (Exception e) {
View Full Code Here

                ChannelStyle userStyle = getDefaultStyle(guestId,source.name,channel.name);
                if (userStyle != null)
                    channel.style = userStyle;

                if (mapping.apiKeyId != null){
                    final AbstractBodytrackResponder bodytrackResponder = api.getConnector().getBodytrackResponder(beanFactory);
                    AbstractBodytrackResponder.Bounds bounds = bodytrackResponder.getBounds(mapping);
                    channel.min_time = bounds.min_time;
                    channel.max_time = bounds.max_time;
                    channel.min = bounds.min;
                    channel.max = bounds.max;
                    source.min_time = Math.min(source.min_time,channel.min_time);
View Full Code Here

        String [] objectTypeNameParts = objectTypeName.split("-");
        ApiKey apiKey = guestService.getApiKeys(guest.getId(),Connector.getConnector(objectTypeNameParts[0])).get(0);
        Connector connector = apiKey.getConnector();

        final AbstractBodytrackResponder bodytrackResponder = connector.getBodytrackResponder(beanFactory);
        return Response.ok(bodytrackResponder.getFacetVOs(settingsService.getSettings(guest.getId()), apiKey, objectTypeName, start, end, value)).build();

    }
View Full Code Here

TOP

Related Classes of org.fluxtream.core.connectors.bodytrackResponders.AbstractBodytrackResponder

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.