Examples of ItemListBean


Examples of org.openhab.io.cv.internal.resources.beans.ItemListBean

      Item item, HttpServletRequest request) {
    ItemStateListBean responseBean;
    if (stateBean == null) {
      stateBean = new ItemStateListBean();
    }
    ItemListBean list = stateBean.stateList;

    if (item instanceof GroupItem) {
      GroupItem groupItem = (GroupItem) item;
      // get the base item
      if (groupItem.getBaseItem() != null) {
View Full Code Here

Examples of org.openhab.io.cv.internal.resources.beans.ItemListBean

  @Override
  protected Object getSingleResponseObject(Item item, HttpServletRequest request) {
    ItemStateListBean responseBean ;
    Collection<ItemBean> beans = new LinkedList<ItemBean>();
    beans.add(new ItemBean(item.getName(), item.getState().toString()));
    responseBean = new ItemStateListBean( new ItemListBean(beans));
    responseBean.index = System.currentTimeMillis();
    return responseBean;
  }
View Full Code Here

Examples of org.openhab.io.cv.internal.resources.beans.ItemListBean

  private ItemStateListBean getItemStateListBean(HttpServletRequest request){
    String pathInfo = request.getPathInfo();
    String responseType = (new ResponseTypeHelper()).getResponseType(request);
    if(responseType!=null) {
      if (pathInfo.startsWith("/" +ReadResource.PATH_READ)) {
            ItemStateListBean bean = new ItemStateListBean(new ItemListBean(getItemBeans(request)));
            bean.index = System.currentTimeMillis();
        return bean;
          }
    }
    return null;
View Full Code Here

Examples of org.openhab.io.cv.internal.resources.beans.ItemListBean

   
    @Override
  public List<Object> retrieveFromCache(String broadcasterId,
      AtmosphereResource r) {
    List<Object> result = new ArrayList<Object>();
    ItemStateListBean response = new ItemStateListBean(new ItemListBean());
    for (Object cacheMessage : super.retrieveFromCache(broadcasterId, r)) {
      if (cacheMessage instanceof ItemStateListBean) {
        ItemStateListBean cachedStateList = (ItemStateListBean) cacheMessage;
        // add states to the response (maybe a comparison is needed here
        // so that only the last state of an item is used)
View Full Code Here

Examples of org.openhab.io.cv.internal.resources.beans.ItemListBean

      .broadcaster(itemBroadcaster)
      .outputComments(true).build();
  }
 
  public ItemStateListBean getItemStateListBean(List<String> itemNames, long index) {
    ItemStateListBean stateList = new ItemStateListBean(new ItemListBean(getItemBeans(itemNames)));
    stateList.index = index+1;
    return stateList;
  }
View Full Code Here

Examples of org.openhab.io.rest.internal.resources.beans.ItemListBean

    logger.debug("Received HTTP GET request at '{}' for media type '{}'.", new String[] { uriInfo.getPath(), type });

    String responseType = MediaTypeHelper.getResponseMediaType(headers.getAcceptableMediaTypes(), type);
    if(responseType!=null) {
        Object responseObject = responseType.equals(MediaTypeHelper.APPLICATION_X_JAVASCRIPT) ?
            new JSONWithPadding(new ItemListBean(getItemBeans()), callback) : new ItemListBean(getItemBeans());
        return Response.ok(responseObject, responseType).build();
    } else {
      return Response.notAcceptable(null).build();
    }
    }
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.