public final class DefaultMarketplaceClient extends Object implements MarketplaceClient
MarketplaceClient for the Marketplace 2.0 API.| Modifier and Type | Field and Description |
|---|---|
static String |
API_VERSION |
protected URI |
baseUri |
static URI |
DEFAULT_SERVER_URI |
protected EntityEncoding |
encoding |
protected HttpTransport |
httpTransport |
| Constructor and Description |
|---|
DefaultMarketplaceClient(URI baseUri,
HttpConfiguration configuration)
Constructs a
DefaultMarketplaceClient using the default HTTP implementation. |
DefaultMarketplaceClient(URI serverBaseUri,
HttpTransport httpTransport,
EntityEncoding encoding)
Constructs a
DefaultMarketplaceClient using a specific HTTP implementation and
response parser. |
| Modifier and Type | Method and Description |
|---|---|
AddonCategories |
addonCategories()
Returns an API object that provides access to add-on categories.
|
Addons |
addons()
Returns an API object that provides access to add-on listings.
|
Applications |
applications()
Returns an API object that provides access to application listings.
|
Assets |
assets()
Returns an API object that provides file uploading capabilities.
|
void |
close()
Should be called when finished with client to release resources.
|
HttpTransport |
getHttp()
Provides access to the underlying HTTP transport mechanism.
|
<T> Page<T> |
getMore(PageReference<T> ref)
Queries a page of a result set from a previous query, for any resource that provides paginated
results (such as
Addons.find(com.atlassian.marketplace.client.api.AddonQuery)). |
Links |
getRootLinks()
Returns the top-level API resource links, such as "addons".
|
boolean |
isReachable()
Checks whether the MPAC service is available, by attempting to get the root resource.
|
LicenseTypes |
licenseTypes()
Returns an API object that provides access to software license types.
|
Products |
products()
Returns an API object that provides access to product listings (which are called "applications" in the administrative UI).
|
<T> String |
toJson(T entity)
Attempts to convert the specified model object to a JSON string.
|
Vendors |
vendors()
Returns an API object that provides access to vendors.
|
public static final URI DEFAULT_SERVER_URI
protected final URI baseUri
protected final HttpTransport httpTransport
protected final EntityEncoding encoding
public static final String API_VERSION
public DefaultMarketplaceClient(URI baseUri, HttpConfiguration configuration)
DefaultMarketplaceClient using the default HTTP implementation.baseUri - The root URI of the Marketplace server.configuration - Client parameters such as timeouts, authentication, and proxy settings.public DefaultMarketplaceClient(URI serverBaseUri, HttpTransport httpTransport, EntityEncoding encoding)
DefaultMarketplaceClient using a specific HTTP implementation and
response parser.serverBaseUri - The root URI of the Marketplace server.httpTransport - An object that will execute all HTTP requests.encoding - An EntityEncoding implementation.public void close()
MarketplaceClientclose in interface MarketplaceClientclose in interface Closeableclose in interface AutoCloseablepublic boolean isReachable()
MarketplaceClientisReachable in interface MarketplaceClientpublic Links getRootLinks() throws MpacException
MarketplaceClientgetRootLinks in interface MarketplaceClientLinks objectMpacException - if the server was unavailable or returned an errorpublic HttpTransport getHttp()
MarketplaceClientgetHttp in interface MarketplaceClientpublic <T> String toJson(T entity) throws MpacException
MarketplaceClienttoJson in interface MarketplaceCliententity - a model objectMpacException - if the object could not be serialized as JSON (for instance, because it
is not an instance of any of this library's model classes)public Addons addons() throws MpacException
MarketplaceClientaddons in interface MarketplaceClientMpacExceptionpublic AddonCategories addonCategories() throws MpacException
MarketplaceClientaddonCategories in interface MarketplaceClientMpacExceptionpublic Applications applications() throws MpacException
MarketplaceClientapplications in interface MarketplaceClientMpacExceptionpublic Assets assets() throws MpacException
MarketplaceClientassets in interface MarketplaceClientMpacExceptionpublic LicenseTypes licenseTypes() throws MpacException
MarketplaceClientlicenseTypes in interface MarketplaceClientMpacExceptionpublic Products products() throws MpacException
MarketplaceClientproducts in interface MarketplaceClientMpacExceptionpublic Vendors vendors() throws MpacException
MarketplaceClientvendors in interface MarketplaceClientMpacExceptionpublic <T> Page<T> getMore(PageReference<T> ref) throws MpacException
MarketplaceClientAddons.find(com.atlassian.marketplace.client.api.AddonQuery)). The PageReference is obtained by calling
Page.getPrevious(), Page.getNext(), or Page.getReference() on an existing
Page of results.getMore in interface MarketplaceClientPage containing the resultsMpacException - if the server was unavailable or returned an errorCopyright © 2016 Atlassian. All rights reserved.