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
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
Fields Modifier and Type Field Description protected intconnectTimeoutTCP connection timeout in milliseconds.static intDEFAULT_CONNECT_TIMEOUTThe default value for the socket connection timeout (in milliseconds).static intDEFAULT_READ_TIMEOUTThe default value for the socket read timeout (in milliseconds).static booleanDEFAULT_SKIP_HOSTNAME_CHECKSThe default policy for skipping hostname verification.protected VOMSProtocolListenerlistenerListener for protocol events.protected intreadTimeoutSocket read timeout in milliseconds.protected booleanskipHostnameChecksFlag indicating whether hostname verification is disabled.protected eu.emi.security.authn.x509.X509CertChainValidatorExtvalidatorValidator used for 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)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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetConnectTimeout()Retrieves the connection timeout value.intgetReadTimeout()Retrieves the read timeout value.protected javax.net.ssl.SSLSocketFactorygetSSLSocketFactory(eu.emi.security.authn.x509.X509Credential credential)Creates an SSL socket factory using the provided credential and validator.booleanisSkipHostnameChecks()Checks whether hostname verification is disabled.voidsetConnectTimeout(int connectTimeout)Sets the connection timeout for the underlying socket.voidsetReadTimeout(int readTimeout)Sets the read timeout for the underlying socket.voidsetSkipHostnameChecks(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 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 (in milliseconds).- See Also:
- Constant Field Values
-
DEFAULT_READ_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
The default value for the socket read timeout (in milliseconds).- See Also:
- Constant Field Values
-
DEFAULT_SKIP_HOSTNAME_CHECKS
public static final boolean DEFAULT_SKIP_HOSTNAME_CHECKS
The default policy for skipping hostname verification.- See Also:
- Constant Field Values
-
listener
protected VOMSProtocolListener listener
Listener for protocol events.
-
validator
protected eu.emi.security.authn.x509.X509CertChainValidatorExt validator
Validator used for SSL authentication.
-
connectTimeout
protected int connectTimeout
TCP connection timeout in milliseconds.
-
readTimeout
protected int readTimeout
Socket read timeout in milliseconds.
-
skipHostnameChecks
protected boolean skipHostnameChecks
Flag indicating whether hostname verification is disabled.
-
-
Constructor Detail
-
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 Detail
-
getSSLSocketFactory
protected javax.net.ssl.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:
trueif hostname checks are skipped,falseotherwise
-
setSkipHostnameChecks
public void setSkipHostnameChecks(boolean skipHostnameChecks)
Configures whether SSL hostname verification should be skipped.- Parameters:
skipHostnameChecks-trueto disable hostname verification,falseto enable it
-
-