Package org.italiangrid.voms.request.impl

# Class DefaultVOMSACService

java.lang.Object
org.italiangrid.voms.request.impl.DefaultVOMSACService

All Implemented Interfaces:
  `VOMSACService`

public class DefaultVOMSACService extends Object implements VOMSACService
The default implementation of the `VOMSACService`.

Author:
  Valerio Venturi, Andrea Ceccanti

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`DefaultVOMSACService.Builder`
Creates a `DefaultVOMSACService` object.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final VOMSProtocol`
`httpProtocol`
The http protocol implementation
`protected final VOMSProtocol`
`legacyProtocol`
The voms legacy protocol implementation
`protected final boolean`
`legacyProtocolEnabled`
Whether VOMS legacy protocol should be used as a fallback when REST protocol fails
`protected final VOMSProtocolListener`
`protocolListener`
The listener that will be informed about low-level protocol details
`protected final VOMSRequestListener`
`requestListener`
The listener that will be informed about request events
`protected final VOMSServerInfoStore`
`serverInfoStore`
The store used to keep VOMS server contact information.
`protected final eu.emi.security.authn.x509.X509CertChainValidatorExt`
`validator`
The validator used for the SSL handshake

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`DefaultVOMSACService(DefaultVOMSACService.Builder builder)`
Constructor which builds a `DefaultVOMSACService` from a `DefaultVOMSACService.Builder`

## Method Summary

Modifier and Type
Method
Description
`protected org.bouncycastle.asn1.x509.AttributeCertificate`
`getACFromResponse(VOMSACRequest request, VOMSResponse response)`
Extracts an AC from a VOMS response
`org.bouncycastle.asn1.x509.AttributeCertificate`
`getVOMSAttributeCertificate(eu.emi.security.authn.x509.X509Credential credential, VOMSACRequest request)`
Returns an `AttributeCertificate` given a `VOMSACRequest` for VOMS attributes.
`protected List<VOMSServerInfo>`
`getVOMSServerInfos(VOMSACRequest request)`
Get VOMS server endpoint information that matches with the `VOMSACRequest` passed as argument.
`protected void`
`handleErrorsInResponse(VOMSACRequest request, VOMSServerInfo si, VOMSResponse response)`
Handles errors included in the VOMS response
`protected void`
`handleWarningsInResponse(VOMSACRequest request, VOMSServerInfo si, VOMSResponse response)`
Handles warnings included in the VOMS response

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### requestListener

protected final VOMSRequestListener requestListener
The listener that will be informed about request events

### protocolListener

protected final VOMSProtocolListener protocolListener
The listener that will be informed about low-level protocol details

### validator

protected final eu.emi.security.authn.x509.X509CertChainValidatorExt validator
The validator used for the SSL handshake

### serverInfoStore

protected final VOMSServerInfoStore serverInfoStore
The store used to keep VOMS server contact information.

### httpProtocol

protected final VOMSProtocol httpProtocol
The http protocol implementation

### legacyProtocol

protected final VOMSProtocol legacyProtocol
The voms legacy protocol implementation

### legacyProtocolEnabled

protected final boolean legacyProtocolEnabled
Whether VOMS legacy protocol should be used as a fallback when REST protocol fails

## Constructor Details

### DefaultVOMSACService

protected DefaultVOMSACService(DefaultVOMSACService.Builder builder)
Constructor which builds a `DefaultVOMSACService` from a `DefaultVOMSACService.Builder`

Parameters:
  `builder` - the builder object that provides the settings for this `VOMSACService`

## Method Details

### getACFromResponse

protected org.bouncycastle.asn1.x509.AttributeCertificate getACFromResponse(VOMSACRequest request, VOMSResponse response)
Extracts an AC from a VOMS response

Parameters:
  `request` - the request
  `response` - the received response
Returns:
  a possibly `null` `AttributeCertificate` object

### handleErrorsInResponse

protected void handleErrorsInResponse(VOMSACRequest request, VOMSServerInfo si, VOMSResponse response)
Handles errors included in the VOMS response

Parameters:
  `request` - the request
  `si` - the VOMS server endpoint information
  `response` - the received `VOMSResponse`

### handleWarningsInResponse

protected void handleWarningsInResponse(VOMSACRequest request, VOMSServerInfo si, VOMSResponse response)
Handles warnings included in the VOMS response

Parameters:
  `request` - the request
  `si` - the VOMS server endpoint information
  `response` - the received `VOMSResponse`

### getVOMSAttributeCertificate

public org.bouncycastle.asn1.x509.AttributeCertificate getVOMSAttributeCertificate(eu.emi.security.authn.x509.X509Credential credential, VOMSACRequest request)
Description copied from interface: `VOMSACService`
Returns an `AttributeCertificate` given a `VOMSACRequest` for VOMS attributes.

Specified by:
  `getVOMSAttributeCertificate` in interface `VOMSACService`
Parameters:
  `credential` - the credential to be used when contacting the service
  `request` - the request for VOMS attributes
Returns:
  a possibly null `AttributeCertificate` containing (a subset of) the requested attributes.

### getVOMSServerInfos

protected List<VOMSServerInfo> getVOMSServerInfos(VOMSACRequest request)
Get VOMS server endpoint information that matches with the `VOMSACRequest` passed as argument. This method returns a random shuffle of the `VOMSServerInfo` objects that match the input request.

Parameters:
  `request` - the request
Returns:
  a possibly empty `List` of `VOMSServerInfo` objects