com.ibm.datapower.wamt.dataAPI
Interface Repository

All Known Implementing Classes:
RepositoryImpl

public interface Repository

The object used for executing persistence operations such as retrieving and saving Stored objects available with the dataAPI

The implementor of this interface must provide a public static Repository getInstance() method to return the singleton instance of Repository. This is invoked when the Manager is initialized.

For the methods that return multiple objects in the form of arrays, for example getFirmwares(), if there are no items in the collection then the method should return an array of zero elements instead of a null array reference. By doing this the caller can easily use a for loop to iterate the array without worrying about a NullPointerException. This applies to all the classes in this package, not just this class.

See Also:
Manager, StoredManagedSet, StoredDevice, StoredDomain, StoredFirmware

Field Summary
static java.lang.String COPYRIGHT_2009_2010
           
static java.lang.String SCM_REVISION
           
 
Method Summary
 StoredDeploymentPolicy createDeploymentPolicy(StoredDomain domain, java.lang.String policyObjectName, URLSource url, java.lang.String policyDomainName, DeploymentPolicyType type)
          Creates a new policy object in the repository.
 StoredDeploymentPolicyVersion createDeploymentPolicyVersion(StoredDeploymentPolicy policy, Blob blob, java.lang.String comment, java.util.Date timestamp)
          Creates a new policy version object in the repository.
 StoredDevice createDevice(java.lang.String deviceID, java.lang.String serialNumber, java.lang.String name, DeviceType deviceType, ModelType modelType, java.lang.String hostname, java.lang.String userid, java.lang.String password, int HLMport, int guiPort, java.lang.String ampVersion)
          Create a new device object in the repository with these properties.
 StoredDomain createDomain(StoredDevice device, java.lang.String domainName)
          Create a new domain object in the repository.
 StoredDomainVersion createDomainVersion(StoredDomain versionedObject, Blob blob, java.lang.String userComment, java.util.Date timeStamp)
          Creates a new StoredDomainVersion object in the repository when the clientAPI deploys a new domain source configuration from Domain.deployConfiguration().
 StoredFirmware createFirmware(DeviceType deviceType, ModelType modelType, StringCollection strictFeatures, StringCollection nonstrictFeatures)
          Creates a new StoredFirmware object in the repository unless a matching Firmware already exists in the manager.
 StoredFirmwareVersion createFirmwareVersion(StoredFirmware versionedObject, Blob blob, java.lang.String level, java.util.Date manufactureDate, java.lang.String userComment, java.util.Date timeStamp)
          Creates a new StoredFirmwareVersion object in the repository.
 StoredManagedSet createManagedSet(java.lang.String name)
          Creates a new StoredManagedSet object in the repository.
 StoredTagImpl createTag(java.lang.String name, java.lang.String value)
           
 void exportAll(java.io.OutputStream outputStream)
          Export everything in the repository to the specified OutputStream.
 StoredDevice getDevice(java.lang.String serialNumber)
          Retrieves a device from the repository that has the specified serialNumber.
 StoredDevice[] getDeviceBySerialNumber(java.lang.String serialNumber)
          Retrieves all devices from the repository that has the specified serialNumber.
 StoredDevice[] getDevices()
          Retrieves all known devices in the repository.
 StoredFirmware getFirmware(DeviceType deviceType, ModelType modelType, StringCollection strictFeatures, StringCollection nonstrictFeatures)
          Gets an existing firmware with the specified attributes from the repository.
 StoredFirmware[] getFirmwares()
          Gets all the firmwares that are in the repository.
 StoredManagedSet getManagedSet(java.lang.String name)
          Gets the existing StoredManagedSet that has the specified name from the repository.
 StoredManagedSet[] getManagedSets()
          Gets all the ManagedSets in the repository.
 int getMaxVersionsToStore()
          Gets the maximum number of versions of any one object that the repository will try to keep.
 StoredTag getTag(java.lang.String name)
           
 StoredTag[] getTags()
           
 void importAll(java.io.InputStream inputStream)
          Import to the repository from the specified InputStream.
 void save(boolean forceSave)
          Save the changes that have been made to Stored objects to the repository The clientAPI method Manager.save(boolean) calls an implementation of this interface to save the data in the repository.
 void setMaxVersionsToStore(int maxVersions)
          Sets the maximum number of versions of any one object that should be kept in the repository.
 void shutdown()
          Shuts down the Repository.
 void startup()
          Starts up the Repository.
 StoredDomain updateDomain(StoredDomain domain)
          Updates an existing domain object.
 

Field Detail

COPYRIGHT_2009_2010

static final java.lang.String COPYRIGHT_2009_2010
See Also:
Constant Field Values

