Class DataSourceEnumerator


  • public abstract class DataSourceEnumerator
    extends java.lang.Object
    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.
    Since:
    MicroStrategy Web 7.5.2
    • Constructor Detail

      • DataSourceEnumerator

        public DataSourceEnumerator()
    • Method Detail

      • get

        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:
        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 the DataSource 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 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:
        The newly created DataSource object.
      • remove

        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.
      • remove

        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.
      • addCopy

        public abstract DataSource addCopy​(java.lang.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:
        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.