Package org.wso2.carbon.registry.admin.api.governance

# Interface ILifecycleManagementService<LifecycleBean>

Type Parameters:
  `LifecycleBean` - a bean that can be used to manage a lifecycle configuration. Please note that a lifecycle configuration can be modified only if it is not currently being used.

public interface ILifecycleManagementService<LifecycleBean>
This provides functionality to manage various lifecycle (or aspects which are lifecycles) configurations on the registry.
Statistics:

- createLifecycle
- updateLifecycle
- deleteLifecycle

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `createLifecycle(String configuration)`
  Method to create a new lifecycle configuration.
  `boolean`
  `deleteLifecycle(String name)`
  Method to delete an existing lifecycle configuration.
  `LifecycleBean`
  `getLifecycleBean(String name)`
  Method to obtain a configuration bean for the given lifecycle.
  `String`
  `getLifecycleConfiguration(String name)`
  Method to obtain the lifecycle configuration of the given lifecycle.
  `String`
  `getLifecycleConfigurationVersion(String name)`
  Method to retrieve the version of the defined lifecycle configuration
  `String[]`
  `getLifecycleList()`
  Method to obtain a list of currently configured lifecycles.
  `String`
  `getLifecyclesCollectionLocation()`
  Method to obtain the location on the repository where lifecycle configurations are stored.
  `boolean`
  `isLifecycleNameInUse(String name)`
  Method to determine whether the lifecycle configuration by the given name is currently being used.
  `boolean`
  `parseConfiguration(String configuration)`
  Method to parse the given lifecycle configuration XML and generate a lifecycle configuration bean.
  `void`
  `setLifecyclesCollectionLocation(String location)`
  Method to set the location on the repository where lifecycle configurations are stored.
  `boolean`
  `updateLifecycle(String oldName, String configuration)`
  Method to update an existing lifecycle configuration.

- ## Method Details

  - ### getLifecyclesCollectionLocation

    String getLifecyclesCollectionLocation() throws Exception
    Method to obtain the location on the repository where lifecycle configurations are stored.
    Returns:
      the location on the repository where lifecycle configurations are stored.
    Throws:
      `Exception` - if the operation failed.

  - ### setLifecyclesCollectionLocation

    void setLifecyclesCollectionLocation(String location) throws Exception
    Method to set the location on the repository where lifecycle configurations are stored.
    Parameters:
      `location` - the location on the repository where lifecycle configurations are stored.
    Throws:
      `Exception` - if the operation failed.

  - ### getLifecycleList

    String[] getLifecycleList() throws Exception
    Method to obtain a list of currently configured lifecycles.
    Returns:
      the list of lifecycles.
    Throws:
      `Exception` - if the operation failed.

  - ### getLifecycleBean

    LifecycleBean getLifecycleBean(String name) throws Exception
    Method to obtain a configuration bean for the given lifecycle.
    Parameters:
      `name` - the name of the lifecycle configuration.
    Returns:
      the corresponding lifecycle configuration bean.
    Throws:
      `Exception` - if the operation failed.

  - ### getLifecycleConfiguration

    String getLifecycleConfiguration(String name) throws Exception
    Method to obtain the lifecycle configuration of the given lifecycle.
    Parameters:
      `name` - the name of the lifecycle configuration.
    Returns:
      the corresponding lifecycle configuration XML.
    Throws:
      `Exception` - if the operation failed.

  - ### createLifecycle

    boolean createLifecycle(String configuration) throws Exception
    Method to create a new lifecycle configuration.
    Parameters:
      `configuration` - the string configuration. The name of the lifecycle will be determined from the provided configuration.
    Returns:
      whether the operation was successful or not.
    Throws:
      `Exception` - if the operation failed due to an unexpected error.

  - ### updateLifecycle

    boolean updateLifecycle(String oldName, String configuration) throws Exception
    Method to update an existing lifecycle configuration.
    Parameters:
      `oldName` - the name of the existing lifecycle configuration.
      `configuration` - the string configuration containing the updated configuration. if the new lifecycle configuration has a new name, the old lifecycle configuration will be deleted and a new one will be added. If the names were the same, the existing configuration will be updated instead.
    Returns:
      whether the operation was successful or not.
    Throws:
      `Exception` - if the operation failed due to an unexpected error.

  - ### deleteLifecycle

    boolean deleteLifecycle(String name) throws Exception
    Method to delete an existing lifecycle configuration.
    Parameters:
      `name` - the name of the existing lifecycle configuration to be deleted.
    Returns:
      whether the operation was successful or not.
    Throws:
      `Exception` - if the operation failed due to an unexpected error.

  - ### isLifecycleNameInUse

    boolean isLifecycleNameInUse(String name) throws Exception
    Method to determine whether the lifecycle configuration by the given name is currently being used.
    Parameters:
      `name` - the name of an existing lifecycle configuration.
    Returns:
      if the given lifecycle configuration is being used this method will return 'true'. If not, this method will return 'false'.
    Throws:
      `Exception` - if the operation failed.

  - ### parseConfiguration

    boolean parseConfiguration(String configuration) throws Exception
    Method to parse the given lifecycle configuration XML and generate a lifecycle configuration bean.
    Parameters:
      `configuration` - the configuration of the lifecycle in XML.
    Returns:
      a bean corresponding to the given configuration.
    Throws:
      `Exception` - if the operation failed.

  - ### getLifecycleConfigurationVersion

    String getLifecycleConfigurationVersion(String name) throws Exception
    Method to retrieve the version of the defined lifecycle configuration
    Parameters:
      `name` - the name of the lifecycle resource.
    Returns:
      a string which is the version.
    Throws:
      `Exception` - if the operation failed.