blackboard.admin.persist.datasource
Interface DataSourceManager


public interface DataSourceManager

Provides an API for managing DataSources and the data associated with them.

Since:
Bb 9.1 SP4

Nested Class Summary
static class DataSourceManager.EntityType
          Types of entities that are associated with a DataSource
 
Method Summary
 java.lang.String beginSnapshotSession()
          Notifies the persistence layer that a snapshot session is beginning for tracking purposes.
 void beginSnapshotSession(java.lang.String sessionId)
          Notifies the persistence layer that a snapshot session is beginning for tracking purposes.
 DataSource create(java.lang.String batchUid, java.lang.String description)
          Create a new DataSource.
 void delete(java.lang.String batchUid)
          Delete a DataSource.
 void disableAll(java.lang.String batchUid, java.util.Calendar cutoffDate)
          Disable all of the data associated to a DataSource.
 void disableEntity(java.lang.String batchUid, DataSourceManager.EntityType entityType, java.util.Calendar cutoffDate)
          Disable a specific type of data associated to a DataSource.
 void endSnapshotSession(java.lang.String sessionId)
          Notifies the persistence layer that a snapshot session is ending for tracking purposes.
 java.util.List<DataSource> loadAll()
          Load all DataSource objects in the system.
 DataSource loadByBatchUid(java.lang.String batchUid)
          Load a DataSource.
 java.util.Map<DataSourceManager.EntityType,java.lang.Long> loadObjectCounts(java.lang.String batchUid, IAdminObject.RowStatus status)
          Load the count of all objects associated with a DataSource.
 void modify(DataSource ds)
          Modify a DataSource.
 void purgeAll(java.lang.String batchUid, java.util.Calendar cutoffDate)
          Delete all of the disabled data associated to a DataSource.
 void purgeEntity(java.lang.String batchUid, DataSourceManager.EntityType entityType, java.util.Calendar cutoffDate)
          Delete the disabled records for a specific type of data associated to a DataSource.
 void purgeSnapshotSessions()
          Clears all temporary persistent storage used by snapshot processes ( includes cloning ).
 

Method Detail

loadAll

java.util.List<DataSource> loadAll()
                                   throws PersistenceException
Load all DataSource objects in the system.

Returns:
all the DataSource objects in the system
Throws:
PersistenceException - if a database error occurs.

loadByBatchUid

DataSource loadByBatchUid(java.lang.String batchUid)
                          throws PersistenceException,
                                 KeyNotFoundException
Load a DataSource.

Parameters:
batchUid - Unique identifier of the data source.
Returns:
the DataSource that has the specified Batch UID.
Throws:
PersistenceException - if a database error occurs.
KeyNotFoundException - if no DataSource exists that has the specified Batch UID.

create

DataSource create(java.lang.String batchUid,
                  java.lang.String description)
                  throws PersistenceException,
                         ValidationException
Create a new DataSource.

Parameters:
batchUid - unique identifier for the data source.
description - an optional description of the data source.
Returns:
The new DataSource.
Throws:
PersistenceException - if a database error occurs.
ValidationException - if the parameters specified are not valid for a DataSource.

modify

void modify(DataSource ds)
            throws PersistenceException,
                   KeyNotFoundException,
                   ValidationException
Modify a DataSource.

Parameters:
ds - the modified DataSource.
Throws:
PersistenceException - if a database error occurs.
KeyNotFoundException - if the specified data source does not exist.
ValidationException - if the data in the data source object is not valid.

delete

void delete(java.lang.String batchUid)
            throws PersistenceException,
                   KeyNotFoundException
Delete a DataSource.

The data source must not have any data associated with it in order to delete the data source.

Parameters:
batchUid - unique identifier of the data source.
Throws:
PersistenceException - if a database error occurs (e.g. if the data source has data associated with it)
KeyNotFoundException - if the specified data source does not exist.

disableAll

void disableAll(java.lang.String batchUid,
                java.util.Calendar cutoffDate)
                throws PersistenceException
Disable all of the data associated to a DataSource. Optionally, a cutoff date can be specified which limits the operation to data that was last modified before the cutoff date.

Parameters:
batchUid - Unique identifier of the data source.
cutoffDate - Date at which to limit the operation.
Throws:
PersistenceException - if a database error occurs.

disableEntity

void disableEntity(java.lang.String batchUid,
                   DataSourceManager.EntityType entityType,
                   java.util.Calendar cutoffDate)
                   throws PersistenceException
Disable a specific type of data associated to a DataSource. Optionally, a cutoff date can be specified which limits the operation to data that was last modified before the cutoff date.

Parameters:
batchUid - Unique identifier of the data source.
entityType - Type of entity to disable.
cutoffDate - Date at which to limit the operation.
Throws:
PersistenceException - if a database error occurs.

purgeAll

void purgeAll(java.lang.String batchUid,
              java.util.Calendar cutoffDate)
              throws PersistenceException
Delete all of the disabled data associated to a DataSource. Optionally, a cutoff date can be specified which limits the operation to data that was last modified before the cutoff date.

Parameters:
batchUid - Unique identifier of the data source.
cutoffDate - Date at which to limit the operation.
Throws:
PersistenceException - if a database error occurs.

purgeEntity

void purgeEntity(java.lang.String batchUid,
                 DataSourceManager.EntityType entityType,
                 java.util.Calendar cutoffDate)
                 throws PersistenceException
Delete the disabled records for a specific type of data associated to a DataSource. Optionally, a cutoff date can be specified which limits the operation to data that was last modified before the cutoff date.

Parameters:
batchUid - Unique identifier of the data source.
entityType - Type of entity to disable.
cutoffDate - Date at which to limit the operation.
Throws:
PersistenceException - if a database error occurs.

purgeSnapshotSessions

void purgeSnapshotSessions()
                           throws PersistenceException
Clears all temporary persistent storage used by snapshot processes ( includes cloning ). Important... This removes all references used by snapshot process. If invoked while snapshot is running it will adversely affect results.

Throws:
PersistenceException - if a database error occurs.

beginSnapshotSession

java.lang.String beginSnapshotSession()
                                      throws PersistenceException
Notifies the persistence layer that a snapshot session is beginning for tracking purposes.

Throws:
PersistenceException - Thrown if failure occurs during logging start of snapshot based session.

beginSnapshotSession

void beginSnapshotSession(java.lang.String sessionId)
                          throws PersistenceException
Notifies the persistence layer that a snapshot session is beginning for tracking purposes. This version created to support SOAP interactions.

Parameters:
sessionId - - the id of the session to create
Throws:
PersistenceException - Thrown if failure occurs during logging start of snapshot based session.

endSnapshotSession

void endSnapshotSession(java.lang.String sessionId)
                        throws PersistenceException
Notifies the persistence layer that a snapshot session is ending for tracking purposes. Expected behavior is that this will cleanup any data associated with that session.

Parameters:
sessionId - - the id of the session to delete
Throws:
PersistenceException - Thrown if failure occurs during logging end of snapshot based session.

loadObjectCounts

java.util.Map<DataSourceManager.EntityType,java.lang.Long> loadObjectCounts(java.lang.String batchUid,
                                                                            IAdminObject.RowStatus status)
                                                                            throws PersistenceException
Load the count of all objects associated with a DataSource.

Parameters:
batchUid - Unique identifier of the data source.
status - status to be used in specifying criteria in count selection.
Returns:
a Map of DataSourceManager.EntityType to count of that entity.
Throws:
PersistenceException - if a database error occurs.


Copyright © 2012 Blackboard, Inc. All Rights Reserved.