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
Abstract base class providing a skeletal implementation of the VOMS client-server protocol. This class handles SSL authentication, connection timeouts, and hostname verification.
  • Field Details

    • 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 (in milliseconds).
      See Also:
    • DEFAULT_READ_TIMEOUT

      public static final int DEFAULT_READ_TIMEOUT
      The default value for the socket read timeout (in milliseconds).
      See Also:
    • DEFAULT_SKIP_HOSTNAME_CHECKS

      public static final boolean DEFAULT_SKIP_HOSTNAME_CHECKS
      The default policy for skipping hostname verification.
      See Also:
    • 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 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 authentication
      listener - the listener for protocol events
      connectTimeout - the socket connection timeout in milliseconds
      readTimeout - 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