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 Object implements VOMSProtocol
Base implementation class for the VOMS client/server protocol
-
-
Field Summary
Fields Modifier and Type Field Description protected int
connectTimeout
The tcp connection timeout (in milliseconds)static int
DEFAULT_CONNECT_TIMEOUT
The default value for the socket connection timeoutstatic int
DEFAULT_READ_TIMEOUT
The default value for the socket read timeoutstatic boolean
DEFAULT_SKIP_HOSTNAME_CHECKS
The default hostname checking policy.protected VOMSProtocolListener
listener
protected int
readTimeout
The socket read timeout (in milliseconds)protected boolean
skipHostnameChecks
Whether to skip hostname checksprotected eu.emi.security.authn.x509.X509CertChainValidatorExt
validator
The CAnL validator used to manage SSL authentication.static String[]
VOMS_LEGACY_ENABLED_PROTOCOLS
Enabled 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 int
getConnectTimeout()
int
getReadTimeout()
protected 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
boolean
isSkipHostnameChecks()
void
setConnectTimeout(int connectTimeout)
Sets the connection timeout value for the underlying socket of thisAbstractVOMSProtocol
void
setReadTimeout(int readTimeout)
Sets the read timeout value for the underlying socketvoid
setSkipHostnameChecks(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 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 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
-
-