Package org.fluxtream.core.connectors

Examples of org.fluxtream.core.connectors.ObjectType


        }
        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())) {
                        for (final ObjectType objectType : facetsByObjectType.keySet()) {
                            final List<AbstractFacet> facets = facetsByObjectType.get(objectType);
                            if (facets != null) {
                                photos.addAll(convertFacetsToPhotos(apiKey, timeInterval, facets, connector, objectType));
                            }
                        }
                    }
                }
                else if (desiredObjectType.isImageType()) {
                    final List<AbstractFacet> facets = facetFinderStrategy.find(apiKey, desiredObjectType, tagFilter);
                    if (facets != null) {
                        photos.addAll(convertFacetsToPhotos(apiKey, timeInterval, facets, connector, desiredObjectType));
                    }
                }
View Full Code Here


    @Override
    public List<AbstractFacetVO<AbstractFacet>> getFacetVOs(final GuestSettings guestSettings, final ApiKey apiKey, final String objectTypeName, final long start, final long end, final String value) {
        Connector connector = apiKey.getConnector();
        String[] objectTypeNameParts = objectTypeName.split("-");
        ObjectType objectType = null;
        for (ObjectType ot : connector.objectTypes()){
            if (ot.getName().equals(objectTypeNameParts[1])){
                objectType = ot;
                break;
            }
        }
        if (objectType == null || (objectType.getName().equals("place") && !"place".equals(value)))
            return new ArrayList<AbstractFacetVO<AbstractFacet>>();

        TimeInterval timeInterval = metadataService.getArbitraryTimespanMetadata(apiKey.getGuestId(), start, end).getTimeInterval();

        List<AbstractFacet> facets = getFacetsInTimespan(timeInterval,apiKey,objectType);

        if (objectType.getName().equals("move")){
            MovesMoveFacet move;
            for (Iterator<AbstractFacet> i = facets.iterator(); i.hasNext();){
                move = (MovesMoveFacet) i.next();
                boolean found = false;
                for (MovesActivity activity : move.getActivities()){
View Full Code Here

    public List<TimespanModel> getTimespans(final long startMillis, final long endMillis, final ApiKey apiKey, final String channelName) {
        List<TimespanModel> items = new ArrayList<TimespanModel>();
        final TimeInterval timeInterval = new SimpleTimeInterval(startMillis, endMillis, TimeUnit.ARBITRARY, TimeZone.getTimeZone("UTC"));

        int sleepObjectTypeValue = ObjectType.getObjectTypeValue(JawboneUpSleepFacet.class);
        final ObjectType sleepObjectType = ObjectType.getObjectType(Connector.getConnector("up"), sleepObjectTypeValue);
        List<AbstractFacet> facets = getFacetsInTimespanOrderedByEnd(timeInterval, apiKey, sleepObjectType);
        for (AbstractFacet facet : facets){
            JawboneUpSleepFacet sleepFacet = (JawboneUpSleepFacet) facet;
            if (StringUtils.isEmpty(sleepFacet.phasesStorage))
                continue;
View Full Code Here

                                                            final long start, final long end, final String value) {

        TimeInterval timeInterval = metadataService.getArbitraryTimespanMetadata(apiKey.getGuestId(), start, end).getTimeInterval();

        int sleepObjectTypeValue = ObjectType.getObjectTypeValue(JawboneUpSleepFacet.class);
        final ObjectType sleepObjectType = ObjectType.getObjectType(Connector.getConnector("up"), sleepObjectTypeValue);
        List<AbstractFacet> facets = getFacetsInTimespan(timeInterval, apiKey, sleepObjectType);

        List<AbstractFacetVO<AbstractFacet>> facetVOsForFacets = getFacetVOsForFacets(facets, timeInterval, guestSettings);
        return facetVOsForFacets;
    }
View Full Code Here

    }

    @Override
    protected void updateConnectorDataHistory(UpdateInfo updateInfo) throws Exception {
        initChannelMapping(updateInfo);
        final ObjectType recent_track = ObjectType.getObjectType(connector(), "recent_track");
        if (updateInfo.objectTypes().contains(recent_track)) {
            retrieveTracks(updateInfo, 0, "recenttracks");
        }
    }
View Full Code Here

    @Override
    public List<TimespanModel> getTimespans(final long startMillis, final long endMillis, final ApiKey apiKey, final String channelName) {
        List<TimespanModel> items = new ArrayList<TimespanModel>();
        final TimeInterval timeInterval = new SimpleTimeInterval(startMillis, endMillis, TimeUnit.ARBITRARY, TimeZone.getTimeZone("UTC"));
        Connector connector = apiKey.getConnector();
        final ObjectType recent_track = ObjectType.getObjectType(connector, "recent_track");

        String objectTypeName = apiKey.getConnector().getName() + "-" + recent_track.getName();
        List<AbstractFacet> facets = getFacetsInTimespanOrderedByEnd(timeInterval,apiKey, recent_track);

        // Sadly, the start and end times of track facets are the same.  Assume that the
        // start time is correct and arbitrarily draw a box that's 3 mins or
        // 1/256 of the tile width, whichever is larger.
View Full Code Here

    public List<AbstractFacetVO<AbstractFacet>> getFacetVOs(final GuestSettings guestSettings, final ApiKey apiKey, final String objectTypeName, final long start, final long end, final String value) {
        Connector connector = apiKey.getConnector();

        TimeInterval timeInterval = metadataService.getArbitraryTimespanMetadata(apiKey.getGuestId(), start, end).getTimeInterval();

        final ObjectType recent_track = ObjectType.getObjectType(connector, "recent_track");

        List<AbstractFacet> facets = getFacetsInTimespan(timeInterval, apiKey, recent_track);

        return getFacetVOsForFacets(facets,timeInterval,guestSettings);
    }
View Full Code Here

    public List<AbstractFacetVO<AbstractFacet>> getFacetVOs(final GuestSettings guestSettings, final ApiKey apiKey,
                                                            final String objectTypeName, final long start, final long end,
                                                            final String value) {
        Connector connector = apiKey.getConnector();
        String[] objectTypeNameParts = objectTypeName.split("-");
        ObjectType objectType = null;
        for (ObjectType ot : connector.objectTypes()){
            if (ot.getName().equals(objectTypeNameParts[1])){
                objectType = ot;
                break;
            }
View Full Code Here

                                                            final String objectTypeName,
                                                            final long start, final long end,
                                                            final String value) {
        Connector connector = apiKey.getConnector();
        String[] objectTypeNameParts = objectTypeName.split("-");
        ObjectType objectType = null;
        for (ObjectType ot : connector.objectTypes()){
            if (ot.getName().equals(objectTypeNameParts[1])){
                objectType = ot;
                break;
            }
View Full Code Here

    private Long timeOfLastCall;

    public BodymediaUpdater() {
        super();
        ObjectType burn = ObjectType.getObjectType(connector(), "burn");
        ObjectType sleep = ObjectType.getObjectType(connector(), "sleep");
        ObjectType steps = ObjectType.getObjectType(connector(), "steps");
        url.put(burn, "burn/day/minute/intensity/");
        url.put(sleep, "sleep/day/period/");
        url.put(steps, "step/day/hour/");
        maxIncrement.put(burn, 1);
        maxIncrement.put(sleep, 1);
View Full Code Here

TOP

Related Classes of org.fluxtream.core.connectors.ObjectType

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.