Package com.cumulocity.me.lang

Examples of com.cumulocity.me.lang.HashMap$EntrySet


    public ExternalIDRepresentation getExternalId(ID extId) throws SDKException {
        if (extId == null || extId.getValue() == null || extId.getType() == null) {
            throw new SDKException("XtId without value/type or null");
        }

        Map filter = new HashMap();
        filter.put(TYPE, extId.getType());
        filter.put(EXTERNAL_ID, extId.getValue());
        String extIdUrl = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalId(), filter);
        return (ExternalIDRepresentation) restConnector.get(extIdUrl, IdentityMediaType.EXTERNAL_ID, ExternalIDRepresentation.class);
    }
View Full Code Here


        String extIdUrl = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalId(), filter);
        return (ExternalIDRepresentation) restConnector.get(extIdUrl, IdentityMediaType.EXTERNAL_ID, ExternalIDRepresentation.class);
    }

    public void deleteExternalId(ExternalIDRepresentation extIdRep) throws SDKException {
        Map filter = new HashMap();
        filter.put(TYPE, extIdRep.getType());
        filter.put(EXTERNAL_ID, extIdRep.getExternalId());
        String extIdUrl = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalId(), filter);

        restConnector.delete(extIdUrl);
    }
View Full Code Here

    public PagedCollectionResource getExternalIdsOfGlobalId(GId gid) throws SDKException {
        if (gid == null || gid.getValue() == null) {
            throw new SDKException("Cannot determine global id value");
        }

        Map filter = new HashMap();
        filter.put(GLOBAL_ID, gid.getValue());
        String uri = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalIdsOfGlobalId(), filter);
        return new ExternalIDCollectionImpl(restConnector, uri, pageSize);
    }
View Full Code Here

    public ExternalIDRepresentation create(ExternalIDRepresentation representation) throws SDKException {
        if (representation == null || representation.getManagedObject() == null || representation.getManagedObject().getId() == null) {
            throw new SDKException("Cannot determine global id value");
        }

        Map filter = new HashMap();
        filter.put(GLOBAL_ID, representation.getManagedObject().getId().getValue());
        String path = templateUrlParser.replacePlaceholdersWithParams(getIdentityRepresentation().getExternalIdsOfGlobalId(), filter);
        return (ExternalIDRepresentation) restConnector.post(path, IdentityMediaType.EXTERNAL_ID, representation);
    }
View Full Code Here

    this.type = type == null ? MEDIA_TYPE_WILDCARD : type;
    this.subtype = subtype == null ? MEDIA_TYPE_WILDCARD : subtype;
    if (parameters == null) {
      this.parameters = Collections.emptyMap();
    } else {
      Map map = new HashMap();
      Iterator iterator = parameters.entrySet().iterator();
      while (iterator.hasNext()) {
        Map.Entry e = (Entry) iterator.next();
        map.put(((String) e.getKey()).toLowerCase(), e.getValue());
      }
      this.parameters = map;
    }
  }
View Full Code Here

public class QueryURLBuilderTest {

    @Test
    public void shouldBuildUrlForOneParameter() throws Exception {
        // given
        Map filters = new HashMap();
        filters.put("a", "b");

        List uriTemplates = new ArrayList();
        uriTemplates.add("http://something?a={a}");

        String[] optionalParameters = new String[] {};
View Full Code Here

    }

    @Test
    public void shouldBuildUrlForTwoParameters() throws Exception {
        // given
        Map filters = new HashMap();
        filters.put("a", "b");
        filters.put("c", "d");

        List uriTemplates = new ArrayList();
        uriTemplates.add("http://something?a={a}&c={c}");

        String[] optionalParameters = new String[] {};
View Full Code Here

    }

    @Test
    public void shouldNotBuildUrlForUnknownParameters() throws Exception {
        // given
        Map filters = new HashMap();
        filters.put("s", "b");
        filters.put("f", "d");

        List uriTemplates = new ArrayList();
        uriTemplates.add("http://something?a={a}&c={c}");

        String[] optionalParameters = new String[] {};
View Full Code Here

    }

    @Test
    public void shouldBuildUrlForOptionalParametersWithValue() throws Exception {
        // given
        Map filters = new HashMap();
        filters.put("a", "b");
        filters.put("c", "d");

        List uriTemplates = new ArrayList();
        uriTemplates.add("http://something?a={a}&c={c}");

        String[] optionalParameters = new String[] { "c" };
View Full Code Here

    }

    @Test
    public void shouldBuildUrlForOptionalParametersWithoutValue() throws Exception {
        // given
        Map filters = new HashMap();
        filters.put("a", "b");

        List uriTemplates = new ArrayList();
        uriTemplates.add("http://something?a={a}&c={c}");

        String[] optionalParameters = new String[] { "c" };
View Full Code Here

TOP

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

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.