public class SrampAtomApiClient extends Object
| Constructor and Description |
|---|
SrampAtomApiClient(String endpoint)
Constructor.
|
SrampAtomApiClient(String endpoint,
AuthenticationProvider authenticationProvider,
boolean validating)
Constructor.
|
SrampAtomApiClient(String endpoint,
boolean validating)
Constructor.
|
SrampAtomApiClient(String endpoint,
String username,
String password,
boolean validating)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry |
addAuditEntry(String artifactUuid,
org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry auditEntry)
Adds a new audit entry on the artifact with the given UUID.
|
org.w3._1999._02._22_rdf_syntax_ns_.RDF |
addOntology(org.w3._1999._02._22_rdf_syntax_ns_.RDF ontology)
Adds on ontology in RDF format to the S-RAMP repository.
|
SrampClientQuery |
buildQuery(String query)
Build a query that can be parameterized and then executed.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
createArtifact(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact)
Creates a new artifact in the S-RAMP repository.
|
protected ClientRequest |
createClientRequest(String atomUrl)
Creates the RESTEasy client request object, configured appropriately.
|
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(ArtifactSummary artifact)
Convenience method for getting the artifact content given an artifact summary (which are typically
returned when performing s-ramp queries).
|
InputStream |
getArtifactContent(ArtifactType artifactType,
String artifactUuid)
Gets the content for an artifact as an input stream.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
getArtifactMetaData(ArtifactSummary artifact)
Convenience method to get the artifact meta-data given an artifact summary (which are typically
returned when performing s-ramp queries).
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
getArtifactMetaData(ArtifactType artifactType,
String artifactUuid)
Gets the full meta-data listing for an Artifact in the S-RAMP repository.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
getArtifactMetaData(String artifactUuid)
Gets the full meta-data listing for an Artifact in the S-RAMP repository.
|
org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry |
getAuditEntry(String artifactUuid,
String auditEntryUuid)
Gets the full audit entry for the given artifact + audit event pair.
|
AuditResultSet |
getAuditTrailForArtifact(String artifactUuid)
Gets the audit trail for the artifact with the given UUID.
|
AuditResultSet |
getAuditTrailForArtifact(String artifactUuid,
int startIndex,
int count)
Gets the audit trail for the artifact with the given UUID.
|
AuditResultSet |
getAuditTrailForUser(String username)
Gets the audit trail for the artifact with the given UUID.
|
AuditResultSet |
getAuditTrailForUser(String username,
int startIndex,
int count)
Gets the audit trail for the artifact with the given UUID.
|
String |
getEndpoint() |
Locale |
getLocale() |
List<OntologySummary> |
getOntologies()
Gets a list of all the ontologies currently installed in the S-RAMP repository.
|
org.w3._1999._02._22_rdf_syntax_ns_.RDF |
getOntology(String ontologyUuid)
Gets a single ontology by UUID.
|
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 |
setLocale(Locale locale) |
void |
updateArtifactContent(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact,
InputStream content)
Updates the content of the artifact.
|
void |
updateArtifactMetaData(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact)
Called to update the meta-data stored in the s-ramp repository for the given s-ramp
artifact.
|
void |
updateOntology(String ontologyUuid,
InputStream content)
Uploads a new version of an ontology to the S-RAMP repository.
|
void |
updateOntology(String ontologyUuid,
org.w3._1999._02._22_rdf_syntax_ns_.RDF ontology)
Uploads a new version of an ontology to the S-RAMP repository.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
uploadArtifact(ArtifactType artifactType,
InputStream content,
String artifactFileName)
Creates a new artifact in the repository by uploading a document.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
uploadArtifact(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType baseArtifactType,
InputStream content)
Creates a new artifact in the repository by uploading a document.
|
Map<String,?> |
uploadBatch(SrampArchive archive)
Performs a batch operation by uploading an s-ramp package archive to the s-ramp server
for processing.
|
org.w3._1999._02._22_rdf_syntax_ns_.RDF |
uploadOntology(InputStream content)
Uploads an ontology to the S-RAMP repository.
|
public SrampAtomApiClient(String endpoint)
endpoint - public SrampAtomApiClient(String endpoint, boolean validating) throws SrampClientException, SrampAtomException
endpoint - validating - SrampClientExceptionSrampAtomExceptionpublic SrampAtomApiClient(String endpoint, String username, String password, boolean validating) throws SrampClientException, SrampAtomException
endpoint - username - password - validating - SrampClientExceptionSrampAtomExceptionpublic SrampAtomApiClient(String endpoint, AuthenticationProvider authenticationProvider, boolean validating) throws SrampClientException, SrampAtomException
endpoint - authenticationProvider - validating - SrampClientExceptionSrampAtomExceptionpublic String getEndpoint()
public org.jboss.resteasy.plugins.providers.atom.app.AppService getServiceDocument()
throws SrampClientException,
SrampAtomException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.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 - SrampClientExceptionSrampAtomExceptionpublic org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType getArtifactMetaData(ArtifactSummary artifact) throws SrampClientException, SrampAtomException
artifact - SrampClientExceptionSrampAtomExceptionpublic org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType getArtifactMetaData(ArtifactType artifactType, String artifactUuid) throws SrampClientException, SrampAtomException
artifactType - artifactUuid - SrampClientExceptionSrampAtomExceptionpublic InputStream getArtifactContent(ArtifactType artifactType, String artifactUuid) throws SrampClientException, SrampAtomException
artifactType - the artifact typeartifactUuid - the S-RAMP uuid of the artifactInputStream to the S-RAMP artifact contentSrampClientExceptionSrampAtomExceptionpublic InputStream getArtifactContent(ArtifactSummary artifact) throws SrampClientException, SrampAtomException
artifact - SrampClientExceptionSrampAtomExceptionpublic org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType createArtifact(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact)
throws SrampClientException,
SrampAtomException
artifact - SrampClientExceptionSrampAtomExceptionpublic org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(ArtifactType artifactType, InputStream content, String artifactFileName) throws SrampClientException, SrampAtomException
artifactType - content - artifactFileName - SrampClientExceptionSrampAtomExceptionpublic org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType baseArtifactType,
InputStream content)
throws SrampClientException,
SrampAtomException
baseArtifactType - content - SrampClientExceptionSrampAtomExceptionpublic 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 uploadSrampClientExceptionSrampAtomExceptionpublic void updateArtifactMetaData(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact)
throws SrampClientException,
SrampAtomException
artifact - SrampClientExceptionSrampAtomExceptionpublic void updateArtifactContent(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact,
InputStream content)
throws SrampClientException,
SrampAtomException
artifact - content - SrampClientExceptionSrampAtomExceptionpublic void deleteArtifact(String uuid, ArtifactType type) throws SrampClientException, SrampAtomException
uuid - type - SrampClientExceptionSrampAtomExceptionpublic QueryResultSet query(String srampQuery) throws SrampClientException, SrampAtomException
srampQuery - the s-ramp query (xpath formatted)SrampClientExceptionSrampAtomExceptionpublic 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 setFeedSrampClientExceptionSrampAtomExceptionpublic 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 setFeedSrampClientExceptionSrampAtomExceptionpublic 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 org.w3._1999._02._22_rdf_syntax_ns_.RDF addOntology(org.w3._1999._02._22_rdf_syntax_ns_.RDF ontology)
throws SrampClientException,
SrampAtomException
ontology - SrampClientExceptionSrampAtomExceptionpublic org.w3._1999._02._22_rdf_syntax_ns_.RDF uploadOntology(InputStream content) throws SrampClientException, SrampAtomException
content - SrampClientExceptionSrampAtomExceptionpublic void updateOntology(String ontologyUuid, InputStream content) throws SrampClientException, SrampAtomException
ontologyUuid - content - SrampClientExceptionSrampAtomExceptionpublic void updateOntology(String ontologyUuid, org.w3._1999._02._22_rdf_syntax_ns_.RDF ontology) throws SrampClientException, SrampAtomException
ontologyUuid - content - SrampClientExceptionSrampAtomExceptionpublic List<OntologySummary> getOntologies() throws SrampClientException, SrampAtomException
public org.w3._1999._02._22_rdf_syntax_ns_.RDF getOntology(String ontologyUuid) throws SrampClientException, SrampAtomException
ontologyUuid - SrampClientExceptionSrampAtomExceptionpublic void deleteOntology(String ontologyUuid) throws SrampClientException, SrampAtomException
ontologyUuid - SrampClientExceptionSrampAtomExceptionpublic org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry addAuditEntry(String artifactUuid, org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry auditEntry) throws SrampClientException, SrampAtomException
artifactUuid - auditEntry - SrampClientExceptionSrampAtomExceptionpublic AuditResultSet getAuditTrailForArtifact(String artifactUuid) throws SrampClientException, SrampAtomException
artifactUuid - SrampClientExceptionSrampAtomExceptionpublic AuditResultSet getAuditTrailForArtifact(String artifactUuid, int startIndex, int count) throws SrampClientException, SrampAtomException
artifactUuid - startIndex - count - SrampClientExceptionSrampAtomExceptionpublic AuditResultSet getAuditTrailForUser(String username) throws SrampClientException, SrampAtomException
username - SrampClientExceptionSrampAtomExceptionpublic AuditResultSet getAuditTrailForUser(String username, int startIndex, int count) throws SrampClientException, SrampAtomException
username - startIndex - count - SrampClientExceptionSrampAtomExceptionpublic org.jboss.downloads.overlord.sramp._2013.auditing.AuditEntry getAuditEntry(String artifactUuid, String auditEntryUuid) throws SrampClientException, SrampAtomException
artifactUuid - auditEntryUuid - SrampClientExceptionSrampAtomExceptionprotected ClientRequest createClientRequest(String atomUrl)
atomUrl - public Locale getLocale()
public void setLocale(Locale locale)
locale - the locale to setCopyright © 2011-2014 JBoss, a division of Red Hat. All Rights Reserved.