public interface AssetRepository
This interface provides methods for managing ADAPA assets on a backend storage. By default, ADAPA uses a file-based repository to store the uploaded artifacts (models, rules, reports and resources). ADAPA also provides support for a Database-based repository by using the Java Persistence API (JPA) in conjunction with using Hibernate as a JPA provider. A traditional Database can be plugged-in as a repository store for ADAPA by providing an appropriate configuration file.
On top of this, ADAPA also allows users to provide a custom backend store (e.g. MongoDB) by implementing this
interface. A sample implementation is shown in
MongoAssetRepository.java.
As shown in the sample implementation, the addAsset(Serializable, InputStream)
method requires assignment
of a unique identifier to the provided ADAPA asset. The choice of unique identifier is left to the implementor.
The implementation of this interface needs to be in the classpath of ADAPA library
(along with the required JDBC drivers, if any) and it can be integrated into ADAPA by using a Spring configuration
file as described in
applicationContext.xml.
Modifier and Type | Method and Description |
---|---|
String |
addAsset(Serializable adapaAssetInfo,
InputStream adapaAssetSource)
Add a new ADAPA asset and assign a new unique ID to it.
|
String |
addAsset(Serializable adapaAssetInfo,
InputStream adapaAssetSource,
InputStream annotatedAdapaAssetSource)
Add a new ADAPA asset and assign a new unique ID to it.
|
InputStream |
getAnnotatedAssetSource(String identifier)
Returns the annotated ADAPA asset source corresponding to the
identifier . |
Set<String> |
getAssetIds()
Returns a collection of identifiers for existing ADAPA assets.
|
Serializable |
getAssetInfo(String identifier)
Returns the ADAPA asset corresponding to the
identifier . |
InputStream |
getAssetSource(String identifier)
Returns the ADAPA asset source corresponding to the
identifier . |
void |
removeAsset(String identifier)
Remove an existing ADAPA asset.
|
String addAsset(Serializable adapaAssetInfo, InputStream adapaAssetSource)
adapaAssetInfo
- the information about the ADAPA asset to be addedadapaAssetSource
- the source (e.g. PMML code) of the ADAPA assetString addAsset(Serializable adapaAssetInfo, InputStream adapaAssetSource, InputStream annotatedAdapaAssetSource)
adapaAssetInfo
- the information about the ADAPA asset to be addedadapaAssetSource
- the source (e.g. PMML code) of the ADAPA assetannotatedAdapaAssetSource
- the annotated source of the ADAPA assetvoid removeAsset(String identifier)
identifier
- the identifier of the ADAPA asset to removeSet<String> getAssetIds()
Serializable getAssetInfo(String identifier)
identifier
.identifier
- an ADAPA asset identifiernull
InputStream getAssetSource(String identifier)
identifier
.identifier
- an ADAPA asset identifierInputStream
if found; otherwise
null
InputStream getAnnotatedAssetSource(String identifier)
identifier
.identifier
- an ADAPA asset identifierInputStream
if found; otherwise
null
Copyright © 2005–2016 Zementis, Inc.. All rights reserved.