Class BaseController
java.lang.Object
org.springframework.cloud.servicebroker.controller.BaseController
- Direct Known Subclasses:
CatalogController
,ServiceInstanceBindingController
,ServiceInstanceController
Base functionality shared by controllers.
- Author:
- S Greenberg, Scott Frederick, Roy Clarkson
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBaseController
(CatalogService catalogService) Construct a newBaseController
. -
Method Summary
Modifier and TypeMethodDescriptionprotected reactor.core.publisher.Mono<AsyncServiceBrokerRequest>
configureCommonRequestFields
(AsyncServiceBrokerRequest request, String platformInstanceId, String apiInfoLocation, String originatingIdentityString, String requestIdentity, boolean asyncAccepted) Sets common headers for the request.protected reactor.core.publisher.Mono<ServiceBrokerRequest>
configureCommonRequestFields
(ServiceBrokerRequest request, String platformInstanceId, String apiInfoLocation, String originatingIdentityString, String requestIdentity) Sets common headers for the request.protected HttpStatus
If an asynchronous request is received, then return HTTP 202 Accepted, otherwise HTTP 200 OK.protected reactor.core.publisher.Mono<ServiceDefinition>
getRequiredServiceDefinition
(String serviceDefinitionId) Find the Service Definition for the provided ID.protected reactor.core.publisher.Mono<Plan>
getRequiredServiceDefinitionPlan
(ServiceDefinition serviceDefinition, String planId) Find the Plan for the Service Definition and Plan ID.protected reactor.core.publisher.Mono<ServiceDefinition>
getServiceDefinition
(String serviceDefinitionId) Find the Service Definition for the provided ID, or empty if not found.protected reactor.core.publisher.Mono<Plan>
getServiceDefinitionPlan
(ServiceDefinition serviceDefinition, String planId) Find the Plan for the Service Definition and Plan ID, or empty if not found.protected Context
parseOriginatingIdentity
(String originatingIdentityString) Populates a platform specific context from the originating identity.
-
Field Details
-
catalogService
-
-
Constructor Details
-
BaseController
Construct a newBaseController
.- Parameters:
catalogService
- the catalog service
-
-
Method Details
-
configureCommonRequestFields
protected reactor.core.publisher.Mono<ServiceBrokerRequest> configureCommonRequestFields(ServiceBrokerRequest request, String platformInstanceId, String apiInfoLocation, String originatingIdentityString, String requestIdentity) Sets common headers for the request.- Parameters:
request
- the request in which to set the headersplatformInstanceId
- the platform instance IDapiInfoLocation
- location of the API info endpoint of the platform instanceoriginatingIdentityString
- identity of the user that initiated the request from the platformrequestIdentity
- identity of the request sent from the platform- Returns:
- the request with the applied headers
-
configureCommonRequestFields
protected reactor.core.publisher.Mono<AsyncServiceBrokerRequest> configureCommonRequestFields(AsyncServiceBrokerRequest request, String platformInstanceId, String apiInfoLocation, String originatingIdentityString, String requestIdentity, boolean asyncAccepted) Sets common headers for the request.- Parameters:
request
- the request in which to set the headersplatformInstanceId
- the platform instance IDapiInfoLocation
- location of the API info endpoint of the platform instanceoriginatingIdentityString
- identity of the user that initiated the request from the platformrequestIdentity
- identity of the request sent from the platformasyncAccepted
- does the platform accept asynchronous requests- Returns:
- the request with the applied headers
-
getRequiredServiceDefinition
protected reactor.core.publisher.Mono<ServiceDefinition> getRequiredServiceDefinition(String serviceDefinitionId) Find the Service Definition for the provided ID. Emits an error if not found.- Parameters:
serviceDefinitionId
- the service definition ID- Returns:
- the Service Definition
-
getServiceDefinition
protected reactor.core.publisher.Mono<ServiceDefinition> getServiceDefinition(String serviceDefinitionId) Find the Service Definition for the provided ID, or empty if not found.- Parameters:
serviceDefinitionId
- the service definition ID- Returns:
- the Service Definition
-
getServiceDefinitionPlan
protected reactor.core.publisher.Mono<Plan> getServiceDefinitionPlan(ServiceDefinition serviceDefinition, String planId) Find the Plan for the Service Definition and Plan ID, or empty if not found.- Parameters:
serviceDefinition
- the Service DefinitionplanId
- the plan ID- Returns:
- the Plan
-
getRequiredServiceDefinitionPlan
protected reactor.core.publisher.Mono<Plan> getRequiredServiceDefinitionPlan(ServiceDefinition serviceDefinition, String planId) Find the Plan for the Service Definition and Plan ID. Emits an error if not found.- Parameters:
serviceDefinition
- the Service DefinitionplanId
- the plan ID- Returns:
- the Plan
-
parseOriginatingIdentity
Populates a platform specific context from the originating identity.- Parameters:
originatingIdentityString
- identity of the user that initiated the request from the platform- Returns:
- the Context
-
getAsyncResponseCode
If an asynchronous request is received, then return HTTP 202 Accepted, otherwise HTTP 200 OK.- Parameters:
response
- the response- Returns:
- the HTTP status
-