public interface AssetDao extends DataAccessObject
Modifier and Type | Method and Description |
---|---|
boolean |
delete(AssetId assetId, MessageCollectors.DeleteAssetsMessageCollector collector)
Deletes an asset.
|
List<AssetId> |
delete(List<AssetId> assetIds, MessageCollectors.DeleteAssetsMessageCollector collector)
Deletes a list of assets identified by the asset identifiers in assetsToDelete.
|
boolean |
exists(AssetId assetId)
Returns true if an asset exists.
|
AssetTypeDef |
getDefinition(String type, String subType)
Returns the asset type definition object for a specified asset type.
|
List<AssetId> |
getFlexDefinitions(String assetType, long site)
Returns the List of definition asset identifiers for the given Flex asset type and site.
|
List<AssetId> |
getReferences(AssetId assetId)
Returns a list of asset identifiers for all assets which reference a given asset.
|
List<SiteBean> |
getSitesInWhichEnabled(String userName, String assetType)
Returns the list of sites for which the given asset type is enabled.
|
List<SiteBean> |
getSitesInWhichShared(AssetId assetId)
Returns the list of sites in which an asset is shared.
|
List<String> |
getSubTypes(String assetType, long site)
Returns the List of subtypes for the given asset type and site.
|
AssetData |
newAsset(AssetTypeDef assetTypeDef)
Returns an empty asset data instance for a given asset type.
|
AssetData |
read(AssetId assetId)
Returns the data associated with an asset.
|
AssetData |
read(AssetId assetId, List<String> fields)
Returns the data associated with an asset, retrieving only a subset of the available fields.
|
List<AssetId> |
removeReferences(AssetId assetId, List<AssetId> references, MessageCollectors.RemoveReferenceMessageCollector collector)
Removes the references of an asset.
|
AssetSaveStatusBean |
save(AssetData assetData, MessageCollectors.SaveAssetsMessageCollector collector)
Saves the data associated with an asset.
|
boolean |
share(AssetId assetId, List<Long> sites)
Shares an asset with all the sites in the specified list.
|
getResponse, getService, setService
boolean exists(AssetId assetId) throws DataAccessException
assetId
- the identifier for the asset.DataAccessException
- wraps any exception underlying the service call.AssetTypeDef getDefinition(String type, String subType) throws DataAccessException
type,
- String the asset type for which the type definition is to be retrieved.subType,
- String the asset sub type for which the type definition is to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetData newAsset(AssetTypeDef assetTypeDef) throws DataAccessException
assetTypeDef
- asset type definition to use in creating the empty asset data object.DataAccessException
- wraps any underlying exception caused during data access.AssetData read(AssetId assetId) throws DataAccessException
assetId
- the identifier of the asset whose data is to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetData read(AssetId assetId, List<String> fields) throws DataAccessException
assetId
- the identifier of the asset whose data is to be retrieved.fields
- the list of fields which are to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.AssetSaveStatusBean save(AssetData assetData, MessageCollectors.SaveAssetsMessageCollector collector) throws DataAccessException
assetData
- the data associated with the asset to save.collector
- a collectorDataAccessException
- wraps any underlying exception caused during data access.boolean delete(AssetId assetId, MessageCollectors.DeleteAssetsMessageCollector collector) throws DataAccessException
assetId
- the identifier of the asset to delete.collector
- a collectorDataAccessException
- wraps any underlying exception caused during data access.List<AssetId> delete(List<AssetId> assetIds, MessageCollectors.DeleteAssetsMessageCollector collector) throws DataAccessException
assetIds
- the list containing identifiers of the assets to delete.collector
- a collectorDataAccessException
- wraps any underlying exception caused during data access.List<AssetId> getReferences(AssetId assetId) throws DataAccessException
assetId
- the identifier for the asset whose references are to be retrieved.DataAccessException
- wraps any underlying exception caused during data access.List<AssetId> removeReferences(AssetId assetId, List<AssetId> references, MessageCollectors.RemoveReferenceMessageCollector collector) throws DataAccessException
assetId
- identifier of the asset to delete.references
- list containing identifiers of assets referencing asset.collector
- a collectorDataAccessException
- wraps any underlying exception caused during data access.List<SiteBean> getSitesInWhichEnabled(String userName, String assetType) throws DataAccessException
assetType
- the asset type which should be enabled in the list of sites returned.userName
- a usernameDataAccessException
- wraps any underlying exception caused during data access.List<SiteBean> getSitesInWhichShared(AssetId assetId) throws DataAccessException
assetId
- identifier of the asset which should be shared in the list of sites returned.DataAccessException
- wraps any underlying exception caused during data access.boolean share(AssetId assetId, List<Long> sites) throws DataAccessException
assetId
- identifier of the asset to share.sites
- list of sites with which asset is to be shared.DataAccessException
- wraps any underlying exception caused during data access.List<String> getSubTypes(String assetType, long site) throws DataAccessException
assetType
- the asset type for which to retrieve the list of sub types in the specified site (the type returned by link TypeBean getType() is considered).site
- the site in which to search for the subtypes.DataAccessException
- wraps any underlying exception caused during data access.List<AssetId> getFlexDefinitions(String assetType, long site) throws DataAccessException
assetType
- the flex asset type for which the definitions are to be retrieved.site
- the site in which to search for the definitions.DataAccessException
- wraps any underlying exception caused during data access.