|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.datapower.wamt.dataAPI.local.filesystem.RepositoryImpl
public class RepositoryImpl
The Repository object used for executing persistence operations such as reading and writing Stored objects to the local file system
This implementation provides a public static Repository getInstance() method to return the singleton instance of Repository object. The clientAPI starts up the repository when the Manager is initialized. It obtains an instance of the singleton Repository in order to make make modifications to persisted data.
The data to be persisted is written to a directory configured by the caller.
The Repository objects transforms all the Stored objects to XML Objects before saving them in the local file system. It also determines the WAMT.Repository.xml and loads all all persisted XMLobjects and transforms them to Java objects.
Repository
Field Summary |
---|
Fields inherited from interface com.ibm.datapower.wamt.dataAPI.Repository |
---|
COPYRIGHT_2009_2010, SCM_REVISION |
Method Summary | |
---|---|
StoredDeploymentPolicyImpl |
createDeploymentPolicy(StoredDomain domain,
java.lang.String name,
URLSource policyURL,
java.lang.String policyDomainName,
DeploymentPolicyType policyType)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the policy version within the containing domain element. |
StoredDeploymentPolicyVersion |
createDeploymentPolicyVersion(StoredDeploymentPolicy policy,
Blob blob,
java.lang.String comment,
java.util.Date timestamp)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the policy version within the containing deployment policy element. |
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)
Note: The Local File System implementation adds a device element to the WAMT.repository.xml file during a save operation to save all information related to the device. |
StoredDomain |
createDomain(StoredDevice device,
java.lang.String domainName)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the domain within the containing device element. |
StoredDomainVersion |
createDomainVersion(StoredDomain versionedObject,
Blob blob,
java.lang.String userComment,
java.util.Date timeStamp)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the StoredDomainVersion within the containing Domain element. |
StoredFirmware |
createFirmware(DeviceType deviceType,
ModelType modelType,
StringCollection strictFeatures,
StringCollection nonstrictFeatures)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the firmware within the containing manager element. |
StoredFirmwareVersion |
createFirmwareVersion(StoredFirmware versionedObject,
Blob blob,
java.lang.String level,
java.util.Date manufactureDate,
java.lang.String userComment,
java.util.Date timeStamp)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the firmware version within the containing firmware element. |
StoredManagedSet |
createManagedSet(java.lang.String name)
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the managed set within the containing manager element. |
StoredTagImpl |
createTag(java.lang.String name,
java.lang.String value)
|
void |
exportAll(java.io.OutputStream outputStream)
Note: The Local File System implementation does not implement this method. |
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. |
static RepositoryImpl |
getInstance(Credential cred)
This method must be implemented to return the singleton instance of 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()
|
StoredDevice[] |
getUnmanagedDevices(DeviceType desiredDeviceType)
|
void |
importAll(java.io.InputStream inputStream)
Note: The Local File System implementation does not implement this method. |
void |
save(boolean forceSave)
Note: The Local File System implementation adds or changes elements in the WAMT.Repository.xml file during a save operation. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final RepositoryImpl getInstance(Credential cred)
cred
- The credential to use for this implementation
public void exportAll(java.io.OutputStream outputStream)
Note: The Local File System implementation does not implement this method. To backup the repository, make copies of all the files in configured repository directory.
exportAll
in interface Repository
outputStream
- where the exported data will be writtenRepository.importAll(InputStream)
public void importAll(java.io.InputStream inputStream) throws DatastoreException
Note: The Local File System implementation does not implement this method.
importAll
in interface Repository
inputStream
- where to read the previously exported data fromRepository.exportAll(OutputStream)
public void save(boolean forceSave) throws DirtySaveException
Note: The Local File System implementation adds or changes elements in the WAMT.Repository.xml file during a save operation. It may also persist separate bin files for deployed firmware versions and domain configurations. This implementation ignores the forceSave parameter.
save
in interface Repository
forceSave
- If true, do not throw DirtySaveException, even if other changes have
been saved to the repository while the unsaved changes were
taking place.public 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
Note: The Local File System implementation adds a device element to the WAMT.repository.xml file during a save operation to save all information related to the device.
createDevice
in interface Repository
serialNumber
- the serialNumber for this devicename
- the human-consumable symbolic name for this objectdeviceType
- the device type of the devicemodelType
- the model type of the devicehostname
- the host name or IP address of the deviceuserid
- the administrative user id of the devicepassword
- the administrative password of the deviceHLMport
- the device port for AMP communicationsguiPort
- the device port for the WebGUIampVersion
- the device's current AMP version
StoredManagedSet.add(StoredDevice)
,
Repository.getDevice(String)
,
StoredDevice.delete()
public StoredDomain createDomain(StoredDevice device, java.lang.String domainName) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the domain within the containing device element.
createDomain
in interface Repository
device
- The StoredDevice that contains this StoredDomaindomainName
- The name of this StoredDomain
StoredDeployableConfiguration.delete()
public StoredDomain updateDomain(StoredDomain domain) throws AlreadyExistsInRepositoryException, DatastoreException
Repository
Domain.setSourceConfiguration(URLSource)
,
Domain.setQuiesceTimeout(int)
, and
Domain.setSynchronizationMode(com.ibm.datapower.wamt.clientAPI.DomainSynchronizationMode)
.
These changes have to be persisted in the repository.
updateDomain
in interface Repository
Domain.setDeploymentPolicy(URLSource, String, String)
,
Domain.setQuiesceTimeout(int)
,
Domain.setSynchronizationMode(com.ibm.datapower.wamt.clientAPI.DomainSynchronizationMode)
public StoredDeploymentPolicyVersion createDeploymentPolicyVersion(StoredDeploymentPolicy policy, Blob blob, java.lang.String comment, java.util.Date timestamp) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the policy version within the containing deployment policy element.
createDeploymentPolicyVersion
in interface Repository
policy
- The StoredDeploymentPolicyVersion objectblob
- The policy blob that will be deployedcomment
- The user provided comment for the deployment policy objecttimestamp
- creation timestamp
StoredVersion.delete()
public StoredDeploymentPolicyImpl createDeploymentPolicy(StoredDomain domain, java.lang.String name, URLSource policyURL, java.lang.String policyDomainName, DeploymentPolicyType policyType) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the policy version within the containing domain element.
createDeploymentPolicy
in interface Repository
domain
- The stored Domain objectname
- - this is the first piece of information used to find the deployment policy within
the URLSource specifiedpolicyURL
- - 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 specifiedpolicyType
- - the policy type used during configuration deployment
StoredDeployablePolicy.delete()
,
DeploymentPolicyType.EXPORT
,
DeploymentPolicyType.XML
public StoredDevice getDevice(java.lang.String serialNumber)
Repository
Manager.getDeviceBySerialNumber(String)
getDevice
in interface Repository
serialNumber
- serialNumber of the device to retrieve from the repository
public StoredDevice[] getDeviceBySerialNumber(java.lang.String serialNumber)
Repository
getDeviceBySerialNumber
in interface Repository
serialNumber
- serialNumber of the device to retrieve from the repository
public StoredDevice[] getDevices()
Repository
Manager.getAllDevices()
getDevices
in interface Repository
public StoredDevice[] getUnmanagedDevices(DeviceType desiredDeviceType)
public StoredTag getTag(java.lang.String name)
getTag
in interface Repository
public StoredTag[] getTags()
getTags
in interface Repository
public StoredManagedSet getManagedSet(java.lang.String name)
Repository
Manager.getManagedSet(String)
getManagedSet
in interface Repository
name
- name of the StoredManagedSet as stored in the repository
public StoredManagedSet[] getManagedSets()
Repository
Manager.getManagedSets()
getManagedSets
in interface Repository
public StoredFirmware[] getFirmwares()
Repository
Manager.getFirmwares()
getFirmwares
in interface Repository
public StoredFirmware getFirmware(DeviceType deviceType, ModelType modelType, StringCollection strictFeatures, StringCollection nonstrictFeatures)
Repository
getFirmware
in interface Repository
deviceType
- the deviceType the firmware supportsmodelType
- the modelType the firmware supportsstrictFeatures
- The strict features supported by this firmware.nonstrictFeatures
- The nonstrict features supported by this firmware.
public StoredManagedSet createManagedSet(java.lang.String name) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the managed set within the containing manager element.
createManagedSet
in interface Repository
name
- a human-consumable symbolic name for this StoredManagedSet
public StoredTagImpl createTag(java.lang.String name, java.lang.String value) throws AlreadyExistsInRepositoryException, DatastoreException
createTag
in interface Repository
public StoredFirmware createFirmware(DeviceType deviceType, ModelType modelType, StringCollection strictFeatures, StringCollection nonstrictFeatures) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the firmware within the containing manager element. It will also contain firmware version elements for each level of firmware deployed.
createFirmware
in interface Repository
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.
public 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
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the firmware version within the containing firmware element.
createFirmwareVersion
in interface Repository
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
sitelevel
- The level of the firmware extracted from the blobmanufactureDate
- The date the firmware was created. Extracted from the blob.userComment
- The user's comment for the action that is creating the
StoredFirmware versiontimeStamp
- The time to record for the creation of the
StoredFirmwareVersion
public StoredDomainVersion createDomainVersion(StoredDomain versionedObject, Blob blob, java.lang.String userComment, java.util.Date timeStamp) throws AlreadyExistsInRepositoryException, DatastoreException
Note: The Local File System implementation adds an element to the WAMT.repository.xml file during create operation to save all information related to the StoredDomainVersion within the containing Domain element.
createDomainVersion
in interface Repository
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 StoredDomainVersionuserComment
- The user's comment for the action that is creating the
StoredDomainVersiontimeStamp
- The time to record for the creation of the StoredDomainVersion
public int getMaxVersionsToStore()
Repository
Manager.getMaxVersionsToStore()
uses this interface to query the maximum versions that can currently be persisted.
This is the value set in Repository.setMaxVersionsToStore(int)
. This allows the version
data for objects to be trimmed by users when they want to purge their older data.
getMaxVersionsToStore
in interface Repository
Repository.setMaxVersionsToStore(int)
) then it should return 0 so
that the Manager can set it to a usable default.Repository.setMaxVersionsToStore(int)
public void setMaxVersionsToStore(int maxVersions)
Repository
setMaxVersionsToStore
in interface Repository
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.Repository.getMaxVersionsToStore()
public void shutdown()
Repository
Manager.shutdown()
shutdown
in interface Repository
Repository.startup()
public void startup() throws DatastoreException
Repository
Manager.getInstance(java.util.Map)
startup
in interface Repository
Repository.shutdown()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |