Class DefaultVOMSACService.Builder
- java.lang.Object
-
- org.italiangrid.voms.request.impl.DefaultVOMSACService.Builder
-
- Enclosing class:
- DefaultVOMSACService
public static class DefaultVOMSACService.Builder extends java.lang.ObjectCreates aDefaultVOMSACServiceobject. TheDefaultVOMSACServiceparameters 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 private intconnectTimeoutThe connect timeout valueprotected VOMSProtocolhttpProtocolThe http protocol implementationprotected VOMSProtocollegacyProtocolThe voms legacy protocol implementationprivate booleanlegacyProtocolEnabledWhether the client should attempt legacy protocol requestsprivate VOMSProtocolListenerprotocolListenerThe listener that will be informed about low-level protocol detailsprivate intreadTimeoutThe read timeout usedprivate VOMSRequestListenerrequestListenerThe listener that will be informed about request eventsprivate VOMSServerInfoStoreserverInfoStoreThe store used to keep VOMS server contact information.private booleanskipHostnameChecksWhether the client should skip hostname checkingprivate VOMSServerInfoStoreListenerstoreListenerThe listener that will be informed about server info store eventsprivate eu.emi.security.authn.x509.X509CertChainValidatorExtvalidatorThe validator used for the SSL handshakeprivate java.util.List<java.lang.String>vomsesLocationsA list of paths where vomses information will be looked for, used to create the server info store.private VOMSESLookupStrategyvomsesLookupStrategyThe provided strategy to lookup vomses information.
-
Constructor Summary
Constructors Constructor Description Builder(eu.emi.security.authn.x509.X509CertChainValidatorExt certChainValidator)Creates a Builder for aDefaultVOMSACService.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultVOMSACServicebuild()Builds theDefaultVOMSACServiceprotected voidbuildProtocols()Builds default protocols if neededprotected voidbuildServerInfoStore()Builds the server info storeDefaultVOMSACService.BuilderconnectTimeout(int timeout)Sets the connect timeout (in millisecods) for theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderhttpProtocol(VOMSProtocol httpProtocol)Sets the http protocol implementationDefaultVOMSACService.BuilderlegacyProtocol(VOMSProtocol legacyProtocol)Sets the legacy protocol implementationDefaultVOMSACService.BuilderlegacyProtocolEnabled(boolean lpe)Enables/disables the fallback the VOMS legacy protocol.DefaultVOMSACService.BuilderprotocolListener(VOMSProtocolListener pl)Sets theVOMSProtocolListenerfor theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderreadTimeout(int timeout)Sets the read timeout (in milliseconds) for theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderrequestListener(VOMSRequestListener l)Sets the request listener for theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderserverInfoStore(VOMSServerInfoStore sis)Sets theVOMSServerInfoStorefor theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderserverInfoStoreListener(VOMSServerInfoStoreListener sl)Sets theVOMSServerInfoStoreListenerfor theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuilderskipHostnameChecks(boolean s)Sets a flag to skip VOMS hostname checking.DefaultVOMSACService.BuildervomsesLocations(java.util.List<java.lang.String> vomsesLocations)Sets a list of locations that will be used to build aVOMSESLookupStrategyfor theDefaultVOMSACServicethat this builder is creatingDefaultVOMSACService.BuildervomsesLookupStrategy(VOMSESLookupStrategy strategy)Sets the vomses lookup strategy for theDefaultVOMSACServicethat this builder is creating
-
-
-
Field Detail
-
requestListener
private VOMSRequestListener requestListener
The listener that will be informed about request events
-
protocolListener
private VOMSProtocolListener protocolListener
The listener that will be informed about low-level protocol details
-
storeListener
private VOMSServerInfoStoreListener storeListener
The listener that will be informed about server info store events
-
validator
private eu.emi.security.authn.x509.X509CertChainValidatorExt validator
The validator used for the SSL handshake
-
serverInfoStore
private VOMSServerInfoStore serverInfoStore
The store used to keep VOMS server contact information.
-
vomsesLookupStrategy
private VOMSESLookupStrategy vomsesLookupStrategy
The provided strategy to lookup vomses information.
-
vomsesLocations
private java.util.List<java.lang.String> vomsesLocations
A list of paths where vomses information will be looked for, used to create the server info store.
-
connectTimeout
private int connectTimeout
The connect timeout value
-
readTimeout
private int readTimeout
The read timeout used
-
skipHostnameChecks
private boolean skipHostnameChecks
Whether the client should skip hostname checking
-
httpProtocol
protected VOMSProtocol httpProtocol
The http protocol implementation
-
legacyProtocol
protected VOMSProtocol legacyProtocol
The voms legacy protocol implementation
-
legacyProtocolEnabled
private boolean legacyProtocolEnabled
Whether the client should attempt legacy protocol requests
-
-
Constructor Detail
-
Builder
public Builder(eu.emi.security.authn.x509.X509CertChainValidatorExt certChainValidator)
Creates a Builder for aDefaultVOMSACService.- Parameters:
certChainValidator- the validator to use to setup the SSL connection and validate the certificates
-
-
Method Detail
-
requestListener
public DefaultVOMSACService.Builder requestListener(VOMSRequestListener l)
Sets the request listener for theDefaultVOMSACServicethat this builder is creating- Parameters:
l- the request listener that will receive notifications about request events- Returns:
- this
DefaultVOMSACService.Builderinstance
-
serverInfoStoreListener
public DefaultVOMSACService.Builder serverInfoStoreListener(VOMSServerInfoStoreListener sl)
Sets theVOMSServerInfoStoreListenerfor theDefaultVOMSACServicethat this builder is creating- Parameters:
sl- the store listener that will receive notifications about store events- Returns:
- this
DefaultVOMSACService.Builderinstance
-
serverInfoStore
public DefaultVOMSACService.Builder serverInfoStore(VOMSServerInfoStore sis)
Sets theVOMSServerInfoStorefor theDefaultVOMSACServicethat this builder is creating- Parameters:
sis- aVOMSServerInfoStoreobject- Returns:
- this
DefaultVOMSACService.Builderinstance
-
protocolListener
public DefaultVOMSACService.Builder protocolListener(VOMSProtocolListener pl)
Sets theVOMSProtocolListenerfor theDefaultVOMSACServicethat this builder is creating- Parameters:
pl- theVOMSProtocolListenerthat will receive notifications about protocol events- Returns:
- this
DefaultVOMSACService.Builderinstance
-
connectTimeout
public DefaultVOMSACService.Builder connectTimeout(int timeout)
Sets the connect timeout (in millisecods) for theDefaultVOMSACServicethat this builder is creating- Parameters:
timeout- the timeout value in milliseconds- Returns:
- this
DefaultVOMSACService.Builderinstance
-
readTimeout
public DefaultVOMSACService.Builder readTimeout(int timeout)
Sets the read timeout (in milliseconds) for theDefaultVOMSACServicethat this builder is creating- Parameters:
timeout- the timeout value in milliseconds- Returns:
- this
DefaultVOMSACService.Builderinstance
-
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-trueto skip the checks,falseotherwise- Returns:
- this
DefaultVOMSACService.Builderinstance
-
vomsesLookupStrategy
public DefaultVOMSACService.Builder vomsesLookupStrategy(VOMSESLookupStrategy strategy)
Sets the vomses lookup strategy for theDefaultVOMSACServicethat this builder is creating- Parameters:
strategy- theVOMSESLookupStrategyobject- Returns:
- this
DefaultVOMSACService.Builderinstance
-
vomsesLocations
public DefaultVOMSACService.Builder vomsesLocations(java.util.List<java.lang.String> vomsesLocations)
Sets a list of locations that will be used to build aVOMSESLookupStrategyfor theDefaultVOMSACServicethat this builder is creating- Parameters:
vomsesLocations- a list of paths where vomses information will be looked for- Returns:
- this
DefaultVOMSACService.Builderinstance
-
httpProtocol
public DefaultVOMSACService.Builder httpProtocol(VOMSProtocol httpProtocol)
Sets the http protocol implementation- Parameters:
httpProtocol- the http protocol implementatino- Returns:
- this
DefaultVOMSACService.Builderinstance
-
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-trueto enable the legacy protocol,falseotherwise- Returns:
- this
DefaultVOMSACService.Builderinstance
-
buildServerInfoStore
protected void buildServerInfoStore()
Builds the server info store
-
buildProtocols
protected void buildProtocols()
Builds default protocols if needed
-
build
public DefaultVOMSACService build()
Builds theDefaultVOMSACService- Returns:
- a
DefaultVOMSACServiceconfigured as required by this builder
-
-