public class ArtificerAtomApiClient extends Object
Constructor and Description |
---|
ArtificerAtomApiClient(String endpoint)
Constructor.
|
ArtificerAtomApiClient(String endpoint,
AuthenticationProvider authenticationProvider,
boolean validating)
Constructor.
|
ArtificerAtomApiClient(String endpoint,
boolean validating)
Constructor.
|
ArtificerAtomApiClient(String endpoint,
String username,
String password,
boolean validating)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.jboss.downloads.artificer._2013.auditing.AuditEntry |
addAuditEntry(String artifactUuid,
org.jboss.downloads.artificer._2013.auditing.AuditEntry auditEntry)
Adds a new audit entry on the artifact with the given UUID.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
addComment(String uuid,
ArtifactType type,
String text) |
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.
|
ArtificerClientQuery |
buildQuery(String query)
Build a query that can be parameterized and then executed.
|
ArtificerClientQuery |
buildQueryWithStoredQuery(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery)
|
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.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery |
createStoredQuery(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery)
Adds a stored query to the S-RAMP repository.
|
void |
deleteArtifact(String uuid,
ArtifactType type)
Delets an artifact from the s-ramp repository.
|
void |
deleteArtifact(String uuid,
ArtifactType type,
boolean force)
Delets an artifact from the s-ramp repository.
|
void |
deleteOntology(String ontologyUuid)
Deletes a single ontology by its UUID.
|
void |
deleteStoredQuery(String queryName)
Deletes a single stored query by name.
|
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.artificer._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.
|
List<org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery> |
getStoredQueries()
Gets a list of all the stored queries currently installed in the S-RAMP repository.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery |
getStoredQuery(String queryName)
Gets a single stored query by name.
|
List<String> |
getTypes() |
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.
|
QueryResultSet |
queryWithStoredQuery(String queryName)
See
query(String) |
QueryResultSet |
queryWithStoredQuery(String queryName,
int startIndex,
int count,
String orderBy,
boolean ascending)
|
QueryResultSet |
reverseRelationships(String uuid) |
void |
setLocale(Locale locale) |
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.
|
void |
updateStoredQuery(String queryName,
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery)
Uploads a new version of a stored query 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(ArtifactType artifactType,
String path)
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.
|
org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType |
uploadArtifact(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(String path)
Creates a new artifact in the repository by uploading a document.
|
Map<String,?> |
uploadBatch(ArtificerArchive 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 ArtificerAtomApiClient(String endpoint)
endpoint
- public ArtificerAtomApiClient(String endpoint, boolean validating) throws ArtificerClientException, ArtificerServerException
endpoint
- validating
- ArtificerClientException
ArtificerServerException
public ArtificerAtomApiClient(String endpoint, String username, String password, boolean validating) throws ArtificerClientException, ArtificerServerException
endpoint
- username
- password
- validating
- ArtificerClientException
ArtificerServerException
public ArtificerAtomApiClient(String endpoint, AuthenticationProvider authenticationProvider, boolean validating) throws ArtificerClientException, ArtificerServerException
endpoint
- authenticationProvider
- validating
- ArtificerClientException
ArtificerServerException
public String getEndpoint()
public org.jboss.resteasy.plugins.providers.atom.app.AppService getServiceDocument() throws ArtificerClientException, ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType getArtifactMetaData(String artifactUuid) throws ArtificerClientException, ArtificerServerException
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
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType getArtifactMetaData(ArtifactSummary artifact) throws ArtificerClientException, ArtificerServerException
artifact
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType getArtifactMetaData(ArtifactType artifactType, String artifactUuid) throws ArtificerClientException, ArtificerServerException
artifactType
- artifactUuid
- ArtificerClientException
ArtificerServerException
public InputStream getArtifactContent(ArtifactType artifactType, String artifactUuid) throws ArtificerClientException, ArtificerServerException
artifactType
- the artifact typeartifactUuid
- the S-RAMP uuid of the artifactInputStream
to the S-RAMP artifact contentArtificerClientException
ArtificerServerException
public InputStream getArtifactContent(ArtifactSummary artifact) throws ArtificerClientException, ArtificerServerException
artifact
- ArtificerClientException
ArtificerServerException
public 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 ArtificerClientException, ArtificerServerException
artifact
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(ArtifactType artifactType, InputStream content, String artifactFileName) throws ArtificerClientException, ArtificerServerException
artifactType
- content
- artifactFileName
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(ArtifactType artifactType, String path) throws ArtificerClientException, ArtificerServerException
artifactType
- path
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(String path) throws ArtificerClientException, ArtificerServerException
path
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType uploadArtifact(InputStream content, String artifactFileName) throws ArtificerClientException, ArtificerServerException
content
- artifactFileName
- ArtificerClientException
ArtificerServerException
public 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 ArtificerClientException, ArtificerServerException
baseArtifactType
- content
- ArtificerClientException
ArtificerServerException
public Map<String,?> uploadBatch(ArtificerArchive archive) throws ArtificerClientException, ArtificerServerException
BaseArtifactType
or an
ArtificerServerException
, depending on success vs. failure of that entry.archive
- the s-ramp package archive to uploadArtificerClientException
ArtificerServerException
public void updateArtifactMetaData(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType artifact) throws ArtificerClientException, ArtificerServerException
artifact
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType addComment(String uuid, ArtifactType type, String text) throws ArtificerClientException, ArtificerServerException
public void deleteArtifact(String uuid, ArtifactType type) throws ArtificerClientException, ArtificerServerException
uuid
- type
- ArtificerClientException
ArtificerServerException
public void deleteArtifact(String uuid, ArtifactType type, boolean force) throws ArtificerClientException, ArtificerServerException
uuid
- type
- force
- ArtificerClientException
ArtificerServerException
public QueryResultSet query(String srampQuery) throws ArtificerClientException, ArtificerServerException
srampQuery
- the s-ramp query (xpath formatted)ArtificerClientException
ArtificerServerException
public QueryResultSet query(String srampQuery, int startIndex, int count, String orderBy, boolean ascending) throws ArtificerClientException, ArtificerServerException
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 sortFeed
ArtificerClientException
ArtificerServerException
public QueryResultSet query(String srampQuery, int startIndex, int count, String orderBy, boolean ascending, Collection<String> propertyNames) throws ArtificerClientException, ArtificerServerException
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 setFeed
ArtificerClientException
ArtificerServerException
public ArtificerClientQuery 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 ArtificerClientException, ArtificerServerException
ontology
- ArtificerClientException
ArtificerServerException
public org.w3._1999._02._22_rdf_syntax_ns_.RDF uploadOntology(InputStream content) throws ArtificerClientException, ArtificerServerException
content
- ArtificerClientException
ArtificerServerException
public void updateOntology(String ontologyUuid, InputStream content) throws ArtificerClientException, ArtificerServerException
ontologyUuid
- content
- ArtificerClientException
ArtificerServerException
public void updateOntology(String ontologyUuid, org.w3._1999._02._22_rdf_syntax_ns_.RDF ontology) throws ArtificerClientException, ArtificerServerException
ontologyUuid
- ArtificerClientException
ArtificerServerException
public List<OntologySummary> getOntologies() throws ArtificerClientException, ArtificerServerException
public org.w3._1999._02._22_rdf_syntax_ns_.RDF getOntology(String ontologyUuid) throws ArtificerClientException, ArtificerServerException
ontologyUuid
- ArtificerClientException
ArtificerServerException
public void deleteOntology(String ontologyUuid) throws ArtificerClientException, ArtificerServerException
ontologyUuid
- ArtificerClientException
ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery createStoredQuery(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery) throws ArtificerClientException, ArtificerServerException
storedQuery
- ArtificerClientException
ArtificerServerException
public void updateStoredQuery(String queryName, org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery) throws ArtificerClientException, ArtificerServerException
queryName
- storedQuery
- ArtificerClientException
ArtificerServerException
public List<org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery> getStoredQueries() throws ArtificerClientException, ArtificerServerException
public org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery getStoredQuery(String queryName) throws ArtificerClientException, ArtificerServerException
queryName
- ArtificerClientException
ArtificerServerException
public void deleteStoredQuery(String queryName) throws ArtificerClientException, ArtificerServerException
queryName
- ArtificerClientException
ArtificerServerException
public QueryResultSet queryWithStoredQuery(String queryName) throws ArtificerClientException, ArtificerServerException
query(String)
queryName
- ArtificerClientException
ArtificerServerException
public QueryResultSet queryWithStoredQuery(String queryName, int startIndex, int count, String orderBy, boolean ascending) throws ArtificerClientException, ArtificerServerException
query(String, int, int, String, boolean, Collection)
.
Note that StoredQuery.getPropertyName()
is automatically given to #query.startIndex
- count
- orderBy
- ascending
- ArtificerClientException
ArtificerServerException
public ArtificerClientQuery buildQueryWithStoredQuery(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.StoredQuery storedQuery)
storedQuery
- public org.jboss.downloads.artificer._2013.auditing.AuditEntry addAuditEntry(String artifactUuid, org.jboss.downloads.artificer._2013.auditing.AuditEntry auditEntry) throws ArtificerClientException, ArtificerServerException
artifactUuid
- auditEntry
- ArtificerClientException
ArtificerServerException
public AuditResultSet getAuditTrailForArtifact(String artifactUuid) throws ArtificerClientException, ArtificerServerException
artifactUuid
- ArtificerClientException
ArtificerServerException
public AuditResultSet getAuditTrailForArtifact(String artifactUuid, int startIndex, int count) throws ArtificerClientException, ArtificerServerException
artifactUuid
- startIndex
- count
- ArtificerClientException
ArtificerServerException
public AuditResultSet getAuditTrailForUser(String username) throws ArtificerClientException, ArtificerServerException
username
- ArtificerClientException
ArtificerServerException
public AuditResultSet getAuditTrailForUser(String username, int startIndex, int count) throws ArtificerClientException, ArtificerServerException
username
- startIndex
- count
- ArtificerClientException
ArtificerServerException
public org.jboss.downloads.artificer._2013.auditing.AuditEntry getAuditEntry(String artifactUuid, String auditEntryUuid) throws ArtificerClientException, ArtificerServerException
artifactUuid
- auditEntryUuid
- ArtificerClientException
ArtificerServerException
protected ClientRequest createClientRequest(String atomUrl)
atomUrl
- public Locale getLocale()
public void setLocale(Locale locale)
locale
- the locale to setpublic QueryResultSet reverseRelationships(String uuid) throws ArtificerClientException, ArtificerServerException
public List<String> getTypes() throws ArtificerClientException, ArtificerServerException
Copyright © 2011–2015 JBoss, a division of Red Hat. All rights reserved.