Class DnsRequisitionUrlConnection
- java.lang.Object
-
- java.net.URLConnection
-
- org.opennms.netmgt.provision.service.dns.DnsRequisitionUrlConnection
-
public class DnsRequisitionUrlConnection extends URLConnection
Implementation ofjava.net.URLConnectionfor 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 StringPROTOCOLConstantPROTOCOL="dns"static StringURL_SCHEMEConstantURL_SCHEME="dns://"-
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
-
-
Constructor Summary
Constructors Constructor Description DnsRequisitionUrlConnection(URL url)Constructor for DnsRequisitionUrlConnection.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect()This is a no op.protected static StringdecodeQueryString(URL url)decodeQueryStringprotected static StringdetermineExpressionFromUrl(URL url)determineExpressionFromUrlprotected static StringdetermineLocationFromUrl(URL url)InputStreamgetInputStream()Creates a ByteArrayInputStream implementation of InputStream of the XML marshaled version of the Requisition class.DnsRequisitionRequestgetRequest()protected static Map<String,String>getUrlArgs(URL url)protected static StringparseForeignSource(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 StringparseZone(URL url)Zone should be the first path entity dns:/// [/ ][/> protected voidvalidateDnsUrl(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
-
-
-
-
Field Detail
-
URL_SCHEME
public static final String URL_SCHEME
ConstantURL_SCHEME="dns://"- See Also:
- Constant Field Values
-
PROTOCOL
public static final String PROTOCOL
ConstantPROTOCOL="dns"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DnsRequisitionUrlConnection
public DnsRequisitionUrlConnection(URL url) throws MalformedURLException
Constructor for DnsRequisitionUrlConnection.
- Parameters:
url- aURLobject.- Throws:
MalformedURLException- if any.
-
-
Method Detail
-
getRequest
public DnsRequisitionRequest getRequest()
-
connect
public void connect() throws IOExceptionThis is a no op.- Specified by:
connectin classURLConnection- Throws:
IOException
-
getInputStream
public InputStream getInputStream() throws IOException
Creates a ByteArrayInputStream implementation of InputStream of the XML marshaled version of the Requisition class. Calling close on this stream is safe.- Overrides:
getInputStreamin classURLConnection- Throws:
IOException
-
determineExpressionFromUrl
protected static String determineExpressionFromUrl(URL url)
determineExpressionFromUrl
-
validateDnsUrl
protected void validateDnsUrl(URL url) throws 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- aURLobject.- Throws:
MalformedURLException- if any.
-
parseZone
protected static String parseZone(URL url)
Zone should be the first path entity dns:/// [/ ][/>
-
parseForeignSource
protected static String parseForeignSource(URL url)
Foreign Source should be the second path entity, if it exists, otherwise it is set to the value of the zone. dns:/// [/ ][/>
-
-