Class MegacliteServiceBinding

java.lang.Object
com.sap.cloud.sdk.cloudplatform.connectivity.MegacliteServiceBinding
All Implemented Interfaces:
com.sap.cloud.environment.servicebinding.api.ServiceBinding

@Beta public final class MegacliteServiceBinding extends Object implements com.sap.cloud.environment.servicebinding.api.ServiceBinding
Represents a (remote) service that is bound to Megaclite. Therefore, the application may reach the bound service by using Megaclite as an egress proxy.

Instances of this class require manual (i.e. programmer) input because the configuration cannot be automatically derived. Instead, the configuration is part of the Deploy With Confidence product configuration.

Usage Example:

 MegacliteServiceBinding megacliteServiceBinding =
     MegacliteServiceBinding
         .forService(BindableService.DESTINATION)
         .providerConfiguration()
         .name("destination")
         .version("v1")
         .build();

 MegacliteServiceBindingAccessor.registerServiceBinding(megacliteServiceBinding);
 

Since:
4.17.0
See Also:
  • Method Details

    • getKeys

      @Nonnull public Set<String> getKeys()
      Specified by:
      getKeys in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • containsKey

      public boolean containsKey(@Nonnull String key)
      Specified by:
      containsKey in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • get

      @Nonnull public Optional<Object> get(@Nonnull String key)
      Specified by:
      get in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • getName

      @Nonnull public Optional<String> getName()
      Specified by:
      getName in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • getServiceName

      @Nonnull public Optional<String> getServiceName()
      Specified by:
      getServiceName in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • getServicePlan

      @Nonnull public Optional<String> getServicePlan()
      Specified by:
      getServicePlan in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • getTags

      @Nonnull public List<String> getTags()
      Specified by:
      getTags in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • getCredentials

      @Nonnull public Map<String,Object> getCredentials()
      Specified by:
      getCredentials in interface com.sap.cloud.environment.servicebinding.api.ServiceBinding
    • forService

      @Nonnull public static MegacliteServiceBinding.Builder1 forService(@Nonnull com.sap.cloud.environment.servicebinding.api.ServiceIdentifier service)
      Creates a new MegacliteServiceBinding.Builder1 instance that can be used to configure access to the provided service that is bound to Megaclite.

      Usage Example: Assume you have the following two configurations in your Deploy with Confidence product configuration:

      
       # destination-paas.yaml
       communication:
         cacheResponse: true
         type: reuse
         typeSpecificProperties:
           authorizeOnBehalf: paas
           grantType: client_credentials
           serviceUrlKey: uri
           vcapServiceName: destination
       headers:
         forwardDwcHeaders: false
       name: destination-paas
       version: paas-v1
      
       ---
      
       # destination-saas.yaml
       communication:
         cacheResponse: true
         type: reuse
         typeSpecificProperties:
           authorizeOnBehalf: saas
           grantType: client_credentials
           serviceUrlKey: uri
           vcapServiceName: destination
       headers:
         forwardDwcHeaders: false
       name: destination-saas
       version: saas-v1

      Then you could use the builder as follows:

      
       MegacliteServiceBinding destinationServiceBinding =
           MegacliteServiceBinding
               .forService(ServiceIdentifier.DESTINATION)
               .providerConfiguration()
               .name("destination-paas")
               .version("paas-v1")
               .and()
               .subscriberConfiguration()
               .name("destination-saas")
               .version("saas-v1")
               .build();
       MegacliteServiceBindingAccessor.registerServiceBinding(destinationServiceBinding);
       

      Parameters:
      service - The service that the configuration is about.
      Returns:
      A new MegacliteServiceBinding.Builder1 instance that can be used to construct new MegacliteServiceBinding instances.
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      @Nonnull public String toString()
      Overrides:
      toString in class Object