class OGCServerConnector {

    public CancellableInputStream requestStream() throws OGCServerException
    {
        try
        {
            ResponseValues response = new ResponseValues();
            ServerProvider<HttpServer> provider = myServerRegistry.getProvider(HttpServer.class);
            HttpServer server = provider.getServer(myUrl);

            CancellableInputStream stream = null;
            if (myParamList != null)
            {
                stream = server.sendPost(myUrl, myParamList, response);
            }
            else if (postInput != null)
            {
                stream = server.sendPost(myUrl, postInput, response);
            }
            else
            {
                stream = server.sendGet(myUrl, response);
            }

            String contentType = response.getHeaderValue("Content-Type");
            if (contentType != null && contentType.contains("application/vnd.ogc.se_xml"))
            {
                throw new OGCServerException("Exception received from server, check server URL", null);
            }

            if (response.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED)
            {
                throw new OGCServerException("HTTP Connection error (401): Unauthorized", null);
            }
            else if (response.getResponseCode() != HttpURLConnection.HTTP_OK)
            {
                StringBuilder codeString = new StringBuilder().append(response.getResponseCode());
                if (StringUtils.isNotEmpty(response.getResponseMessage()))
                {
                    codeString.append(" = ").append(response.getResponseMessage());
                }
                throw new OGCServerException("Error code [" + codeString.toString() + "] received from server", null);
            }
            return stream;
        }
        catch (ServiceException | IOException | URISyntaxException e)
        {
            throw new OGCServerException("Failed to get stream from server: " + e, e);
        }
    }

    public  OGCServerConnector(URL url, InputStream postParams, ServerProviderRegistry serverProvider);
    public  OGCServerConnector(URL url, Map<String, String> postParams, ServerProviderRegistry serverProvider);
    public  OGCServerConnector(URL url, ServerProviderRegistry serverProvider);

}