Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.HashMap


        Date dateFrom = filter.getFromDate();
        Date dateTo = filter.getToDate();
        Class fragmentType = filter.getFragmentType();
        ManagedObjectRepresentation source = filter.getSource();

        Map filterMap = new HashMap();
        if (null != source) {
            filterMap.put(SOURCE, source.getId().getValue());
        }
        if (null != dateFrom) {
            filterMap.put(DATE_FROM, DateUtils.format(dateFrom));
        }
        if (null != dateTo) {
            filterMap.put(DATE_TO, DateUtils.format(dateTo));
        }
        if (null != fragmentType) {
            filterMap.put(FRAGMENT_TYPE, ExtensibilityConverter.classToStringRepresentation(fragmentType));
        }
        if (null != type) {
            filterMap.put(TYPE, type);
        }

        QueryURLBuilder query = new QueryURLBuilder(templateUrlParser, filterMap, getEventApiRepresentation().getURITemplates(),
                OPTIONAL_PARAMETERS);
        String queryUrl = query.build();
View Full Code Here


    public BaseCollectionRepresentation getPage(BaseCollectionRepresentation collectionRepresentation, int pageNumber, int pageSize) {
        if (collectionRepresentation == null || collectionRepresentation.getSelf() == null) {
            throw new SDKException("Unable to determin the Resource URL. ");
        }

        Map params = new HashMap();
        params.put(PAGE_SIZE_KEY, String.valueOf(pageSize < 1 ? DEFAULT_PAGE_SIZE : pageSize));
        params.put(PAGE_NUMBER_KEY, String.valueOf(pageNumber));

        String url = replaceOrAddQueryParam(collectionRepresentation.getSelf(), params);
        return getCollection(url);
    }
View Full Code Here

        return builder.toString();
    }

    private Map parseQueryParams(String queryParams) {
        Map result = new HashMap();
        String[] pairs = StringUtils.split(queryParams, "&");
        for (int i = 0; i < pairs.length; i++) {
          String pair = pairs[i];
            String[] items = StringUtils.split(pair, "=");
            if (items.length == 2) {
                result.put(items[0], items[1]);
            }
        }

        return result;
    }
View Full Code Here

        return new OperationCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getOperationsByStatus(OperationStatus status) throws SDKException {
        String urlTemplate = getDeviceControlRepresentation().getOperationsByStatus();
        Map filter = new HashMap();
        filter.put(STATUS, status.toString());
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new OperationCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new OperationCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getOperationsByAgent(String agentId) throws SDKException {
        String urlTemplate = getDeviceControlRepresentation().getOperationsByAgentId();
        Map filter = new HashMap();
        filter.put(AGENT_ID, agentId);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new OperationCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new OperationCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getOperationsByAgentAndStatus(String agentId, OperationStatus status) throws SDKException {
        String urlTemplate = getDeviceControlRepresentation().getOperationsByAgentIdAndStatus();
        Map filter = new HashMap();
        filter.put(AGENT_ID, agentId);
        filter.put(STATUS, status.toString());
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new OperationCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new OperationCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getOperationsByDevice(String deviceId) throws SDKException {
        String urlTemplate = getDeviceControlRepresentation().getOperationsByDeviceId();
        Map filter = new HashMap();
        filter.put(DEVICE_ID, deviceId);
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new OperationCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

        return new OperationCollectionImpl(restConnector, url, pageSize);
    }

    private PagedCollectionResource getOperationsByDeviceAndStatus(String deviceId, OperationStatus status) throws SDKException {
        String urlTemplate = getDeviceControlRepresentation().getOperationsByDeviceIdAndStatus();
        Map filter = new HashMap();
        filter.put(DEVICE_ID, deviceId);
        filter.put(STATUS, status.toString());
        String url = templateUrlParser.replacePlaceholdersWithParams(urlTemplate, filter);
        return new OperationCollectionImpl(restConnector, url, pageSize);
    }
View Full Code Here

TOP

Related Classes of com.cumulocity.me.lang.HashMap

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.