org.opennms.web.map.db
Class DBManager

java.lang.Object
  extended by org.opennms.web.map.db.Manager
      extended by org.opennms.web.map.db.DBManager

public class DBManager
extends Manager

Author:
maumig

Nested Class Summary
 class DBManager.OutageInfo
           
 
Field Summary
 
Fields inherited from class org.opennms.web.map.db.Manager
initialized
 
Constructor Summary
DBManager(DataSource dataSource)
           
DBManager(DataSource dataSource, java.util.Map params)
           
 
Method Summary
 int countMaps(int mapId)
           
 void deleteElement(Element e)
           
 void deleteElement(int id, int mapid, java.lang.String type)
           
 void deleteElements(Element[] elems)
           
 void deleteElementsOfMap(int id)
           
 int deleteMap(int id)
           
 int deleteMap(Map m)
           
 void deleteMapTypeElementsFromAllMaps()
           
 void deleteNodeTypeElementsFromAllMaps()
           
 void endSession()
           
 void finalize()
           
 ElementInfo[] getAllElementInfo()
           
 Element[] getAllElements()
           
 MapMenu[] getAllMapMenus()
           
 Map[] getAllMaps()
           
 Map[] getContainerMaps(int id, java.lang.String type)
           
 Element getElement(int id, int mapId, java.lang.String type)
           
 java.util.Map getElementInfo(int elementId, int mapId, java.lang.String type)
          returns a java.util.Map containing infos for the element of the map (key, value)
 Element[] getElementsLike(java.lang.String elementLabel)
           
 Element[] getElementsOfMap(int mapid)
           
 VLink[] getLinks(VElement[] elems)
           
 VLink[] getLinksOnElement(VElement[] elems, VElement elem)
           
 Map getMap(int id)
           
 Element[] getMapElementsOfMap(int mapid)
           
 MapMenu getMapMenu(int mapId)
           
 Map[] getMaps(java.lang.String mapname, java.lang.String maptype)
           
 Map[] getMapsByName(java.lang.String mapLabel)
           
 Map[] getMapsLike(java.lang.String mapLabel)
           
 MapMenu[] getMapsMenuByName(java.lang.String mapLabel)
           
 MapMenu[] getMapsMenuByOwner(java.lang.String owner)
           
 java.util.Map getMapsStructure()
          get a java.util.Map (key=parentMapId, value=set of child maps)
 Element[] getNodeElementsOfMap(int mapid)
           
 MapMenu[] getVisibleMapsMenu(java.lang.String user, java.lang.String userRole)
           
 void init()
           
 boolean isElementInMap(int elementId, int mapId, java.lang.String type)
           
 boolean isStartedSession()
           
 Element newElement(int id, int mapId, java.lang.String type)
           
 VElement refreshElement(VElement mapElement)
           
 VElement[] refreshElements(VElement[] mapElements)
           
 VMap reloadMap(VMap map)
           
 void saveElement(Element e)
           
 void saveElements(Element[] e)
           
 void saveMap(Map m)
           
 void saveMaps(Map[] m)
           
 void startSession()
          All your operations on Maps must be preceeded from a startSession() call and termined by an endSession() call.
 
Methods inherited from class org.opennms.web.map.db.Manager
isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBManager

public DBManager(DataSource dataSource)
          throws MapsException
Throws:
MapsException

DBManager

public DBManager(DataSource dataSource,
                 java.util.Map params)
          throws MapsException
Throws:
MapsException
Method Detail

init

public void init()
          throws MapsException
Specified by:
init in class Manager
Throws:
MapsException

finalize

public void finalize()
              throws MapsException
Specified by:
finalize in class Manager
Throws:
MapsException

startSession

public void startSession()
                  throws MapsException
Description copied from class: Manager
All your operations on Maps must be preceeded from a startSession() call and termined by an endSession() call.

Specified by:
startSession in class Manager
Throws:
MapsException

endSession

public void endSession()
                throws MapsException
Specified by:
endSession in class Manager
Throws:
MapsException

isStartedSession

public boolean isStartedSession()
                         throws MapsException
Specified by:
isStartedSession in class Manager
Throws:
MapsException

saveMaps

public void saveMaps(Map[] m)
              throws MapsException
Specified by:
saveMaps in class Manager
Throws:
MapsException

saveMap

public void saveMap(Map m)
             throws MapsException
Specified by:
saveMap in class Manager
Throws:
MapsException

saveElements

public void saveElements(Element[] e)
                  throws MapsException
Specified by:
saveElements in class Manager
Throws:
MapsException

saveElement

public void saveElement(Element e)
                 throws MapsException
Specified by:
saveElement in class Manager
Throws:
MapsException

deleteElements

public void deleteElements(Element[] elems)
                    throws MapsException
Specified by:
deleteElements in class Manager
Throws:
MapsException

deleteElement

public void deleteElement(Element e)
                   throws MapsException
Specified by:
deleteElement in class Manager
Throws:
MapsException

deleteElement

public void deleteElement(int id,
                          int mapid,
                          java.lang.String type)
                   throws MapsException
Specified by:
deleteElement in class Manager
Throws:
MapsException

deleteElementsOfMap

public void deleteElementsOfMap(int id)
                         throws MapsException
Specified by:
deleteElementsOfMap in class Manager
Throws:
MapsException

deleteMap

public int deleteMap(Map m)
              throws MapsException
Specified by:
deleteMap in class Manager
Throws:
MapsException

deleteMap

public int deleteMap(int id)
              throws MapsException
Specified by:
deleteMap in class Manager
Throws:
MapsException

deleteNodeTypeElementsFromAllMaps

