[ 
https://issues.apache.org/jira/browse/AIRAVATA-1006?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13892237#comment-13892237
 ] 

Chathuri Wimalasena commented on AIRAVATA-1006:
-----------------------------------------------

Hi Suresh / Marlon, 

Here is one approach that I came to define Registry CPI. Will this be too 
abstract ? A programmer who is going to program against this should only know 
about the thrift models. He does not have to know about the registry structure. 
Please give feedback. 

/**
 * This is the interface for Registry CPI
 */
public interface Registry {

    /**
     * This method is to add an object in to the registry
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param newObjectToAdd Object which contains the fields that need to be 
saved in to registry. This object is a
     *                       thrift model object. In experiment case this 
object can be BasicMetadata, ConfigurationData
     *                       etc
     */
    public void add(DataType dataType, Object newObjectToAdd);

    /**
     * This method is to update the whole object in registry
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param newObjectToUpdate Object which contains the fields that need to 
be updated in to registry. This object is a
     *                       thrift model object. In experiment case this 
object can be BasicMetadata, ConfigurationData
     *                       etc. CPI programmer can only fill necessary fields 
that need to be updated. He does not
     *                       have to fill the whole object. He needs to only 
fill the mandatory fields and whatever the
     *                       other fields that need to be updated.
     *
     */
    public void update(DataType dataType, Object newObjectToUpdate);

    /**
     * This method is to update a specific field of the data model
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param identifier Identifier which will uniquely identify the data 
model. For example, in Experiment_Basic_Type,
     *                   identifier will be generated experimentID
     * @param field Field which need to be updated in the registry. In 
Experiment_Basic_Type, if you want to update the
     *              description, field will be "description"
     * @param value Value by which the given field need to be updated. If the 
field is "description", that field will be
     *              updated by given value
     */
    public void update(DataType dataType, Object identifier, Object field, 
Object value);

    /**
     * This method is to retrieve list of objects according to a given criteria
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param filteredBy FilterBy is the field that filtering should be done. 
For example, if we want to retrieve all
     *                   the experiments for a given user, filterBy will be 
"userName"
     * @param value value for the filtering field. In the experiment case, 
value for "userName" can be "admin"
     * @return List of objects according to the given criteria
     */
    public List<Object> get(DataType dataType, Object filteredBy, Object value);

    /**
     * This method is to retrieve a specific value for a given field.
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param identifier Identifier which will uniquely identify the data 
model. For example, in Experiment_Basic_Type,
     *                   identifier will be generated experimentID
     * @param field field that filtering should be done. For example, if we 
want to execution user for a given
     *              experiment, field will be "userName"
     * @return return the value for the specific field where data model is 
identified by the unique identifier that has
     *         given
     */
    public Object getValue (DataType dataType, Object identifier, Object field);

    /**
     * This method is to remove a item from the registry
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param identifier Identifier which will uniquely identify the data 
model. For example, in Experiment_Basic_Type,
     *                   identifier will be generated experimentID
     */
    public void remove (DataType dataType, Object identifier);

    /**
     * This method will check whether a given data type which can be identified 
with the identifier exists or not
     * @param dataType Data type is a predefined type which the programmer 
should choose according to the object he
     *                 is going to save in to registry
     * @param identifier Identifier which will uniquely identify the data 
model. For example, in Experiment_Basic_Type,
     *                   identifier will be generated experimentID
     * @return whether the given data type exists or not
     */
    public boolean isExist(DataType dataType, Object identifier);


}

> Craft the Registry 1.0 CPI
> --------------------------
>
>                 Key: AIRAVATA-1006
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-1006
>             Project: Airavata
>          Issue Type: Sub-task
>            Reporter: Suresh Marru
>             Fix For: 0.12
>
>
> As the Airavata API is evolving towards 1.0 version, we need to refine the 
> currently Registry API (and the current Airavata Client->Registry API) into a 
> unified and well defined Registry CPI. 
> This registry CPI is targeted to be invoked by the Airavata API functions and 
> use of Registry by all internal Airavata internal components like 
> Orchestrator, Workflow Interpreter and GFac.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to