Examples of OrionContextElement


Examples of com.kurento.kmf.orion.entities.OrionContextElement

   *             if a communication exception happens, either when contacting
   *             the context broker at the given address, or obtaining the
   *             answer from it.
   */
  public QueryContextResponse queryContext(String type, String id) {
    OrionContextElement element = new OrionContextElement();
    element.setId(id);
    element.setType(type);
    QueryContext query = new QueryContext(element);
    return sendRequestToOrion(query, QUERY_PATH, QueryContextResponse.class);
  }
View Full Code Here

Examples of com.kurento.kmf.orion.entities.OrionContextElement

   *             the context broker at the given address, or obtaining the
   *             answer from it.
   */
  public QueryContextResponse queryContextWithPattern(String type,
      String pattern) {
    OrionContextElement element = new OrionContextElement();
    element.setId(pattern);
    element.setPattern(true);
    element.setType(type);
    QueryContext query = new QueryContext(element);
    return sendRequestToOrion(query, QUERY_PATH, QueryContextResponse.class);
  }
View Full Code Here

Examples of com.kurento.kmf.orion.entities.OrionContextElement

  @Ignore
  @Test
  public void test() {

    OrionContextElement oer1 = new OrionContextElement();
    oer1.setId("12");
    oer1.setPattern(false);
    oer1.setType("test");

    OrionAttribute<String> oa1 = new OrionAttribute<>("oa1", "oa1", "temp");
    OrionAttribute<String> oa2 = new OrionAttribute<>("oa2", "oa2",
        "another temp");

    List<OrionAttribute<String>> oaList = newArrayList(oa1, oa2);
    oer1.getAttributes().addAll(oaList);

    OrionContextElement oer2 = new OrionContextElement();
    oer2.setId("2");
    oer2.setPattern(false);
    oer2.setType("test2");

    OrionAttribute<String> oa3 = new OrionAttribute<>("oa3", "oa3", "temp3");
    OrionAttribute<String> oa4 = new OrionAttribute<>("oa4", "oa4", "temp4");

    List<OrionAttribute<String>> oaList2 = newArrayList(oa3, oa4);
    oer2.getAttributes().addAll(oaList2);

    OrionConnector op = new OrionConnector(
        new OrionConnectorConfiguration());

    ContextUpdateResponse resp = op.registerContextElements(oer1, oer2);
View Full Code Here

Examples of com.kurento.kmf.orion.entities.OrionContextElement

  @Test
  public void testWithZbarMediaObject() {
    OrionConnector op = new OrionConnector(
        new OrionConnectorConfiguration());

    final OrionContextElement ctxElement = new OrionContextElement();
    ctxElement.setId("ZBarHandler_test");
    ctxElement.setType("ZBarFilter");
    ctxElement.getAttributes().add(
        new OrionAttribute<>("CodeFoundEvent", "CodeFoundEvent",
            "xxxxx"));
    ContextUpdateResponse resp = op.registerContextElements(ctxElement);

    log.info("Response: {}", resp);
View Full Code Here

Examples of com.kurento.kmf.orion.entities.OrionContextElement

  @Test
  public void testCrowdDetectorFilter () {
    final OrionConnector oc = new OrionConnector(
        new OrionConnectorConfiguration());

    final OrionContextElement fluidityElement = new OrionContextElement();
    fluidityElement.setId("CAM-ID_FluidityEvent");
    fluidityElement.setType("FluidityEvent");
    OrionAttribute<String> oaPercentage = new OrionAttribute<>("fluidityPercentage", "percentile", "0");
    OrionAttribute<String> oaLevel = new OrionAttribute<>("fluidityLevel", "level", "none");
    OrionAttribute<String> roiID1 = new OrionAttribute<>("roiID", "text", "-");
    fluidityElement.getAttributes().add(oaPercentage);
    fluidityElement.getAttributes().add(oaLevel);
    fluidityElement.getAttributes().add(roiID1);

    final OrionContextElement directionElement = new OrionContextElement();
    directionElement.setId("CAM-ID_DirectionEvent");
    directionElement.setType("DirectionEvent");
    OrionAttribute<String> oaAngle = new OrionAttribute<>("directionAngle", "degrees", "0");
    OrionAttribute<String> roiID2 = new OrionAttribute<>("roiID", "text", "-");
    directionElement.getAttributes().add(oaAngle);
    directionElement.getAttributes().add(roiID2);

    final OrionContextElement occupancyElement = new OrionContextElement();
    occupancyElement.setId("CAM-ID_OccupancyEvent");
    occupancyElement.setType("OccupancyEvent");
    OrionAttribute<String> oaOcPerc = new OrionAttribute<>("occupancyPercentage", "percentile", "0");
    OrionAttribute<String> oaOcLevel = new OrionAttribute<>("occupancyLevel", "level", "none");
    OrionAttribute<String> roiID3 = new OrionAttribute<>("roiID", "text", "-");
    occupancyElement.getAttributes().add(oaOcPerc);
    occupancyElement.getAttributes().add(oaOcLevel);
    occupancyElement.getAttributes().add(roiID3);

    ContextUpdateResponse resp = oc.registerContextElements(fluidityElement, directionElement, occupancyElement);

    log.info("Response: {}", resp);
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.