Class AbstractVOMSProtocol
- java.lang.Object
-
- org.italiangrid.voms.request.impl.AbstractVOMSProtocol
-
- All Implemented Interfaces:
VOMSProtocol
- Direct Known Subclasses:
LegacyProtocol,RESTProtocol
public abstract class AbstractVOMSProtocol extends java.lang.Object implements VOMSProtocol
Base implementation class for the VOMS client/server protocol
-
-
Field Summary
Fields Modifier and Type Field Description protected intconnectTimeoutThe tcp connection timeout (in milliseconds)static intDEFAULT_CONNECT_TIMEOUTThe default value for the socket connection timeoutstatic intDEFAULT_READ_TIMEOUTThe default value for the socket read timeoutstatic booleanDEFAULT_SKIP_HOSTNAME_CHECKSThe default hostname checking policy.protected VOMSProtocolListenerlistenerprotected intreadTimeoutThe socket read timeout (in milliseconds)protected booleanskipHostnameChecksWhether to skip hostname checksprotected eu.emi.security.authn.x509.X509CertChainValidatorExtvalidatorThe CAnL validator used to manage SSL authentication.static java.lang.String[]VOMS_LEGACY_ENABLED_PROTOCOLSEnabled TLS protocols for VOMS legacy connections.
-
Constructor Summary
Constructors Constructor Description AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator)Ctor.AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator, VOMSProtocolListener listener, int connectTimeout, int readTimeout)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetConnectTimeout()intgetReadTimeout()protected javax.net.ssl.SSLSocketFactorygetSSLSocketFactory(eu.emi.security.authn.x509.X509Credential credential)Builds an SSL socket factory based on the credential passed as argument and the validator configured for thisAbstractVOMSProtocolbooleanisSkipHostnameChecks()voidsetConnectTimeout(int connectTimeout)Sets the connection timeout value for the underlying socket of thisAbstractVOMSProtocolvoidsetReadTimeout(int readTimeout)Sets the read timeout value for the underlying socketvoidsetSkipHostnameChecks(boolean skipHostnameChecks)Sets whether this protocol will skip SSL hostname checks-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.italiangrid.voms.request.VOMSProtocol
doRequest
-
-
-
-
Field Detail
-
VOMS_LEGACY_ENABLED_PROTOCOLS
public static final java.lang.String[] VOMS_LEGACY_ENABLED_PROTOCOLS
Enabled TLS protocols for VOMS legacy connections.
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
The default value for the socket connection timeout- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
The default value for the socket read timeout- See Also:
- Constant Field Values
-
DEFAULT_SKIP_HOSTNAME_CHECKS
public static final boolean DEFAULT_SKIP_HOSTNAME_CHECKS
The default hostname checking policy.- See Also:
- Constant Field Values
-
listener
protected VOMSProtocolListener listener
-
validator
protected eu.emi.security.authn.x509.X509CertChainValidatorExt validator
The CAnL validator used to manage SSL authentication.
-
connectTimeout
protected int connectTimeout
The tcp connection timeout (in milliseconds)
-
readTimeout
protected int readTimeout
The socket read timeout (in milliseconds)
-
skipHostnameChecks
protected boolean skipHostnameChecks
Whether to skip hostname checks
-
-
Constructor Detail
-
AbstractVOMSProtocol
public AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator)
Ctor.- Parameters:
validator- the validator used to manage the SSL authentication
-
AbstractVOMSProtocol
public AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator, VOMSProtocolListener listener, int connectTimeout, int readTimeout)Ctor.- Parameters:
validator- the validator used to manage the SSL authenticationlistener- the listener informed of low-level protocol detailsconnectTimeout- sets the socket connection timeoutreadTimeout- sets the socket read timeout
-
-
Method Detail
-
getSSLSocketFactory
protected javax.net.ssl.SSLSocketFactory getSSLSocketFactory(eu.emi.security.authn.x509.X509Credential credential)
Builds an SSL socket factory based on the credential passed as argument and the validator configured for thisAbstractVOMSProtocol- Parameters:
credential- the client credential used for the socket factory being created- Returns:
- an
SSLSocketFactory
-
getConnectTimeout
public int getConnectTimeout()
- Returns:
- The connect timeout value (in milliseconds)
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
Sets the connection timeout value for the underlying socket of thisAbstractVOMSProtocol- Parameters:
connectTimeout- the connection timeout in milliseconds
-
getReadTimeout
public int getReadTimeout()
- Returns:
- the read timeout value (in milliseconds)
-
setReadTimeout
public void setReadTimeout(int readTimeout)
Sets the read timeout value for the underlying socket- Parameters:
readTimeout- the read timeout in milliseconds
-
isSkipHostnameChecks
public boolean isSkipHostnameChecks()
- Returns:
- whether this protocol will skip hostname checks
-
setSkipHostnameChecks
public void setSkipHostnameChecks(boolean skipHostnameChecks)
Sets whether this protocol will skip SSL hostname checks- Parameters:
skipHostnameChecks- flag that defines whether hostname checks should be skipped for this protocol
-
-