• BlackBerry Dynamics
  • Runtime library for Android applications
  • 12.0.1.79
HttpHost Class Reference

Holds all of the variables needed to describe an HTTP connection to a host. More...

Inherits Cloneable.

Description

This includes remote host name, port and scheme.

Author
Michael Becke
Mike Bowler
Oleg Kalnichevski
Laura Werner
Since
4.0

Notice

The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.

/*
 * Copyright (C) 2006 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Public Member Functions

 HttpHost (final String hostname, int port, final String scheme, final String uri)
 Creates a new HttpHost , specifying all values. More...
 
 HttpHost (final String hostname, int port)
 Creates a new HttpHost , with default scheme. More...
 
 HttpHost (final String hostname)
 Creates a new HttpHost , with default scheme and port. More...
 
 HttpHost (final HttpHost httphost)
 Copy constructor for HttpHost . More...
 
String getHostName ()
 Returns the host name. More...
 
int getPort ()
 Returns the port. More...
 
String getSchemeName ()
 Returns the scheme name. More...
 
String toURI ()
 Return the host URI, as a string. More...
 
String toHostString ()
 Obtains the host string, without scheme prefix. More...
 
String toString ()
 
boolean equals (final Object obj)
 
int hashCode ()
 

Static Public Attributes

static final String DEFAULT_SCHEME_NAME = "http"
 The default scheme is "http". More...
 

Protected Attributes

final String hostname
 The host to use. More...
 
final String lcHostname
 The lowercase host, for equals and hashCode. More...
 
final int port
 The port to use. More...
 
final String schemeName
 The scheme.
 

Constructor & Destructor Documentation

◆ HttpHost() [1/4]

HttpHost ( final String  hostname,
int  port,
final String  scheme,
final String  uri 
)

Constructor for HttpHost.

Parameters
hostnamethe hostname (IP or DNS name)
portthe port number. -1 indicates the scheme default port.
schemethe name of the scheme. null indicates the default scheme
urithe complete uri for the request

◆ HttpHost() [2/4]

HttpHost ( final String  hostname,
int  port 
)
Parameters
hostnamethe hostname (IP or DNS name)
portthe port number. -1 indicates the scheme default port.

◆ HttpHost() [3/4]

HttpHost ( final String  hostname)
Parameters
hostnamethe hostname (IP or DNS name)

◆ HttpHost() [4/4]

HttpHost ( final HttpHost  httphost)
Parameters
httphostthe HTTP host to copy details from

Member Function Documentation

◆ getHostName()

String getHostName ( )
Returns
the host name (IP or DNS name)

◆ getPort()

int getPort ( )
Returns
the host port, or -1 if not set

◆ getSchemeName()

String getSchemeName ( )
Returns
the scheme name

◆ toURI()

String toURI ( )
Returns
the host URI

◆ toHostString()

String toHostString ( )
Returns
the host string, for example localhost:8080

◆ toString()

String toString ( )
See also
java.lang.Object::toString()

◆ equals()

boolean equals ( final Object  obj)
See also
java.lang.Object::equals()

◆ hashCode()

int hashCode ( )
See also
java.lang.Object::hashCode()

Member Data Documentation

◆ DEFAULT_SCHEME_NAME

final String DEFAULT_SCHEME_NAME = "http"
static

◆ hostname

final String hostname
protected

◆ lcHostname

final String lcHostname
protected

◆ port

final int port
protected