Class DnsRequisitionUrlConnection


  • public class DnsRequisitionUrlConnection
    extends java.net.URLConnection
    Implementation of java.net.URLConnection for handling URLs specified in the Provisiond configuration requesting an import requisition based on the A records of a zone transfer for a DNS server.
    Version:
    $Id: $
    Author:
    David Hustace
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROTOCOL
      Constant PROTOCOL="dns"
      static java.lang.String URL_SCHEME
      Constant URL_SCHEME="dns://"
      • Fields inherited from class java.net.URLConnection

        allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
    • Constructor Summary

      Constructors 
      Constructor Description
      DnsRequisitionUrlConnection​(java.net.URL url)
      Constructor for DnsRequisitionUrlConnection.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void connect()
      This is a no op.
      protected static java.lang.String decodeQueryString​(java.net.URL url)
      decodeQueryString
      protected static java.lang.String determineExpressionFromUrl​(java.net.URL url)
      determineExpressionFromUrl
      protected static java.lang.String determineLocationFromUrl​(java.net.URL url)  
      java.io.InputStream getInputStream()
      Creates a ByteArrayInputStream implementation of InputStream of the XML marshaled version of the Requisition class.
      DnsRequisitionRequest getRequest()  
      protected static java.util.Map<java.lang.String,​java.lang.String> getUrlArgs​(java.net.URL url)  
      protected static java.lang.String parseForeignSource​(java.net.URL url)
      Foreign Source should be the second path entity, if it exists, otherwise it is set to the value of the zone.
      protected static java.lang.String parseZone​(java.net.URL url)
      Zone should be the first path entity dns:///[/][/>
      protected void validateDnsUrl​(java.net.URL url)
      Validate the format is: dns:////?expression= there should be only one arguement in the path there should only be one query parameter
      • Methods inherited from class java.net.URLConnection

        addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFieldLong, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString
      • Methods inherited from class java.lang.Object

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

      • URL_SCHEME

        public static final java.lang.String URL_SCHEME
        Constant URL_SCHEME="dns://"
        See Also:
        Constant Field Values
      • PROTOCOL

        public static final java.lang.String PROTOCOL
        Constant PROTOCOL="dns"
        See Also:
        Constant Field Values
    • Constructor Detail

      • DnsRequisitionUrlConnection

        public DnsRequisitionUrlConnection​(java.net.URL url)
                                    throws java.net.MalformedURLException

        Constructor for DnsRequisitionUrlConnection.

        Parameters:
        url - a URL object.
        Throws:
        java.net.MalformedURLException - if any.
    • Method Detail

      • connect

        public void connect()
                     throws java.io.IOException
        This is a no op.
        Specified by:
        connect in class java.net.URLConnection
        Throws:
        java.io.IOException
      • getInputStream

        public java.io.InputStream getInputStream()
                                           throws java.io.IOException
        Creates a ByteArrayInputStream implementation of InputStream of the XML marshaled version of the Requisition class. Calling close on this stream is safe.
        Overrides:
        getInputStream in class java.net.URLConnection
        Throws:
        java.io.IOException
      • determineExpressionFromUrl

        protected static java.lang.String determineExpressionFromUrl​(java.net.URL url)

        determineExpressionFromUrl

        Parameters:
        url - a URL object.
        Returns:
        a String object.
      • determineLocationFromUrl

        protected static java.lang.String determineLocationFromUrl​(java.net.URL url)
      • decodeQueryString

        protected static java.lang.String decodeQueryString​(java.net.URL url)

        decodeQueryString

        Parameters:
        url - a URL object.
        Returns:
        a String object.
      • validateDnsUrl

        protected void validateDnsUrl​(java.net.URL url)
                               throws java.net.MalformedURLException
        Validate the format is: dns:////?expression= there should be only one arguement in the path there should only be one query parameter
        Parameters:
        url - a URL object.
        Throws:
        java.net.MalformedURLException - if any.
      • parseZone

        protected static java.lang.String parseZone​(java.net.URL url)
        Zone should be the first path entity dns:///[/][/>
        Parameters:
        url - a URL object.
        Returns:
        a String object.
      • parseForeignSource

        protected static java.lang.String parseForeignSource​(java.net.URL url)
        Foreign Source should be the second path entity, if it exists, otherwise it is set to the value of the zone. dns:///[/][/>
        Parameters:
        url - a URL object.
        Returns:
        a String object.
      • getUrlArgs

        protected static java.util.Map<java.lang.String,​java.lang.String> getUrlArgs​(java.net.URL url)