SCM_REVISION

static final java.lang.String SCM_REVISION
See Also:
Constant Field Values
Method Detail

exportAll

void exportAll(java.io.OutputStream outputStream)
               throws DatastoreException
Export everything in the repository to the specified OutputStream. This method can be used to backup the repository. This method will not close the OutputStream. The format of this data is in a known interchange format so the repository data can be migrated to another management system. The clientAPI method Manager.exportAll(OutputStream) calls an implementation of this interface to perform the export of the data in the repository.

Parameters:
outputStream - where the exported data will be written
See Also:
importAll(InputStream)

importAll

void importAll(java.io.InputStream inputStream)
               throws DatastoreException
Import to the repository from the specified InputStream. This InputStream should be connected to data that was previously exported. This method will not close the InputStream. The format of this data is in a known interchange format so the repository data can be migrated from another management system.The clientAPI method Manager.importAll(InputStream) calls an implementation of this interface to perform the export of the data in the repository.

Parameters:
inputStream - where to read the previously exported data from
See Also:
exportAll(OutputStream)

save

void save(boolean forceSave)
          throws DirtySaveException,
                 DatastoreException
Save the changes that have been made to Stored objects to the repository The clientAPI method Manager.save(boolean) calls an implementation of this interface to save the data in the repository.

Parameters:
forceSave - If true, do not throw DirtySaveException, even if other changes have been saved to the repository while the unsaved changes were taking place.

createDevice

StoredDevice createDevice(java.lang.String deviceID,
                          java.lang.String serialNumber,
                          java.lang.String name,
                          DeviceType deviceType,
                          ModelType modelType,
                          java.lang.String hostname,
                          java.lang.String userid,
                          java.lang.String password,
                          int HLMport,
                          int guiPort,
                          java.lang.String ampVersion)
                          throws AlreadyExistsInRepositoryException,
                                 DatastoreException
Create a new device object in the repository with these properties. The clientAPI Device calls an implementation of this interface to save the data in the repository.

Parameters:
serialNumber - the serialNumber for this device
name - the human-consumable symbolic name for this object
deviceType - the device type of the device
modelType - the model type of the device
hostname - the host name or IP address of the device
userid - the administrative user id of the device
password - the administrative password of the device
HLMport - the device port for AMP communications
guiPort - the device port for the WebGUI
ampVersion - the device's current AMP version
Returns:
a new StoredDevice object
See Also:
StoredManagedSet.add(StoredDevice), getDevice(String), StoredDevice.delete()

createDomain

StoredDomain createDomain(StoredDevice device,
                          java.lang.String domainName)
                          throws AlreadyExistsInRepositoryException,
                                 DatastoreException
Create a new domain object in the repository. The clientAPI Device.createManagedDomain(String) calls an implementation of this interface to save the newly created domain data in the repository.

Parameters:
device - The StoredDevice that contains this StoredDomain
domainName - The name of this StoredDomain
Returns:
a new StoredDomain object
See Also:
StoredDeployableConfiguration.delete()

createDeploymentPolicyVersion

StoredDeploymentPolicyVersion createDeploymentPolicyVersion(StoredDeploymentPolicy policy,
                                                            Blob blob,
                                                            java.lang.String comment,
                                                            java.util.Date timestamp)
                                                            throws AlreadyExistsInRepositoryException,
                                                                   DatastoreException
Creates a new policy version object in the repository. The clientAPI Domain.deployConfiguration() will create a new domain version and a new policy version. It will invoke an implementation of this interface to save the newly created policy version data in the repository.

Parameters:
policy - The StoredDeploymentPolicyVersion object
blob - The policy blob that will be deployed
comment - The user provided comment for the deployment policy object
timestamp - creation timestamp
Returns:
a new StoredDeploymentPolicyVersion object
See Also:
StoredVersion.delete()

createDeploymentPolicy

StoredDeploymentPolicy createDeploymentPolicy(StoredDomain domain,
                                              java.lang.String policyObjectName,
                                              URLSource url,
                                              java.lang.String policyDomainName,
                                              DeploymentPolicyType type)
                                              throws AlreadyExistsInRepositoryException,
                                                     DatastoreException
Creates a new policy object in the repository. The clientAPI Domain.deployConfiguration() will create a new domain version and a new policy version. It will invoke an implementation of this interface to save the newly created policy version data in the repository.

