. It isolates the
client from becoming intimate with the structure and location of the related
assets within the Asset
. It also hides the details of how or
when the related assets are loaded.
This interface is not intended to be implemented by clients.
Nested Class Summary |
static class |
IRelatedAssetManager.DepthOptions
Type safe enumeration for the depth options supported by the
IRelatedAssetManager methods that take a depth. |
static class |
IRelatedAssetManager.StatusOptions
Type safe enumeration for the status options supported by the
IRelatedAssetManager methods that take a status option. |
hasRelatedAssets
public boolean hasRelatedAssets()
- Determines if the
Asset
being managed contains related
assets.
- Returns:
true
if the Asset
contains related
assets
getAsset
public Asset getAsset()
- Retrieves the
Asset
being managed.
- Returns:
- the
Asset
being managed.
getRelatedAssets
public Asset[] getRelatedAssets()
throws RelatedAssetManagerException
- Retrieves the related assets for the
Asset
being managed.
This is a convenience method and equivalent to calling the other
getRelatedAssets(DepthOptions, StatusOptions, IProgressMonitor)
method with a depth option of DEPTH_INFINITE
, a status
option of RECORD
and a null
progress
monitor.
- Returns:
- an array of
Asset
instances
- Throws:
RelatedAssetManagerException
- if the client has specified that error conditions should
generate an exception
getRelatedAssets
public Asset[] getRelatedAssets(IRelatedAssetManager.DepthOptions theDepth,
IRelatedAssetManager.StatusOptions theStatusOption,
IProgressMonitor theProgressMonitor)
throws RelatedAssetManagerException,
IllegalArgumentException
- Retrieves the related assets for the
Asset
being managed.
The client has the option of specifying the depth level from which
related assets should be retrieved. If the assets are large or many this
could be a long running process so a progress monitor can be provided to
track progress and allow cancellation.
- Parameters:
theDepth
- to which related assets should be acquiredtheStatusOption
- used to determine how statuses should be treated during
related asset retrievaltheProgressMonitor
- optional progress monitor used to track progress on. This
paramter can be null
.
- Returns:
- an array of
Asset
instances or null
if the process was canceled.
- Throws:
RelatedAssetManagerException
- if the client has specified that error conditions should
generate an exception
IllegalArgumentException
- if theDepth
or theStatusOption
is null
getRelatedAssetElements
public RelatedAsset[] getRelatedAssetElements()
throws RelatedAssetManagerException
- Retrieves the related assets for the
Asset
being managed.
This is a convenience method and equivalent to calling the other
getRelatedAssetElements(DepthOptions, StatusOptions, IProgressMonitor)
method with a depth option of DEPTH_INFINITE
, a status
option of RECORD
and a null
progress
monitor.
- Returns:
- an array of
RelatedAsset
instances
- Throws:
RelatedAssetManagerException
- if the client has specified that error conditions should
generate an exception
getRelatedAssetElements
public RelatedAsset[] getRelatedAssetElements(IRelatedAssetManager.DepthOptions theDepth,
IRelatedAssetManager.StatusOptions theStatusOption,
IProgressMonitor theProgressMonitor)
throws RelatedAssetManagerException,
IllegalArgumentException
- Retrieves the related asset elements for the
Asset
being
managed. The client has the option of specifying the depth level from
which related assets should be retrieved. If the assets are large or many
this could be a long running process so a progress monitor can be
provided to track progress and allow cancellation.
- Parameters:
theDepth
- to which related asset elements should be acquiredtheStatusOption
- used to determine how statuses should be treated during
related asset retrievaltheProgressMonitor
- optional progress monitor used to track progress on. This
paramter can be null
.
- Returns:
- an array of
RelatedAsset
instances or
null
if the process was canceled.
- Throws:
RelatedAssetManagerException
- if the client has specified that error conditions should
generate an exception
IllegalArgumentException
- if theDepth
or theStatusOption
is null
getRelatedAssetElement
public RelatedAsset getRelatedAssetElement(Asset theAsset)
- Retrieves the
RelatedAsset
instance that maps to the given
Asset
instance or null
if the given
Asset
is not one of the related assets being managed.
- Parameters:
theAsset
- to get the RelatedAsset
for
- Returns:
- the
RelatedAsset
instance that maps to the given
Asset
instance or null
if the given
Asset
is not one of the related assets being
managed.
getStatus
public IStatus getStatus()
- Retrieves the
IStatus
instance recording the success level
the last time a request to get the related assets was made. This will
only return non null
if the retrieval request included the
IRelatedAssetManager.StatusOptions.RECORD
status option. Like any IStatus
it may have children indicating multiple problems.
- Returns:
- an
IStatus
instance or null
close
public void close(boolean clearCaches)
- Closes any resources being used by the
IRelatedAssetManager
instance or any of the related assets being managed. Since there is no
way the manager will know when the client has completed the use of the
resources it's up to the client to call close on it when it's finished.
It takes a boolean
indicating if all the caches should be
cleared. This forces the manager to process the Asset
again the next time a call is made into it. In the event that one of the
IRelatedAssetManager
methods throws a
RelatedAssetManagerException
this method will
automatically be called closing any resources and clear all caches.
- Parameters:
clearCaches
- indicates if the manager should clear all of it's caches
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.