org.apache.solr.common.cloud

## Enum UrlScheme

- java.lang.Object
- - java.lang.Enum<UrlScheme>
  - - org.apache.solr.common.cloud.UrlScheme

All Implemented Interfaces:
  Serializable, Comparable<UrlScheme>

    public enum UrlScheme
    extends Enum<UrlScheme>

Singleton access to global urlScheme, which although is stored in ZK as a cluster property really should be treated like a static global that is set at initialization and not altered after. Client applications should not use this class directly; it is only included in SolrJ because Replica and ZkNodeProps depend on it.

### Enum Constant Summary

Enum Constants
Enum Constant and Description
`INSTANCE`

### Field Summary

Fields
`static String` `HTTP`
`static String` `HTTPS`
`static String` `HTTPS_PORT_PROP`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`String` `applyUrlScheme(String url)` Given a URL string with or without a scheme, return a new URL with the correct scheme applied.
`String` `getBaseUrlForNodeName(String nodeName)`
`String` `getUrlScheme()`
`void` `setUrlScheme(String urlScheme)` Set the global urlScheme variable; ideally this should be immutable once set, but some tests rely on changing the value on-the-fly.
`static UrlScheme` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static UrlScheme[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

### Enum Constant Detail

#### INSTANCE

    public static final UrlScheme INSTANCE

### Field Detail

#### HTTP

    public static final String HTTP

See Also:
  Constant Field Values

#### HTTPS

    public static final String HTTPS

See Also:
  Constant Field Values

#### HTTPS_PORT_PROP

    public static final String HTTPS_PORT_PROP

See Also:
  Constant Field Values

### Method Detail

#### values

    public static UrlScheme[] values()

Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

    for (UrlScheme c : UrlScheme.values())
        System.out.println(c);

Returns:
  an array containing the constants of this enum type, in the order they are declared

#### valueOf

    public static UrlScheme valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum type has no constant with the specified name
  `NullPointerException` - if the argument is null

#### setUrlScheme

    public void setUrlScheme(String urlScheme)

Set the global urlScheme variable; ideally this should be immutable once set, but some tests rely on changing the value on-the-fly.

Parameters:
  `urlScheme` - The new URL scheme, either http or https.

#### getBaseUrlForNodeName

    public String getBaseUrlForNodeName(String nodeName)

#### applyUrlScheme

    public String applyUrlScheme(String url)

Given a URL string with or without a scheme, return a new URL with the correct scheme applied.

Parameters:
  `url` - A URL to change the scheme (http|https)
Returns:
  A new URL with the correct scheme

#### getUrlScheme

    public String getUrlScheme()