Class OnmsVaadinContainer<T,​K extends java.io.Serializable>

  • Type Parameters:
    T - The type of the elements in the container.
    K - the key of the elements in the container.
    All Implemented Interfaces:
    com.vaadin.v7.data.Container, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeNotifier, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.Sortable, java.io.Serializable, SelectionChangedListener
    Direct Known Subclasses:
    AlarmDaoContainer, ApplicationDaoContainer, ApplicationOutageDaoContainer, BusinessServicesContainer, NodeDaoContainer

    public abstract class OnmsVaadinContainer<T,​K extends java.io.Serializable>
    extends java.lang.Object
    implements com.vaadin.v7.data.Container, com.vaadin.v7.data.Container.Sortable, com.vaadin.v7.data.Container.Ordered, com.vaadin.v7.data.Container.Indexed, com.vaadin.v7.data.Container.ItemSetChangeNotifier, SelectionChangedListener
    See Also:
    Serialized Form
    • Constructor Detail

    • Method Detail

      • containsId

        public boolean containsId​(java.lang.Object itemId)
        Specified by:
        containsId in interface com.vaadin.v7.data.Container
      • getContainerProperty

        public com.vaadin.v7.data.Property<?> getContainerProperty​(java.lang.Object itemId,
                                                                   java.lang.Object propertyId)
        Specified by:
        getContainerProperty in interface com.vaadin.v7.data.Container
      • getContainerPropertyIds

        public java.util.Collection<?> getContainerPropertyIds()
        Specified by:
        getContainerPropertyIds in interface com.vaadin.v7.data.Container
      • getItem

        public com.vaadin.v7.data.Item getItem​(java.lang.Object itemId)
        Specified by:
        getItem in interface com.vaadin.v7.data.Container
      • getItemClass

        public java.lang.Class<T> getItemClass()
      • getId

        protected abstract K getId​(T bean)
      • getType

        public java.lang.Class<?> getType​(java.lang.Object propertyId)
        Specified by:
        getType in interface com.vaadin.v7.data.Container
      • removeAllItems

        public boolean removeAllItems()
                               throws java.lang.UnsupportedOperationException
        Specified by:
        removeAllItems in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • removeItem

        public boolean removeItem​(java.lang.Object itemId)
                           throws java.lang.UnsupportedOperationException
        Specified by:
        removeItem in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • size

        public int size()
        Specified by:
        size in interface com.vaadin.v7.data.Container
      • firstItemId

        public java.lang.Object firstItemId()
        Specified by:
        firstItemId in interface com.vaadin.v7.data.Container.Ordered
      • lastItemId

        public java.lang.Object lastItemId()
        Specified by:
        lastItemId in interface com.vaadin.v7.data.Container.Ordered
      • isFirstId

        public boolean isFirstId​(java.lang.Object itemId)
        Specified by:
        isFirstId in interface com.vaadin.v7.data.Container.Ordered
      • isLastId

        public boolean isLastId​(java.lang.Object itemId)
        Specified by:
        isLastId in interface com.vaadin.v7.data.Container.Ordered
      • nextItemId

        public java.lang.Object nextItemId​(java.lang.Object itemId)
        Specified by:
        nextItemId in interface com.vaadin.v7.data.Container.Ordered
      • prevItemId

        public java.lang.Object prevItemId​(java.lang.Object itemId)
        Specified by:
        prevItemId in interface com.vaadin.v7.data.Container.Ordered
      • getSortableContainerPropertyIds

        public java.util.Collection<?> getSortableContainerPropertyIds()
        This function returns getContainerPropertyIds().
        Specified by:
        getSortableContainerPropertyIds in interface com.vaadin.v7.data.Container.Sortable
      • sort

        public void sort​(java.lang.Object[] propertyId,
                         boolean[] ascending)
        Specified by:
        sort in interface com.vaadin.v7.data.Container.Sortable
      • createSortEntries

        protected java.util.List<OnmsVaadinContainer.SortEntry> createSortEntries​(java.lang.Object[] propertyId,
                                                                                  boolean[] ascending)
      • addListener

        public void addListener​(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
        Specified by:
        addListener in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
      • removeListener

        public void removeListener​(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
        Specified by:
        removeListener in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
      • addItemSetChangeListener

        public void addItemSetChangeListener​(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
        Specified by:
        addItemSetChangeListener in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
      • removeItemSetChangeListener

        public void removeItemSetChangeListener​(com.vaadin.v7.data.Container.ItemSetChangeListener listener)
        Specified by:
        removeItemSetChangeListener in interface com.vaadin.v7.data.Container.ItemSetChangeNotifier
      • fireItemSetChangedEvent

        protected void fireItemSetChangedEvent()
      • setRestrictions

        public void setRestrictions​(java.util.List<Restriction> newRestrictions)
      • getRestrictions

        public java.util.List<Restriction> getRestrictions()
      • addBeanToHibernatePropertyMapping

        public void addBeanToHibernatePropertyMapping​(java.lang.String key,
                                                      java.lang.String value)
      • getItemIds

        public java.util.Collection<?> getItemIds()
        Specified by:
        getItemIds in interface com.vaadin.v7.data.Container
      • getItemIds

        public java.util.List<K> getItemIds​(int startIndex,
                                            int numberOfItems)
        Specified by:
        getItemIds in interface com.vaadin.v7.data.Container.Indexed
      • indexOfId

        public int indexOfId​(java.lang.Object itemId)
        Specified by:
        indexOfId in interface com.vaadin.v7.data.Container.Indexed
      • getIdByIndex

        public K getIdByIndex​(int index)
        Specified by:
        getIdByIndex in interface com.vaadin.v7.data.Container.Indexed
      • addItemAt

        public java.lang.Object addItemAt​(int index)
                                   throws java.lang.UnsupportedOperationException
        Specified by:
        addItemAt in interface com.vaadin.v7.data.Container.Indexed
        Throws:
        java.lang.UnsupportedOperationException
      • addItemAt

        public com.vaadin.v7.data.Item addItemAt​(int index,
                                                 java.lang.Object newItemId)
                                          throws java.lang.UnsupportedOperationException
        Specified by:
        addItemAt in interface com.vaadin.v7.data.Container.Indexed
        Throws:
        java.lang.UnsupportedOperationException
      • addItemAfter

        public java.lang.Object addItemAfter​(java.lang.Object previousItemId)
                                      throws java.lang.UnsupportedOperationException
        Specified by:
        addItemAfter in interface com.vaadin.v7.data.Container.Ordered
        Throws:
        java.lang.UnsupportedOperationException
      • addItemAfter

        public com.vaadin.v7.data.Item addItemAfter​(java.lang.Object previousItemId,
                                                    java.lang.Object newItemId)
                                             throws java.lang.UnsupportedOperationException
        Specified by:
        addItemAfter in interface com.vaadin.v7.data.Container.Ordered
        Throws:
        java.lang.UnsupportedOperationException
      • addContainerProperty

        public final boolean addContainerProperty​(java.lang.Object propertyId,
                                                  java.lang.Class<?> type,
                                                  java.lang.Object defaultValue)
                                           throws java.lang.UnsupportedOperationException
        Specified by:
        addContainerProperty in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • addItem

        public java.lang.Object addItem()
                                 throws java.lang.UnsupportedOperationException
        Can be overridden if you want to support adding items.
        Specified by:
        addItem in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • addItem

        public com.vaadin.v7.data.Item addItem​(java.lang.Object itemId)
                                        throws java.lang.UnsupportedOperationException
        Can be overridden if you want to support adding items.
        Specified by:
        addItem in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • removeContainerProperty

        public final boolean removeContainerProperty​(java.lang.Object propertyId)
                                              throws java.lang.UnsupportedOperationException
        Specified by:
        removeContainerProperty in interface com.vaadin.v7.data.Container
        Throws:
        java.lang.UnsupportedOperationException
      • updateContainerPropertyIds

        protected void updateContainerPropertyIds​(java.util.Map<java.lang.Object,​java.lang.Class<?>> properties)
      • getCriteria

        protected Criteria getCriteria​(OnmsVaadinContainer.Page page,
                                       boolean doOrder)
        Creates a Criteria object to get data from database. If considerPaging is set Limit and offset values are added as restriction.
        Parameters:
        page -
        doOrder -
        Returns:
      • getContentType

        protected abstract ContentType getContentType()