org.apache.falcon.resource
Class AbstractEntityManager

java.lang.Object
  extended by org.apache.falcon.resource.AbstractEntityManager
Direct Known Subclasses:
AbstractInstanceManager, AbstractSchedulableEntityManager, ConfigSyncService

public abstract class AbstractEntityManager
extends Object

A base class for managing Entity operations.


Field Summary
protected  ConfigurationStore configStore
           
protected static int XML_DEBUG_LEN
           
 
Constructor Summary
AbstractEntityManager()
           
 
Method Summary
protected  void audit(javax.servlet.http.HttpServletRequest request, String entity, String type, String action)
           
protected  void checkColo(String colo)
           
 org.apache.falcon.resource.APIResult delete(javax.servlet.http.HttpServletRequest request, String type, String entity, String colo)
          Deletes a scheduled entity, a deleted entity is removed completely from execution pool.
protected  Entity deserializeEntity(javax.servlet.http.HttpServletRequest request, EntityType entityType)
           
protected  Set<String> getAllColos()
           
protected  Set<String> getApplicableColos(String type, Entity entity)
           
protected  Set<String> getApplicableColos(String type, String name)
           
protected  Set<String> getColosFromExpression(String coloExpr, String type, String entity)
           
 org.apache.falcon.resource.EntityList getDependencies(String type, String entityName)
          Returns dependencies.
 String getEntityDefinition(String type, String entityName)
          Returns the entity definition as an XML based on name.
 org.apache.falcon.resource.EntityList getEntityList(String type, String fieldStr)
          Returns the list of entities registered of a given type.
protected  org.apache.falcon.resource.AbstractEntityManager.EntityStatus getStatus(Entity entity, EntityType type)
           
 org.apache.falcon.resource.APIResult getStatus(String type, String entity, String colo)
          Returns the status of requested entity.
protected  AbstractWorkflowEngine getWorkflowEngine()
           
 org.apache.falcon.resource.APIResult submit(javax.servlet.http.HttpServletRequest request, String type, String colo)
          Submit a new entity.
protected  Entity submitInternal(javax.servlet.http.HttpServletRequest request, String type)
           
 org.apache.falcon.resource.APIResult update(javax.servlet.http.HttpServletRequest request, String type, String entityName, String colo)
           
 org.apache.falcon.resource.APIResult validate(javax.servlet.http.HttpServletRequest request, String type)
          Post an entity XML with entity type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_DEBUG_LEN

protected static final int XML_DEBUG_LEN
See Also:
Constant Field Values

configStore

protected ConfigurationStore configStore
Constructor Detail

AbstractEntityManager

public AbstractEntityManager()
Method Detail

checkColo

protected void checkColo(String colo)

getAllColos

protected Set<String> getAllColos()

getColosFromExpression

protected Set<String> getColosFromExpression(String coloExpr,
                                             String type,
                                             String entity)

getApplicableColos

protected Set<String> getApplicableColos(String type,
                                         String name)

getApplicableColos

protected Set<String> getApplicableColos(String type,
                                         Entity entity)

submit

public org.apache.falcon.resource.APIResult submit(javax.servlet.http.HttpServletRequest request,
                                                   String type,
                                                   String colo)
Submit a new entity. Entities can be of type feed, process or data end points. Entity definitions are validated structurally against schema and subsequently for other rules before they are admitted into the system

Entity name acts as the key and an entity once added, can't be added again unless deleted.

Parameters:
request - - Servlet Request
type - - entity type - feed, process or data end point
colo - - applicable colo
Returns:
result of the operation

validate

public org.apache.falcon.resource.APIResult validate(javax.servlet.http.HttpServletRequest request,
                                                     String type)
Post an entity XML with entity type. Validates the XML which can be Process, Feed or Dataendpoint

Parameters:
type - entity type
Returns:
APIResule -Succeeded or Failed

delete

public org.apache.falcon.resource.APIResult delete(javax.servlet.http.HttpServletRequest request,
                                                   String type,
                                                   String entity,
                                                   String colo)
Deletes a scheduled entity, a deleted entity is removed completely from execution pool.

Parameters:
type - entity type
entity - entity name
Returns:
APIResult

update

public org.apache.falcon.resource.APIResult update(javax.servlet.http.HttpServletRequest request,
                                                   String type,
                                                   String entityName,
                                                   String colo)

submitInternal

protected Entity submitInternal(javax.servlet.http.HttpServletRequest request,
                                String type)
                         throws IOException,
                                FalconException
Throws:
IOException
FalconException

deserializeEntity

protected Entity deserializeEntity(javax.servlet.http.HttpServletRequest request,
                                   EntityType entityType)
                            throws IOException,
                                   FalconException
Throws:
IOException
FalconException

audit

protected void audit(javax.servlet.http.HttpServletRequest request,
                     String entity,
                     String type,
                     String action)

getStatus

public org.apache.falcon.resource.APIResult getStatus(String type,
                                                      String entity,
                                                      String colo)
Returns the status of requested entity.

Parameters:
type - entity type
entity - entity name
Returns:
String

getStatus

protected org.apache.falcon.resource.AbstractEntityManager.EntityStatus getStatus(Entity entity,
                                                                                  EntityType type)
                                                                           throws FalconException
Throws:
FalconException

getDependencies

public org.apache.falcon.resource.EntityList getDependencies(String type,
                                                             String entityName)
Returns dependencies.

Parameters:
type - entity type
entityName - entity name
Returns:
EntityList

getEntityList

public org.apache.falcon.resource.EntityList getEntityList(String type,
                                                           String fieldStr)
Returns the list of entities registered of a given type.

Parameters:
type - entity type
fieldStr - fields that the query is interested in, separated by comma
type - entity type
Returns:
String

getEntityDefinition

public String getEntityDefinition(String type,
                                  String entityName)
Returns the entity definition as an XML based on name.

Parameters:
type - entity type
entityName - entity name
Returns:
String

getWorkflowEngine

protected AbstractWorkflowEngine getWorkflowEngine()


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