Parameters:
domain - The stored Domain object
policyObjectName - - this is the first piece of information used to find the deployment policy within the URLSource specified
url - - is a URLSource that points to a configuration containing the policy to be used during deployment.
policyDomainName - - this is the second piece of information used to find the deployment domain within the URLSource specified
type - - the policy type used during configuration deployment
Returns:
a new StoredDeploymentPolicy object
See Also:
StoredDeployablePolicy.delete(), DeploymentPolicyType.EXPORT, DeploymentPolicyType.XML

createTag

StoredTagImpl createTag(java.lang.String name,
                        java.lang.String value)
                        throws AlreadyExistsInRepositoryException,
                               DatastoreException

getDevice

StoredDevice getDevice(java.lang.String serialNumber)
Retrieves a device from the repository that has the specified serialNumber. This is a convenience method that is invoked from the The clientAPI Manager.getDeviceBySerialNumber(String)

Parameters:
serialNumber - serialNumber of the device to retrieve from the repository
Returns:
the StoredDevice object

getDeviceBySerialNumber

StoredDevice[] getDeviceBySerialNumber(java.lang.String serialNumber)
Retrieves all devices from the repository that has the specified serialNumber.

Parameters:
serialNumber - serialNumber of the device to retrieve from the repository
Returns:
the array of StoredDevice object

getDevices

StoredDevice[] getDevices()
Retrieves all known devices in the repository. The returned Devices may be managed or unmanaged, i.e they may or may not be members of a ManagedSet. This is a convenience method that is invoked from the The clientAPI Manager.getAllDevices()

Returns:
an array of Devices

getManagedSet

StoredManagedSet getManagedSet(java.lang.String name)
Gets the existing StoredManagedSet that has the specified name from the repository. This is is invoked from the The clientAPI Manager.getManagedSet(String)

Parameters:
name - name of the StoredManagedSet as stored in the repository
Returns:
a reference to the StoredManagedSet object that is populated from the repository

getManagedSets

StoredManagedSet[] getManagedSets()
Gets all the ManagedSets in the repository. This is a convenience method that is invoked internally in many places from the The clientAPI and is also call from Manager.getManagedSets()

Returns:
a array of ManagedSets

getTag

StoredTag getTag(java.lang.String name)

getTags

StoredTag[] getTags()

getFirmwares

StoredFirmware[] getFirmwares()
Gets all the firmwares that are in the repository. This is a convenience method that is invoked internally in many places within the clientAPI and also from public API Manager.getFirmwares()

Returns:
a array of StoredFirmware object
See Also:
"useCases section 4.3, 4.4"

getFirmware

StoredFirmware getFirmware(DeviceType deviceType,
                           ModelType modelType,
                           StringCollection strictFeatures,
                           StringCollection nonstrictFeatures)
Gets an existing firmware with the specified attributes from the repository. This is a convenience method that is invoked internally in many places within the clientAPI.

Parameters:
deviceType - the deviceType the firmware supports
modelType - the modelType the firmware supports
strictFeatures - The strict features supported by this firmware.
nonstrictFeatures - The nonstrict features supported by this firmware.
Returns:
a firmware object populated by the repository

createManagedSet

StoredManagedSet createManagedSet(java.lang.String name)
                                  throws AlreadyExistsInRepositoryException,
                                         DatastoreException
Creates a new StoredManagedSet object in the repository. This is invoked by ManagedSet.ManagedSet(String) to create and persist a new managed set in the repository.

Parameters:
name - a human-consumable symbolic name for this StoredManagedSet
Returns:
a new StoredManagedSet object.

createFirmware

StoredFirmware createFirmware(DeviceType deviceType,
                              ModelType modelType,
                              StringCollection strictFeatures,
                              StringCollection nonstrictFeatures)
                              throws AlreadyExistsInRepositoryException,
                                     DatastoreException
Creates a new StoredFirmware object in the repository unless a matching Firmware already exists in the manager. Each Firmware has attributes that uniquely identify it. These attributes include DeviceType, ModelType, Strict feature list, and Non-strict features See Firmware. It also creates a new StoredFirmwareVersion object whose attributes are determined from the firmware image passed in on the Manager.addFirmware(Blob, String) call.

Parameters:
deviceType - The type of device this firmware must run on.
modelType - The model type this firmware must run on.
strictFeatures - The strict features supported by this firmware.
nonstrictFeatures - The nonstrict features supported by this firmware.
Returns:
a new firmware object. *

createFirmwareVersion

StoredFirmwareVersion createFirmwareVersion(StoredFirmware versionedObject,
                                            Blob blob,
                                            java.lang.String level,
                                            java.util.Date manufactureDate,
                                            java.lang.String userComment,
                                            java.util.Date timeStamp)
                                            throws AlreadyExistsInRepositoryException,
                                                   DatastoreException
