Class RESTVOMSResponse
java.lang.Object
org.italiangrid.voms.request.impl.RESTVOMSResponse
- All Implemented Interfaces:
VOMSResponse
This class is used to parse and represent VOMS server responses coming from a RESTful VOMS
service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Document
The XML response document from the VOMS server. -
Constructor Summary
ConstructorsConstructorDescriptionRESTVOMSResponse
(Document res) Constructs aRESTVOMSResponse
with the given XML response document. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves error messages from the response.byte[]
getAC()
Retrieves the attribute certificate (AC) from the response.int
Retrieves the version of the VOMS response.Converts the XML response to a string representation.boolean
Checks if the response contains errors.boolean
Checks if the response contains warnings.Retrieves warning messages from the response.
-
Field Details
-
xmlResponse
The XML response document from the VOMS server.
-
-
Constructor Details
-
RESTVOMSResponse
Constructs aRESTVOMSResponse
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 interfaceVOMSResponse
- Returns:
- the version number, or 0 if not found
-
hasErrors
public boolean hasErrors()Checks if the response contains errors.- Specified by:
hasErrors
in interfaceVOMSResponse
- Returns:
true
if errors are present,false
otherwise
-
hasWarnings
public boolean hasWarnings()Checks if the response contains warnings.- Specified by:
hasWarnings
in interfaceVOMSResponse
- Returns:
true
if warnings are present,false
otherwise
-
getAC
public byte[] getAC()Retrieves the attribute certificate (AC) from the response.- Specified by:
getAC
in interfaceVOMSResponse
- Returns:
- the decoded AC as a byte array, or
null
if not found
-
errorMessages
Retrieves error messages from the response.- Specified by:
errorMessages
in interfaceVOMSResponse
- Returns:
- an array of
VOMSErrorMessage
objects, ornull
if no errors are found
-
warningMessages
Retrieves warning messages from the response.- Specified by:
warningMessages
in interfaceVOMSResponse
- Returns:
- an array of
VOMSWarningMessage
objects, ornull
if no warnings are found
-
getXMLAsString
Converts the XML response to a string representation.- Specified by:
getXMLAsString
in interfaceVOMSResponse
- Returns:
- the XML response as a string
-