org.apache.falcon.entity.store
Class ConfigurationStore

java.lang.Object
  extended by org.apache.falcon.entity.store.ConfigurationStore
All Implemented Interfaces:
FalconService

public final class ConfigurationStore
extends Object
implements FalconService

Persistent store for falcon entities.


Method Summary
 void cleanupUpdateInit()
           
 void destroy()
           
static ConfigurationStore get()
           
<T extends Entity>
T
get(EntityType type, String name)
           
 Collection<String> getEntities(EntityType type)
           
 String getName()
           
 void init()
           
 void initiateUpdate(Entity entity)
           
 void publish(EntityType type, Entity entity)
           
 void registerListener(ConfigurationChangeListener listener)
           
 boolean remove(EntityType type, String name)
          Remove an entity which is already stored in the config store.
 void unregisterListener(ConfigurationChangeListener listener)
           
 void update(EntityType type, Entity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static ConfigurationStore get()

init

public void init()
          throws FalconException
Specified by:
init in interface FalconService
Throws:
FalconException

registerListener

public void registerListener(ConfigurationChangeListener listener)

unregisterListener

public void unregisterListener(ConfigurationChangeListener listener)

publish

public void publish(EntityType type,
                    Entity entity)
             throws FalconException
Parameters:
type - - EntityType that need to be published
entity - - Reference to the Entity Object
Throws:
FalconException

update

public void update(EntityType type,
                   Entity entity)
            throws FalconException
Throws:
FalconException

initiateUpdate

public void initiateUpdate(Entity entity)
                    throws FalconException
Throws:
FalconException

get

public <T extends Entity> T get(EntityType type,
                                String name)
                     throws FalconException
Type Parameters:
T - - Actual Entity object type
Parameters:
type - - Entity type that is being retrieved
name - - Name as it appears in the entity xml definition
Returns:
- Entity object from internal dictionary, If the object is not loaded in memory yet, it will retrieve it from persistent store just in time. On startup all the entities will be added to the dictionary with null reference.
Throws:
FalconException

getEntities

public Collection<String> getEntities(EntityType type)

remove

public boolean remove(EntityType type,
                      String name)
               throws FalconException
Remove an entity which is already stored in the config store.

Parameters:
type - - Entity type being removed
name - - Name of the entity object being removed
Returns:
- True is remove is successful, false if request entity doesn't exist
Throws:
FalconException

cleanupUpdateInit

public void cleanupUpdateInit()

getName

public String getName()
Specified by:
getName in interface FalconService

destroy

public void destroy()
Specified by:
destroy in interface FalconService


Copyright © 2013-2014 Apache Software Foundation. All Rights Reserved.