Class DataSourceEnumerator
- java.lang.Object
-
- com.microstrategy.web.objects.admin.DataSourceEnumerator
-
public abstract class DataSourceEnumerator extends java.lang.ObjectThe DataSourceEnumerator interface represents the list ofDataSourceobjects active on the current server. TheDataSourceobjects are persisted in the registry of the machine that the API is local to. Finally, note that any changes made to the enumerator or the objects in the enumerator will not be svaed to metadata until the save method is called.- Since:
- MicroStrategy Web 7.5.2
-
-
Constructor Summary
Constructors Constructor Description DataSourceEnumerator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract DataSourceadd(java.lang.String name, int connectionType)Adds a newDataSourceobject to the collection.abstract DataSourceaddCopy(java.lang.String destName, DataSource origin)Adds a copy of the givenDataSourceobject to the collection with a different name.abstract java.util.Enumerationelements()Returns a java.util.Enumeration containing the items in the collection.abstract DataSourceget(int i)Returns theDataSourceat the given index in the collection.static DataSourceEnumeratorgetInstance()Returns aDataSourceEnumeratorobject containing the list of DataSource objects in the registry.abstract DataSourcegetItemByName(java.lang.String name)Returns theDataSourceobject with the given name.abstract voidremove(int i)Removes theDataSourceobject at the given index from the collection.abstract voidremove(DataSource ds)Removes the givenDataSourceobject from the collection.abstract voidsave()Saves the DataSourceEnumerator back to the registry.abstract intsize()Returns the number of items in the collection.
-
-
-
Method Detail
-
getInstance
public static DataSourceEnumerator getInstance()
Returns aDataSourceEnumeratorobject containing the list of DataSource objects in the registry.- Returns:
- The
DataSourceEnumeratorcontaining the list of DataSource objects.
-
get
public abstract DataSource get(int i)
Returns theDataSourceat the given index in the collection.- Parameters:
i- The index of theDataSourceobject to return.- Returns:
- The
DataSourceobject at the given index.
-
elements
public abstract java.util.Enumeration elements()
Returns a java.util.Enumeration containing the items in the collection.- Returns:
- A java.util.Enumeration containing the items in the collection.
-
size
public abstract int size()
Returns the number of items in the collection.- Returns:
- The number of items in the collection.
-
getItemByName
public abstract DataSource getItemByName(java.lang.String name) throws java.lang.IllegalArgumentException
Returns theDataSourceobject with the given name.- Parameters:
name- The name of the object to find.- Returns:
- The
DataSourceobject with the given name. - Throws:
java.lang.IllegalArgumentException- Thrown if no item with the given name exists.
-
add
public abstract DataSource add(java.lang.String name, int connectionType)
Adds a newDataSourceobject to the collection. The newly addedDataSourceobject will have the given connection type. Note that the newly created Data Source will not be saved to metadata until the save method is called on either the newDataSourceor the DataSourceEnumerator.- Parameters:
name- The name of the Data Source to create.connectionType- The connection type of the data source, fromEnumDSSXMLDataSourceConnectionType.- Returns:
- The newly created
DataSourceobject.
-
remove
public abstract void remove(int i)
Removes theDataSourceobject at the given index from the collection. Note that the change will not be propagated to the metadata until the save method on the DataSourceEnumerator is called.- Parameters:
i- The index of the item to remove from the collection.
-
remove
public abstract void remove(DataSource ds)
Removes the givenDataSourceobject from the collection. Note that the change will not be propagated to the metadata until the save method on the DataSourceEnumerator is called.- Parameters:
ds- TheDataSourceobject to remove from the collection.
-
addCopy
public abstract DataSource addCopy(java.lang.String destName, DataSource origin)
Adds a copy of the givenDataSourceobject to the collection with a different name. Note that the newly created Data Source will not be saved to metadata until the save method is called on either the newDataSourceor the DataSourceEnumerator. *- Parameters:
destName- The name of the newly created Data Source.origin- TheDataSourceobject to copy.- Returns:
- The new copy of the
DataSourceobject.
-
save
public abstract void save() throws WebObjectsAdminExceptionSaves the DataSourceEnumerator back to the registry. This will save all added, and changed DataSource objects back to registry, and will cause the final deletion of the deleted objects to be persisted to the registry.- Throws:
WebObjectsAdminException- Thrown if an error occurs when saving.
-
-