|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.overlord.sramp.client.SrampAtomApiClient
public class SrampAtomApiClient
Class used to communicate with the S-RAMP server via the S-RAMP Atom API.
| Constructor Summary | |
|---|---|
SrampAtomApiClient(String endpoint)
Constructor. |
|
SrampAtomApiClient(String endpoint,
boolean validating)
Constructor. |
|
| Method Summary | |
|---|---|
SrampClientQuery |
buildQuery(String query)
Build a query that can be parameterized and then executed. |
void |
deleteArtifact(String uuid,
ArtifactType type)
Delets an artifact from the s-ramp repository. |
void |
deleteOntology(String ontologyUuid)
Deletes a single ontology by its UUID. |
InputStream |
getArtifactContent(ArtifactType artifactType,
String artifactUuid)
Gets the content for an artifact as an input stream. |
BaseArtifactType |
getArtifactMetaData(ArtifactType artifactType,
String artifactUuid)
Gets the full meta-data listing for an Artifact in the S-RAMP repository. |
BaseArtifactType |
getArtifactMetaData(String artifactUuid)
Gets the full meta-data listing for an Artifact in the S-RAMP repository. |
String |
getEndpoint()
|
List<OntologySummary> |
getOntologies()
Gets a list of all the ontologies currently installed in the S-RAMP repository. |
org.jboss.resteasy.plugins.providers.atom.app.AppService |
getServiceDocument()
Gets the S-RAMP service document. |
QueryResultSet |
query(String srampQuery)
Provides a very simple mechanism for querying. |
QueryResultSet |
query(String srampQuery,
int startIndex,
int count,
String orderBy,
boolean ascending)
Executes the given s-ramp query xpath and returns a Feed of the matching artifacts. |
QueryResultSet |
query(String srampQuery,
int startIndex,
int count,
String orderBy,
boolean ascending,
Collection<String> propertyNames)
Executes the given s-ramp query xpath and returns a Feed of the matching artifacts. |
void |
updateArtifactContent(BaseArtifactType artifact,
InputStream content)
Updates the content of the artifact. |
void |
updateArtifactMetaData(BaseArtifactType artifact)
Called to update the meta-data stored in the s-ramp repository for the given s-ramp artifact. |
BaseArtifactType |
uploadArtifact(ArtifactType artifactType,
InputStream content,
String artifactFileName)
Please refer to javadoc in SrampAtomApiClient#uploadArtifact(String, String, InputStream, String) |
BaseArtifactType |
uploadArtifact(BaseArtifactType baseArtifactType,
InputStream content)
Please refer to javadoc in SrampAtomApiClient#uploadArtifact(String, String, InputStream, String) |
Map<String,?> |
uploadBatch(SrampArchive archive)
Performs a batch operation by uploading an s-ramp package archive to the s-ramp server for processing. |
RDF |
uploadOntology(InputStream content)
Uploads an ontology to the S-RAMP repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SrampAtomApiClient(String endpoint)
endpoint -
public SrampAtomApiClient(String endpoint,
boolean validating)
throws SrampClientException,
SrampAtomException
endpoint - validating -
SrampClientException
SrampAtomException| Method Detail |
|---|
public String getEndpoint()
public org.jboss.resteasy.plugins.providers.atom.app.AppService getServiceDocument()
throws SrampClientException,
SrampAtomException
SrampClientException
SrampAtomException
public BaseArtifactType getArtifactMetaData(String artifactUuid)
throws SrampClientException,
SrampAtomException
getArtifactMetaData(ArtifactType, String)
Use this variant only if you don't know the artifact type (you only know the UUID).
The reason is that the client must first do a query to determine the artifact type
and then make another call to fetch the meta data.
artifactUuid -
SrampClientException
SrampAtomException
public BaseArtifactType getArtifactMetaData(ArtifactType artifactType,
String artifactUuid)
throws SrampClientException,
SrampAtomException
artifactType - artifactUuid -
SrampClientException
SrampAtomException
public InputStream getArtifactContent(ArtifactType artifactType,
String artifactUuid)
throws SrampClientException,
SrampAtomException
artifactType - the artifact typeartifactUuid - the S-RAMP uuid of the artifact
InputStream to the S-RAMP artifact content
SrampClientException
SrampAtomException
public BaseArtifactType uploadArtifact(ArtifactType artifactType,
InputStream content,
String artifactFileName)
throws SrampClientException,
SrampAtomException
SrampAtomApiClient#uploadArtifact(String, String, InputStream, String)
artifactType - content - artifactFileName -
SrampClientException
SrampAtomException
public BaseArtifactType uploadArtifact(BaseArtifactType baseArtifactType,
InputStream content)
throws SrampClientException,
SrampAtomException
SrampAtomApiClient#uploadArtifact(String, String, InputStream, String)
baseArtifactType - content -
SrampClientException
SrampAtomException
public Map<String,?> uploadBatch(SrampArchive archive)
throws SrampClientException,
SrampAtomException
BaseArtifactType or an
SrampAtomException, depending on success vs. failure of that entry.
archive - the s-ramp package archive to upload
SrampClientException
SrampAtomException
public void updateArtifactMetaData(BaseArtifactType artifact)
throws SrampClientException,
SrampAtomException
artifact -
SrampClientException
SrampAtomException
public void updateArtifactContent(BaseArtifactType artifact,
InputStream content)
throws SrampClientException,
SrampAtomException
artifact - content -
SrampClientException
SrampAtomException
public void deleteArtifact(String uuid,
ArtifactType type)
throws SrampClientException,
SrampAtomException
uuid - type -
SrampClientException
SrampAtomException
public QueryResultSet query(String srampQuery)
throws SrampClientException,
SrampAtomException
srampQuery - the s-ramp query (xpath formatted)
SrampClientException
SrampAtomException
public QueryResultSet query(String srampQuery,
int startIndex,
int count,
String orderBy,
boolean ascending)
throws SrampClientException,
SrampAtomException
srampQuery - the s-ramp query (xpath formatted)startIndex - which index within the result to start (0 indexed)count - the size of the page of results to returnorderBy - the s-ramp property to use for sorting (name, uuid, createdOn, etc)ascending - the direction of the sortpropertyNames - an optional collection of names of custom s-ramp properties to be returned as part of the result set
Feed
SrampClientException
SrampAtomException
public QueryResultSet query(String srampQuery,
int startIndex,
int count,
String orderBy,
boolean ascending,
Collection<String> propertyNames)
throws SrampClientException,
SrampAtomException
srampQuery - the s-ramp query (xpath formatted)startIndex - which index within the result to start (0 indexed)count - the size of the page of results to returnorderBy - the s-ramp property to use for sorting (name, uuid, createdOn, etc)ascending - the direction of the sortpropertyNames - an optional collection of names of custom s-ramp properties to be returned as part of the result set
Feed
SrampClientException
SrampAtomExceptionpublic SrampClientQuery buildQuery(String query)
String uuid = ...
client.buildQuery("/s-ramp/core/Document[@uuid = ?]")
.parameter(uuid)
.startIndex(3)
.count(20)
.orderBy("name")
.ascending()
.propertyName("custom-prop-1")
.propertyName("custom-prop-2")
.query();
query -
public RDF uploadOntology(InputStream content)
throws SrampClientException,
SrampAtomException
content -
SrampClientException
SrampAtomException
public List<OntologySummary> getOntologies()
throws SrampClientException,
SrampAtomException
SrampClientException
SrampAtomException
public void deleteOntology(String ontologyUuid)
throws SrampClientException,
SrampAtomException
ontologyUuid -
SrampClientException
SrampAtomException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||