Package org.italiangrid.voms.request.impl

# Class RESTVOMSResponse

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

All Implemented Interfaces:
  `VOMSResponse`

public class RESTVOMSResponse extends Object implements VOMSResponse
This class is used to parse and represent VOMS server responses coming from a RESTful VOMS service.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected Document`
`xmlResponse`
The XML response document from the VOMS server.

## Constructor Summary

Constructors
Constructor
Description
`RESTVOMSResponse(Document res)`
Constructs a `RESTVOMSResponse` with the given XML response document.

## Method Summary

Modifier and Type
Method
Description
`VOMSErrorMessage[]`
`errorMessages()`
Retrieves error messages from the response.
`byte[]`
`getAC()`
Retrieves the attribute certificate (AC) from the response.
`int`
`getVersion()`
Retrieves the version of the VOMS response.
`String`
`getXMLAsString()`
Converts the XML response to a string representation.
`boolean`
`hasErrors()`
Checks if the response contains errors.
`boolean`
`hasWarnings()`
Checks if the response contains warnings.
`VOMSWarningMessage[]`
`warningMessages()`
Retrieves warning messages from the response.

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

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

## Field Details

### xmlResponse

protected Document xmlResponse
The XML response document from the VOMS server.

## Constructor Details

### RESTVOMSResponse

public RESTVOMSResponse(Document res)
Constructs a `RESTVOMSResponse` with the given XML response document.

Parameters:
  `res` - the XML response document

## Method Details

### getVersion

public int getVersion()
Retrieves the version of the VOMS response.

Specified by:
  `getVersion` in interface `VOMSResponse`
Returns:
  the version number, or 0 if not found

### hasErrors

public boolean hasErrors()
Checks if the response contains errors.

Specified by:
  `hasErrors` in interface `VOMSResponse`
Returns:
  `true` if errors are present, `false` otherwise

### hasWarnings

public boolean hasWarnings()
Checks if the response contains warnings.

Specified by:
  `hasWarnings` in interface `VOMSResponse`
Returns:
  `true` if warnings are present, `false` otherwise

### getAC

public byte[] getAC()
Retrieves the attribute certificate (AC) from the response.

Specified by:
  `getAC` in interface `VOMSResponse`
Returns:
  the decoded AC as a byte array, or `null` if not found

### errorMessages

public VOMSErrorMessage[] errorMessages()
Retrieves error messages from the response.

Specified by:
  `errorMessages` in interface `VOMSResponse`
Returns:
  an array of `VOMSErrorMessage` objects, or `null` if no errors are found

### warningMessages

public VOMSWarningMessage[] warningMessages()
Retrieves warning messages from the response.

Specified by:
  `warningMessages` in interface `VOMSResponse`
Returns:
  an array of `VOMSWarningMessage` objects, or `null` if no warnings are found

### getXMLAsString

public String getXMLAsString()
Converts the XML response to a string representation.

Specified by:
  `getXMLAsString` in interface `VOMSResponse`
Returns:
  the XML response as a string