Class DataSourceEnumerator
- java.lang.Object
-
- com.microstrategy.web.objects.admin.DataSourceEnumerator
-
public abstract class DataSourceEnumerator extends java.lang.Object
The DataSourceEnumerator interface represents the list ofDataSource
objects active on the current server. TheDataSource
objects 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 DataSource
add(java.lang.String name, int connectionType)
Adds a newDataSource
object to the collection.abstract DataSource
addCopy(java.lang.String destName, DataSource origin)
Adds a copy of the givenDataSource
object to the collection with a different name.abstract java.util.Enumeration
elements()
Returns a java.util.Enumeration containing the items in the collection.abstract DataSource
get(int i)
Returns theDataSource
at the given index in the collection.static DataSourceEnumerator
getInstance()
Returns aDataSourceEnumerator
object containing the list of DataSource objects in the registry.abstract DataSource
getItemByName(java.lang.String name)
Returns theDataSource
object with the given name.abstract void
remove(int i)
Removes theDataSource
object at the given index from the collection.abstract void
remove(DataSource ds)
Removes the givenDataSource
object from the collection.abstract void
save()
Saves the DataSourceEnumerator back to the registry.abstract int
size()
Returns the number of items in the collection.
-
-
-
Method Detail
-
getInstance
public static DataSourceEnumerator getInstance()
Returns aDataSourceEnumerator
object containing the list of DataSource objects in the registry.- Returns:
- The
DataSourceEnumerator
containing the list of DataSource objects.
-
get
public abstract DataSource get(int i)
Returns theDataSource
at the given index in the collection.- Parameters:
i
- The index of theDataSource
object to return.- Returns:
- The
DataSource
object 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 theDataSource
object with the given name.- Parameters:
name
- The name of the object to find.- Returns:
- The
DataSource
object 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 newDataSource
object to the collection. The newly addedDataSource
object 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 newDataSource
or 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
DataSource
object.
-
remove
public abstract void remove(int i)
Removes theDataSource
object 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 givenDataSource
object 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
- TheDataSource
object to remove from the collection.
-
addCopy
public abstract DataSource addCopy(java.lang.String destName, DataSource origin)
Adds a copy of the givenDataSource
object 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 newDataSource
or the DataSourceEnumerator. *- Parameters:
destName
- The name of the newly created Data Source.origin
- TheDataSource
object to copy.- Returns:
- The new copy of the
DataSource
object.
-
save
public abstract void save() throws WebObjectsAdminException
Saves 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.
-
-