Package com.xebialabs.deployit.plugin.api.reflect

## Class DescriptorRegistry

- java.lang.Object
- - com.xebialabs.deployit.plugin.api.reflect.DescriptorRegistry

-     public abstract class DescriptorRegistry
      extends java.lang.Object

  A registry for the `ConfigurationItem`s the XL Deploy system should know about. Every CI registry must extend this class, and it can be added to the collection of known registries, which is kept in this class. One special descriptor registry is the LocalDescriptorRegistry, which is usually the default one. Another descriptor registry is the RemoteDescriptorRegistry.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor | Description
    --- | --- | ---
    `protected` | `DescriptorRegistry​(DescriptorRegistryId id)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract boolean` | `_exists​(Type type)` |
    `protected abstract Descriptor` | `_getDescriptor​(Type type)` |
    `protected abstract java.util.Collection<Descriptor>` | `_getDescriptors()` |
    `protected abstract java.util.Collection<Type>` | `_getSubtypes​(Type supertype)` |
    `static void` | `add​(DescriptorRegistry registry)` | Registers a DescriptorRegistry to a global map.
    `static boolean` | `exists​(Type type)` |
    `static Descriptor` | `getDescriptor​(Type type)` |
    `static Descriptor` | `getDescriptor​(java.lang.String prefixedName)` |
    `static Descriptor` | `getDescriptor​(java.lang.String prefix, java.lang.String name)` |
    `static DescriptorRegistry` | `getDescriptorRegistry​(DescriptorRegistryId id)` | Gets a DescriptorRegistry by id.
    `static java.util.Collection<Descriptor>` | `getDescriptors()` |
    `protected static DescriptorRegistry` | `getInstance()` |
    `static java.util.Collection<Type>` | `getSubtypes​(Type supertype)` |
    `protected abstract boolean` | `isLocal()` |
    `Type` | `lookupType​(java.lang.Class<?> ciClass)` | Searches in the registry for a CI type by CI class.
    `Type` | `lookupType​(java.lang.String typeName)` | Searches in the registry for a CI type by CI prefixed type name.
    `Type` | `lookupType​(java.lang.String prefix, java.lang.String simpleName)` | Searches in the registry for a CI type by CI prefix and simple name.
    `static void` | `remove​(DescriptorRegistryId id)` | Unregisters the descriptor registry with the specified id.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DescriptorRegistry

          protected DescriptorRegistry​(DescriptorRegistryId id)

  - ### Method Detail

    - #### add

          public static void add​(DescriptorRegistry registry)

      Registers a DescriptorRegistry to a global map.

    - #### remove

          public static void remove​(DescriptorRegistryId id)

      Unregisters the descriptor registry with the specified id.

    - #### getDescriptors

          public static java.util.Collection<Descriptor> getDescriptors()

      Returns:
        A collection of all the registered type descriptors.

    - #### getSubtypes

          public static java.util.Collection<Type> getSubtypes​(Type supertype)

      Parameters:
        `supertype` - The super type to search against.
      Returns:
        A collection of subtypes of the given super type.

    - #### getDescriptor

          public static Descriptor getDescriptor​(java.lang.String prefixedName)

      Parameters:
        `prefixedName` - The prefixed type name of a CI.
      Returns:
        The descriptor of the specified CI type.

    - #### getDescriptor

          public static Descriptor getDescriptor​(java.lang.String prefix,
                                                 java.lang.String name)

      Parameters:
        `prefix` - The prefix of a CI.
        `name` - The simple name of a CI.
      Returns:
        The descriptor of the specified CI type.

    - #### getDescriptor

          public static Descriptor getDescriptor​(Type type)

      Parameters:
        `type` - The type of a CI.
      Returns:
        The descriptor of the specified CI type.

    - #### exists

          public static boolean exists​(Type type)

      Parameters:
        `type` - The type of a CI.
      Returns:
        Whether the given type can be found in the registry.

    - #### getInstance

          protected static DescriptorRegistry getInstance()

    - #### getDescriptorRegistry

          public static DescriptorRegistry getDescriptorRegistry​(DescriptorRegistryId id)

      Gets a DescriptorRegistry by id.

    - #### lookupType

          public Type lookupType​(java.lang.Class<?> ciClass)

      Searches in the registry for a CI type by CI class.
      Parameters:
        `ciClass` - A class instance of a CI.
      Returns:
        The type for the given CI class.

    - #### lookupType

          public Type lookupType​(java.lang.String typeName)

      Searches in the registry for a CI type by CI prefixed type name.
      Parameters:
        `typeName` - The prefixed type name of a CI.
      Returns:
        The type of the CI.

    - #### lookupType

          public Type lookupType​(java.lang.String prefix,
                                 java.lang.String simpleName)

      Searches in the registry for a CI type by CI prefix and simple name.
      Parameters:
        `prefix` - The prefix of a CI.
        `simpleName` - The simple name of a CI.
      Returns:
        The type of the CI.

    - #### isLocal

          protected abstract boolean isLocal()

    - #### _getDescriptors

          protected abstract java.util.Collection<Descriptor> _getDescriptors()

    - #### _getSubtypes

          protected abstract java.util.Collection<Type> _getSubtypes​(Type supertype)

    - #### _getDescriptor

          protected abstract Descriptor _getDescriptor​(Type type)

    - #### _exists

          protected abstract boolean _exists​(Type type)