Class OutboundTarget.Builder

All Implemented Interfaces:
Builder<OutboundTarget.Builder,OutboundTarget>, Supplier<OutboundTarget>
Enclosing class:

public static final class OutboundTarget.Builder extends Object implements Builder<OutboundTarget.Builder,OutboundTarget>
Fluent API builder for OutboundTarget.
  • Method Details

    • name

      public OutboundTarget.Builder name(String name)
      Configure the name of this outbound target.
      name - name of the target, cannot be null
      updated builder
    • config

      public OutboundTarget.Builder config(Config config)
      Set config for this target. This may be useful if each target requires different provider configuration.
      config - Config object to configure the provider
      update builder instance
    • addHost

      public OutboundTarget.Builder addHost(String host)
      Add supported host for this target. May be called more than once to add more hosts.

      Valid examples:

      • localhost
      • *
      • 192.169.*.*
      • *.google.*
      host - name or IP of host, with possible "*" asterisk character to match any sequence
      updated builder instance
    • addTransport

      public OutboundTarget.Builder addTransport(String transport)
      Add supported transports for this target. May be called more than once to add more transports.

      Valid examples:

      • http
      • https
      There is no wildcard support
      transport - that is supported
      updated builder instance
    • addPath

      public OutboundTarget.Builder addPath(String path)
      Add supported paths for this target. May be called more than once to add more paths. The path is tested as is against called path, and also tested as a regular expression.
      path - supported path (regular expression supported)
      updated builder instance
    • addMethod

      public OutboundTarget.Builder addMethod(String method)
      Add supported method for this target. May be called more than once to add more methods. The method is tested as is ignoring case against the used method.
      method - supported method (exact match ignoring case)
      updated builder instance
    • customObject

      public <U, V extends U> OutboundTarget.Builder customObject(Class<U> objectClass, V anObject)
      Set or replace a custom object. This object will be provided to security provider. Objects are stored by class, so we can have multiple objects of different classes (e.g. when using multiple outbound providers). Class of object is defined by security provider.
      Type Parameters:
      U - Class of the custom object to be stored. The object instance is available ONLY under this class
      V - Implementation of the class
      objectClass - Class of object as expected by security provider
      anObject - Custom object to be used by outbound security provider
      updated Builder instance
    • build

      public OutboundTarget build()
      Build a OutboundTarget instance from this builder.
      Specified by:
      build in interface Builder<OutboundTarget.Builder,OutboundTarget>
      instance configured with this builder values