org.apache.http.conn.scheme

## Class Scheme

- java.lang.Object
- - org.apache.http.conn.scheme.Scheme

- Deprecated.
  (4.3) use `SchemePortResolver` for default port resolution and `Registry` for socket factory lookups.

      @Contract(threading=IMMUTABLE)
      @Deprecated
      public final class Scheme
      extends Object

  Encapsulates specifics of a protocol scheme such as "http" or "https". Schemes are identified by lowercase names. Supported schemes are typically collected in a `SchemeRegistry`.

  For example, to configure support for "https://" URLs, you could write code like the following:

       Scheme https = new Scheme("https", 443, new MySecureSocketFactory());
       SchemeRegistry registry = new SchemeRegistry();
       registry.register(https);

  Since:
    4.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Scheme(String name, int port, SchemeSocketFactory factory)` Deprecated. Creates a new scheme.
    `Scheme(String name, SocketFactory factory, int port)` Deprecated. (4.1) Use `Scheme(String, int, SchemeSocketFactory)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)` Deprecated.
    `int` | `getDefaultPort()` Deprecated. Obtains the default port.
    `String` | `getName()` Deprecated. Obtains the scheme name.
    `SchemeSocketFactory` | `getSchemeSocketFactory()` Deprecated. Obtains the socket factory.
    `SocketFactory` | `getSocketFactory()` Deprecated. (4.1) Use `getSchemeSocketFactory()`
    `int` | `hashCode()` Deprecated.
    `boolean` | `isLayered()` Deprecated. Indicates whether this scheme allows for layered connections.
    `int` | `resolvePort(int port)` Deprecated. Resolves the correct port for this scheme.
    `String` | `toString()` Deprecated. Return a string representation of this object.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Scheme

          public Scheme(String name,
                int port,
                SchemeSocketFactory factory)

      Deprecated.
      Creates a new scheme. Whether the created scheme allows for layered connections depends on the class of `factory`.
      Parameters:
        `name` - the scheme name, for example "http". The name will be converted to lowercase.
        `port` - the default port for this scheme
        `factory` - the factory for creating sockets for communication with this scheme
      Since:
        4.1

    - #### Scheme

          @Deprecated
          public Scheme(String name,
                           SocketFactory factory,
                           int port)

      Deprecated. (4.1) Use `Scheme(String, int, SchemeSocketFactory)`
      Creates a new scheme. Whether the created scheme allows for layered connections depends on the class of `factory`.
      Parameters:
        `name` - the scheme name, for example "http". The name will be converted to lowercase.
        `factory` - the factory for creating sockets for communication with this scheme
        `port` - the default port for this scheme

  - ### Method Detail

    - #### getDefaultPort

          public int getDefaultPort()

      Deprecated.
      Obtains the default port.
      Returns:
        the default port for this scheme

    - #### getSocketFactory

          @Deprecated
          public SocketFactory getSocketFactory()

      Deprecated. (4.1) Use `getSchemeSocketFactory()`
      Obtains the socket factory. If this scheme is `layered`, the factory implements `LayeredSocketFactory`.
      Returns:
        the socket factory for this scheme

    - #### getSchemeSocketFactory

          public SchemeSocketFactory getSchemeSocketFactory()

      Deprecated.
      Obtains the socket factory. If this scheme is `layered`, the factory implements `LayeredSchemeSocketFactory`.
      Returns:
        the socket factory for this scheme
      Since:
        4.1

    - #### getName

          public String getName()

      Deprecated.
      Obtains the scheme name.
      Returns:
        the name of this scheme, in lowercase

    - #### isLayered

          public boolean isLayered()

      Deprecated.
      Indicates whether this scheme allows for layered connections.
      Returns:
        `true` if layered connections are possible, `false` otherwise

    - #### resolvePort

          public int resolvePort(int port)

      Deprecated.
      Resolves the correct port for this scheme. Returns the given port if it is valid, the default port otherwise.
      Parameters:
        `port` - the port to be resolved, a negative number to obtain the default port
      Returns:
        the given port or the defaultPort

    - #### toString

          public String toString()

      Deprecated.
      Return a string representation of this object.
      Overrides:
        `toString` in class `Object`
      Returns:
        a human-readable string description of this scheme

    - #### equals

          public boolean equals(Object obj)

      Deprecated.
      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Deprecated.
      Overrides:
        `hashCode` in class `Object`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.