public abstract class

DataSourceEnumerator

extends Object
java.lang.Object
   ↳ com.microstrategy.web.objects.admin.DataSourceEnumerator

Class Overview

The DataSourceEnumerator interface represents the list of DataSource objects active on the current server. The DataSource 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.

Summary

Public Constructors
DataSourceEnumerator()
Public Methods
abstract DataSource add(String name, int connectionType)
Adds a new DataSource object to the collection.
abstract DataSource addCopy(String destName, DataSource origin)
Adds a copy of the given DataSource object to the collection with a different name.
abstract Enumeration elements()
Returns a java.util.Enumeration containing the items in the collection.
abstract DataSource get(int i)
Returns the DataSource at the given index in the collection.
static DataSourceEnumerator getInstance()
Returns a DataSourceEnumerator object containing the list of DataSource objects in the registry.
abstract DataSource getItemByName(String name)
Returns the DataSource object with the given name.
abstract void remove(int i)
Removes the DataSource object at the given index from the collection.
abstract void remove(DataSource ds)
Removes the given DataSource 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DataSourceEnumerator ()

Public Methods

public abstract DataSource add (String name, int connectionType)

Adds a new DataSource object to the collection. The newly added DataSource 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 new DataSource or the DataSourceEnumerator.

Parameters
name The name of the Data Source to create.
connectionType The connection type of the data source, from EnumDSSXMLDataSourceConnectionType.
Returns

public abstract DataSource addCopy (String destName, DataSource origin)

Adds a copy of the given DataSource 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 new DataSource or the DataSourceEnumerator. *

Parameters
destName The name of the newly created Data Source.
origin The DataSource object to copy.
Returns

public abstract Enumeration elements ()

Returns a java.util.Enumeration containing the items in the collection.

Returns
  • A java.util.Enumeration containing the items in the collection.

public abstract DataSource get (int i)

Returns the DataSource at the given index in the collection.

Parameters
i The index of the DataSource object to return.
Returns

public static DataSourceEnumerator getInstance ()

Returns a DataSourceEnumerator object containing the list of DataSource objects in the registry.

Returns

public abstract DataSource getItemByName (String name)

Returns the DataSource object with the given name.

Parameters
name The name of the object to find.
Returns
Throws
IllegalArgumentException Thrown if no item with the given name exists.

public abstract void remove (int i)

Removes the DataSource 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.

public abstract void remove (DataSource ds)

Removes the given DataSource 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 The DataSource object to remove from the collection.

public abstract void save ()

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.

public abstract int size ()

Returns the number of items in the collection.

Returns
  • The number of items in the collection.