Package org.italiangrid.voms.request.impl

# Class DefaultVOMSACService.Builder

java.lang.Object
org.italiangrid.voms.request.impl.DefaultVOMSACService.Builder

Enclosing class:
  `DefaultVOMSACService`

public static class DefaultVOMSACService.Builder extends Object
Creates a `DefaultVOMSACService` object. The `DefaultVOMSACService` parameters can be set with the appropriate methods. Example:

     {
       @code
       VOMSACService acService =
           new DefaultVOMSACService.Builder(certChainValidator).requestListener(requestListener)
             .serverInfoStoreListener(serverInfoStoreListener)
             .protocolListener(protocolListener)
             .build();
     }

## Field Summary

Fields
Modifier and Type
Field
Description
`protected VOMSProtocol`
`httpProtocol`
The http protocol implementation
`protected VOMSProtocol`
`legacyProtocol`
The voms legacy protocol implementation

## Constructor Summary

Constructors
Constructor
Description
`Builder(eu.emi.security.authn.x509.X509CertChainValidatorExt certChainValidator)`
Creates a Builder for a `DefaultVOMSACService`.

## Method Summary

Modifier and Type
Method
Description
`DefaultVOMSACService`
`build()`
Builds the `DefaultVOMSACService`
`protected void`
`buildProtocols()`
Builds default protocols if needed
`protected void`
`buildServerInfoStore()`
Builds the server info store
`DefaultVOMSACService.Builder`
`connectTimeout(int timeout)`
Sets the connect timeout (in millisecods) for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`httpProtocol(VOMSProtocol httpProtocol)`
Sets the http protocol implementation
`DefaultVOMSACService.Builder`
`legacyProtocol(VOMSProtocol legacyProtocol)`
Sets the legacy protocol implementation
`DefaultVOMSACService.Builder`
`legacyProtocolEnabled(boolean lpe)`
Enables/disables the fallback the VOMS legacy protocol.
`DefaultVOMSACService.Builder`
`protocolListener(VOMSProtocolListener pl)`
Sets the `VOMSProtocolListener` for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`readTimeout(int timeout)`
Sets the read timeout (in milliseconds) for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`requestListener(VOMSRequestListener l)`
Sets the request listener for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`serverInfoStore(VOMSServerInfoStore sis)`
Sets the `VOMSServerInfoStore` for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`serverInfoStoreListener(VOMSServerInfoStoreListener sl)`
Sets the `VOMSServerInfoStoreListener` for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`skipHostnameChecks(boolean s)`
Sets a flag to skip VOMS hostname checking.
`DefaultVOMSACService.Builder`
`vomsesLocations(List<String> vomsesLocations)`
Sets a list of locations that will be used to build a `VOMSESLookupStrategy` for the `DefaultVOMSACService` that this builder is creating
`DefaultVOMSACService.Builder`
`vomsesLookupStrategy(VOMSESLookupStrategy strategy)`
Sets the vomses lookup strategy for the `DefaultVOMSACService` that this builder is creating

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### httpProtocol

protected VOMSProtocol httpProtocol
The http protocol implementation

### legacyProtocol

protected VOMSProtocol legacyProtocol
The voms legacy protocol implementation

## Constructor Details

### Builder

public Builder(eu.emi.security.authn.x509.X509CertChainValidatorExt certChainValidator)
Creates a Builder for a `DefaultVOMSACService`.

Parameters:
  `certChainValidator` - the validator to use to setup the SSL connection and validate the certificates

## Method Details

### requestListener

public DefaultVOMSACService.Builder requestListener(VOMSRequestListener l)
Sets the request listener for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `l` - the request listener that will receive notifications about request events
Returns:
  this `DefaultVOMSACService.Builder` instance

### serverInfoStoreListener

public DefaultVOMSACService.Builder serverInfoStoreListener(VOMSServerInfoStoreListener sl)
Sets the `VOMSServerInfoStoreListener` for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `sl` - the store listener that will receive notifications about store events
Returns:
  this `DefaultVOMSACService.Builder` instance

### serverInfoStore

public DefaultVOMSACService.Builder serverInfoStore(VOMSServerInfoStore sis)
Sets the `VOMSServerInfoStore` for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `sis` - a `VOMSServerInfoStore` object
Returns:
  this `DefaultVOMSACService.Builder` instance

### protocolListener

public DefaultVOMSACService.Builder protocolListener(VOMSProtocolListener pl)
Sets the `VOMSProtocolListener` for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `pl` - the `VOMSProtocolListener` that will receive notifications about protocol events
Returns:
  this `DefaultVOMSACService.Builder` instance

### connectTimeout

public DefaultVOMSACService.Builder connectTimeout(int timeout)
Sets the connect timeout (in millisecods) for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `timeout` - the timeout value in milliseconds
Returns:
  this `DefaultVOMSACService.Builder` instance

### readTimeout

public DefaultVOMSACService.Builder readTimeout(int timeout)
Sets the read timeout (in milliseconds) for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `timeout` - the timeout value in milliseconds
Returns:
  this `DefaultVOMSACService.Builder` instance

### skipHostnameChecks

public DefaultVOMSACService.Builder skipHostnameChecks(boolean s)
Sets a flag to skip VOMS hostname checking. Allows for creative VOMS server side certificate configuration.

Parameters:
  `s` - `true` to skip the checks, `false` otherwise
Returns:
  this `DefaultVOMSACService.Builder` instance

### vomsesLookupStrategy

public DefaultVOMSACService.Builder vomsesLookupStrategy(VOMSESLookupStrategy strategy)
Sets the vomses lookup strategy for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `strategy` - the `VOMSESLookupStrategy` object
Returns:
  this `DefaultVOMSACService.Builder` instance

### vomsesLocations

public DefaultVOMSACService.Builder vomsesLocations(List<String> vomsesLocations)
Sets a list of locations that will be used to build a `VOMSESLookupStrategy` for the `DefaultVOMSACService` that this builder is creating

Parameters:
  `vomsesLocations` - a list of paths where vomses information will be looked for
Returns:
  this `DefaultVOMSACService.Builder` instance

### httpProtocol

public DefaultVOMSACService.Builder httpProtocol(VOMSProtocol httpProtocol)
Sets the http protocol implementation

Parameters:
  `httpProtocol` - the http protocol implementatino
Returns:
  this `DefaultVOMSACService.Builder` instance

### legacyProtocol

public DefaultVOMSACService.Builder legacyProtocol(VOMSProtocol legacyProtocol)
Sets the legacy protocol implementation

Parameters:
  `legacyProtocol` - the legacy protocol implementation
Returns:
  the `DefaultVOMSACService.Builder`

### legacyProtocolEnabled

public DefaultVOMSACService.Builder legacyProtocolEnabled(boolean lpe)
Enables/disables the fallback the VOMS legacy protocol.

Parameters:
  `lpe` - `true` to enable the legacy protocol, `false` otherwise
Returns:
  this `DefaultVOMSACService.Builder` instance

### buildServerInfoStore

protected void buildServerInfoStore()
Builds the server info store

### buildProtocols

protected void buildProtocols()
Builds default protocols if needed

### build

public DefaultVOMSACService build()
Builds the `DefaultVOMSACService`

Returns:
  a `DefaultVOMSACService` configured as required by this builder