Git Product home page Git Product logo

carbon-lcm's Introduction

Lifecycle Management Component


Branch Build Status
master Build Status

This component provides lifecycle management capability to any of the resource type which requires lifecycle capability. This will store all the data related to lifecycles in its side. Component will provide an unique id to outside to maintain tha mapping between the lifecycle data external object (For ex: API, APP, REST Service)

All the operations are exposed the through the "ManagedLifecycle" interface. Any object which require lifecycle only need to implement this interface and invoke relevant operations. This interface have following methods with default implementation.

  • void createLifecycleEntry(String lcName, String user) throws LifecycleException
  • LifecycleState executeLifecycleEvent(String targetState, String user, String lcName) throws LifecycleException
  • void removeLifecycleEntry(String lcName) throws LifecycleException
  • LifecycleState checkListItemEvent(String lcName, String checkListItemName, boolean value)
  • LifecycleState getCurrentLifecycleState(String lcName) throws LifecycleException

Following methods should be provide with implementation.

  • void associateLifecycle(LifecycleState lifecycleState) throws LifecycleException After adding lifecycle to object(which implements the interface) by calling "createLifecycleEntry" should set this lifecycle state object to its instance. Then they should implement the logic to persist lifecycle id which is in the lifecycle state. This id is the mapping between particular object and its lifecycle data.

  • void dissociateLifecycle() throws LifecycleException This method should update its the current object lifecycle state to null and implement the logic to remove the persisted lifecycle id which was implemented in "associateLifecycle" method.

  • String getLifecycleId(String lcName) This method should provide implementation to give the lifecycle id when lifecycle name is provided. A map can be used to maintain the mapping. This is used if one object is associated with multiple lifecycles.

Note

Please note that any of the above 3 methods should not be called from outside. The default methods in the
interface only call the above 3 methods.
Refer the SampleApi class for an implementation for "ManagedLifecycle" interface.

carbon-lcm's People

Contributors

anuruddhal avatar isurad avatar maheshika avatar rajith90 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.