@Exported
public interface AssetDataManager
AssetId
using AssetDataManager.read(List)
or by using a Query
in AssetDataManager.read(Query)
.
A Query is an abstract construct that defines user's request for asset's data. Query can be considered as an object
representation of SQL.
Using Query, one would be able to specify Condition
(a set of matching criterion) to limit the assets returned as well as the sorting order in which the results are to be read.
A Query also limits the number of attributes to be retrieved. Limiting the Query to contain only a few attributes limits the
amount of data that read into memory.
Query also contains an accessory set of properties, QueryProperties
.
QueryProperties can be used, among other things, to specify the type of query algorithm to use.
For more details about Query, its construct and limitations please see Query
Note: Only read methods are implemented in CS version 7.0. Methods for which implementation does not exist
throw UnsupportedOperationException.Modifier and Type | Method and Description |
---|---|
void |
delete(List<AssetId> data)
Deletes a given list of AssetIds from database.
|
void |
insert(List<AssetData> data)
Inserts a given List of AssetData instances in the database and new assets will be created with
the data from the list.
|
AssetData |
newAssetData(String assetTypeName,
AssetData example)
Creates an instance of AssetData (with copied instances of AttributeData from the example AssetData).
|
MutableAssetData |
newAssetData(String assetTypeName,
String subtype)
Create an empty instance of AssetData with empty instance of AttributeData.
|
AttributeData |
newAttribiteData(String attributeName,
String assetTypeName,
String subtype)
Deprecated.
|
AttributeData |
newAttributeData(AttributeDef attributeDef)
Create an attributeData with an attribute definition specified.
|
AttributeData |
newAttributeData(String attributeName,
String assetTypeName,
String subtype)
Creates an empty instance of AttributeData (of appropriate type and default).
|
Iterable<AssetData> |
read(List<AssetId> ids)
Reads asset data for all given
AssetId s. |
Iterable<AssetData> |
read(Query query)
Reads all asset data that satisfies a given Query
|
AssetData |
readAttributes(AssetId id,
List<String> attributeNames)
Reads given set attribute data and returns an AssetData instance containing them.
|
Iterable<MutableAssetData> |
readForUpdate(List<AssetId> ids)
NOTE: This method is not implemented yet.
|
Iterable<MutableAssetData> |
readForUpdate(Query query)
Reads all asset data that satisfies a given Query and results in mutable results.
|
void |
update(List<AssetData> data)
Updates a given list of AssetData in the database.
|
void |
update(List<AssetData> data,
boolean keepCheckedOut)
Updates a given list of AssetData in the database.
|
Iterable<AssetData> read(Query query) throws AssetAccessException
query
- Query to be satisfied.AssetAccessException
- Is thrown when Query is invalid by the way of incorrect attributes or invalid operation given
the choice of query algorithm. AssetAccessException also wraps any AssetExceptions thrown by the internal implementation.Iterable<MutableAssetData> readForUpdate(Query query) throws AssetAccessException
query
- Query to be satisfied.AssetAccessException
- is the layer specific failures and wraps other internal exceptions.Iterable<AssetData> read(List<AssetId> ids) throws AssetAccessException, AssetNotExistException
AssetId
s.ids
- List of AssetIdsAssetAccessException
- Is thrown when any of the AssetIds passed in does not exist.
AssetAccessException also wraps any AssetExceptions thrown by the internal implementation.AssetNotExistException
- an AssetNotExistExceptionIterable<MutableAssetData> readForUpdate(List<AssetId> ids) throws AssetAccessException, AssetNotExistException
ids
- List of AssetIds.AssetAccessException
- Captures layer specific failures and wraps other internal exceptions.AssetNotExistException
- an AssetNotExistExceptionAssetData readAttributes(AssetId id, List<String> attributeNames) throws AssetAccessException, AssetNotExistException
id
- AssetId to read attributes forattributeNames
- Names of the attributesAssetAccessException
- Is thrown if the AssetId does not exist or attribute names passed are incorrect
for the asset. AssetAccessException also wraps any AssetExceptions thrown by the internal implementation.AssetNotExistException
- an AssetNotExistExceptionvoid insert(List<AssetData> data) throws AssetAccessException
data
- AssetData to be inserted.AssetAccessException
- Captures layer specific failures and wraps other internal exceptions.void update(List<AssetData> data) throws AssetAccessException
data
- AssetData to be updated.AssetAccessException
- Captures layer specific failures and wraps other internal exceptions.void update(List<AssetData> data, boolean keepCheckedOut) throws AssetAccessException
data
- AssetData to be updated.keepCheckedOut
- Do not check in asset after save if revision tracked.AssetAccessException
- Captures layer specific failures and wraps other internal exceptions.void delete(List<AssetId> data) throws AssetAccessException
data
- AssetIds to be deleted.AssetAccessException
- Captures layer specific failures and wraps other internal exceptions.AttributeData newAttribiteData(String attributeName, String assetTypeName, String subtype)
AssetDataManager.newAttributeData(String,String, String)
attributeName
- Name of the attribute.assetTypeName
- Name of asset type.subtype
- Subtype of asset type.AttributeData newAttributeData(String attributeName, String assetTypeName, String subtype)
attributeName
- Name of the attribute.assetTypeName
- Name of asset type.subtype
- Subtype of asset type.AttributeData newAttributeData(AttributeDef attributeDef)
attributeDef
- The definition of the attribute.AssetData newAssetData(String assetTypeName, AssetData example)
assetTypeName
- Name of the asset typeexample
- Optional example AssetData the returned will be based on.MutableAssetData newAssetData(String assetTypeName, String subtype) throws AssetAccessException
assetTypeName
- The name of the asset type.subtype
- The name of the asset subtype.AssetAccessException
- an AssetAccessException