public void deleteNodeTypeElementsFromAllMaps()
                                       throws MapsException
Specified by:
deleteNodeTypeElementsFromAllMaps in class Manager
Throws:
MapsException

deleteMapTypeElementsFromAllMaps

public void deleteMapTypeElementsFromAllMaps()
                                      throws MapsException
Specified by:
deleteMapTypeElementsFromAllMaps in class Manager
Throws:
MapsException

getElement

public Element getElement(int id,
                          int mapId,
                          java.lang.String type)
                   throws MapsException
Specified by:
getElement in class Manager
Throws:
MapsException

newElement

public Element newElement(int id,
                          int mapId,
                          java.lang.String type)
                   throws MapsException
Specified by:
newElement in class Manager
Throws:
MapsException

getAllElements

public Element[] getAllElements()
                         throws MapsException
Specified by:
getAllElements in class Manager
Throws:
MapsException

getElementsOfMap

public Element[] getElementsOfMap(int mapid)
                           throws MapsException
Specified by:
getElementsOfMap in class Manager
Throws:
MapsException

getNodeElementsOfMap

public Element[] getNodeElementsOfMap(int mapid)
                               throws MapsException
Specified by:
getNodeElementsOfMap in class Manager
Throws:
MapsException

getMapElementsOfMap

public Element[] getMapElementsOfMap(int mapid)
                              throws MapsException
Specified by:
getMapElementsOfMap in class Manager
Throws:
MapsException

getElementsLike

public Element[] getElementsLike(java.lang.String elementLabel)
                          throws MapsException
Specified by:
getElementsLike in class Manager
Throws:
MapsException

getMapsStructure

public java.util.Map getMapsStructure()
                               throws MapsException
Description copied from class: Manager
get a java.util.Map (key=parentMapId, value=set of child maps)

Specified by:
getMapsStructure in class Manager
Returns:
java.util.Map (key=parentMapId, value=set of child maps)
Throws:
MapsException

countMaps

public int countMaps(int mapId)
              throws MapsException
Specified by:
countMaps in class Manager
Throws:
MapsException

getMap

public Map getMap(int id)
           throws MapsException
Specified by:
getMap in class Manager
Throws:
MapsException

getMaps

public Map[] getMaps(java.lang.String mapname,
                     java.lang.String maptype)
              throws MapsException
Specified by:
getMaps in class Manager
Throws:
MapsException

getAllMaps

public Map[] getAllMaps()
                 throws MapsException
Specified by:
getAllMaps in class Manager
Throws:
MapsException

getMapsLike

public Map[] getMapsLike(java.lang.String mapLabel)
                  throws MapsException
Specified by:
getMapsLike in class Manager
Throws:
MapsException

getMapsByName

public Map[] getMapsByName(java.lang.String mapLabel)
                    throws MapsException
Specified by:
getMapsByName in class Manager
Throws:
MapsException

getContainerMaps

public Map[] getContainerMaps(int id,
                              java.lang.String type)
                       throws MapsException
Specified by:
getContainerMaps in class Manager
Throws:
MapsException

getAllMapMenus

public MapMenu[] getAllMapMenus()
                         throws MapsException
Specified by:
getAllMapMenus in class Manager
Throws:
MapsException

getMapMenu

public MapMenu getMapMenu(int mapId)
                   throws MapsException
Specified by:
getMapMenu in class Manager
Throws:
MapsException

getMapsMenuByName

public MapMenu[] getMapsMenuByName(java.lang.String mapLabel)
                            throws MapsException
Specified by:
getMapsMenuByName in class Manager
Throws:
MapsException

getMapsMenuByOwner

public MapMenu[] getMapsMenuByOwner(java.lang.String owner)
                             throws MapsException
Specified by:
getMapsMenuByOwner in class Manager
Throws:
MapsException

isElementInMap

public boolean isElementInMap(int elementId,
                              int mapId,
                              java.lang.String type)
                       throws MapsException
Specified by:
isElementInMap in class Manager
Throws:
MapsException

getAllElementInfo

public ElementInfo[] getAllElementInfo()
                                throws MapsException
Specified by:
getAllElementInfo in class Manager
Throws:
MapsException

getLinks

public VLink[] getLinks(VElement[] elems)
                 throws MapsException
Specified by:
getLinks in class Manager
Throws:
MapsException

getLinksOnElement

public VLink[] getLinksOnElement(VElement[] elems,
                                 VElement elem)
                          throws MapsException
Specified by:
getLinksOnElement in class Manager
Throws:
MapsException

refreshElement

public VElement refreshElement(VElement mapElement)
                        throws MapsException
Specified by:
refreshElement in class Manager
Throws:
MapsException

refreshElements

public VElement[] refreshElements(VElement[] mapElements)
                           throws MapsException
Specified by:
refreshElements in class Manager
Throws:
MapsException

reloadMap

public VMap reloadMap(VMap map)
               throws MapsException
Specified by:
reloadMap in class Manager
Throws:
MapsException

getElementInfo

public java.util.Map getElementInfo(int elementId,
                                    int mapId,
                                    java.lang.String type)
                             throws MapsException
Description copied from class: Manager
returns a java.util.Map containing infos for the element of the map (key, value)

Specified by:
getElementInfo in class Manager
Returns:
Throws:
MapsException

getVisibleMapsMenu

public MapMenu[] getVisibleMapsMenu(java.lang.String user,
                                    java.lang.String userRole)
                             throws MapsException
Specified by:
getVisibleMapsMenu in class Manager
Throws:
MapsException


Copyright © 2007. All Rights Reserved.