public class MarketplaceServiceInternalImpl extends Object implements MarketplaceServiceInternal, org.springframework.beans.factory.InitializingBean
MarketplaceServiceInternal
that proxies all request to the configured MarketplaceModifier and Type | Field and Description |
---|---|
protected String |
edition
The current Crafter CMS edition, sent with all requests
|
protected org.springframework.http.HttpHeaders |
httpHeaders
The custom HTTP headers to sent with all requests
|
protected InstanceService |
instanceService |
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected org.craftercms.commons.rest.RestTemplate |
restTemplate |
protected boolean |
showPending
Indicates if the search should include plugins pending of approval
|
protected SiteService |
siteService |
protected SitesServiceInternal |
sitesServiceInternal |
protected StudioConfiguration |
studioConfiguration |
protected String |
url
The Marketplace URL to use
|
protected String |
version
The current Crafter CMS version, sent with all requests
|
HEADER_JAVA_VERSION, HEADER_OS_ARCH, HEADER_OS_NAME, HEADER_OS_VERSION, HEADER_STUDIO_BUILD, HEADER_STUDIO_ID, HEADER_STUDIO_VERSION
Constructor and Description |
---|
MarketplaceServiceInternalImpl(InstanceService instanceService,
SiteService siteService,
SitesServiceInternal sitesServiceInternal,
StudioConfiguration studioConfiguration) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
createSite(CreateSiteRequest request)
Creates a site using the given blueprint
|
protected Map<String,Object> |
getDescriptor(String id,
org.craftercms.commons.plugin.model.Version version) |
Map<String,Object> |
searchPlugins(String type,
String keywords,
boolean showIncompatible,
long offset,
long limit)
Performs a search for all available plugins that match the given filters
|
void |
setShowPending(boolean showPending) |
void |
setUrl(String url) |
protected void |
validate() |
protected InstanceService instanceService
protected SiteService siteService
protected SitesServiceInternal sitesServiceInternal
protected StudioConfiguration studioConfiguration
protected org.craftercms.commons.rest.RestTemplate restTemplate
protected com.fasterxml.jackson.databind.ObjectMapper mapper
protected org.springframework.http.HttpHeaders httpHeaders
protected String version
protected String edition
protected String url
protected boolean showPending
public MarketplaceServiceInternalImpl(InstanceService instanceService, SiteService siteService, SitesServiceInternal sitesServiceInternal, StudioConfiguration studioConfiguration)
public void setUrl(String url)
public void setShowPending(boolean showPending)
public void afterPropertiesSet() throws IOException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
IOException
public Map<String,Object> searchPlugins(String type, String keywords, boolean showIncompatible, long offset, long limit) throws MarketplaceException
MarketplaceServiceInternal
searchPlugins
in interface MarketplaceServiceInternal
type
- the type of plugins to searchkeywords
- the keywords to filter pluginsshowIncompatible
- indicates if incompatible plugins should be returnedoffset
- the offset for paginationlimit
- the limit for paginationMarketplaceException
- if there is any error performing the searchprotected void validate() throws MarketplaceException
MarketplaceException
protected Map<String,Object> getDescriptor(String id, org.craftercms.commons.plugin.model.Version version) throws MarketplaceException, BlueprintNotFoundException
public void createSite(CreateSiteRequest request) throws RemoteRepositoryNotFoundException, InvalidRemoteRepositoryException, RemoteRepositoryNotBareException, InvalidRemoteUrlException, ServiceLayerException, InvalidRemoteRepositoryCredentialsException
MarketplaceServiceInternal
createSite
in interface MarketplaceServiceInternal
request
- the site informationRemoteRepositoryNotFoundException
- if there is an error with the remote repositoryInvalidRemoteRepositoryException
- if there is an error with the remote repositoryRemoteRepositoryNotBareException
- if there is an error with the remote repositoryInvalidRemoteUrlException
- if there is an error with the remote repositoryServiceLayerException
- if there is any unexpected errorInvalidRemoteRepositoryCredentialsException
- if there is any error with the credentialsCopyright © 2020 CrafterCMS. All rights reserved.