Class AbstractVOMSProtocol
java.lang.Object
org.italiangrid.voms.request.impl.AbstractVOMSProtocol
- All Implemented Interfaces:
VOMSProtocol
- Direct Known Subclasses:
LegacyProtocol
,RESTProtocol
Abstract base class providing a skeletal implementation of the VOMS client-server protocol. This
class handles SSL authentication, connection timeouts, and hostname verification.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
TCP connection timeout in milliseconds.static final int
The default value for the socket connection timeout (in milliseconds).static final int
The default value for the socket read timeout (in milliseconds).static final boolean
The default policy for skipping hostname verification.protected VOMSProtocolListener
Listener for protocol events.protected int
Socket read timeout in milliseconds.protected boolean
Flag indicating whether hostname verification is disabled.protected eu.emi.security.authn.x509.X509CertChainValidatorExt
Validator used for SSL authentication.static final String[]
Enabled TLS protocols for VOMS legacy connections. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVOMSProtocol
(eu.emi.security.authn.x509.X509CertChainValidatorExt validator) Constructor initializing the protocol with a certificate validator.AbstractVOMSProtocol
(eu.emi.security.authn.x509.X509CertChainValidatorExt validator, VOMSProtocolListener listener, int connectTimeout, int readTimeout) Constructor initializing the protocol with a validator, listener, and timeout settings. -
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the connection timeout value.int
Retrieves the read timeout value.protected SSLSocketFactory
getSSLSocketFactory
(eu.emi.security.authn.x509.X509Credential credential) Creates an SSL socket factory using the provided credential and validator.boolean
Checks whether hostname verification is disabled.void
setConnectTimeout
(int connectTimeout) Sets the connection timeout for the underlying socket.void
setReadTimeout
(int readTimeout) Sets the read timeout for the underlying socket.void
setSkipHostnameChecks
(boolean skipHostnameChecks) Configures whether SSL hostname verification should be skipped.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 Details
-
VOMS_LEGACY_ENABLED_PROTOCOLS
Enabled TLS protocols for VOMS legacy connections. -
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUTThe default value for the socket connection timeout (in milliseconds).- See Also:
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUTThe default value for the socket read timeout (in milliseconds).- See Also:
-
DEFAULT_SKIP_HOSTNAME_CHECKS
public static final boolean DEFAULT_SKIP_HOSTNAME_CHECKSThe default policy for skipping hostname verification.- See Also:
-
listener
Listener for protocol events. -
validator
protected eu.emi.security.authn.x509.X509CertChainValidatorExt validatorValidator used for SSL authentication. -
connectTimeout
protected int connectTimeoutTCP connection timeout in milliseconds. -
readTimeout
protected int readTimeoutSocket read timeout in milliseconds. -
skipHostnameChecks
protected boolean skipHostnameChecksFlag indicating whether hostname verification is disabled.
-
-
Constructor Details
-
AbstractVOMSProtocol
public AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator) Constructor initializing the protocol with a certificate validator.- Parameters:
validator
- the certificate validator for SSL authentication
-
AbstractVOMSProtocol
public AbstractVOMSProtocol(eu.emi.security.authn.x509.X509CertChainValidatorExt validator, VOMSProtocolListener listener, int connectTimeout, int readTimeout) Constructor initializing the protocol with a validator, listener, and timeout settings.- Parameters:
validator
- the certificate validator for SSL authenticationlistener
- the listener for protocol eventsconnectTimeout
- the socket connection timeout in millisecondsreadTimeout
- the socket read timeout in milliseconds
-
-
Method Details
-
getSSLSocketFactory
protected SSLSocketFactory getSSLSocketFactory(eu.emi.security.authn.x509.X509Credential credential) Creates an SSL socket factory using the provided credential and validator.- Parameters:
credential
- the client credential for SSL authentication- Returns:
- an SSL socket factory configured with the given credential and validator
-
getConnectTimeout
public int getConnectTimeout()Retrieves the connection timeout value.- Returns:
- the connection timeout in milliseconds
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Sets the connection timeout for the underlying socket.- Parameters:
connectTimeout
- the connection timeout in milliseconds
-
getReadTimeout
public int getReadTimeout()Retrieves the read timeout value.- Returns:
- the read timeout in milliseconds
-
setReadTimeout
public void setReadTimeout(int readTimeout) Sets the read timeout for the underlying socket.- Parameters:
readTimeout
- the read timeout in milliseconds
-
isSkipHostnameChecks
public boolean isSkipHostnameChecks()Checks whether hostname verification is disabled.- Returns:
true
if hostname checks are skipped,false
otherwise
-
setSkipHostnameChecks
public void setSkipHostnameChecks(boolean skipHostnameChecks) Configures whether SSL hostname verification should be skipped.- Parameters:
skipHostnameChecks
-true
to disable hostname verification,false
to enable it
-