Class LegacyVOMSESParserImpl

  • All Implemented Interfaces:
    VOMSESParser

    public class LegacyVOMSESParserImpl
    extends java.lang.Object
    implements VOMSESParser
    Implementation of the VOMSESParser interface. This class is responsible for parsing VOMSES configuration files and extracting VOMSServerInfo instances from them.

    It supports parsing from files, directories, and readers, and ensures that the VOMSES files exist and are readable before processing.

    VOMSES files typically contain server connection information in a structured format.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private VOMSESLineParser lineParser
      Line parser used to process individual VOMSES lines.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void fileSanityChecks​(java.io.File f)
      Performs basic sanity checks on the provided file.
      java.util.List<VOMSServerInfo> parse​(java.io.File f)
      Parses a VOMSES file or directory.
      java.util.List<VOMSServerInfo> parse​(java.io.Reader vomsesReader)
      Parses VOMSES configuration from a Reader.
      protected java.util.List<VOMSServerInfo> parseDirectory​(java.io.File directory)
      Parses all VOMSES files in a given directory.
      protected VOMSServerInfo parseLine​(java.lang.String vomsesLine)
      Parses a single line from a VOMSES file.
      • Methods inherited from class java.lang.Object

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

      • lineParser

        private final VOMSESLineParser lineParser
        Line parser used to process individual VOMSES lines.
    • Constructor Detail

      • LegacyVOMSESParserImpl

        public LegacyVOMSESParserImpl()
    • Method Detail

      • fileSanityChecks

        protected void fileSanityChecks​(java.io.File f)
        Performs basic sanity checks on the provided file.
        Parameters:
        f - the file to check
        Throws:
        VOMSError - if the file does not exist or is not readable
      • parseLine

        protected VOMSServerInfo parseLine​(java.lang.String vomsesLine)
                                    throws java.net.URISyntaxException
        Parses a single line from a VOMSES file.
        Parameters:
        vomsesLine - the line to parse
        Returns:
        a VOMSServerInfo instance representing the parsed line
        Throws:
        java.net.URISyntaxException - if the URI in the line is malformed
      • parse

        public java.util.List<VOMSServerInfo> parse​(java.io.Reader vomsesReader)
        Parses VOMSES configuration from a Reader.
        Specified by:
        parse in interface VOMSESParser
        Parameters:
        vomsesReader - the reader containing VOMSES configuration
        Returns:
        a list of VOMSServerInfo instances extracted from the input
      • parseDirectory

        protected java.util.List<VOMSServerInfo> parseDirectory​(java.io.File directory)
        Parses all VOMSES files in a given directory.
        Parameters:
        directory - the directory containing VOMSES files
        Returns:
        a list of VOMSServerInfo instances parsed from the directory
      • parse

        public java.util.List<VOMSServerInfo> parse​(java.io.File f)
        Parses a VOMSES file or directory.
        Specified by:
        parse in interface VOMSESParser
        Parameters:
        f - the file or directory to parse
        Returns:
        a list of VOMSServerInfo instances parsed from the file/directory
        Throws:
        VOMSError - if the file is not found or an error occurs during parsing