Class SurveillanceViewProvider
- java.lang.Object
-
- org.opennms.features.vaadin.surveillanceviews.config.SurveillanceViewProvider
-
public class SurveillanceViewProvider extends Object
This class is used for loading, holding and saving ofSurveillanceViewConfiguration
definitions.- Author:
- Christian Pape
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addView(View view)
This method adds aView
to this provider.boolean
containsView(String name)
Checks whether this object containsView
data concerning the given title.boolean
containsView(View view)
Checks whether this object contains a givenView
instance.View
getDefaultView()
Returns the defaultView
.static SurveillanceViewProvider
getInstance()
Method to return the instance of this singleton.SurveillanceViewConfiguration
getSurveillanceViewConfiguration()
Returns the loadedorg.opennms.features.vaadin.surveillanceviews.model.SurveillanceViewConfiguration
instanceView
getView(String name)
Returns theView
for the given title.void
load()
This method loads the configuration data from disk.void
removeView(View view)
This method removes aView
from this provider.void
replaceView(View oldView, View newView)
Replaces aView
with a new one.void
save()
This method saves the data represented by this object to disk.
-
-
-
Method Detail
-
getInstance
public static SurveillanceViewProvider getInstance()
Method to return the instance of this singleton.- Returns:
- the singleton instance
-
save
public void save()
This method saves the data represented by this object to disk.
-
load
public void load()
This method loads the configuration data from disk.
-
containsView
public boolean containsView(String name)
Checks whether this object containsView
data concerning the given title.- Parameters:
name
- the title to search for- Returns:
- true, if a
View
with the given name exists, false otherwise
-
getView
public View getView(String name)
Returns theView
for the given title.- Parameters:
name
- the title to search for- Returns:
- the
View
instance if found, null otherwise
-
replaceView
public void replaceView(View oldView, View newView)
Replaces aView
with a new one.- Parameters:
oldView
- the old view to be replacednewView
- the new view
-
getDefaultView
public View getDefaultView()
Returns the defaultView
.- Returns:
- the
View
instance if found, null otherwise
-
getSurveillanceViewConfiguration
public SurveillanceViewConfiguration getSurveillanceViewConfiguration()
Returns the loadedorg.opennms.features.vaadin.surveillanceviews.model.SurveillanceViewConfiguration
instance- Returns:
- the loaded config instance
-
containsView
public boolean containsView(View view)
Checks whether this object contains a givenView
instance.
-
addView
public void addView(View view)
This method adds aView
to this provider.- Parameters:
view
- theView
instance to be added
-
-