Package org.openhab.io.cv.internal.resources.beans

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


  @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

  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

   
    @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

      .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

TOP

Related Classes of org.openhab.io.cv.internal.resources.beans.ItemListBean

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.