Creates a new StoredFirmwareVersion object in the repository. It stores the Firmware level (i.e. "3.6.0.1"), a reference to the firmware image file created from the binary image for this firmware added to the manager. See Firmware and Version. The StoredFirmwareVersion attributes (level) are determined from the firmware image passed in on the Manager.addFirmware(Blob, String) call.

When creating a StoredFirmwareVersion that has a Blob, please read the Blob class javadoc about verifying the contents are not in a byte array via Blob.hasBytes().

Parameters:
versionedObject - a reference to the StoredFirmware object that this StoredVersion object is a version of.
blob - a reference to the Blob that contains the binary image for this firmware image as down loaded from the manufacturer's web site
level - The level of the firmware extracted from the blob
manufactureDate - The date the firmware was created. Extracted from the blob.
userComment - The user's comment for the action that is creating the StoredFirmware version
timeStamp - The time to record for the creation of the StoredFirmwareVersion
Returns:
a StoredFirmwareVersion object populated by the repository

createDomainVersion

StoredDomainVersion createDomainVersion(StoredDomain versionedObject,
                                        Blob blob,
                                        java.lang.String userComment,
                                        java.util.Date timeStamp)
                                        throws AlreadyExistsInRepositoryException,
                                               DatastoreException
Creates a new StoredDomainVersion object in the repository when the clientAPI deploys a new domain source configuration from Domain.deployConfiguration(). The binary image for the domain configuration is also persisted.

When creating a StoredDomainVersion that has a Blob, please read the Blob class javadoc about verifying the contents are not in a byte array via Blob.hasBytes().

Parameters:
versionedObject - a reference to the StoredDomain object that this StoredVersion object is a version of.
blob - a reference to the Blob that contains the binary image for this StoredDomainVersion
userComment - The user's comment for the action that is creating the StoredDomainVersion
timeStamp - The time to record for the creation of the StoredDomainVersion
Returns:
a StoredDomainVersion object populated by the repository

getMaxVersionsToStore

int getMaxVersionsToStore()
Gets the maximum number of versions of any one object that the repository will try to keep. The Manager.getMaxVersionsToStore() uses this interface to query the maximum versions that can currently be persisted. This is the value set in setMaxVersionsToStore(int). This allows the version data for objects to be trimmed by users when they want to purge their older data.

Returns:
the maximum number of versions of any one object to keep in the repository. This will likely apply to StoredFirmwareVersions, StoredSettingsVersions, and StoredDomainVersions. If this value is not initialized (previously set to a specific value via setMaxVersionsToStore(int)) then it should return 0 so that the Manager can set it to a usable default.
See Also:
setMaxVersionsToStore(int)

setMaxVersionsToStore

void setMaxVersionsToStore(int maxVersions)
                           throws DatastoreException
Sets the maximum number of versions of any one object that should be kept in the repository. This is used to trim the repository to a reasonable size. If any object has more than maxVersions in the repository, then the repository will automatically delete the oldest versions until this threshold is no longer exceeded. The repository will not delete any versions that are currently desired versions, even if that results in storing more than maxVersions.

Parameters:
maxVersions - the maximum number of versions of any one object to keep in the repository. For example, is set to 4 then the repository will limit itself to keeping 4 versions of firmware, 4 settings of each managedSet, and 4 versions of each domain in each managedSet. This applies to all versioned objects: firmware, domains, and settings. A value that is less than 1 (0 or negative) means that there is no limit and the repository will never delete versions.
See Also:
getMaxVersionsToStore()

startup

void startup()
             throws DatastoreException
Starts up the Repository. This instance of Repository is available for use after startup is invoked. This invoked by Manager.getInstance(java.util.Map)

See Also:
shutdown()

shutdown

void shutdown()
              throws DatastoreException
Shuts down the Repository. This instance of Repository should no longer be used after shutdown is invoked. This invoked by Manager.shutdown()

See Also:
startup()

updateDomain

StoredDomain updateDomain(StoredDomain domain)
                          throws AlreadyExistsInRepositoryException,
                                 DatastoreException
Updates an existing domain object. Domain object attributes values can be modified by calling the following methods: Domain.setSourceConfiguration(URLSource), Domain.setQuiesceTimeout(int), and Domain.setSynchronizationMode(com.ibm.datapower.wamt.clientAPI.DomainSynchronizationMode). These changes have to be persisted in the repository.

See Also:
Domain.setDeploymentPolicy(URLSource, String, String), Domain.setQuiesceTimeout(int), Domain.setSynchronizationMode(com.ibm.datapower.wamt.clientAPI.DomainSynchronizationMode)


© Copyright IBM Corp. 2006, 2010 All Rights Reserved.