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 intERROR_OFFSETprotected org.w3c.dom.DocumentxmlResponseThe XML response document from the VOMS server.
-
Constructor Summary
Constructors Constructor Description RESTVOMSResponse(org.w3c.dom.Document res)Constructs aRESTVOMSResponsewith 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.intgetVersion()Retrieves the version of the VOMS response.java.lang.StringgetXMLAsString()Converts the XML response to a string representation.booleanhasErrors()Checks if the response contains errors.booleanhasWarnings()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:
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
public VOMSErrorMessage[] errorMessages()
Retrieves error messages from the response.- Specified by:
errorMessagesin interfaceVOMSResponse- Returns:
- an array of
VOMSErrorMessageobjects, ornullif no errors are found
-
warningMessages
public VOMSWarningMessage[] warningMessages()
Retrieves warning messages from the response.- Specified by:
warningMessagesin interfaceVOMSResponse- Returns:
- an array of
VOMSWarningMessageobjects, ornullif no warnings are found
-
getXMLAsString
public java.lang.String getXMLAsString()
Converts the XML response to a string representation.- Specified by:
getXMLAsStringin interfaceVOMSResponse- Returns:
- the XML response as a string
-
-