Tabnine Logo
OwsHttpClientImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
OwsHttpClientImpl
in
org.deegree.protocol.ows.http

Best Java code snippets using org.deegree.protocol.ows.http.OwsHttpClientImpl (Showing top 8 results out of 315)

origin: deegree/deegree3

/**
 * Creates a new {@link CSWClient} instance.
 * 
 * @param capaUrl
 *            url of a CSW capabilities document, usually this is a <code>GetCapabilities</code> request to the
 *            service, must not be <code>null</code>
 * @param connectionTimeout
 *            the timeout for get/post requests in milliseconds, 0 is interpreted as an infinite timeout (default)
 * @throws OWSExceptionReport
 *             if the server replied with a service exception report
 * @throws XMLStreamException
 * @throws IOException
 *             if a communication/network problem occured
 */
public CSWClient( URL capaUrl, int connectionTimeout, int readTimeout ) throws OWSExceptionReport,
            XMLStreamException, IOException {
  super( capaUrl, new OwsHttpClientImpl( connectionTimeout, readTimeout, null, null ) );
}
origin: deegree/deegree3

private DefaultHttpClient getInitializedHttpClient( URL url ) {
  DefaultHttpClient client = new DefaultHttpClient();
  setTimeouts( client );
  setProxies( url, client );
  setCredentials( url, client );
  return client;
}
origin: deegree/deegree3

URI query = null;
try {
  URL normalizedEndpointUrl = normalizeGetUrl( endPoint );
  StringBuilder sb = new StringBuilder( normalizedEndpointUrl.toString() );
  boolean first = true;
  DefaultHttpClient httpClient = getInitializedHttpClient( endPoint );
  LOG.debug( "Performing GET request: " + query );
  HttpResponse httpResponse = httpClient.execute( httpGet );
origin: deegree/deegree3

@Override
public OwsHttpResponse doPost( URL endPoint, String contentType, StreamBufferStore body, Map<String, String> headers )
            throws IOException {
  OwsHttpResponse response = null;
  try {
    HttpPost httpPost = new HttpPost( endPoint.toURI() );
    DefaultHttpClient httpClient = getInitializedHttpClient( endPoint );
    LOG.debug( "Performing POST request on " + endPoint );
    LOG.debug( "post size: " + body.size() );
    InputStreamEntity entity = new InputStreamEntity( body.getInputStream(), (long) body.size() );
    entity.setContentType( contentType );
    httpPost.setEntity( entity );
    HttpResponse httpResponse = httpClient.execute( httpPost );
    response = new OwsHttpResponseImpl( httpResponse, httpClient.getConnectionManager(), endPoint.toString() );
  } catch ( Throwable e ) {
    String msg = "Error performing POST request on '" + endPoint + "': " + e.getMessage();
    throw new IOException( msg );
  }
  return response;
}
origin: deegree/deegree3

  this.httpClient = httpClient;
} else {
  this.httpClient = new OwsHttpClientImpl();
origin: deegree/deegree3

/**
 * Creates a new {@link AbstractOWSClient} instance from the given capabilities document.
 * 
 * @param capabilities
 *            OWS capabilities document, must not be <code>null</code>
 * @param httpClient
 *            client for customizing HTTP communication, can be <code>null</code>
 * @throws OWSExceptionReport
 *             if the server replied with a service exception report
 * @throws XMLStreamException
 * @throws IOException
 *             if a communication/network problem occured
 */
protected AbstractOWSClient( XMLAdapter capabilities, OwsHttpClient httpClient ) throws OWSExceptionReport,
            XMLStreamException, IOException {
  if ( capabilities == null ) {
    throw new NullPointerException( "Capabilities must not be null." );
  }
  try {
    capaBaseUrl = getGetUrl( "GetCapabilities" );
  } catch ( Exception e ) {
    LOG.warn( "No GetCapabilities URL available." );
  }
  if ( httpClient != null ) {
    this.httpClient = httpClient;
  } else {
    this.httpClient = new OwsHttpClientImpl();
  }
  initCapabilities( capabilities );
}
origin: deegree/deegree3

/**
 * @param url
 * @param connectionTimeout
 *            default is 5 seconds
 * @param requestTimeout
 *            default is 60 seconds
 * @param user
 *            http basic username
 * @param pass
 *            http basic password
 * @throws XMLStreamException
 * @throws OWSExceptionReport
 * @throws IOException
 */
public WMSClient( URL url, int connectionTimeout, int requestTimeout, String user, String pass )
            throws IOException, OWSExceptionReport, XMLStreamException {
  super( url, new OwsHttpClientImpl( connectionTimeout * 1000, requestTimeout * 1000, user, pass ) );
  this.connectionTimeout = connectionTimeout;
  this.requestTimeout = requestTimeout;
  capaDoc.parseWMSSpecificCapabilities( getOperations() );
  checkCapabilities();
  this.httpBasicUser = user;
  this.httpBasicPass = pass;
}
origin: deegree/deegree3

private OwsHttpClient createOwsHttpClient( RemoteWMTSConfig config ) {
  int connTimeout = DEFAULT_CONNECTION_TIMEOUT_SECS;
  if ( config.getConnectionTimeout() != null ) {
    connTimeout = config.getConnectionTimeout();
  }
  int reqTimeout = DEFAULT_REQUEST_TIMEOUT_SECS;
  if ( config.getRequestTimeout() != null ) {
    reqTimeout = config.getRequestTimeout();
  }
  AuthenticationType type = config.getAuthentication() == null ? null : config.getAuthentication().getValue();
  String user = null;
  String pass = null;
  if ( type instanceof HTTPBasicAuthenticationType ) {
    HTTPBasicAuthenticationType basic = (HTTPBasicAuthenticationType) type;
    user = basic.getUsername();
    pass = basic.getPassword();
  }
  return new OwsHttpClientImpl( connTimeout * 1000, reqTimeout * 1000, user, pass );
}
org.deegree.protocol.ows.httpOwsHttpClientImpl

Javadoc

Default implementation of OwsHttpClient.

Most used methods

  • <init>
    Creates a new OwsHttpClientImpl instance.
  • getInitializedHttpClient
  • normalizeGetUrl
  • setCredentials
  • setProxies
  • setTimeouts

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Collectors (java.util.stream)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now