Class CloudControllerRestClientImpl
- java.lang.Object
-
- com.sap.cloudfoundry.client.facade.rest.CloudControllerRestClientImpl
-
- All Implemented Interfaces:
CloudControllerRestClient
public class CloudControllerRestClientImpl extends Object implements CloudControllerRestClient
Abstract implementation of the CloudControllerClient intended to serve as the base.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCloudControllerRestClientImpl()Only for unit tests.CloudControllerRestClientImpl(URL controllerUrl, CloudCredentials credentials, org.springframework.web.reactive.function.client.WebClient webClient, OAuthClient oAuthClient, org.cloudfoundry.client.CloudFoundryClient delegate)CloudControllerRestClientImpl(URL controllerUrl, CloudCredentials credentials, org.springframework.web.reactive.function.client.WebClient webClient, OAuthClient oAuthClient, org.cloudfoundry.client.CloudFoundryClient delegate, org.cloudfoundry.doppler.DopplerClient dopplerClient, CloudSpace target)
-
Method Summary
-
-
-
Constructor Detail
-
CloudControllerRestClientImpl
protected CloudControllerRestClientImpl()
Only for unit tests. This works around the fact that the initialize method is called within the constructor and hence can not be overloaded, making it impossible to write unit tests that don't trigger network calls.
-
CloudControllerRestClientImpl
public CloudControllerRestClientImpl(URL controllerUrl, CloudCredentials credentials, org.springframework.web.reactive.function.client.WebClient webClient, OAuthClient oAuthClient, org.cloudfoundry.client.CloudFoundryClient delegate)
-
CloudControllerRestClientImpl
public CloudControllerRestClientImpl(URL controllerUrl, CloudCredentials credentials, org.springframework.web.reactive.function.client.WebClient webClient, OAuthClient oAuthClient, org.cloudfoundry.client.CloudFoundryClient delegate, org.cloudfoundry.doppler.DopplerClient dopplerClient, CloudSpace target)
-
-
Method Detail
-
getWebClient
public org.springframework.web.reactive.function.client.WebClient getWebClient()
- Specified by:
getWebClientin interfaceCloudControllerRestClient
-
getOAuthClient
public OAuthClient getOAuthClient()
- Specified by:
getOAuthClientin interfaceCloudControllerRestClient
-
getControllerUrl
public URL getControllerUrl()
- Specified by:
getControllerUrlin interfaceCloudControllerRestClient
-
addDomain
public void addDomain(String domainName)
- Specified by:
addDomainin interfaceCloudControllerRestClient
-
addRoute
public void addRoute(String host, String domainName, String path)
- Specified by:
addRoutein interfaceCloudControllerRestClient
-
bindServiceInstance
public void bindServiceInstance(String applicationName, String serviceInstanceName)
- Specified by:
bindServiceInstancein interfaceCloudControllerRestClient
-
bindServiceInstance
public void bindServiceInstance(String applicationName, String serviceInstanceName, Map<String,Object> parameters)
- Specified by:
bindServiceInstancein interfaceCloudControllerRestClient
-
createApplication
public void createApplication(String name, Staging staging, Integer memory, List<String> uris)
- Specified by:
createApplicationin interfaceCloudControllerRestClient
-
createApplication
public void createApplication(String name, Staging staging, Integer diskQuota, Integer memory, List<String> uris, DockerInfo dockerInfo)
- Specified by:
createApplicationin interfaceCloudControllerRestClient
-
createServiceInstance
public void createServiceInstance(CloudServiceInstance serviceInstance)
- Specified by:
createServiceInstancein interfaceCloudControllerRestClient
-
createServiceBroker
public void createServiceBroker(CloudServiceBroker serviceBroker)
- Specified by:
createServiceBrokerin interfaceCloudControllerRestClient
-
createServiceKey
public CloudServiceKey createServiceKey(String serviceInstanceName, String serviceKeyName, Map<String,Object> parameters)
- Specified by:
createServiceKeyin interfaceCloudControllerRestClient
-
createUserProvidedServiceInstance
public void createUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials)
- Specified by:
createUserProvidedServiceInstancein interfaceCloudControllerRestClient
-
createUserProvidedServiceInstance
public void createUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String,Object> credentials, String syslogDrainUrl)
- Specified by:
createUserProvidedServiceInstancein interfaceCloudControllerRestClient
-
deleteAllApplications
public void deleteAllApplications()
- Specified by:
deleteAllApplicationsin interfaceCloudControllerRestClient
-
deleteAllServiceInstances
public void deleteAllServiceInstances()
- Specified by:
deleteAllServiceInstancesin interfaceCloudControllerRestClient
-
deleteApplication
public void deleteApplication(String applicationName)
- Specified by:
deleteApplicationin interfaceCloudControllerRestClient
-
deleteDomain
public void deleteDomain(String domainName)
- Specified by:
deleteDomainin interfaceCloudControllerRestClient
-
deleteOrphanedRoutes
public List<CloudRoute> deleteOrphanedRoutes()
Delete routes that do not have any application which is assigned to them.- Specified by:
deleteOrphanedRoutesin interfaceCloudControllerRestClient- Returns:
- deleted routes or an empty list if no routes have been found
-
deleteRoute
public void deleteRoute(String host, String domainName, String path)
- Specified by:
deleteRoutein interfaceCloudControllerRestClient
-
deleteServiceInstance
public void deleteServiceInstance(String serviceInstanceName)
- Specified by:
deleteServiceInstancein interfaceCloudControllerRestClient
-
deleteServiceInstance
public void deleteServiceInstance(CloudServiceInstance serviceInstance)
- Specified by:
deleteServiceInstancein interfaceCloudControllerRestClient
-
deleteServiceBroker
public void deleteServiceBroker(String name)
- Specified by:
deleteServiceBrokerin interfaceCloudControllerRestClient
-
deleteServiceKey
public void deleteServiceKey(String serviceInstanceName, String serviceKeyName)
- Specified by:
deleteServiceKeyin interfaceCloudControllerRestClient
-
deleteServiceKey
public void deleteServiceKey(CloudServiceKey serviceKey)
- Specified by:
deleteServiceKeyin interfaceCloudControllerRestClient
-
getApplication
public CloudApplication getApplication(String applicationName)
- Specified by:
getApplicationin interfaceCloudControllerRestClient
-
getApplication
public CloudApplication getApplication(String applicationName, boolean required)
- Specified by:
getApplicationin interfaceCloudControllerRestClient
-
getApplication
public CloudApplication getApplication(UUID applicationGuid)
- Specified by:
getApplicationin interfaceCloudControllerRestClient
-
getApplicationEnvironment
public Map<String,String> getApplicationEnvironment(String applicationName)
- Specified by:
getApplicationEnvironmentin interfaceCloudControllerRestClient
-
getApplicationEnvironment
public Map<String,String> getApplicationEnvironment(UUID applicationGuid)
- Specified by:
getApplicationEnvironmentin interfaceCloudControllerRestClient
-
getApplicationEvents
public List<CloudEvent> getApplicationEvents(String applicationName)
- Specified by:
getApplicationEventsin interfaceCloudControllerRestClient
-
getEventsByActee
public List<CloudEvent> getEventsByActee(UUID uuid)
- Specified by:
getEventsByActeein interfaceCloudControllerRestClient
-
getApplicationInstances
public InstancesInfo getApplicationInstances(String applicationName)
- Specified by:
getApplicationInstancesin interfaceCloudControllerRestClient
-
getApplicationInstances
public InstancesInfo getApplicationInstances(CloudApplication application)
- Specified by:
getApplicationInstancesin interfaceCloudControllerRestClient
-
getApplications
public List<CloudApplication> getApplications()
- Specified by:
getApplicationsin interfaceCloudControllerRestClient
-
getApplicationsByMetadataLabelSelector
public List<CloudApplication> getApplicationsByMetadataLabelSelector(String labelSelector)
- Specified by:
getApplicationsByMetadataLabelSelectorin interfaceCloudControllerRestClient
-
getDefaultDomain
public CloudDomain getDefaultDomain()
- Specified by:
getDefaultDomainin interfaceCloudControllerRestClient
-
getSharedDomains
public List<CloudDomain> getSharedDomains()
- Specified by:
getSharedDomainsin interfaceCloudControllerRestClient
-
getDomains
public List<CloudDomain> getDomains()
- Specified by:
getDomainsin interfaceCloudControllerRestClient
-
getDomainsForOrganization
public List<CloudDomain> getDomainsForOrganization()
- Specified by:
getDomainsForOrganizationin interfaceCloudControllerRestClient
-
getPrivateDomains
public List<CloudDomain> getPrivateDomains()
- Specified by:
getPrivateDomainsin interfaceCloudControllerRestClient
-
getEvents
public List<CloudEvent> getEvents()
- Specified by:
getEventsin interfaceCloudControllerRestClient
-
getInfo
public CloudInfo getInfo()
- Specified by:
getInfoin interfaceCloudControllerRestClient
-
getOrganization
public CloudOrganization getOrganization(String organizationName)
- Specified by:
getOrganizationin interfaceCloudControllerRestClient
-
getOrganization
public CloudOrganization getOrganization(String organizationName, boolean required)
Get organization by given name.- Specified by:
getOrganizationin interfaceCloudControllerRestClient- Parameters:
organizationName-required-- Returns:
- CloudOrganization instance
-
getOrganizations
public List<CloudOrganization> getOrganizations()
- Specified by:
getOrganizationsin interfaceCloudControllerRestClient
-
getRecentLogs
public List<ApplicationLog> getRecentLogs(String applicationName)
- Specified by:
getRecentLogsin interfaceCloudControllerRestClient
-
getRecentLogs
public List<ApplicationLog> getRecentLogs(UUID applicationGuid)
- Specified by:
getRecentLogsin interfaceCloudControllerRestClient
-
getRoutes
public List<CloudRoute> getRoutes(String domainName)
- Specified by:
getRoutesin interfaceCloudControllerRestClient
-
getServiceInstance
public CloudServiceInstance getServiceInstance(String serviceInstanceName)
- Specified by:
getServiceInstancein interfaceCloudControllerRestClient
-
getServiceInstance
public CloudServiceInstance getServiceInstance(String serviceInstanceName, boolean required)
- Specified by:
getServiceInstancein interfaceCloudControllerRestClient
-
getServiceBindings
public List<CloudServiceBinding> getServiceBindings(UUID serviceInstanceGuid)
- Specified by:
getServiceBindingsin interfaceCloudControllerRestClient
-
getServiceBroker
public CloudServiceBroker getServiceBroker(String name)
- Specified by:
getServiceBrokerin interfaceCloudControllerRestClient
-
getServiceBroker
public CloudServiceBroker getServiceBroker(String name, boolean required)
- Specified by:
getServiceBrokerin interfaceCloudControllerRestClient
-
getServiceBrokers
public List<CloudServiceBroker> getServiceBrokers()
- Specified by:
getServiceBrokersin interfaceCloudControllerRestClient
-
getServiceKeys
public List<CloudServiceKey> getServiceKeys(String serviceInstanceName)
- Specified by:
getServiceKeysin interfaceCloudControllerRestClient
-
getServiceKeys
public List<CloudServiceKey> getServiceKeys(CloudServiceInstance serviceInstance)
- Specified by:
getServiceKeysin interfaceCloudControllerRestClient
-
getServiceInstanceParameters
public Map<String,Object> getServiceInstanceParameters(UUID guid)
- Specified by:
getServiceInstanceParametersin interfaceCloudControllerRestClient
-
getServiceBindingParameters
public Map<String,Object> getServiceBindingParameters(UUID guid)
- Specified by:
getServiceBindingParametersin interfaceCloudControllerRestClient
-
getServiceOfferings
public List<CloudServiceOffering> getServiceOfferings()
- Specified by:
getServiceOfferingsin interfaceCloudControllerRestClient
-
updateServicePlan
public void updateServicePlan(String serviceName, String planName)
- Specified by:
updateServicePlanin interfaceCloudControllerRestClient
-
updateServiceParameters
public void updateServiceParameters(String serviceName, Map<String,Object> parameters)
- Specified by:
updateServiceParametersin interfaceCloudControllerRestClient
-
updateServiceTags
public void updateServiceTags(String serviceName, List<String> tags)
- Specified by:
updateServiceTagsin interfaceCloudControllerRestClient
-
getServiceInstances
public List<CloudServiceInstance> getServiceInstances()
- Specified by:
getServiceInstancesin interfaceCloudControllerRestClient
-
getServiceInstancesByMetadataLabelSelector
public List<CloudServiceInstance> getServiceInstancesByMetadataLabelSelector(String labelSelector)
- Specified by:
getServiceInstancesByMetadataLabelSelectorin interfaceCloudControllerRestClient
-
getSpace
public CloudSpace getSpace(UUID spaceGuid)
- Specified by:
getSpacein interfaceCloudControllerRestClient
-
getSpace
public CloudSpace getSpace(String organizationName, String spaceName)
- Specified by:
getSpacein interfaceCloudControllerRestClient
-
getSpace
public CloudSpace getSpace(String organizationName, String spaceName, boolean required)
- Specified by:
getSpacein interfaceCloudControllerRestClient
-
getSpace
public CloudSpace getSpace(String spaceName)
- Specified by:
getSpacein interfaceCloudControllerRestClient
-
getSpace
public CloudSpace getSpace(String spaceName, boolean required)
- Specified by:
getSpacein interfaceCloudControllerRestClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(String spaceName)
- Specified by:
getSpaceAuditorsin interfaceCloudControllerRestClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(String organizationName, String spaceName)
- Specified by:
getSpaceAuditorsin interfaceCloudControllerRestClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors()
- Specified by:
getSpaceAuditorsin interfaceCloudControllerRestClient
-
getSpaceAuditors
public List<UUID> getSpaceAuditors(UUID spaceGuid)
- Specified by:
getSpaceAuditorsin interfaceCloudControllerRestClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(String spaceName)
- Specified by:
getSpaceDevelopersin interfaceCloudControllerRestClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(String organizationName, String spaceName)
- Specified by:
getSpaceDevelopersin interfaceCloudControllerRestClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers()
- Specified by:
getSpaceDevelopersin interfaceCloudControllerRestClient
-
getSpaceDevelopers
public List<UUID> getSpaceDevelopers(UUID spaceGuid)
- Specified by:
getSpaceDevelopersin interfaceCloudControllerRestClient
-
getSpaceManagers
public List<UUID> getSpaceManagers(String spaceName)
- Specified by:
getSpaceManagersin interfaceCloudControllerRestClient
-
getSpaceManagers
public List<UUID> getSpaceManagers(String organizationName, String spaceName)
- Specified by:
getSpaceManagersin interfaceCloudControllerRestClient
-
getSpaceManagers
public List<UUID> getSpaceManagers()
- Specified by:
getSpaceManagersin interfaceCloudControllerRestClient
-
getSpaceManagers
public List<UUID> getSpaceManagers(UUID spaceGuid)
- Specified by:
getSpaceManagersin interfaceCloudControllerRestClient
-
getSpaces
public List<CloudSpace> getSpaces()
- Specified by:
getSpacesin interfaceCloudControllerRestClient
-
getSpaces
public List<CloudSpace> getSpaces(String organizationName)
- Specified by:
getSpacesin interfaceCloudControllerRestClient
-
getStack
public CloudStack getStack(String name)
- Specified by:
getStackin interfaceCloudControllerRestClient
-
getStack
public CloudStack getStack(String name, boolean required)
- Specified by:
getStackin interfaceCloudControllerRestClient
-
getStacks
public List<CloudStack> getStacks()
- Specified by:
getStacksin interfaceCloudControllerRestClient
-
login
public org.springframework.security.oauth2.common.OAuth2AccessToken login()
- Specified by:
loginin interfaceCloudControllerRestClient
-
logout
public void logout()
- Specified by:
logoutin interfaceCloudControllerRestClient
-
rename
public void rename(String applicationName, String newName)
- Specified by:
renamein interfaceCloudControllerRestClient
-
restartApplication
public StartingInfo restartApplication(String applicationName)
- Specified by:
restartApplicationin interfaceCloudControllerRestClient
-
startApplication
public StartingInfo startApplication(String applicationName)
- Specified by:
startApplicationin interfaceCloudControllerRestClient
-
stopApplication
public void stopApplication(String applicationName)
- Specified by:
stopApplicationin interfaceCloudControllerRestClient
-
unbindServiceInstance
public void unbindServiceInstance(String applicationName, String serviceInstanceName)
- Specified by:
unbindServiceInstancein interfaceCloudControllerRestClient
-
unbindServiceInstance
public void unbindServiceInstance(CloudApplication application, CloudServiceInstance serviceInstance)
- Specified by:
unbindServiceInstancein interfaceCloudControllerRestClient
-
updateApplicationDiskQuota
public void updateApplicationDiskQuota(String applicationName, int diskQuota)
- Specified by:
updateApplicationDiskQuotain interfaceCloudControllerRestClient
-
updateApplicationEnv
public void updateApplicationEnv(String applicationName, Map<String,String> env)
- Specified by:
updateApplicationEnvin interfaceCloudControllerRestClient
-
updateApplicationInstances
public void updateApplicationInstances(String applicationName, int instances)
- Specified by:
updateApplicationInstancesin interfaceCloudControllerRestClient
-
updateApplicationMemory
public void updateApplicationMemory(String applicationName, int memory)
- Specified by:
updateApplicationMemoryin interfaceCloudControllerRestClient
-
updateApplicationMetadata
public void updateApplicationMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)
- Specified by:
updateApplicationMetadatain interfaceCloudControllerRestClient
-
updateApplicationStaging
public void updateApplicationStaging(String applicationName, Staging staging)
- Specified by:
updateApplicationStagingin interfaceCloudControllerRestClient
-
updateApplicationUris
public void updateApplicationUris(String applicationName, List<String> uris)
- Specified by:
updateApplicationUrisin interfaceCloudControllerRestClient
-
updateServiceBroker
public void updateServiceBroker(CloudServiceBroker serviceBroker)
- Specified by:
updateServiceBrokerin interfaceCloudControllerRestClient
-
updateServiceInstanceMetadata
public void updateServiceInstanceMetadata(UUID guid, org.cloudfoundry.client.v3.Metadata metadata)
- Specified by:
updateServiceInstanceMetadatain interfaceCloudControllerRestClient
-
updateServicePlanVisibilityForBroker
public void updateServicePlanVisibilityForBroker(String name, boolean visibility)
- Specified by:
updateServicePlanVisibilityForBrokerin interfaceCloudControllerRestClient
-
getTask
public CloudTask getTask(UUID taskGuid)
- Specified by:
getTaskin interfaceCloudControllerRestClient
-
getTasks
public List<CloudTask> getTasks(String applicationName)
- Specified by:
getTasksin interfaceCloudControllerRestClient
-
runTask
public CloudTask runTask(String applicationName, CloudTask task)
- Specified by:
runTaskin interfaceCloudControllerRestClient
-
cancelTask
public CloudTask cancelTask(UUID taskGuid)
- Specified by:
cancelTaskin interfaceCloudControllerRestClient
-
uploadApplication
public void uploadApplication(String applicationName, Path file, UploadStatusCallback callback)
- Specified by:
uploadApplicationin interfaceCloudControllerRestClient
-
uploadApplication
public void uploadApplication(String applicationName, InputStream inputStream, UploadStatusCallback callback) throws IOException
- Specified by:
uploadApplicationin interfaceCloudControllerRestClient- Throws:
IOException
-
asyncUploadApplication
public CloudPackage asyncUploadApplication(String applicationName, Path file, UploadStatusCallback callback)
- Specified by:
asyncUploadApplicationin interfaceCloudControllerRestClient
-
getUploadStatus
public Upload getUploadStatus(UUID packageGuid)
- Specified by:
getUploadStatusin interfaceCloudControllerRestClient
-
getBuild
public CloudBuild getBuild(UUID buildGuid)
- Specified by:
getBuildin interfaceCloudControllerRestClient
-
getBuildsForApplication
public List<CloudBuild> getBuildsForApplication(UUID applicationGuid)
- Specified by:
getBuildsForApplicationin interfaceCloudControllerRestClient
-
getBuildsForPackage
public List<CloudBuild> getBuildsForPackage(UUID packageGuid)
- Specified by:
getBuildsForPackagein interfaceCloudControllerRestClient
-
createBuild
public CloudBuild createBuild(UUID packageGuid)
- Specified by:
createBuildin interfaceCloudControllerRestClient
-
bindDropletToApp
public void bindDropletToApp(UUID dropletGuid, UUID applicationGuid)
- Specified by:
bindDropletToAppin interfaceCloudControllerRestClient
-
getCurrentDropletForApplication
public DropletInfo getCurrentDropletForApplication(UUID applicationGuid)
- Specified by:
getCurrentDropletForApplicationin interfaceCloudControllerRestClient
-
getPackagesForApplication
public List<CloudPackage> getPackagesForApplication(UUID applicationGuid)
- Specified by:
getPackagesForApplicationin interfaceCloudControllerRestClient
-
extractUriInfo
protected void extractUriInfo(Map<String,UUID> existingDomains, String uri, Map<String,String> uriInfo)
-
getServiceResource
protected reactor.core.publisher.Mono<? extends org.cloudfoundry.client.v2.Resource<org.cloudfoundry.client.v2.services.ServiceEntity>> getServiceResource(UUID serviceGuid)
-
getServicePlanResource
protected reactor.core.publisher.Mono<? extends org.cloudfoundry.client.v2.Resource<org.cloudfoundry.client.v2.serviceplans.ServicePlanEntity>> getServicePlanResource(UUID servicePlanGuid)
-
getPackage
public CloudPackage getPackage(UUID packageGuid)
- Specified by:
getPackagein interfaceCloudControllerRestClient
-
-