Tom Beerbower created AMBARI-5257:
-------------------------------------
Summary: Ambari Views : Persistence
Key: AMBARI-5257
URL: https://issues.apache.org/jira/browse/AMBARI-5257
Project: Ambari
Issue Type: Task
Reporter: Tom Beerbower
Assignee: Tom Beerbower
View Persistence
# Save view and view instance resources to Ambari DB.
Same as any other resource (Cluster, Service, Blueprint, etc.). Will use
established JPA patterns to persist resources to Ambari DB.
# Allow views to store application data in Ambari DB.
* Option 1: Application data map.
Allow application code to store key / value pairs for a view instance. These
are different than view instance properties in that they may change (updated
during the life of the view instance). We may limit the type to String or
String and Numeric (future expansion to allow Serializable types?)
* Option 2 : Data Store
The view context will expose a data store object with the following interface
(subject to change) …
{code}
public interface DataStore {
void persist(java.lang.Object resource);
void remove(java.lang.Object resource);
<T> T find(java.lang.Class<T> clazz, java.lang.Object primaryKey);
void refresh(java.lang.Object resource);
}
{code}
This will allow a view to persist any Java Bean as application data.
Issues:
* Uses org.eclipse.persistence.dynamic classes so it further ties us to
EclipseLink.
* How do we identify primary key fields? JPA annotation?
--
This message was sent by Atlassian JIRA
(v6.2#6252)