Class PegasusURL


  • public class PegasusURL
    extends java.lang.Object
    A common PegasusURL class to use by the planner and other components. The class parses the PegasusURL into 3 main components - protocol - hostname - path The class is consistent with the PegasusURL parsing scheme used in pegasus-transfer.
    Author:
    Karan Vahi, Mats Rynge
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_PROTOCOL
      The default protocol if none is determined from the PegasusURL or path
      static java.lang.String FILE_URL_SCHEME
      The scheme name for file url.
      private java.lang.String mHost
      The hostname referred to by the PegasusURL.
      private java.lang.String mPath
      The path referred to by the PegasusURL
      private static java.util.regex.Pattern mPattern
      Stores compiled patterns at first use, quasi-Singleton.
      private java.lang.String mProtocol
      The protocol referred to by the PegasusURL
      private static java.lang.String mRegexExpression
      Stores the regular expressions necessary to parse a PegasusURL into 3 components protocol, host and path
      static java.lang.String SYMLINK_URL_SCHEME
      The scheme name for file url.
    • Constructor Summary

      Constructors 
      Constructor Description
      PegasusURL()
      The default constructor.
      PegasusURL​(java.lang.String url)
      The overloaded constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHost()
      Returns the host asscoiated with the PegasusURL
      java.lang.String getPath()
      Returns the path associated with the PegasusURL
      java.lang.String getProtocol()
      Returns the protocol associated with the PegasusURL
      java.lang.String getURLPrefix()
      Returns the url prefix associated with the PegasusURL.
      static void main​(java.lang.String[] args)
      Test program
      void parse​(java.lang.String url)
      Parses the url and populates the internal member variables that can be accessed via the appropriate accessor methods
      void reset()
      Resets the internal member variables
      java.lang.String toString()
      The contents represented as a string
      • Methods inherited from class java.lang.Object

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

      • FILE_URL_SCHEME

        public static final java.lang.String FILE_URL_SCHEME
        The scheme name for file url.
        See Also:
        Constant Field Values
      • SYMLINK_URL_SCHEME

        public static final java.lang.String SYMLINK_URL_SCHEME
        The scheme name for file url.
        See Also:
        Constant Field Values
      • DEFAULT_PROTOCOL

        public static final java.lang.String DEFAULT_PROTOCOL
        The default protocol if none is determined from the PegasusURL or path
        See Also:
        Constant Field Values
      • mRegexExpression

        private static final java.lang.String mRegexExpression
        Stores the regular expressions necessary to parse a PegasusURL into 3 components protocol, host and path
        See Also:
        Constant Field Values
      • mPattern

        private static java.util.regex.Pattern mPattern
        Stores compiled patterns at first use, quasi-Singleton.
      • mProtocol

        private java.lang.String mProtocol
        The protocol referred to by the PegasusURL
      • mHost

        private java.lang.String mHost
        The hostname referred to by the PegasusURL. Can include the port also
      • mPath

        private java.lang.String mPath
        The path referred to by the PegasusURL
    • Constructor Detail

      • PegasusURL

        public PegasusURL()
        The default constructor.
      • PegasusURL

        public PegasusURL​(java.lang.String url)
        The overloaded constructor.
        Parameters:
        url - the url to be parsed internally
    • Method Detail

      • parse

        public void parse​(java.lang.String url)
        Parses the url and populates the internal member variables that can be accessed via the appropriate accessor methods
        Parameters:
        url -
      • getProtocol

        public java.lang.String getProtocol()
        Returns the protocol associated with the PegasusURL
        Returns:
        the protocol else empty
      • getHost

        public java.lang.String getHost()
        Returns the host asscoiated with the PegasusURL
        Returns:
        the host else empty
      • getPath

        public java.lang.String getPath()
        Returns the path associated with the PegasusURL
        Returns:
        the host else empty
      • getURLPrefix

        public java.lang.String getURLPrefix()
        Returns the url prefix associated with the PegasusURL. The PegasusURL prefix is the part of the PegasusURL composed of protocol and the hostname For example PegasusURL prefix for
         gsiftp://dataserver.phys.uwm.edu/~/griphyn_test/ligodemo_output
         
        is gsiftp://dataserver.phys.uwm.edu
        Returns:
        the host else empty
      • reset

        public void reset()
        Resets the internal member variables
      • toString

        public java.lang.String toString()
        The contents represented as a string
        Overrides:
        toString in class java.lang.Object
        Returns:
      • main

        public static void main​(java.lang.String[] args)
        Test program
        Parameters:
        args -