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

A set of supported protocol schemes . More...

Description

Schemes are identified by lowercase names.

Author
Roland Weber
Version
Revision
648356
Date
2008-04-15 10:57:53 -0700 (Tue, 15 Apr 2008)
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

 SchemeRegistry ()
 Creates a new, empty scheme registry.
 
synchronized final Scheme getScheme (String name)
 Obtains a scheme by name. More...
 
synchronized final Scheme getScheme (HttpHost host)
 Obtains the scheme for a host. More...
 
synchronized final Scheme get (String name)
 Obtains a scheme by name, if registered. More...
 
synchronized final Scheme register (Scheme sch)
 Registers a scheme. More...
 
synchronized final Scheme unregister (String name)
 Unregisters a scheme. More...
 
synchronized final List< String > getSchemeNames ()
 Obtains the names of the registered schemes in their default order. More...
 
synchronized void setItems (final Map< String, Scheme > map)
 Populates the internal collection of registered protocol schemes with the content of the map passed as a parameter. More...
 

Member Function Documentation

◆ getScheme() [1/2]

synchronized final Scheme getScheme ( String  name)
Parameters
namethe name of the scheme to look up (in lowercase)
Returns
the scheme, never null
Exceptions
IllegalStateExceptionif the scheme with the given name is not registered

◆ getScheme() [2/2]

synchronized final Scheme getScheme ( HttpHost  host)

Convenience method for getScheme(host.getSchemeName())

Parameters
hostthe host for which to obtain the scheme
Returns
the scheme for the given host, never null
Exceptions
IllegalStateExceptionif a scheme with the respective name is not registered

◆ get()

synchronized final Scheme get ( String  name)
Parameters
namethe name of the scheme to look up (in lowercase)
Returns
the scheme, or null if there is none by this name

◆ register()

synchronized final Scheme register ( Scheme  sch)

The scheme can later be retrieved by its name using (String) getScheme or get .

Parameters
schthe scheme to register
Returns
the scheme previously registered with that name, or null if none was registered

◆ unregister()

synchronized final Scheme unregister ( String  name)
Parameters
namethe name of the scheme to unregister (in lowercase)
Returns
the unregistered scheme, or null if there was none

◆ getSchemeNames()

synchronized final List<String> getSchemeNames ( )
Returns
List containing registered scheme names.

◆ setItems()

synchronized void setItems ( final Map< String, Scheme map)
Parameters
mapprotocol schemes