Class RESTVOMSResponse
- java.lang.Object
-
- org.italiangrid.voms.request.impl.RESTVOMSResponse
-
- All Implemented Interfaces:
VOMSResponse
public class RESTVOMSResponse extends java.lang.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 private static int
ERROR_OFFSET
protected org.w3c.dom.Document
xmlResponse
The XML response document from the VOMS server.
-
Constructor Summary
Constructors Constructor Description RESTVOMSResponse(org.w3c.dom.Document res)
Constructs aRESTVOMSResponse
with the given XML response document.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.java.lang.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.
-
-
-
Method Detail
-
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
public VOMSErrorMessage[] 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
public VOMSWarningMessage[] 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
public java.lang.String getXMLAsString()
Converts the XML response to a string representation.- Specified by:
getXMLAsString
in interfaceVOMSResponse
- Returns:
- the XML response as a string
-
-