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 DocumentThe XML response document from the VOMS server. -
Constructor Summary
ConstructorsConstructorDescriptionRESTVOMSResponse(Document res) Constructs aRESTVOMSResponsewith 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.intRetrieves the version of the VOMS response.Converts the XML response to a string representation.booleanChecks if the response contains errors.booleanChecks 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 aRESTVOMSResponsewith 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:
getVersionin interfaceVOMSResponse- Returns:
- the version number, or 0 if not found
-
hasErrors
public boolean hasErrors()Checks if the response contains errors.- Specified by:
hasErrorsin interfaceVOMSResponse- Returns:
trueif errors are present,falseotherwise
-
hasWarnings
public boolean hasWarnings()Checks if the response contains warnings.- Specified by:
hasWarningsin interfaceVOMSResponse- Returns:
trueif warnings are present,falseotherwise
-
getAC
public byte[] getAC()Retrieves the attribute certificate (AC) from the response.- Specified by:
getACin interfaceVOMSResponse- Returns:
- the decoded AC as a byte array, or
nullif not found
-
errorMessages
Retrieves error messages from the response.- Specified by:
errorMessagesin interfaceVOMSResponse- Returns:
- an array of
VOMSErrorMessageobjects, ornullif no errors are found
-
warningMessages
Retrieves warning messages from the response.- Specified by:
warningMessagesin interfaceVOMSResponse- Returns:
- an array of
VOMSWarningMessageobjects, ornullif no warnings are found
-
getXMLAsString
Converts the XML response to a string representation.- Specified by:
getXMLAsStringin interfaceVOMSResponse- Returns:
- the XML response as a string
-