Class 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 a RESTVOMSResponse 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ERROR_OFFSET

        private static int ERROR_OFFSET
      • xmlResponse

        protected org.w3c.dom.Document xmlResponse
        The XML response document from the VOMS server.
    • Constructor Detail

      • RESTVOMSResponse

        public RESTVOMSResponse​(org.w3c.dom.Document res)
        Constructs a RESTVOMSResponse with the given XML response document.
        Parameters:
        res - the XML response document
    • Method Detail

      • 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
      • getXMLAsString

        public java.lang.String getXMLAsString()
        Converts the XML response to a string representation.
        Specified by:
        getXMLAsString in interface VOMSResponse
        Returns:
        the XML response as a string