You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/06/20 23:01:52 UTC
[01/11] airavata git commit: updating the experiment catalog db
scripts
Repository: airavata
Updated Branches:
refs/heads/master c3b4b0654 -> cb5d3aef0
updating the experiment catalog db scripts
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/a5039dc0
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/a5039dc0
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/a5039dc0
Branch: refs/heads/master
Commit: a5039dc0c0afe65282846fd7bc2fcb590943bb56
Parents: c3b4b06
Author: Supun Nakandala <sc...@apache.org>
Authored: Fri Jun 19 17:58:03 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Fri Jun 19 17:58:03 2015 +0530
----------------------------------------------------------------------
.../src/main/resources/expcatalog-derby.sql | 473 +++++++------------
.../src/main/resources/expcatalog-mysql.sql | 466 +++++++-----------
2 files changed, 360 insertions(+), 579 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/a5039dc0/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index 7ab3755..a867b91 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -20,25 +20,14 @@
*/
CREATE TABLE GATEWAY
(
- GATEWAY_ID VARCHAR (255),
+ GATEWAY_ID VARCHAR(255),
GATEWAY_NAME VARCHAR(255),
DOMAIN VARCHAR(255),
EMAIL_ADDRESS VARCHAR(255),
PRIMARY KEY (GATEWAY_ID)
);
-CREATE TABLE CONFIGURATION
-(
- CONFIG_KEY VARCHAR(255),
- CONFIG_VAL VARCHAR(255),
- EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- CATEGORY_ID VARCHAR (255),
- PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
-
-CREATE TABLE USERS
+CREATE TABLE USER
(
USER_NAME VARCHAR(255),
PASSWORD VARCHAR(255),
@@ -51,20 +40,20 @@ CREATE TABLE GATEWAY_WORKER
USER_NAME VARCHAR(255),
PRIMARY KEY (GATEWAY_ID, USER_NAME),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT
(
GATEWAY_ID VARCHAR(255),
- USER_NAME VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255),
+ USER_NAME VARCHAR(255),
PROJECT_NAME VARCHAR(255) NOT NULL,
+ PROJECT_ID VARCHAR(255),
DESCRIPTION VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (PROJECT_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT_USER
@@ -73,319 +62,221 @@ CREATE TABLE PROJECT_USER
USER_NAME VARCHAR(255),
PRIMARY KEY (PROJECT_ID,USER_NAME),
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
-CREATE TABLE EXPERIMENT
-(
- EXPERIMENT_ID VARCHAR(255),
- GATEWAY_ID VARCHAR(255),
- EXECUTION_USER VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255) NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- EXPERIMENT_NAME VARCHAR(255) NOT NULL,
- EXPERIMENT_DESCRIPTION VARCHAR(255),
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- WORKFLOW_TEMPLATE_ID VARCHAR(255),
- WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
- WORKFLOW_EXECUTION_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- GATEWAY_EXECUTION_ID VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID),
- FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
- FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT (
+ EXPERIMENT_ID varchar(255),
+ PROJECT_ID varchar(255),
+ EXPERIMENT_TYPE varchar(255),
+ USER_NAME varchar(255),
+ APPLICATION_ID varchar(255),
+ EXPERIMENT_NAME varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ DESCRIPTION varchar(255),
+ EXECUTION_ID varchar(255),
+ GATEWAY_EXECUTION_ID varchar(255),
+ ENABLE_EMAIL_NOTIFICATION BOOLEAN,
+ EMAIL_ADDRESSES CLOB,
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
);
+
CREATE TABLE EXPERIMENT_INPUT
(
- EXPERIMENT_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE CLOB,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT BOOLEAN,
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER int(11),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_STAGED BOOLEAN,
+ PRIMARY KEY(EXPERIMENT_ID,INPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT_OUTPUT
(
- EXPERIMENT_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE CLOB,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_MOVEMENT BOOLEAN,
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(EXPERIMENT_ID,OUTPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE WORKFLOW_NODE_DETAIL
-(
- EXPERIMENT_ID VARCHAR(255) NOT NULL,
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- NODE_NAME VARCHAR(255) NOT NULL,
- EXECUTION_UNIT VARCHAR(255) NOT NULL,
- EXECUTION_UNIT_DATA VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_STATUS (
+ EXPERIMENT_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE TASK_DETAIL
-(
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- APPLICATION_DEPLOYMENT_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- PRIMARY KEY(TASK_ID),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-CREATE TABLE NOTIFICATION_EMAIL
-(
- EMAIL_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- EMAIL_ADDRESS VARCHAR(255),
- PRIMARY KEY(EMAIL_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ERROR_DETAIL
-(
- ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- ACTUAL_ERROR_MESSAGE CLOB,
- USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
- TRANSIENT_OR_PERSISTENT SMALLINT,
- ERROR_CATEGORY VARCHAR(255),
- CORRECTIVE_ACTION VARCHAR(255),
- ACTIONABLE_GROUP VARCHAR(255),
- PRIMARY KEY(ERROR_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ EXPERIMENT_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE APPLICATION_INPUT
-(
- TASK_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE CLOB,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(TASK_ID,INPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE USER_CONFIGURATION_DATA (
+ EXPERIMENT_ID varchar(255),
+ AIRAVATA_AUTO_SCHEDULE BOOLEAN,
+ OVERRIDE_MANUAL_SCHEDULED_PARAMS BOOLEAN,
+ SHARE_EXPERIMENT_PUBLICALLY BOOLEAN,
+ THROTTLE_RESOURCES BOOLEAN,
+ USER_DN varchar(255),
+ GENERATE_CERT BOOLEAN,
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT int(11),
+ NODE_COUNT int(11),
+ NUMBER_OF_THREADS int(11),
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT int(11),
+ TOTAL_PHYSICAL_MEMORY int(11),
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE APPLICATION_OUTPUT
-(
- TASK_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE CLOB,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(TASK_ID,OUTPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
+CREATE VIEW EXPERIMENT_SUMMARY AS
+ select E.EXPERIMENT_ID AS EXPERIMENT_ID, E.PROJECT_ID AS PROJECT_ID,
+ E.USER_NAME AS USER_NAME, E.APPLICATION_ID AS APPLICATION_ID, E.EXPERIMENT_NAME AS EXPERIMENT_NAME,
+ E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
+ AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from ((EXPERIMENT E left join EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
+ left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where 1;
-CREATE TABLE NODE_INPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE VARCHAR(255),
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS (
+ PROCESS_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PROCESS_DETAIL CLOB,
+ APPLICATION_INTERFACE_ID varchar(255),
+ TASK_DAG varchar(255),
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE NODE_OUTPUT
+CREATE TABLE PROCESS_INPUT
(
- NODE_INSTANCE_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE VARCHAR(255),
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT BOOLEAN,
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER int(11),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_STAGED BOOLEAN,
+ PRIMARY KEY(PROCESS_ID,INPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE JOB_DETAIL
+CREATE TABLE PROCESS_OUTPUT
(
- JOB_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_DESCRIPTION CLOB NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
- JOBNAME VARCHAR (255),
- WORKING_DIR VARCHAR(255),
- PRIMARY KEY (TASK_ID, JOB_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_MOVEMENT BOOLEAN,
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(PROCESS_ID,OUTPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE DATA_TRANSFER_DETAIL
-(
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- TRANSFER_DESC VARCHAR(255) NOT NULL,
- PRIMARY KEY(TRANSFER_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-CREATE TABLE STATUS
-(
- STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- STATE VARCHAR(255),
- STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- STATUS_TYPE VARCHAR(255),
- PRIMARY KEY(STATUS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
- FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_STATUS (
+ PROCESS_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE CONFIG_DATA
-(
- EXPERIMENT_ID VARCHAR(255),
- AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
- OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
- SHARE_EXPERIMENT SMALLINT,
- USER_DN VARCHAR(255),
- GENERATE_CERT SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID)
-);
-CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
-(
- RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- RESOURCE_HOST_ID VARCHAR(255),
- CPU_COUNT INTEGER,
- NODE_COUNT INTEGER,
- NO_OF_THREADS INTEGER,
- QUEUE_NAME VARCHAR(255),
- WALLTIME_LIMIT INTEGER,
- JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- TOTAL_PHYSICAL_MEMORY INTEGER,
- COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
- CHESSIS_NAME VARCHAR(255),
- PRIMARY KEY(RESOURCE_SCHEDULING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ PROCESS_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
-(
- INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- WORKING_DIR_PARENT VARCHAR(255),
- UNIQUE_WORKING_DIR VARCHAR(255),
- STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
- CLEAN_AFTER_JOB SMALLINT,
- PRIMARY KEY(INPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
+ PROCESS_ID varchar(255),
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT int(11),
+ NODE_COUNT int(11),
+ NUMBER_OF_THREADS int(11),
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT int(11),
+ TOTAL_PHYSICAL_MEMORY int(11),
+ PRIMARY KEY (PROCESS_ID)
);
-CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
-(
- OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- OUTPUT_DATA_DIR VARCHAR(255),
- DATA_REG_URL VARCHAR (255),
- PERSIST_OUTPUT_DATA SMALLINT,
- PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK (
+ TASK_ID varchar(255),
+ TASK_TYPE varchar(255),
+ PARENT_PROCESS_ID varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ TASK_DETAIL CLOB,
+ TASK_INTERNAL_STORE CHAR,
+ PRIMARY KEY (TASK_ID),
+ FOREIGN KEY (PARENT_PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE QOS_PARAM
-(
- QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- START_EXECUTION_AT VARCHAR(255),
- EXECUTE_BEFORE VARCHAR(255),
- NO_OF_RETRIES INTEGER,
- PRIMARY KEY(QOS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK_STATUS (
+ TASK_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (TASK_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE COMMUNITY_USER
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
- PRIMARY KEY (GATEWAY_ID, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-CREATE TABLE CREDENTIALS
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- CREDENTIAL BLOB NOT NULL,
- PORTAL_USER_ID VARCHAR(256) NOT NULL,
- TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+CREATE TABLE EXPERIMENT_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ TASK_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-
-
http://git-wip-us.apache.org/repos/asf/airavata/blob/a5039dc0/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index 14d7fc8..4d19f51 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -27,18 +27,7 @@ CREATE TABLE GATEWAY
PRIMARY KEY (GATEWAY_ID)
);
-CREATE TABLE CONFIGURATION
-(
- CONFIG_KEY VARCHAR(255),
- CONFIG_VAL VARCHAR(255),
- EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- CATEGORY_ID VARCHAR (255),
- PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
-
-CREATE TABLE USERS
+CREATE TABLE USER
(
USER_NAME VARCHAR(255),
PASSWORD VARCHAR(255),
@@ -51,7 +40,7 @@ CREATE TABLE GATEWAY_WORKER
USER_NAME VARCHAR(255),
PRIMARY KEY (GATEWAY_ID, USER_NAME),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT
@@ -64,7 +53,7 @@ CREATE TABLE PROJECT
CREATION_TIME TIMESTAMP DEFAULT NOW(),
PRIMARY KEY (PROJECT_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT_USER
@@ -73,320 +62,221 @@ CREATE TABLE PROJECT_USER
USER_NAME VARCHAR(255),
PRIMARY KEY (PROJECT_ID,USER_NAME),
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
);
-CREATE TABLE EXPERIMENT
-(
- EXPERIMENT_ID VARCHAR(255),
- GATEWAY_ID VARCHAR(255),
- EXECUTION_USER VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255) NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- EXPERIMENT_NAME VARCHAR(255) NOT NULL,
- EXPERIMENT_DESCRIPTION VARCHAR(255),
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- WORKFLOW_TEMPLATE_ID VARCHAR(255),
- WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
- WORKFLOW_EXECUTION_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- GATEWAY_EXECUTION_ID VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID),
- FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
- FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT (
+ EXPERIMENT_ID varchar(255),
+ PROJECT_ID varchar(255),
+ EXPERIMENT_TYPE varchar(255),
+ USER_NAME varchar(255),
+ APPLICATION_ID varchar(255),
+ EXPERIMENT_NAME varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ DESCRIPTION varchar(255),
+ EXECUTION_ID varchar(255),
+ GATEWAY_EXECUTION_ID varchar(255),
+ ENABLE_EMAIL_NOTIFICATION tinyint(1),
+ EMAIL_ADDRESSES text,
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
);
+
CREATE TABLE EXPERIMENT_INPUT
(
- EXPERIMENT_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE LONGTEXT,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE text,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT tinyint(1),
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER int(11),
+ IS_REQUIRED tinyint(1),
+ REQUIRED_TO_ADDED_TO_CMD tinyint(1),
+ DATA_STAGED tinyint(1),
+ PRIMARY KEY(EXPERIMENT_ID,INPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT_OUTPUT
(
- EXPERIMENT_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE LONGTEXT,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED tinyint(1),
+ REQUIRED_TO_ADDED_TO_CMD tinyint(1),
+ DATA_MOVEMENT tinyint(1),
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(EXPERIMENT_ID,OUTPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE WORKFLOW_NODE_DETAIL
-(
- EXPERIMENT_ID VARCHAR(255) NOT NULL,
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- NODE_NAME VARCHAR(255) NOT NULL,
- EXECUTION_UNIT VARCHAR(255) NOT NULL,
- EXECUTION_UNIT_DATA VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-CREATE TABLE TASK_DETAIL
-(
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- APPLICATION_DEPLOYMENT_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- PRIMARY KEY(TASK_ID),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_STATUS (
+ EXPERIMENT_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE NOTIFICATION_EMAIL
-(
- EMAIL_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- EMAIL_ADDRESS VARCHAR(255),
- PRIMARY KEY(EMAIL_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-CREATE TABLE APPLICATION_INPUT
-(
- TASK_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE LONGTEXT,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(TASK_ID,INPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ EXPERIMENT_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE text,
+ USER_FRIENDLY_MESSAGE text,
+ TRANSIENT_OR_PERSISTENT tinyint(1),
+ ROOT_CAUSE_ERROR_ID_LIST text,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE APPLICATION_OUTPUT
-(
- TASK_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE LONGTEXT,
- DATA_MOVEMENT SMALLINT,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(TASK_ID,OUTPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE USER_CONFIGURATION_DATA (
+ EXPERIMENT_ID varchar(255),
+ AIRAVATA_AUTO_SCHEDULE tinyint(1),
+ OVERRIDE_MANUAL_SCHEDULED_PARAMS tinyint(1),
+ SHARE_EXPERIMENT_PUBLICALLY tinyint(1),
+ THROTTLE_RESOURCES tinyint(1),
+ USER_DN varchar(255),
+ GENERATE_CERT tinyint(1),
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT int(11),
+ NODE_COUNT int(11),
+ NUMBER_OF_THREADS int(11),
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT int(11),
+ TOTAL_PHYSICAL_MEMORY int(11),
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE NODE_INPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- METADATA VARCHAR(255),
- VALUE VARCHAR(255),
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
+CREATE VIEW EXPERIMENT_SUMMARY AS
+ select E.EXPERIMENT_ID AS EXPERIMENT_ID, E.PROJECT_ID AS PROJECT_ID,
+ E.USER_NAME AS USER_NAME, E.APPLICATION_ID AS APPLICATION_ID, E.EXPERIMENT_NAME AS EXPERIMENT_NAME,
+ E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
+ AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from ((EXPERIMENT E left join EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
+ left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where 1;
-CREATE TABLE NODE_OUTPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE VARCHAR(255),
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS (
+ PROCESS_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ PROCESS_DETAIL text,
+ APPLICATION_INTERFACE_ID varchar(255),
+ TASK_DAG varchar(255),
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE JOB_DETAIL
+CREATE TABLE PROCESS_INPUT
(
- JOB_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_DESCRIPTION LONGTEXT NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
- JOBNAME VARCHAR (255),
- WORKING_DIR VARCHAR(255),
- PRIMARY KEY (TASK_ID, JOB_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE text,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT tinyint(1),
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER int(11),
+ IS_REQUIRED tinyint(1),
+ REQUIRED_TO_ADDED_TO_CMD tinyint(1),
+ DATA_STAGED tinyint(1),
+ PRIMARY KEY(PROCESS_ID,INPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE DATA_TRANSFER_DETAIL
+CREATE TABLE PROCESS_OUTPUT
(
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- TRANSFER_DESC VARCHAR(255) NOT NULL,
- PRIMARY KEY(TRANSFER_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED tinyint(1),
+ REQUIRED_TO_ADDED_TO_CMD tinyint(1),
+ DATA_MOVEMENT tinyint(1),
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(PROCESS_ID,OUTPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE ERROR_DETAIL
-(
- ERROR_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
- ACTUAL_ERROR_MESSAGE LONGTEXT,
- USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
- TRANSIENT_OR_PERSISTENT SMALLINT,
- ERROR_CATEGORY VARCHAR(255),
- CORRECTIVE_ACTION VARCHAR(255),
- ACTIONABLE_GROUP VARCHAR(255),
- PRIMARY KEY(ERROR_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-CREATE TABLE STATUS
-(
- STATUS_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- STATE VARCHAR(255),
- STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00' ON UPDATE now(),
- STATUS_TYPE VARCHAR(255),
- PRIMARY KEY(STATUS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
- FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_STATUS (
+ PROCESS_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE CONFIG_DATA
-(
- EXPERIMENT_ID VARCHAR(255),
- AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
- OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
- SHARE_EXPERIMENT SMALLINT,
- USER_DN VARCHAR(255),
- GENERATE_CERT SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ PROCESS_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE text,
+ USER_FRIENDLY_MESSAGE text,
+ TRANSIENT_OR_PERSISTENT tinyint(1),
+ ROOT_CAUSE_ERROR_ID_LIST text,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
-(
- RESOURCE_SCHEDULING_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- RESOURCE_HOST_ID VARCHAR(255),
- CPU_COUNT INTEGER,
- NODE_COUNT INTEGER,
- NO_OF_THREADS INTEGER,
- QUEUE_NAME VARCHAR(255),
- WALLTIME_LIMIT INTEGER,
- JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- TOTAL_PHYSICAL_MEMORY INTEGER,
- COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
- CHESSIS_NAME VARCHAR(255),
- PRIMARY KEY(RESOURCE_SCHEDULING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
+ PROCESS_ID varchar(255),
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT int(11),
+ NODE_COUNT int(11),
+ NUMBER_OF_THREADS int(11),
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT int(11),
+ TOTAL_PHYSICAL_MEMORY int(11),
+ PRIMARY KEY (PROCESS_ID)
);
-CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
-(
- INPUT_DATA_HANDLING_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- WORKING_DIR_PARENT VARCHAR(255),
- UNIQUE_WORKING_DIR VARCHAR(255),
- STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
- CLEAN_AFTER_JOB SMALLINT,
- PRIMARY KEY(INPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK (
+ TASK_ID varchar(255),
+ TASK_TYPE varchar(255),
+ PARENT_PROCESS_ID varchar(255),
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ TASK_DETAIL text,
+ TASK_INTERNAL_STORE tinyint(4),
+ PRIMARY KEY (TASK_ID),
+ FOREIGN KEY (PARENT_PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
-(
- OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- OUTPUT_DATA_DIR VARCHAR(255),
- DATA_REG_URL VARCHAR (255),
- PERSIST_OUTPUT_DATA SMALLINT,
- PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK_STATUS (
+ TASK_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ REASON varchar(255),
+ PRIMARY KEY (TASK_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE QOS_PARAM
-(
- QOS_ID INTEGER NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- START_EXECUTION_AT VARCHAR(255),
- EXECUTE_BEFORE VARCHAR(255),
- NO_OF_RETRIES INTEGER,
- PRIMARY KEY(QOS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE COMMUNITY_USER
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
- PRIMARY KEY (GATEWAY_ID, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-CREATE TABLE CREDENTIALS
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- CREDENTIAL BLOB NOT NULL,
- PORTAL_USER_ID VARCHAR(256) NOT NULL,
- TIME_PERSISTED TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
- PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+CREATE TABLE EXPERIMENT_ERROR (
+ ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
+ TASK_ID varchar(255) NOT NULL,
+ CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE text,
+ USER_FRIENDLY_MESSAGE text,
+ TRANSIENT_OR_PERSISTENT tinyint(1),
+ ROOT_CAUSE_ERROR_ID_LIST text,
+ PRIMARY KEY (ERROR_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-
-
[10/11] airavata git commit: Fixing minor issues and fixing the
registry test cases
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index b8d8b3c..7c31498 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -21,15 +21,20 @@
package org.apache.airavata.registry.core.experiment.catalog.impl;
-import org.apache.airavata.common.utils.AiravataUtils;
import org.apache.airavata.model.application.io.InputDataObjectType;
import org.apache.airavata.model.application.io.OutputDataObjectType;
import org.apache.airavata.model.commons.ErrorModel;
-import org.apache.airavata.model.commons.airavata_commonsConstants;
-import org.apache.airavata.model.experiment.*;
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.experiment.ExperimentStatistics;
+import org.apache.airavata.model.experiment.ExperimentSummaryModel;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
import org.apache.airavata.model.job.JobModel;
+import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
-import org.apache.airavata.model.status.*;
+import org.apache.airavata.model.status.ExperimentState;
+import org.apache.airavata.model.status.ExperimentStatus;
+import org.apache.airavata.model.status.JobStatus;
+import org.apache.airavata.model.status.TaskStatus;
import org.apache.airavata.model.task.TaskModel;
import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
@@ -41,12 +46,14 @@ import org.apache.airavata.registry.cpi.ExperimentCatalogModelType;
import org.apache.airavata.registry.cpi.RegistryException;
import org.apache.airavata.registry.cpi.ResultOrderType;
import org.apache.airavata.registry.cpi.utils.Constants;
-import org.apache.airavata.registry.cpi.utils.StatusType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.Timestamp;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
public class ExperimentRegistry {
private GatewayResource gatewayResource;
@@ -64,122 +71,124 @@ public class ExperimentRegistry {
}
public String addExperiment(ExperimentModel experiment, String gatewayId) throws RegistryException {
- String experimentID;
- try {
- if (!ExpCatResourceUtils.isUserExist(experiment.getUserName())) {
- ExpCatResourceUtils.addUser(experiment.getUserName(), null);
- }
-
- experimentID = getExperimentID(experiment.getExperimentName());
- experiment.setExperimentId(experimentID);
- ExperimentResource experimentResource = new ExperimentResource();
- experimentResource.setExpID(experimentID);
- experimentResource.setExpName(experiment.getExperimentName());
- experimentResource.setExecutionUser(experiment.getUserName());
- experimentResource.setGatewayId(gatewayId);
- experimentResource.setGatewayExecutionId(experiment.getGatewayExecutionId());
- experimentResource.setEnableEmailNotifications(experiment.isEnableEmailNotification());
- if (!workerResource.isProjectExists(experiment.getProjectId())) {
- logger.error("Project does not exist in the system..");
- throw new Exception("Project does not exist in the system, Please create the project first...");
- }
- experimentResource.setProjectId(experiment.getProjectId());
- experimentResource.setCreationTime(AiravataUtils.getTime(experiment.getCreationTime()));
- experimentResource.setDescription(experiment.getDescription());
- experimentResource.setApplicationId(experiment.getExecutionId());
- experimentResource.save();
-
- List<String> emailAddresses = experiment.getEmailAddresses();
- if (emailAddresses != null && !emailAddresses.isEmpty()){
- for (String email : emailAddresses){
- NotificationEmailResource emailResource = new NotificationEmailResource();
- emailResource.setExperimentId(experimentID);
- emailResource.setEmailAddress(email);
- emailResource.save();
- }
- }
-
- List<InputDataObjectType> experimentInputs = experiment.getExperimentInputs();
- if (experimentInputs != null) {
- addExpInputs(experimentInputs, experimentResource);
- }
-
- UserConfigurationDataModel userConfigurationData = experiment.getUserConfigurationData();
- if (userConfigurationData != null) {
- addUserConfigData(userConfigurationData, experimentID);
- }
-
- List<OutputDataObjectType> experimentOutputs = experiment.getExperimentOutputs();
- if (experimentOutputs != null && !experimentOutputs.isEmpty()) {
- //TODO: short change.
-// for (DataObjectType output : experimentOutputs){
-// output.setValue("");
-// }
- addExpOutputs(experimentOutputs, experimentID);
- }
-
-// ExperimentStatus experimentStatus = experiment.getExperimentStatus();
-// if (experimentStatus != null){
-// updateExperimentStatus(experimentStatus, experimentID);
-// }else {
- ExperimentStatus experimentStatus = new ExperimentStatus();
- experimentStatus.setState(ExperimentState.CREATED);
- updateExperimentStatus(experimentStatus, experimentID);
-// }
-
-// List<WorkflowNodeDetails> workflowNodeDetailsList = experiment.getWorkflowNodeDetailsList();
-// if (workflowNodeDetailsList != null && !workflowNodeDetailsList.isEmpty()) {
-// for (WorkflowNodeDetails wf : workflowNodeDetailsList) {
-// addWorkflowNodeDetails(wf, experimentID);
+// String experimentID;
+// try {
+// if (!ExpCatResourceUtils.isUserExist(experiment.getUserName())) {
+// ExpCatResourceUtils.addUser(experiment.getUserName(), null);
+// }
+//
+// experimentID = getExperimentID(experiment.getExperimentName());
+// experiment.setExperimentId(experimentID);
+// ExperimentResource experimentResource = new ExperimentResource();
+// experimentResource.setExpID(experimentID);
+// experimentResource.setExpName(experiment.getExperimentName());
+// experimentResource.setExecutionUser(experiment.getUserName());
+// experimentResource.setGatewayId(gatewayId);
+// experimentResource.setGatewayExecutionId(experiment.getGatewayExecutionId());
+// experimentResource.setEnableEmailNotifications(experiment.isEnableEmailNotification());
+// if (!workerResource.isProjectExists(experiment.getProjectId())) {
+// logger.error("Project does not exist in the system..");
+// throw new Exception("Project does not exist in the system, Please create the project first...");
+// }
+// experimentResource.setProjectId(experiment.getProjectId());
+// experimentResource.setCreationTime(AiravataUtils.getTime(experiment.getCreationTime()));
+// experimentResource.setDescription(experiment.getDescription());
+// experimentResource.setApplicationId(experiment.getExecutionId());
+// experimentResource.save();
+//
+// List<String> emailAddresses = experiment.getEmailAddresses();
+// if (emailAddresses != null && !emailAddresses.isEmpty()){
+// for (String email : emailAddresses){
+// NotificationEmailResource emailResource = new NotificationEmailResource();
+// emailResource.setExperimentId(experimentID);
+// emailResource.setEmailAddress(email);
+// emailResource.save();
// }
// }
- List<ErrorModel> errors = experiment.getErrors();
- if (errors != null && !errors.isEmpty()) {
- for (ErrorModel errror : errors) {
- addErrorDetails(errror, experimentID);
- }
- }
- } catch (Exception e) {
- logger.error("Error while saving experiment to registry", e);
- throw new RegistryException(e);
- }
- return experimentID;
- }
-
- public String addUserConfigData(UserConfigurationDataModel configurationData, String experimentID) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment(experimentID);
- ConfigDataResource configData = (ConfigDataResource) experiment.create(ResourceType.CONFIG_DATA);
- configData.setExperimentId(experimentID);
- configData.setAiravataAutoSchedule(configurationData.isAiravataAutoSchedule());
- configData.setOverrideManualParams(configurationData.isOverrideManualScheduledParams());
- configData.setShareExp(configurationData.isShareExperimentPublicly());
- configData.setUserDn(configurationData.getUserDN());
- configData.setGenerateCert(configurationData.isGenerateCert());
- configData.save();
- ComputationalResourceSchedulingModel resourceScheduling = configurationData.getComputationalResourceScheduling();
- if (resourceScheduling != null) {
- addComputationScheduling(resourceScheduling, experiment);
- }
-// AdvancedInputDataHandling inputDataHandling = configurationData.getAdvanceInputDataHandling();
-// if (inputDataHandling != null) {
-// addInputDataHandling(inputDataHandling, experiment);
+//
+// List<InputDataObjectType> experimentInputs = experiment.getExperimentInputs();
+// if (experimentInputs != null) {
+// addExpInputs(experimentInputs, experimentResource);
// }
//
-// AdvancedOutputDataHandling outputDataHandling = configurationData.getAdvanceOutputDataHandling();
-// if (outputDataHandling != null) {
-// addOutputDataHandling(outputDataHandling, experiment);
+// UserConfigurationDataModel userConfigurationData = experiment.getUserConfigurationData();
+// if (userConfigurationData != null) {
+// addUserConfigData(userConfigurationData, experimentID);
// }
//
-// QualityOfServiceParams qosParams = configurationData.getQosParams();
-// if (qosParams != null) {
-// addQosParams(qosParams, experiment);
+// List<OutputDataObjectType> experimentOutputs = experiment.getExperimentOutputs();
+// if (experimentOutputs != null && !experimentOutputs.isEmpty()) {
+// //TODO: short change.
+//// for (DataObjectType output : experimentOutputs){
+//// output.setValue("");
+//// }
+// addExpOutputs(experimentOutputs, experimentID);
// }
- } catch (Exception e) {
- logger.error("Unable to save user config data", e);
- throw new RegistryException(e);
- }
- return experimentID;
+//
+//// ExperimentStatus experimentStatus = experiment.getExperimentStatus();
+//// if (experimentStatus != null){
+//// updateExperimentStatus(experimentStatus, experimentID);
+//// }else {
+// ExperimentStatus experimentStatus = new ExperimentStatus();
+// experimentStatus.setState(ExperimentState.CREATED);
+// updateExperimentStatus(experimentStatus, experimentID);
+//// }
+//
+//// List<WorkflowNodeDetails> workflowNodeDetailsList = experiment.getWorkflowNodeDetailsList();
+//// if (workflowNodeDetailsList != null && !workflowNodeDetailsList.isEmpty()) {
+//// for (WorkflowNodeDetails wf : workflowNodeDetailsList) {
+//// addWorkflowNodeDetails(wf, experimentID);
+//// }
+//// }
+// List<ErrorModel> errors = experiment.getErrors();
+// if (errors != null && !errors.isEmpty()) {
+// for (ErrorModel errror : errors) {
+// addErrorDetails(errror, experimentID);
+// }
+// }
+// } catch (Exception e) {
+// logger.error("Error while saving experiment to registry", e);
+// throw new RegistryException(e);
+// }
+// return experimentID;
+ return null;
+ }
+
+ public String addUserConfigData(UserConfigurationDataModel configurationData, String experimentID) throws RegistryException {
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment(experimentID);
+// ConfigDataResource configData = (ConfigDataResource) experiment.create(ResourceType.CONFIG_DATA);
+// configData.setExperimentId(experimentID);
+// configData.setAiravataAutoSchedule(configurationData.isAiravataAutoSchedule());
+// configData.setOverrideManualParams(configurationData.isOverrideManualScheduledParams());
+// configData.setShareExp(configurationData.isShareExperimentPublicly());
+// configData.setUserDn(configurationData.getUserDN());
+// configData.setGenerateCert(configurationData.isGenerateCert());
+// configData.save();
+// ComputationalResourceSchedulingModel resourceScheduling = configurationData.getComputationalResourceScheduling();
+// if (resourceScheduling != null) {
+// addComputationScheduling(resourceScheduling, experiment);
+// }
+//// AdvancedInputDataHandling inputDataHandling = configurationData.getAdvanceInputDataHandling();
+//// if (inputDataHandling != null) {
+//// addInputDataHandling(inputDataHandling, experiment);
+//// }
+////
+//// AdvancedOutputDataHandling outputDataHandling = configurationData.getAdvanceOutputDataHandling();
+//// if (outputDataHandling != null) {
+//// addOutputDataHandling(outputDataHandling, experiment);
+//// }
+////
+//// QualityOfServiceParams qosParams = configurationData.getQosParams();
+//// if (qosParams != null) {
+//// addQosParams(qosParams, experiment);
+//// }
+// } catch (Exception e) {
+// logger.error("Unable to save user config data", e);
+// throw new RegistryException(e);
+// }
+// return experimentID;
+ return null;
}
// public void addQosParams(QualityOfServiceParams qosParams, ExperimentCatResource resource) throws RegistryException {
@@ -262,251 +271,255 @@ public class ExperimentRegistry {
// }
public void addComputationScheduling(ComputationalResourceSchedulingModel resourceScheduling, ExperimentCatResource resource) throws RegistryException {
- ComputationSchedulingResource cmsr = new ComputationSchedulingResource();
- try {
- if (resource instanceof ExperimentResource) {
- ExperimentResource experiment = (ExperimentResource) resource;
- cmsr.setExperimentId(experiment.getExpID());
- }
- if (resource instanceof TaskDetailResource) {
- TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
- String nodeId = taskDetailResource.getNodeId();
- ExperimentResource experimentResource = new ExperimentResource();
- WorkflowNodeDetailResource workflowNode = experimentResource.getWorkflowNode(nodeId);
- cmsr.setExperimentId(workflowNode.getExperimentId());
- cmsr.setTaskId(taskDetailResource.getTaskId());
- }
- cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
- cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
- cmsr.setNodeCount(resourceScheduling.getNodeCount());
- cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
- cmsr.setQueueName(resourceScheduling.getQueueName());
- cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
- cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
- cmsr.setChessisName(resourceScheduling.getChessisNumber());
- cmsr.save();
- } catch (Exception e) {
- logger.error("Unable to save computational scheduling data", e);
- throw new RegistryException(e);
- }
+// ComputationSchedulingResource cmsr = new ComputationSchedulingResource();
+// try {
+// if (resource instanceof ExperimentResource) {
+// ExperimentResource experiment = (ExperimentResource) resource;
+// cmsr.setExperimentId(experiment.getExpID());
+// }
+// if (resource instanceof TaskDetailResource) {
+// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
+// String nodeId = taskDetailResource.getNodeId();
+// ExperimentResource experimentResource = new ExperimentResource();
+// WorkflowNodeDetailResource workflowNode = experimentResource.getWorkflowNode(nodeId);
+// cmsr.setExperimentId(workflowNode.getExperimentId());
+// cmsr.setTaskId(taskDetailResource.getTaskId());
+// }
+// cmsr.setResourceHostId(resourceScheduling.getResourceHostId());
+// cmsr.setCpuCount(resourceScheduling.getTotalCPUCount());
+// cmsr.setNodeCount(resourceScheduling.getNodeCount());
+// cmsr.setNumberOfThreads(resourceScheduling.getNumberOfThreads());
+// cmsr.setQueueName(resourceScheduling.getQueueName());
+// cmsr.setWalltimeLimit(resourceScheduling.getWallTimeLimit());
+// cmsr.setPhysicalMemory(resourceScheduling.getTotalPhysicalMemory());
+// cmsr.setChessisName(resourceScheduling.getChessisNumber());
+// cmsr.save();
+// } catch (Exception e) {
+// logger.error("Unable to save computational scheduling data", e);
+// throw new RegistryException(e);
+// }
}
public void addExpInputs(List<InputDataObjectType> exInputs, ExperimentResource experimentResource) throws RegistryException {
- try {
- for (InputDataObjectType input : exInputs) {
- ExperimentInputResource resource = (ExperimentInputResource) experimentResource.create(ResourceType.EXPERIMENT_INPUT);
- resource.setExperimentId(experimentResource.getExpID());
- resource.setExperimentKey(input.getName());
- resource.setValue(input.getValue());
- if (input.getType() != null) {
- resource.setDataType(input.getType().toString());
- }
- resource.setMetadata(input.getMetaData());
- resource.setAppArgument(input.getApplicationArgument());
- resource.setInputOrder(input.getInputOrder());
- resource.setRequired(input.isIsRequired());
- resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Unable to save experiment inputs", e);
- throw new RegistryException(e);
- }
+// try {
+// for (InputDataObjectType input : exInputs) {
+// ExperimentInputResource resource = (ExperimentInputResource) experimentResource.create(ResourceType.EXPERIMENT_INPUT);
+// resource.setExperimentId(experimentResource.getExpID());
+// resource.setExperimentKey(input.getName());
+// resource.setValue(input.getValue());
+// if (input.getType() != null) {
+// resource.setDataType(input.getType().toString());
+// }
+// resource.setMetadata(input.getMetaData());
+// resource.setAppArgument(input.getApplicationArgument());
+// resource.setInputOrder(input.getInputOrder());
+// resource.setRequired(input.isIsRequired());
+// resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
+// resource.save();
+// }
+// } catch (Exception e) {
+// logger.error("Unable to save experiment inputs", e);
+// throw new RegistryException(e);
+// }
}
public void updateExpInputs(List<InputDataObjectType> exInputs, ExperimentResource experimentResource) throws RegistryException {
- try {
- List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
- for (InputDataObjectType input : exInputs) {
- for (ExperimentInputResource exinput : experimentInputs) {
- if (exinput.getExperimentKey().equals(input.getName())) {
- exinput.setValue(input.getValue());
- if (input.getType() != null) {
- exinput.setDataType(input.getType().toString());
- }
- exinput.setMetadata(input.getMetaData());
- exinput.setAppArgument(input.getApplicationArgument());
- exinput.setInputOrder(input.getInputOrder());
- exinput.setRequired(input.isIsRequired());
- exinput.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- exinput.save();
- }
- }
- }
- } catch (Exception e) {
- logger.error("Unable to update experiment inputs", e);
- throw new RegistryException(e);
- }
+// try {
+// List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
+// for (InputDataObjectType input : exInputs) {
+// for (ExperimentInputResource exinput : experimentInputs) {
+// if (exinput.getExperimentKey().equals(input.getName())) {
+// exinput.setValue(input.getValue());
+// if (input.getType() != null) {
+// exinput.setDataType(input.getType().toString());
+// }
+// exinput.setMetadata(input.getMetaData());
+// exinput.setAppArgument(input.getApplicationArgument());
+// exinput.setInputOrder(input.getInputOrder());
+// exinput.setRequired(input.isIsRequired());
+// exinput.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
+// exinput.save();
+// }
+// }
+// }
+// } catch (Exception e) {
+// logger.error("Unable to update experiment inputs", e);
+// throw new RegistryException(e);
+// }
}
public String addExpOutputs(List<OutputDataObjectType> exOutput, String expId) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment(expId);
- for (OutputDataObjectType output : exOutput) {
- ExperimentOutputResource resource = (ExperimentOutputResource) experiment.create(ResourceType.EXPERIMENT_OUTPUT);
- resource.setExperimentId(expId);
- resource.setExperimentKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.get());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding experiment outputs...", e);
- throw new RegistryException(e);
- }
- return expId;
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment(expId);
+// for (OutputDataObjectType output : exOutput) {
+// ExperimentOutputResource resource = (ExperimentOutputResource) experiment.create(ResourceType.EXPERIMENT_OUTPUT);
+// resource.setExperimentId(expId);
+// resource.setExperimentKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.get());
+// resource.save();
+// }
+// } catch (Exception e) {
+// logger.error("Error while adding experiment outputs...", e);
+// throw new RegistryException(e);
+// }
+// return expId;
+ return null;
}
public void updateExpOutputs(List<OutputDataObjectType> exOutput, String expId) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment(expId);
- List<ExperimentOutputResource> existingExpOutputs = experiment.getExperimentOutputs();
- for (OutputDataObjectType output : exOutput) {
- for (ExperimentOutputResource resource : existingExpOutputs) {
- if (resource.getExperimentKey().equals(output.getName())) {
- resource.setExperimentId(expId);
- resource.setExperimentKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.getMetaData());
- resource.save();
- }
- }
- }
- } catch (Exception e) {
- logger.error("Error while updating experiment outputs", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment(expId);
+// List<ExperimentOutputResource> existingExpOutputs = experiment.getExperimentOutputs();
+// for (OutputDataObjectType output : exOutput) {
+// for (ExperimentOutputResource resource : existingExpOutputs) {
+// if (resource.getExperimentKey().equals(output.getName())) {
+// resource.setExperimentId(expId);
+// resource.setExperimentKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.getMetaData());
+// resource.save();
+// }
+// }
+// }
+// } catch (Exception e) {
+// logger.error("Error while updating experiment outputs", e);
+// throw new RegistryException(e);
+// }
}
public String addNodeOutputs(List<OutputDataObjectType> wfOutputs, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment((String) ids.getTopLevelIdentifier());
- WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getSecondLevelIdentifier());
- for (OutputDataObjectType output : wfOutputs) {
- NodeOutputResource resource = (NodeOutputResource) workflowNode.create(ResourceType.NODE_OUTPUT);
- resource.setNodeId(workflowNode.getNodeInstanceId());
- resource.setOutputKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.getMetaData());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding node outputs...", e);
- throw new RegistryException(e);
- }
- return (String) ids.getSecondLevelIdentifier();
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment((String) ids.getTopLevelIdentifier());
+// WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getSecondLevelIdentifier());
+// for (OutputDataObjectType output : wfOutputs) {
+// NodeOutputResource resource = (NodeOutputResource) workflowNode.create(ResourceType.NODE_OUTPUT);
+// resource.setNodeId(workflowNode.getNodeInstanceId());
+// resource.setOutputKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.getMetaData());
+// resource.save();
+// }
+// } catch (Exception e) {
+// logger.error("Error while adding node outputs...", e);
+// throw new RegistryException(e);
+// }
+// return (String) ids.getSecondLevelIdentifier();
+ return null;
}
public void updateNodeOutputs(List<OutputDataObjectType> wfOutputs, String nodeId) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode(nodeId);
- List<NodeOutputResource> nodeOutputs = workflowNode.getNodeOutputs();
- for (OutputDataObjectType output : wfOutputs) {
- for (NodeOutputResource resource : nodeOutputs) {
- resource.setNodeId(workflowNode.getNodeInstanceId());
- resource.setOutputKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.getMetaData());
- resource.save();
- }
- }
- } catch (Exception e) {
- logger.error("Error while updating node outputs...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode(nodeId);
+// List<NodeOutputResource> nodeOutputs = workflowNode.getNodeOutputs();
+// for (OutputDataObjectType output : wfOutputs) {
+// for (NodeOutputResource resource : nodeOutputs) {
+// resource.setNodeId(workflowNode.getNodeInstanceId());
+// resource.setOutputKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.getMetaData());
+// resource.save();
+// }
+// }
+// } catch (Exception e) {
+// logger.error("Error while updating node outputs...", e);
+// throw new RegistryException(e);
+// }
}
public String addApplicationOutputs(List<OutputDataObjectType> appOutputs, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getTopLevelIdentifier());
- TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getSecondLevelIdentifier());
- for (OutputDataObjectType output : appOutputs) {
- ApplicationOutputResource resource = (ApplicationOutputResource) taskDetail.create(ResourceType.APPLICATION_OUTPUT);
- resource.setTaskId(taskDetail.getTaskId());
- resource.setOutputKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.getMetaData());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding application outputs...", e);
- throw new RegistryException(e);
- }
- return (String) ids.getSecondLevelIdentifier();
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getTopLevelIdentifier());
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getSecondLevelIdentifier());
+// for (OutputDataObjectType output : appOutputs) {
+// ApplicationOutputResource resource = (ApplicationOutputResource) taskDetail.create(ResourceType.APPLICATION_OUTPUT);
+// resource.setTaskId(taskDetail.getTaskId());
+// resource.setOutputKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.getMetaData());
+// resource.save();
+// }
+// } catch (Exception e) {
+// logger.error("Error while adding application outputs...", e);
+// throw new RegistryException(e);
+// }
+// return (String) ids.getSecondLevelIdentifier();
+ return null;
}
public String updateExperimentStatus(ExperimentStatus experimentStatus, String expId) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment(expId);
- StatusResource status = experiment.getExperimentStatus();
- if (status == null) {
- status = (StatusResource) experiment.create(ResourceType.STATUS);
- }
- status.setExperimentId(expId);
- status.setStatusUpdateTime(AiravataUtils.getTime(experimentStatus.getTimeOfStateChange()));
-// if (status.getState() == null) {
-// status.setState(ExperimentState.UNKNOWN.name());
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment(expId);
+// StatusResource status = experiment.getExperimentStatus();
+// if (status == null) {
+// status = (StatusResource) experiment.create(ResourceType.STATUS);
+// }
+// status.setExperimentId(expId);
+// status.setStatusUpdateTime(AiravataUtils.getTime(experimentStatus.getTimeOfStateChange()));
+//// if (status.getState() == null) {
+//// status.setState(ExperimentState.UNKNOWN.name());
+//// }
+// if (isValidStatusTransition(ExperimentState.valueOf(status.getState()), experimentStatus.getState())) {
+// status.setState(experimentStatus.getState().toString());
+// status.setStatusType(StatusType.EXPERIMENT.toString());
+// status.save();
+// logger.debug(expId, "Updated experiment {} status to {}.", expId, experimentStatus.toString());
// }
- if (isValidStatusTransition(ExperimentState.valueOf(status.getState()), experimentStatus.getState())) {
- status.setState(experimentStatus.getState().toString());
- status.setStatusType(StatusType.EXPERIMENT.toString());
- status.save();
- logger.debug(expId, "Updated experiment {} status to {}.", expId, experimentStatus.toString());
- }
- } catch (Exception e) {
- logger.error(expId, "Error while updating experiment status...", e);
- throw new RegistryException(e);
- }
- return expId;
+// } catch (Exception e) {
+// logger.error(expId, "Error while updating experiment status...", e);
+// throw new RegistryException(e);
+// }
+// return expId;
+ return null;
}
// public String addWorkflowNodeStatus(WorkflowNodeStatus status, CompositeIdentifier ids) throws RegistryException {
@@ -554,53 +567,54 @@ public class ExperimentRegistry {
// }
public String addTaskStatus(TaskStatus status, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getTopLevelIdentifier());
- TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getSecondLevelIdentifier());
- StatusResource statusResource = (StatusResource) workflowNode.create(ResourceType.STATUS);
- statusResource.setExperimentId(workflowNode.getExperimentId());
- statusResource.setNodeId(workflowNode.getNodeInstanceId());
- statusResource.setTaskId(taskDetail.getTaskId());
- statusResource.setStatusType(StatusType.TASK.toString());
- statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
- if (status.getState() == null) {
-// statusResource.setState(TaskState.UNKNOWN.toString());
- } else {
- statusResource.setState(status.getState().toString());
- }
- statusResource.save();
- return String.valueOf(statusResource.getStatusId());
- } catch (Exception e) {
- logger.error("Error while adding task status...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getTopLevelIdentifier());
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getSecondLevelIdentifier());
+// StatusResource statusResource = (StatusResource) workflowNode.create(ResourceType.STATUS);
+// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setNodeId(workflowNode.getNodeInstanceId());
+// statusResource.setTaskId(taskDetail.getTaskId());
+// statusResource.setStatusType(StatusType.TASK.toString());
+// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
+// if (status.getState() == null) {
+//// statusResource.setState(TaskState.UNKNOWN.toString());
+// } else {
+// statusResource.setState(status.getState().toString());
+// }
+// statusResource.save();
+// return String.valueOf(statusResource.getStatusId());
+// } catch (Exception e) {
+// logger.error("Error while adding task status...", e);
+// throw new RegistryException(e);
+// }
+ return null;
}
public void updateTaskStatus(TaskStatus status, String taskId) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
- StatusResource statusResource;
- if (taskDetail.isTaskStatusExist(taskId)) {
- workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
- statusResource = workflowNode.getTaskStatus(taskId);
- } else {
- statusResource = (StatusResource) taskDetail.create(ResourceType.STATUS);
- }
- statusResource.setExperimentId(workflowNode.getExperimentId());
- statusResource.setNodeId(workflowNode.getNodeInstanceId());
- statusResource.setTaskId(taskId);
- statusResource.setStatusType(StatusType.TASK.toString());
- statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
- statusResource.setState(status.getState().toString());
- statusResource.save();
- logger.info(taskId, "Updated task {} status to {}.", taskId, status.toString());
- } catch (Exception e) {
- logger.error(taskId, "Error while updating task status to " + status.toString() + "...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
+// StatusResource statusResource;
+// if (taskDetail.isTaskStatusExist(taskId)) {
+// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
+// statusResource = workflowNode.getTaskStatus(taskId);
+// } else {
+// statusResource = (StatusResource) taskDetail.create(ResourceType.STATUS);
+// }
+// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setNodeId(workflowNode.getNodeInstanceId());
+// statusResource.setTaskId(taskId);
+// statusResource.setStatusType(StatusType.TASK.toString());
+// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
+// statusResource.setState(status.getState().toString());
+// statusResource.save();
+// logger.info(taskId, "Updated task {} status to {}.", taskId, status.toString());
+// } catch (Exception e) {
+// logger.error(taskId, "Error while updating task status to " + status.toString() + "...", e);
+// throw new RegistryException(e);
+// }
}
/**
@@ -609,52 +623,54 @@ public class ExperimentRegistry {
* @return status id
*/
public String addJobStatus(JobStatus status, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
- workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
- JobDetailResource jobDetail = taskDetail.getJobDetail((String) ids.getSecondLevelIdentifier());
- StatusResource statusResource = (StatusResource) jobDetail.create(ResourceType.STATUS);
- statusResource.setExperimentId(workflowNode.getExperimentId());
- statusResource.setNodeId(workflowNode.getNodeInstanceId());
- statusResource.setTaskId(taskDetail.getTaskId());
- statusResource.setStatusType(StatusType.JOB.toString());
- statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
- if (status.getJobState() == null) {
- statusResource.setState(JobState.UNKNOWN.toString());
- } else {
- statusResource.setState(status.getJobState().toString());
- }
- statusResource.save();
- return String.valueOf(statusResource.getStatusId());
- } catch (Exception e) {
- logger.error("Error while adding job status...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
+// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
+// JobDetailResource jobDetail = taskDetail.getJobDetail((String) ids.getSecondLevelIdentifier());
+// StatusResource statusResource = (StatusResource) jobDetail.create(ResourceType.STATUS);
+// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setNodeId(workflowNode.getNodeInstanceId());
+// statusResource.setTaskId(taskDetail.getTaskId());
+// statusResource.setStatusType(StatusType.JOB.toString());
+// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
+// if (status.getJobState() == null) {
+// statusResource.setState(JobState.UNKNOWN.toString());
+// } else {
+// statusResource.setState(status.getJobState().toString());
+// }
+// statusResource.save();
+// return String.valueOf(statusResource.getStatusId());
+// } catch (Exception e) {
+// logger.error("Error while adding job status...", e);
+// throw new RegistryException(e);
+// }
+ return null;
}
public String updateJobStatus(JobStatus status, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
- JobDetailResource jobDetail = taskDetail.getJobDetail((String) ids.getSecondLevelIdentifier());
- StatusResource statusResource = jobDetail.getJobStatus();
- workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
- statusResource.setExperimentId(workflowNode.getExperimentId());
- statusResource.setNodeId(workflowNode.getNodeInstanceId());
- statusResource.setTaskId(taskDetail.getTaskId());
- statusResource.setStatusType(StatusType.JOB.toString());
- statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
- statusResource.setState(status.getJobState().toString());
- statusResource.save();
- logger.info(ids.toString(), "Updated job status to {}", status.toString());
- return String.valueOf(statusResource.getStatusId());
- } catch (Exception e) {
- logger.error(ids.toString(), "Error while updating job status to " + status.toString() + " ...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
+// JobDetailResource jobDetail = taskDetail.getJobDetail((String) ids.getSecondLevelIdentifier());
+// StatusResource statusResource = jobDetail.getJobStatus();
+// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
+// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setNodeId(workflowNode.getNodeInstanceId());
+// statusResource.setTaskId(taskDetail.getTaskId());
+// statusResource.setStatusType(StatusType.JOB.toString());
+// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
+// statusResource.setState(status.getJobState().toString());
+// statusResource.save();
+// logger.info(ids.toString(), "Updated job status to {}", status.toString());
+// return String.valueOf(statusResource.getStatusId());
+// } catch (Exception e) {
+// logger.error(ids.toString(), "Error while updating job status to " + status.toString() + " ...", e);
+// throw new RegistryException(e);
+// }
+ return null;
}
// /**
@@ -874,56 +890,6 @@ public class ExperimentRegistry {
// }
- public void addWorkflowInputs(List<InputDataObjectType> wfInputs, WorkflowNodeDetailResource nodeDetailResource) throws RegistryException {
- try {
- for (InputDataObjectType input : wfInputs) {
- NodeInputResource resource = (NodeInputResource) nodeDetailResource.create(ResourceType.NODE_INPUT);
- resource.setNodeId(nodeDetailResource.getNodeInstanceId());
- resource.setInputKey(input.getName());
- resource.setValue(input.getValue());
- if (input.getType() != null) {
- resource.setDataType(input.getType().toString());
- }
- resource.setMetadata(input.getMetaData());
- resource.setAppArgument(input.getApplicationArgument());
- resource.setInputOrder(input.getInputOrder());
- resource.setRequired(input.isIsRequired());
- resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding workflow inputs...", e);
- throw new RegistryException(e);
- }
-
- }
-
- public void updateWorkflowInputs(List<InputDataObjectType> wfInputs, WorkflowNodeDetailResource nodeDetailResource) throws RegistryException {
- try {
- List<NodeInputResource> nodeInputs = nodeDetailResource.getNodeInputs();
- for (InputDataObjectType input : wfInputs) {
- for (NodeInputResource resource : nodeInputs) {
- resource.setNodeId(nodeDetailResource.getNodeInstanceId());
- resource.setInputKey(input.getName());
- resource.setValue(input.getValue());
- if (input.getType() != null) {
- resource.setDataType(input.getType().toString());
- }
- resource.setMetadata(input.getMetaData());
- resource.setAppArgument(input.getApplicationArgument());
- resource.setInputOrder(input.getInputOrder());
- resource.setRequired(input.isIsRequired());
- resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- resource.save();
- }
- }
- } catch (Exception e) {
- logger.error("Error while updating workflow inputs...", e);
- throw new RegistryException(e);
- }
-
- }
-
// public String addTaskDetails(TaskModel taskDetails, String nodeId) throws RegistryException {
// try {
// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
@@ -1081,207 +1047,132 @@ public class ExperimentRegistry {
// if (taskStatus != null) {
// updateTaskStatus(taskStatus, taskId);
// }
-// return taskDetail.getTaskId();
-// } catch (Exception e) {
-// logger.error("Error while updating task details...", e);
-// throw new RegistryException(e);
-// }
-// }
-
- public void addAppInputs(List<InputDataObjectType> appInputs, TaskDetailResource taskDetailResource) throws RegistryException {
- try {
- for (InputDataObjectType input : appInputs) {
- ApplicationInputResource resource = (ApplicationInputResource) taskDetailResource.create(ResourceType.APPLICATION_INPUT);
- resource.setTaskId(taskDetailResource.getTaskId());
- resource.setInputKey(input.getName());
- resource.setValue(input.getValue());
- if (input.getType() != null) {
- resource.setDataType(input.getType().toString());
- }
- resource.setMetadata(input.getMetaData());
- resource.setAppArgument(input.getApplicationArgument());
- resource.setInputOrder(input.getInputOrder());
- resource.setRequired(input.isIsRequired());
- resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding application inputs...", e);
- throw new RegistryException(e);
- }
-
- }
-
- public void addAppOutputs(List<OutputDataObjectType> appOytputs, TaskDetailResource taskDetailResource) throws RegistryException {
- try {
- for (OutputDataObjectType output : appOytputs) {
- ApplicationOutputResource resource = (ApplicationOutputResource) taskDetailResource.create(ResourceType.APPLICATION_OUTPUT);
- resource.setTaskId(taskDetailResource.getTaskId());
- resource.setOutputKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
- resource.save();
- }
- } catch (Exception e) {
- logger.error("Error while adding application outputs...", e);
- throw new RegistryException(e);
- }
-
- }
+// return taskDetail.getTaskId();
+// } catch (Exception e) {
+// logger.error("Error while updating task details...", e);
+// throw new RegistryException(e);
+// }
+// }
public void updateAppOutputs(List<OutputDataObjectType> appOutputs, String taskId) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
- List<ApplicationOutputResource> outputs = taskDetail.getApplicationOutputs();
- for (OutputDataObjectType output : appOutputs) {
- for (ApplicationOutputResource resource : outputs) {
- resource.setTaskId(taskId);
- resource.setOutputKey(output.getName());
- resource.setValue(output.getValue());
- if (output.getType() != null) {
- resource.setDataType(output.getType().toString());
- }
- resource.setRequired(output.isIsRequired());
- resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
- resource.setDataMovement(output.isDataMovement());
- resource.setDataNameLocation(output.getLocation());
- resource.setAppArgument(output.getApplicationArgument());
- resource.setSearchQuery(output.getSearchQuery());
-// resource.setMetadata(output.getMetaData());
- resource.save();
- }
- }
- } catch (Exception e) {
- logger.error("Error while updating application outputs...", e);
- throw new RegistryException(e);
- }
- }
-
- public void updateAppInputs(List<InputDataObjectType> appInputs, TaskDetailResource taskDetailResource) throws RegistryException {
- try {
- List<ApplicationInputResource> inputs = taskDetailResource.getApplicationInputs();
- for (InputDataObjectType input : appInputs) {
- for (ApplicationInputResource resource : inputs) {
- resource.setTaskId(taskDetailResource.getTaskId());
- resource.setInputKey(input.getName());
- resource.setValue(input.getValue());
- if (input.getType() != null) {
- resource.setDataType(input.getType().toString());
- }
- resource.setMetadata(input.getMetaData());
- resource.setAppArgument(input.getApplicationArgument());
- resource.setInputOrder(input.getInputOrder());
- resource.setRequired(input.isIsRequired());
- resource.setRequiredToCMD(input.isRequiredToAddedToCommandLine());
- resource.save();
- }
-
- }
- } catch (Exception e) {
- logger.error("Error while updating application inputs...", e);
- throw new RegistryException(e);
- }
-
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
+// List<ApplicationOutputResource> outputs = taskDetail.getApplicationOutputs();
+// for (OutputDataObjectType output : appOutputs) {
+// for (ApplicationOutputResource resource : outputs) {
+// resource.setTaskId(taskId);
+// resource.setOutputKey(output.getName());
+// resource.setValue(output.getValue());
+// if (output.getType() != null) {
+// resource.setDataType(output.getType().toString());
+// }
+// resource.setRequired(output.isIsRequired());
+// resource.setRequiredToCMD(output.isRequiredToAddedToCommandLine());
+// resource.setDataMovement(output.isDataMovement());
+// resource.setDataNameLocation(output.getLocation());
+// resource.setAppArgument(output.getApplicationArgument());
+// resource.setSearchQuery(output.getSearchQuery());
+//// resource.setMetadata(output.getMetaData());
+// resource.save();
+// }
+// }
+// } catch (Exception e) {
+// logger.error("Error while updating application outputs...", e);
+// throw new RegistryException(e);
+// }
}
public String addJobDetails(JobModel jobDetails, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
- JobDetailResource jobDetail = taskDetail.createJobDetail((String) ids.getSecondLevelIdentifier());
- jobDetail.setTaskId(taskDetail.getTaskId());
- jobDetail.setJobDescription(jobDetails.getJobDescription());
- jobDetail.setCreationTime(AiravataUtils.getTime(jobDetails.getCreationTime()));
- jobDetail.setComputeResourceConsumed(jobDetails.getComputeResourceConsumed());
- jobDetail.setWorkingDir(jobDetails.getWorkingDir());
- jobDetail.setJobName(jobDetails.getJobName());
- jobDetail.save();
- JobStatus jobStatus = jobDetails.getJobStatus();
- if (jobStatus != null) {
- JobStatus status = getJobStatus(ids);
- if (status != null) {
- updateJobStatus(jobStatus, ids);
- } else {
- addJobStatus(jobStatus, ids);
- }
- }
- JobStatus applicationStatus = jobDetails.getJobStatus();
- if (applicationStatus != null) {
- JobStatus appStatus = getJobStatus(ids);
- if (appStatus != null) {
- updateJobStatus(applicationStatus, ids);
- } else {
- addJobStatus(applicationStatus, ids);
- }
- }
-// List<ErrorModel> errors = jobDetails.getErrors();
-// if (errors != null && !errors.isEmpty()) {
-// for (ErrorDetails error : errors) {
-// addErrorDetails(error, ids.getSecondLevelIdentifier());
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail((String) ids.getTopLevelIdentifier());
+// JobDetailResource jobDetail = taskDetail.createJobDetail((String) ids.getSecondLevelIdentifier());
+// jobDetail.setTaskId(taskDetail.getTaskId());
+// jobDetail.setJobDescription(jobDetails.getJobDescription());
+// jobDetail.setCreationTime(AiravataUtils.getTime(jobDetails.getCreationTime()));
+// jobDetail.setComputeResourceConsumed(jobDetails.getComputeResourceConsumed());
+// jobDetail.setWorkingDir(jobDetails.getWorkingDir());
+// jobDetail.setJobName(jobDetails.getJobName());
+// jobDetail.save();
+// JobStatus jobStatus = jobDetails.getJobStatus();
+// if (jobStatus != null) {
+// JobStatus status = getJobStatus(ids);
+// if (status != null) {
+// updateJobStatus(jobStatus, ids);
+// } else {
+// addJobStatus(jobStatus, ids);
// }
// }
- return jobDetail.getJobId();
- } catch (Exception e) {
- logger.error("Error while adding job details...", e);
- throw new RegistryException(e);
- }
+// JobStatus applicationStatus = jobDetails.getJobStatus();
+// if (applicationStatus != null) {
+// JobStatus appStatus = getJobStatus(ids);
+// if (appStatus != null) {
+// updateJobStatus(applicationStatus, ids);
+// } else {
+// addJobStatus(applicationStatus, ids);
+// }
+// }
+//// List<ErrorModel> errors = jobDetails.getErrors();
+//// if (errors != null && !errors.isEmpty()) {
+//// for (ErrorDetails error : errors) {
+//// addErrorDetails(error, ids.getSecondLevelIdentifier());
+//// }
+//// }
+// return jobDetail.getJobId();
+// } catch (Exception e) {
+// logger.error("Error while adding job details...", e);
+// throw new RegistryException(e);
+// }
+ return null;
}
// ids - taskId + jobid
public void updateJobDetails(JobModel jobDetails, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- String taskId = (String) ids.getTopLevelIdentifier();
- TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
- String jobId = (String) ids.getSecondLevelIdentifier();
- JobDetailResource jobDetail = taskDetail.getJobDetail(jobId);
- jobDetail.setTaskId(taskDetail.getTaskId());
- jobDetail.setJobDescription(jobDetails.getJobDescription());
- jobDetail.setCreationTime(AiravataUtils.getTime(jobDetails.getCreationTime()));
- jobDetail.setComputeResourceConsumed(jobDetails.getComputeResourceConsumed());
- jobDetail.setJobName(jobDetails.getJobName());
- jobDetail.setWorkingDir(jobDetails.getWorkingDir());
- jobDetail.save();
- JobStatus jobStatus = jobDetails.getJobStatus();
- if (jobStatus != null) {
- JobStatus status = getJobStatus(ids);
- if (status != null) {
- updateJobStatus(jobStatus, ids);
- } else {
- addJobStatus(jobStatus, ids);
- }
- }
- JobStatus applicationStatus = jobDetails.getJobStatus();
- if (applicationStatus != null) {
- JobStatus appStatus = getJobStatus(ids);
- if (appStatus != null) {
- updateJobStatus(applicationStatus, ids);
- } else {
- addJobStatus(applicationStatus, ids);
- }
- }
-// List<ErrorDetails> errors = jobDetails.getErrors();
-// if (errors != null && !errors.isEmpty()) {
-// for (ErrorDetails error : errors) {
-// addErrorDetails(error, jobId);
+// try {
+// ExperimentResource experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// WorkflowNodeDetailResource workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// String taskId = (String) ids.getTopLevelIdentifier();
+// TaskDetailResource taskDetail = workflowNode.getTaskDetail(taskId);
+// String jobId = (String) ids.getSecondLevelIdentifier();
+// JobDetailResource jobDetail = taskDetail.getJobDetail(jobId);
+// jobDetail.setTaskId(taskDetail.getTaskId());
+// jobDetail.setJobDescription(jobDetails.getJobDescription());
+// jobDetail.setCreationTime(AiravataUtils.getTime(jobDetails.getCreationTime()));
+// jobDetail.setComputeResourceConsumed(jobDetails.getComputeResourceConsumed());
+// jobDetail.setJobName(jobDetails.getJobName());
+// jobDetail.setWorkingDir(jobDetails.getWorkingDir());
+// jobDetail.save();
+// JobStatus jobStatus = jobDetails.getJobStatus();
+// if (jobStatus != null) {
+// JobStatus status = getJobStatus(ids);
+// if (status != null) {
+// updateJobStatus(jobStatus, ids);
+// } else {
+// addJobStatus(jobStatus, ids);
// }
// }
- } catch (Exception e) {
- logger.error("Error while updating job details...", e);
- throw new RegistryException(e);
- }
+// JobStatus applicationStatus = jobDetails.getJobStatus();
+// if (applicationStatus != null) {
+// JobStatus appStatus = getJobStatus(ids);
+// if (appStatus != null) {
+// updateJobStatus(applicationStatus, ids);
+// } else {
+// addJobStatus(applicationStatus, ids);
+// }
+// }
+//// List<ErrorDetails> errors = jobDetails.getErrors();
+//// if (errors != null && !errors.isEmpty()) {
+//// for (ErrorDetails error : errors) {
+//// addErrorDetails(error, jobId);
+//// }
+//// }
+// } catch (Exception e) {
+// logger.error("Error while updating job details...", e);
+// throw new RegistryException(e);
+// }
}
// public String addDataTransferDetails(DataTransferDetails transferDetails, String taskId) throws RegistryException {
@@ -1351,29 +1242,30 @@ public class ExperimentRegistry {
* @return scheduling id
*/
public String addComputationalResourceScheduling(ComputationalResourceSchedulingModel scheduling, CompositeIdentifier ids) throws RegistryException {
- try {
- ExperimentResource experiment = gatewayResource.getExperiment((String) ids.getTopLevelIdentifier());
- ComputationSchedulingResource schedulingResource = (ComputationSchedulingResource) experiment.create(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING);
- if (ids.getSecondLevelIdentifier() != null) {
- WorkflowNodeDetailResource nodeDetailResource = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- TaskDetailResource taskDetail = nodeDetailResource.getTaskDetail((String) ids.getSecondLevelIdentifier());
- schedulingResource.setTaskId(taskDetail.getTaskId());
- }
- schedulingResource.setExperimentId(experiment.getExpID());
- schedulingResource.setResourceHostId(scheduling.getResourceHostId());
- schedulingResource.setCpuCount(scheduling.getTotalCPUCount());
- schedulingResource.setNodeCount(scheduling.getNodeCount());
- schedulingResource.setNumberOfThreads(scheduling.getNumberOfThreads());
- schedulingResource.setQueueName(scheduling.getQueueName());
- schedulingResource.setWalltimeLimit(scheduling.getWallTimeLimit());
- schedulingResource.setPhysicalMemory(scheduling.getTotalPhysicalMemory());
- schedulingResource.setChessisName(scheduling.getChessisNumber());
- schedulingResource.save();
- return String.valueOf(schedulingResource.getSchedulingId());
- } catch (Exception e) {
- logger.error("Error while adding scheduling parameters...", e);
- throw new RegistryException(e);
- }
+// try {
+// ExperimentResource experiment = gatewayResource.getExperiment((String) ids.getTopLevelIdentifier());
+// ComputationSchedulingResource schedulingResource = (ComputationSchedulingResource) experiment.create(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING);
+// if (ids.getSecondLevelIdentifier() != null) {
+// WorkflowNodeDetailResource nodeDetailResource = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// TaskDetailResource taskDetail = nodeDetailResource.getTaskDetail((String) ids.getSecondLevelIdentifier());
+// schedulingResource.setTaskId(taskDetail.getTaskId());
+// }
+// schedulingResource.setExperimentId(experiment.getExpID());
+// schedulingResource.setResourceHostId(scheduling.getResourceHostId());
+// schedulingResource.setCpuCount(scheduling.getTotalCPUCount());
+// schedulingResource.setNodeCount(scheduling.getNodeCount());
+// schedulingResource.setNumberOfThreads(scheduling.getNumberOfThreads());
+// schedulingResource.setQueueName(scheduling.getQueueName());
+// schedulingResource.setWalltimeLimit(scheduling.getWallTimeLimit());
+// schedulingResource.setPhysicalMemory(scheduling.getTotalPhysicalMemory());
+// schedulingResource.setChessisName(scheduling.getChessisNumber());
+// schedulingResource.save();
+// return String.valueOf(schedulingResource.getSchedulingId());
+// } catch (Exception e) {
+// logger.error("Error while adding scheduling parameters...", e);
+// throw new RegistryException(e);
+// }
+ return null;
}
// /**
@@ -1451,87 +1343,87 @@ public class ExperimentRegistry {
// }
public String addErrorDetails(ErrorModel error, Object id) throws RegistryException {
- try {
-
- ErrorDetailResource errorResource = null;
- ExperimentResource experiment;
- TaskDetailResource taskDetail;
- WorkflowNodeDetailResource workflowNode;
- // figure out the id is an experiment, node task or job
- if (id instanceof String) {
- // FIXME : for .12 we only save task related errors
-// if (isExperimentExist((String) id)) {
-// experiment = gatewayResource.getExperiment((String) id);
-// errorResource = (ErrorDetailResource) experiment.create(ResourceType.ERROR_DETAIL);
-// } else if (isWFNodeExist((String) id)) {
+// try {
+//
+// ErrorDetailResource errorResource = null;
+// ExperimentResource experiment;
+// TaskDetailResource taskDetail;
+// WorkflowNodeDetailResource workflowNode;
+// // figure out the id is an experiment, node task or job
+// if (id instanceof String) {
+// // FIXME : for .12 we only save task related errors
+//// if (isExperimentExist((String) id)) {
+//// experiment = gatewayResource.getExperiment((String) id);
+//// errorResource = (ErrorDetailResource) experiment.create(ResourceType.ERROR_DETAIL);
+//// } else if (isWFNodeExist((String) id)) {
+//// experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+//// workflowNode = experiment.getWorkflowNode((String) id);
+//// errorResource = (ErrorDetailResource) workflowNode.create(ResourceType.ERROR_DETAIL);
+//// errorResource.setExperimentResource(workflowNode.getExperimentResource());
+//// } else
+// if (isTaskDetailExist((String) id)) {
// experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
-// workflowNode = experiment.getWorkflowNode((String) id);
-// errorResource = (ErrorDetailResource) workflowNode.create(ResourceType.ERROR_DETAIL);
-// errorResource.setExperimentResource(workflowNode.getExperimentResource());
-// } else
- if (isTaskDetailExist((String) id)) {
- experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- taskDetail = workflowNode.getTaskDetail((String) id);
- errorResource = (ErrorDetailResource) taskDetail.create(ResourceType.ERROR_DETAIL);
- if (error.getErrorId() != null && !error.getErrorId().equals(airavata_commonsConstants.DEFAULT_ID)) {
- List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
- if (errorDetailList != null && !errorDetailList.isEmpty()) {
- for (ErrorDetailResource errorDetailResource : errorDetailList) {
- if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorId())) {
- errorResource = errorDetailResource;
- }
- }
- }
- }
- errorResource.setTaskId(taskDetail.getTaskId());
- errorResource.setNodeId(taskDetail.getNodeId());
- workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
- errorResource.setExperimentId(workflowNode.getExperimentId());
- } else {
-// logger.error("The id provided is not an experiment id or a workflow id or a task id..");
- }
- } else if (id instanceof CompositeIdentifier) {
- CompositeIdentifier cid = (CompositeIdentifier) id;
- if (isJobDetailExist(cid)) {
- experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
- taskDetail = workflowNode.getTaskDetail((String) cid.getTopLevelIdentifier());
- JobDetailResource jobDetail = taskDetail.getJobDetail((String) cid.getSecondLevelIdentifier());
- errorResource = (ErrorDetailResource) jobDetail.create(ResourceType.ERROR_DETAIL);
- if (error.getErrorId() != null && !error.getErrorId().equals(airavata_commonsConstants.DEFAULT_ID)) {
- List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
- if (errorDetailList != null && !errorDetailList.isEmpty()) {
- for (ErrorDetailResource errorDetailResource : errorDetailList) {
- if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorId())) {
- errorResource = errorDetailResource;
- }
- }
- }
- }
- errorResource.setTaskId(taskDetail.getTaskId());
- errorResource.setNodeId(taskDetail.getNodeId());
- workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
- errorResource.setExperimentId(workflowNode.getExperimentId());
- } else {
- logger.error("The id provided is not a job in the system..");
- }
- } else {
-// logger.error("The id provided is not an experiment id or a workflow id or a task id or a composite " +
-// "identifier for job..");
- }
- if (errorResource != null) {
- errorResource.setCreationTime(AiravataUtils.getTime(error.getCreationTime()));
- errorResource.setActualErrorMsg(error.getActualErrorMessage());
- errorResource.setUserFriendlyErrorMsg(error.getUserFriendlyMessage());
- errorResource.setTransientPersistent(error.isTransientOrPersistent());
- errorResource.save();
- return String.valueOf(errorResource.getErrorId());
- }
- } catch (Exception e) {
- logger.error("Unable to add error details...", e);
- throw new RegistryException(e);
- }
+// workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// taskDetail = workflowNode.getTaskDetail((String) id);
+// errorResource = (ErrorDetailResource) taskDetail.create(ResourceType.ERROR_DETAIL);
+// if (error.getErrorId() != null && !error.getErrorId().equals(airavata_commonsConstants.DEFAULT_ID)) {
+// List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
+// if (errorDetailList != null && !errorDetailList.isEmpty()) {
+// for (ErrorDetailResource errorDetailResource : errorDetailList) {
+// if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorId())) {
+// errorResource = errorDetailResource;
+// }
+// }
+// }
+// }
+// errorResource.setTaskId(taskDetail.getTaskId());
+// errorResource.setNodeId(taskDetail.getNodeId());
+// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
+// errorResource.setExperimentId(workflowNode.getExperimentId());
+// } else {
+//// logger.error("The id provided is not an experiment id or a workflow id or a task id..");
+// }
+// } else if (id instanceof CompositeIdentifier) {
+// CompositeIdentifier cid = (CompositeIdentifier) id;
+// if (isJobDetailExist(cid)) {
+// experiment = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
+// workflowNode = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
+// taskDetail = workflowNode.getTaskDetail((String) cid.getTopLevelIdentifier());
+// JobDetailResource jobDetail = taskDetail.getJobDetail((String) cid.getSecondLevelIdentifier());
+// errorResource = (ErrorDetailResource) jobDetail.create(ResourceType.ERROR_DETAIL);
+// if (error.getErrorId() != null && !error.getErrorId().equals(airavata_commonsConstants.DEFAULT_ID)) {
+// List<ErrorDetailResource> errorDetailList = taskDetail.getErrorDetailList();
+// if (errorDetailList != null && !errorDetailList.isEmpty()) {
+// for (ErrorDetailResource errorDetailResource : errorDetailList) {
+// if (errorDetailResource.getErrorId() == Integer.parseInt(error.getErrorId())) {
+// errorResource = errorDetailResource;
+// }
+// }
+// }
+// }
+//
<TRUNCATED>
[04/11] airavata git commit: modifying the data models to contain all
the statuses and errors
Posted by sc...@apache.org.
modifying the data models to contain all the statuses and errors
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/3a003666
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/3a003666
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/3a003666
Branch: refs/heads/master
Commit: 3a00366696d4c7d85bf51eab204fe6c3728f5a5d
Parents: a5039dc
Author: Supun Nakandala <sc...@apache.org>
Authored: Sat Jun 20 16:57:03 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sat Jun 20 16:57:03 2015 +0530
----------------------------------------------------------------------
.../catalog/impl/ExperimentCatalogImpl.java | 1 -
.../catalog/impl/ExperimentRegistry.java | 50 +-
.../experiment/catalog/model/Experiment.java | 12 +-
.../catalog/model/ExperimentError.java | 15 +-
.../catalog/model/ExperimentErrorPK.java | 74 +++
.../catalog/model/ExperimentInput.java | 22 +-
.../catalog/model/ExperimentInputPK.java | 77 +++
.../catalog/model/ExperimentOutput.java | 45 +-
.../catalog/model/ExperimentOutputPK.java | 76 +++
.../catalog/model/ExperimentStatus.java | 19 +-
.../catalog/model/ExperimentStatusPK.java | 74 +++
.../core/experiment/catalog/model/Process.java | 24 +-
.../experiment/catalog/model/ProcessError.java | 18 +-
.../catalog/model/ProcessErrorPK.java | 74 +++
.../experiment/catalog/model/ProcessInput.java | 23 +-
.../catalog/model/ProcessInputPK.java | 77 +++
.../experiment/catalog/model/ProcessOutput.java | 46 +-
.../catalog/model/ProcessOutputPK.java | 76 +++
.../experiment/catalog/model/ProcessStatus.java | 19 +-
.../catalog/model/ProcessStatusPK.java | 74 +++
.../experiment/catalog/model/ProjectUser.java | 2 +-
.../experiment/catalog/model/ProjectUserPK.java | 74 +++
.../catalog/model/ProjectUsersPK.java | 74 ---
.../core/experiment/catalog/model/Task.java | 25 +-
.../experiment/catalog/model/TaskError.java | 19 +-
.../experiment/catalog/model/TaskErrorPK.java | 74 +++
.../experiment/catalog/model/TaskStatus.java | 19 +-
.../experiment/catalog/model/TaskStatusPK.java | 74 +++
.../catalog/model/UserConfigurationData.java | 6 +-
.../resources/AbstractExpCatResource.java | 14 +-
.../resources/ExperimentErrorResource.java | 12 +-
.../resources/ExperimentOutputResource.java | 37 +-
.../catalog/resources/ExperimentResource.java | 10 +-
.../catalog/resources/ProcessErrorResource.java | 9 +
.../catalog/resources/ProcessInputResource.java | 2 -
.../resources/ProcessOutputResource.java | 37 +-
.../catalog/resources/ProcessResource.java | 10 +-
.../catalog/resources/ProjectUserResource.java | 10 +-
.../catalog/resources/TaskErrorResource.java | 9 +
.../catalog/resources/TaskResource.java | 2 +-
.../UserConfigurationDataResource.java | 6 +-
.../utils/ThriftDataModelConversion.java | 562 +++++++------------
.../src/main/resources/expcatalog-derby.sql | 38 +-
.../src/main/resources/expcatalog-mysql.sql | 40 +-
44 files changed, 1388 insertions(+), 673 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
index cdedf22..94a881e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
@@ -35,7 +35,6 @@ import org.apache.airavata.model.workspace.Gateway;
import org.apache.airavata.model.workspace.Project;
import org.apache.airavata.model.experiment.*;
import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
-import org.apache.airavata.registry.core.experiment.catalog.model.AdvancedOutputDataHandling;
import org.apache.airavata.registry.core.experiment.catalog.resources.GatewayResource;
import org.apache.airavata.registry.core.experiment.catalog.resources.UserResource;
import org.apache.airavata.registry.cpi.*;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
index 038f916..b8d8b3c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentRegistry.java
@@ -187,7 +187,7 @@ public class ExperimentRegistry {
// QosParamResource qosr = new QosParamResource();
// if (resource instanceof ExperimentResource) {
// ExperimentResource experiment = (ExperimentResource) resource;
-// qosr.setExperimentId(experiment.getExpID());
+// qosr.setProcessId(experiment.getExpID());
// }
// if (resource instanceof TaskDetailResource) {
// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
@@ -195,7 +195,7 @@ public class ExperimentRegistry {
// String nodeId = taskDetailResource.getNodeId();
// ExperimentResource experimentResource = new ExperimentResource();
// WorkflowNodeDetailResource workflowNode = experimentResource.getWorkflowNode(nodeId);
-// qosr.setExperimentId(workflowNode.getExperimentId());
+// qosr.setProcessId(workflowNode.getProcessId());
// }
// qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
// qosr.setExecuteBefore(qosParams.getExecuteBefore());
@@ -213,14 +213,14 @@ public class ExperimentRegistry {
// try {
// if (resource instanceof ExperimentResource) {
// ExperimentResource experiment = (ExperimentResource) resource;
-// adodh.setExperimentId(experiment.getExpID());
+// adodh.setProcessId(experiment.getExpID());
// }
// if (resource instanceof TaskDetailResource) {
// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
// String nodeId = taskDetailResource.getNodeId();
// ExperimentResource experimentResource = new ExperimentResource();
// WorkflowNodeDetailResource workflowNode = experimentResource.getWorkflowNode(nodeId);
-// adodh.setExperimentId(workflowNode.getExperimentId());
+// adodh.setProcessId(workflowNode.getProcessId());
// adodh.setTaskId(taskDetailResource.getTaskId());
// }
// adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
@@ -239,14 +239,14 @@ public class ExperimentRegistry {
// try {
// if (resource instanceof ExperimentResource) {
// ExperimentResource experiment = (ExperimentResource) resource;
-// adidh.setExperimentId(experiment.getExpID());
+// adidh.setProcessId(experiment.getExpID());
// }
// if (resource instanceof TaskDetailResource) {
// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
// String nodeId = taskDetailResource.getNodeId();
// ExperimentResource experimentResource = new ExperimentResource();
// WorkflowNodeDetailResource workflowNode = experimentResource.getWorkflowNode(nodeId);
-// adidh.setExperimentId(workflowNode.getExperimentId());
+// adidh.setProcessId(workflowNode.getProcessId());
// adidh.setTaskId(taskDetailResource.getTaskId());
// }
// adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
@@ -514,7 +514,7 @@ public class ExperimentRegistry {
// ExperimentResource experiment = gatewayResource.getExperiment((String) ids.getTopLevelIdentifier());
// WorkflowNodeDetailResource workflowNode = experiment.getWorkflowNode((String) ids.getSecondLevelIdentifier());
// StatusResource statusResource = (StatusResource) experiment.create(ResourceType.STATUS);
-// statusResource.setExperimentId(experiment.getExpID());
+// statusResource.setProcessId(experiment.getExpID());
// statusResource.setNodeId(workflowNode.getNodeInstanceId());
// statusResource.setStatusType(StatusType.WORKFLOW_NODE.toString());
// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
@@ -539,7 +539,7 @@ public class ExperimentRegistry {
// if (statusResource == null) {
// statusResource = (StatusResource) workflowNode.create(ResourceType.STATUS);
// }
-// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setProcessId(workflowNode.getProcessId());
// statusResource.setNodeId(nodeId);
// statusResource.setStatusType(StatusType.WORKFLOW_NODE.toString());
// statusResource.setStatusUpdateTime(AiravataUtils.getTime(status.getTimeOfStateChange()));
@@ -670,7 +670,7 @@ public class ExperimentRegistry {
// JobDetailResource jobDetail = taskDetail.getJobDetail((String) ids.getSecondLevelIdentifier());
// StatusResource statusResource = (StatusResource) jobDetail.create(ResourceType.STATUS);
// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
-// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setProcessId(workflowNode.getProcessId());
// statusResource.setNodeId(workflowNode.getNodeInstanceId());
// statusResource.setTaskId(taskDetail.getTaskId());
// statusResource.setStatusType(StatusType.APPLICATION.toString());
@@ -696,7 +696,7 @@ public class ExperimentRegistry {
// JobDetailResource jobDetail = taskDetail.getJobDetail(jobId);
// StatusResource statusResource = jobDetail.getApplicationStatus();
// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
-// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setProcessId(workflowNode.getProcessId());
// statusResource.setNodeId(workflowNode.getNodeInstanceId());
// statusResource.setTaskId(taskDetail.getTaskId());
// statusResource.setStatusType(StatusType.APPLICATION.toString());
@@ -718,7 +718,7 @@ public class ExperimentRegistry {
// DataTransferDetailResource dataTransferDetail = taskDetail.getDataTransferDetail((String) ids.getSecondLevelIdentifier());
// StatusResource statusResource = (StatusResource) dataTransferDetail.create(ResourceType.STATUS);
// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
-// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setProcessId(workflowNode.getProcessId());
// statusResource.setNodeId(workflowNode.getNodeInstanceId());
// statusResource.setTaskId(taskDetail.getTaskId());
// statusResource.setTransferId(dataTransferDetail.getTransferId());
@@ -749,7 +749,7 @@ public class ExperimentRegistry {
// taskDetail = workflowNode.getTaskDetail(taskId);
// workflowNode = experiment.getWorkflowNode(taskDetail.getNodeId());
// if (workflowNode != null) {
-// statusResource.setExperimentId(workflowNode.getExperimentId());
+// statusResource.setProcessId(workflowNode.getProcessId());
// statusResource.setNodeId(workflowNode.getNodeInstanceId());
// }
// statusResource.setTaskId(taskId);
@@ -768,7 +768,7 @@ public class ExperimentRegistry {
// try {
// ExperimentResource experiment = gatewayResource.getExperiment(expId);
// WorkflowNodeDetailResource resource = (WorkflowNodeDetailResource) experiment.create(ResourceType.WORKFLOW_NODE_DETAIL);
-// resource.setExperimentId(expId);
+// resource.setProcessId(expId);
// resource.setNodeName(nodeDetails.getNodeName());
// resource.setExecutionUnit(nodeDetails.getExecutionUnit().toString());
// resource.setExecutionUnitData(nodeDetails.getExecutionUnitData());
@@ -832,7 +832,7 @@ public class ExperimentRegistry {
// workflowNode.setCreationTime(AiravataUtils.getTime(nodeDetails.getCreationTime()));
// workflowNode.setNodeInstanceId(nodeId);
// workflowNode.save();
-// String expID = workflowNode.getExperimentId();
+// String expID = workflowNode.getProcessId();
// List<InputDataObjectType> nodeInputs = nodeDetails.getNodeInputs();
// if (nodeInputs != null) {
// updateWorkflowInputs(nodeDetails.getNodeInputs(), workflowNode);
@@ -941,7 +941,7 @@ public class ExperimentRegistry {
// if (emailAddresses != null && !emailAddresses.isEmpty()){
// for (String email : emailAddresses){
// NotificationEmailResource emailResource = new NotificationEmailResource();
-// emailResource.setExperimentId(workflowNode.getExperimentId());
+// emailResource.setProcessId(workflowNode.getProcessId());
// emailResource.setTaskId(taskDetail.getTaskId());
// emailResource.setEmailAddress(email);
// emailResource.save();
@@ -1033,7 +1033,7 @@ public class ExperimentRegistry {
// if (emailAddresses != null && !emailAddresses.isEmpty()){
// for (String email : emailAddresses){
// NotificationEmailResource emailResource = new NotificationEmailResource();
-// emailResource.setExperimentId(workflowNode.getExperimentId());
+// emailResource.setProcessId(workflowNode.getProcessId());
// emailResource.setTaskId(taskId);
// emailResource.setEmailAddress(email);
// emailResource.save();
@@ -1390,7 +1390,7 @@ public class ExperimentRegistry {
// TaskDetailResource taskDetail = nodeDetailResource.getTaskDetail((String) ids.getSecondLevelIdentifier());
// dataHandlingResource.setTaskId(taskDetail.getTaskId());
// }
-// dataHandlingResource.setExperimentId(experiment.getExpID());
+// dataHandlingResource.setProcessId(experiment.getExpID());
// dataHandlingResource.setWorkingDir(dataHandling.getUniqueWorkingDirectory());
// dataHandlingResource.setWorkingDirParent(dataHandling.getParentWorkingDirectory());
// dataHandlingResource.setStageInputFiles(dataHandling.isStageInputFilesToWorkingDir());
@@ -1417,7 +1417,7 @@ public class ExperimentRegistry {
// TaskDetailResource taskDetail = nodeDetailResource.getTaskDetail((String) ids.getSecondLevelIdentifier());
// dataHandlingResource.setTaskId(taskDetail.getTaskId());
// }
-// dataHandlingResource.setExperimentId(experiment.getExpID());
+// dataHandlingResource.setProcessId(experiment.getExpID());
// dataHandlingResource.setOutputDataDir(dataHandling.getOutputDataDir());
// dataHandlingResource.setDataRegUrl(dataHandling.getDataRegistryURL());
// dataHandlingResource.setPersistOutputData(dataHandling.isPersistOutputData());
@@ -1438,7 +1438,7 @@ public class ExperimentRegistry {
// TaskDetailResource taskDetail = nodeDetailResource.getTaskDetail((String) ids.getSecondLevelIdentifier());
// qosParamResource.setTaskId(taskDetail.getTaskId());
// }
-// qosParamResource.setExperimentId(experiment.getExpID());
+// qosParamResource.setProcessId(experiment.getExpID());
// qosParamResource.setStartExecutionAt(qosParams.getStartExecutionAt());
// qosParamResource.setExecuteBefore(qosParams.getExecuteBefore());
// qosParamResource.setNoOfRetries(qosParams.getNumberofRetries());
@@ -1721,7 +1721,7 @@ public class ExperimentRegistry {
// if (resource instanceof ExperimentResource) {
// ExperimentResource expResource = (ExperimentResource) resource;
// QosParamResource qosr = expResource.getQOSparams(expResource.getExpID());
-// qosr.setExperimentId(expResource.getExpID());
+// qosr.setProcessId(expResource.getExpID());
// qosr.setStartExecutionAt(qosParams.getStartExecutionAt());
// qosr.setExecuteBefore(qosParams.getExecuteBefore());
// qosr.setNoOfRetries(qosParams.getNumberofRetries());
@@ -1740,14 +1740,14 @@ public class ExperimentRegistry {
// if (resource instanceof ExperimentResource) {
// ExperimentResource expResource = (ExperimentResource) resource;
// adodh = expResource.getOutputDataHandling(expResource.getExpID());
-// adodh.setExperimentId(expResource.getExpID());
+// adodh.setProcessId(expResource.getExpID());
// } else {
// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
// ExperimentResource experimentResource = new ExperimentResource();
// adodh = taskDetailResource.getOutputDataHandling(taskDetailResource.getTaskId());
// adodh.setTaskId(taskDetailResource.getTaskId());
// WorkflowNodeDetailResource nodeDetailResource = experimentResource.getWorkflowNode(taskDetailResource.getNodeId());
-// adodh.setExperimentId(nodeDetailResource.getExperimentId());
+// adodh.setProcessId(nodeDetailResource.getProcessId());
// }
// adodh.setOutputDataDir(outputDataHandling.getOutputDataDir());
// adodh.setDataRegUrl(outputDataHandling.getDataRegistryURL());
@@ -1766,14 +1766,14 @@ public class ExperimentRegistry {
// if (resource instanceof ExperimentResource) {
// ExperimentResource expResource = (ExperimentResource) resource;
// adidh = expResource.getInputDataHandling(expResource.getExpID());
-// adidh.setExperimentId(expResource.getExpID());
+// adidh.setProcessId(expResource.getExpID());
// } else {
// TaskDetailResource taskDetailResource = (TaskDetailResource) resource;
// ExperimentResource experimentResource = new ExperimentResource();
// adidh = taskDetailResource.getInputDataHandling(taskDetailResource.getTaskId());
// adidh.setTaskId(taskDetailResource.getTaskId());
// WorkflowNodeDetailResource nodeDetailResource = experimentResource.getWorkflowNode(taskDetailResource.getNodeId());
-// adidh.setExperimentId(nodeDetailResource.getExperimentId());
+// adidh.setProcessId(nodeDetailResource.getProcessId());
// }
// adidh.setWorkingDir(inputDataHandling.getUniqueWorkingDirectory());
// adidh.setWorkingDirParent(inputDataHandling.getParentWorkingDirectory());
@@ -1857,7 +1857,7 @@ public class ExperimentRegistry {
// } else if (value instanceof WorkflowNodeDetails) {
// WorkflowNodeDetailResource nodeDetailResource = getWorkflowNodeDetailResource(((WorkflowNodeDetails) value).getNodeInstanceId());
// if (nodeDetailResource != null) {
-// String experimentId = nodeDetailResource.getExperimentId();
+// String experimentId = nodeDetailResource.getProcessId();
// ExperimentResource experiment = gatewayResource.getExperiment(experimentId);
// return Arrays.asList(ThriftDataModelConversion
// .getExperiment(experiment));
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
index 16bdad9..f4bdcbc 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
@@ -48,7 +48,7 @@ public class Experiment {
private Collection<ExperimentError> experimentErrors;
private Collection<ExperimentInput> experimentInputs;
private Collection<ExperimentOutput> experimentOutputs;
- private ExperimentStatus experimentStatus;
+ private Collection<ExperimentStatus> experimentStatuses;
private Collection<Process> processes;
private UserConfigurationData userConfigurationData;
@@ -265,13 +265,13 @@ public class Experiment {
this.experimentOutputs = experimentOutputsByExperimentId;
}
- @OneToOne(mappedBy = "experiment")
- public ExperimentStatus getExperimentStatus() {
- return experimentStatus;
+ @OneToMany(mappedBy = "experiment")
+ public Collection<ExperimentStatus> getExperimentStatuses() {
+ return experimentStatuses;
}
- public void setExperimentStatus(ExperimentStatus experimentStatusesByExperimentId) {
- this.experimentStatus = experimentStatusesByExperimentId;
+ public void setExperimentStatuses(Collection<ExperimentStatus> experimentStatusesByExperimentId) {
+ this.experimentStatuses = experimentStatusesByExperimentId;
}
@OneToMany(mappedBy = "experiment")
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
index 82af1e9..b1e20ce 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
@@ -28,9 +28,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "EXPERIMENT_ERROR")
+@IdClass(ExperimentErrorPK.class)
public class ExperimentError {
private final static Logger logger = LoggerFactory.getLogger(ExperimentError.class);
- private int errorId;
+ private String errorId;
private String experimentId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -39,21 +40,17 @@ public class ExperimentError {
private String rootCauseErrorIdList;
private Experiment experiment;
- public void setErrorId(Integer errorId) {
- this.errorId = errorId;
- }
-
@Id
@Column(name = "ERROR_ID")
- public int getErrorId() {
+ public String getErrorId() {
return errorId;
}
- public void setErrorId(int errorId) {
+ public void setErrorId(String errorId) {
this.errorId = errorId;
}
- @Basic
+ @Id
@Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
@@ -137,7 +134,7 @@ public class ExperimentError {
@Override
public int hashCode() {
- int result = errorId;
+ int result = errorId != null ? errorId.hashCode() : 0;
result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
new file mode 100644
index 0000000..e9ac79e
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ExperimentErrorPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ExperimentErrorPK.class);
+ private String errorId;
+ private String experimentId;
+
+ @Column(name = "ERROR_ID")
+ @Id
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
+ @Column(name = "EXPERIMENT_ID")
+ @Id
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ExperimentErrorPK that = (ExperimentErrorPK) o;
+
+ if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
+ if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = errorId != null ? errorId.hashCode() : 0;
+ result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
index bf8a1f4..b331f21 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
@@ -27,9 +27,9 @@ import javax.persistence.*;
@Entity
@Table(name = "EXPERIMENT_INPUT")
+@IdClass(ExperimentInputPK.class)
public class ExperimentInput {
private final static Logger logger = LoggerFactory.getLogger(ExperimentInput.class);
- private int experimentInputId;
private String experimentId;
private String inputName;
private String inputValue;
@@ -44,21 +44,7 @@ public class ExperimentInput {
private Boolean dataStaged;
private Experiment experiment;
- public void setExperimentInputId(Integer experimentInputId) {
- this.experimentInputId = experimentInputId;
- }
-
@Id
- @Column(name = "EXPERIMENT_INPUT_ID")
- public int getExperimentInputId() {
- return experimentInputId;
- }
-
- public void setExperimentInputId(int experimentInputId) {
- this.experimentInputId = experimentInputId;
- }
-
- @Basic
@Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
@@ -68,7 +54,7 @@ public class ExperimentInput {
this.experimentId = experimentId;
}
- @Basic
+ @Id
@Column(name = "INPUT_NAME")
public String getInputName() {
return inputName;
@@ -185,7 +171,6 @@ public class ExperimentInput {
ExperimentInput that = (ExperimentInput) o;
- if (experimentInputId != that.experimentInputId) return false;
if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
return false;
if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
@@ -208,8 +193,7 @@ public class ExperimentInput {
@Override
public int hashCode() {
- int result = experimentInputId;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ int result = experimentId != null ? experimentId.hashCode() : 0;
result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
new file mode 100644
index 0000000..c84b541
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ExperimentInputPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ExperimentInputPK.class);
+ private String experimentId;
+ private String inputName;
+
+ @Column(name = "EXPERIMENT_ID")
+ @Basic
+ @Id
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ @Column(name = "INPUT_NAME")
+ @Basic
+ @Id
+ public String getInputName() {
+ return inputName;
+ }
+
+ public void setInputName(String inputName) {
+ this.inputName = inputName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ExperimentInputPK that = (ExperimentInputPK) o;
+
+ if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+ if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = experimentId != null ? experimentId.hashCode() : 0;
+ result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
index 2bc01ad..9962429 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
@@ -27,10 +27,12 @@ import javax.persistence.*;
@Entity
@Table(name = "EXPERIMENT_OUTPUT")
+@IdClass(ExperimentOutputPK.class)
public class ExperimentOutput {
private final static Logger logger = LoggerFactory.getLogger(ExperimentOutput.class);
- private int experimentOutputId;
private String experimentId;
+ private String outputName;
+ private String outputValue;
private String dataType;
private String applicationArgument;
private Boolean isRequired;
@@ -40,28 +42,34 @@ public class ExperimentOutput {
private String searchQuery;
private Experiment experiment;
- public void setExperimentOutputId(Integer experimentOutputId) {
- this.experimentOutputId = experimentOutputId;
+ @Id
+ @Column(name = "EXPERIMENT_ID")
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
}
@Id
- @Column(name = "EXPERIMENT_OUTPUT_ID")
- public int getExperimentOutputId() {
- return experimentOutputId;
+ @Column(name = "OUTPUT_NAME")
+ public String getOutputName() {
+ return outputName;
}
- public void setExperimentOutputId(int experimentOutputId) {
- this.experimentOutputId = experimentOutputId;
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
}
@Basic
- @Column(name = "EXPERIMENT_ID")
- public String getExperimentId() {
- return experimentId;
+ @Column(name = "OUTPUT_VALUE")
+ public String getOutputValue() {
+ return outputValue;
}
- public void setExperimentId(String experimentId) {
- this.experimentId = experimentId;
+ public void setOutputValue(String outputValue) {
+ this.outputValue = outputValue;
}
@Basic
@@ -140,8 +148,10 @@ public class ExperimentOutput {
if (o == null || getClass() != o.getClass()) return false;
ExperimentOutput that = (ExperimentOutput) o;
-
- if (experimentOutputId != that.experimentOutputId) return false;
+ if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
+ return false;
+ if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
+ return false;
if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
return false;
if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
@@ -158,8 +168,9 @@ public class ExperimentOutput {
@Override
public int hashCode() {
- int result = experimentOutputId;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ int result = experimentId != null ? experimentId.hashCode() : 0;
+ result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
new file mode 100644
index 0000000..08285c1
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
@@ -0,0 +1,76 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ExperimentOutputPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ExperimentOutputPK.class);
+ private String experimentId;
+ private String outputName;
+
+ @Column(name = "EXPERIMENT_ID")
+ @Basic
+ @Id
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ @Column(name = "OUTPUT_NAME")
+ @Id
+ public String getOutputName() {
+ return outputName;
+ }
+
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ExperimentOutputPK that = (ExperimentOutputPK) o;
+
+ if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+ if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = experimentId != null ? experimentId.hashCode() : 0;
+ result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
index 32eb348..4db87e0 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
@@ -28,8 +28,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "EXPERIMENT_STATUS")
+@IdClass(ExperimentStatusPK.class)
public class ExperimentStatus {
private final static Logger logger = LoggerFactory.getLogger(ExperimentStatus.class);
+ private String statusId;
private String experimentId;
private String state;
private Timestamp timeOfStateChange;
@@ -37,6 +39,16 @@ public class ExperimentStatus {
private Experiment experiment;
@Id
+ @Column(name = "STATUS_ID")
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Id
@Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
@@ -82,7 +94,7 @@ public class ExperimentStatus {
if (o == null || getClass() != o.getClass()) return false;
ExperimentStatus that = (ExperimentStatus) o;
-
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
if (state != null ? !state.equals(that.state) : that.state != null) return false;
@@ -94,14 +106,15 @@ public class ExperimentStatus {
@Override
public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
result = 31 * result + (reason != null ? reason.hashCode() : 0);
return result;
}
- @OneToOne
+ @ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID", nullable = false)
public Experiment getExperiment() {
return experiment;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
new file mode 100644
index 0000000..de17178
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ExperimentStatusPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ExperimentStatusPK.class);
+ private String statusId;
+ private String experimentId;
+
+ @Column(name = "STATUS_ID")
+ @Id
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Column(name = "EXPERIMENT_ID")
+ @Id
+ public String getExperimentId() {
+ return experimentId;
+ }
+
+ public void setExperimentId(String experimentId) {
+ this.experimentId = experimentId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ExperimentStatusPK that = (ExperimentStatusPK) o;
+
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+ if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
index 1b379e0..9330530 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
@@ -39,11 +39,11 @@ public class Process {
private String applicationInterfaceId;
private String taskDag;
private Experiment experiment;
- private ProcessError processError;
+ private Collection<ProcessError> processErrors;
private Collection<ProcessInput> processInputs;
private Collection<ProcessOutput> processOutputs;
private ProcessResourceSchedule processResourceSchedule;
- private ProcessStatus processStatus;
+ private Collection<ProcessStatus> processStatuses;
private Collection<Task> tasks;
@Id
@@ -161,13 +161,13 @@ public class Process {
this.experiment = experimentByExperimentId;
}
- @OneToOne(mappedBy = "process")
- public ProcessError getProcessError() {
- return processError;
+ @OneToMany(mappedBy = "process")
+ public Collection<ProcessError> getProcessErrors() {
+ return processErrors;
}
- public void setProcessError(ProcessError processErrorsByProcessId) {
- this.processError = processErrorsByProcessId;
+ public void setProcessErrors(Collection<ProcessError> processErrorsByProcessId) {
+ this.processErrors = processErrorsByProcessId;
}
@OneToMany(mappedBy = "process")
@@ -197,13 +197,13 @@ public class Process {
this.processResourceSchedule = processResourceSchedulesByProcessId;
}
- @OneToOne(mappedBy = "process")
- public ProcessStatus getProcessStatus() {
- return processStatus;
+ @OneToMany(mappedBy = "process")
+ public Collection<ProcessStatus> getProcessStatuses() {
+ return processStatuses;
}
- public void setProcessStatus(ProcessStatus processStatusesByProcessId) {
- this.processStatus = processStatusesByProcessId;
+ public void setProcessStatuses(Collection<ProcessStatus> processStatusesByProcessId) {
+ this.processStatuses = processStatusesByProcessId;
}
@OneToMany(mappedBy = "process")
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
index cd64ad7..fa6f45e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
@@ -29,8 +29,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "PROCESS_ERROR")
+@IdClass(ProcessErrorPK.class)
public class ProcessError {
private final static Logger logger = LoggerFactory.getLogger(ProcessError.class);
+ private String errorId;
private String processId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -40,6 +42,16 @@ public class ProcessError {
private Process process;
@Id
+ @Column(name = "ERROR_ID")
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
+ @Basic
@Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
@@ -106,6 +118,7 @@ public class ProcessError {
ProcessError that = (ProcessError) o;
+ if (errorId != that.errorId) return false;
if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
return false;
if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
@@ -122,7 +135,8 @@ public class ProcessError {
@Override
public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
+ int result = errorId != null ? errorId.hashCode() : 0;
+ result = 31 * result + (processId != null ? processId.hashCode() : 0);
result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
@@ -131,7 +145,7 @@ public class ProcessError {
return result;
}
- @OneToOne
+ @ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID", nullable = false)
public Process getProcess() {
return process;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
new file mode 100644
index 0000000..c335016
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ProcessErrorPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ProcessErrorPK.class);
+ private String errorId;
+ private String processId;
+
+ @Column(name = "ERROR_ID")
+ @Id
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
+ @Column(name = "PROCESS_ID")
+ @Id
+ public String getProcessId() {
+ return processId;
+ }
+
+ public void setProcessId(String processId) {
+ this.processId = processId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessErrorPK that = (ProcessErrorPK) o;
+
+ if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
+ if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = errorId != null ? errorId.hashCode() : 0;
+ result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
index 0ef2cba..ed99b64 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
@@ -28,9 +28,9 @@ import java.lang.*;
@Entity
@Table(name = "PROCESS_INPUT")
+@IdClass(ProcessInputPK.class)
public class ProcessInput {
private final static Logger logger = LoggerFactory.getLogger(ProcessInput.class);
- private int processInputId;
private String processId;
private String inputName;
private String inputValue;
@@ -45,22 +45,7 @@ public class ProcessInput {
private Boolean dataStaged;
private Process process;
- public void setProcessInputId(Integer processInputId) {
- this.processInputId = processInputId;
- }
-
@Id
- @GeneratedValue
- @Column(name = "PROCESS_INPUT_ID")
- public int getProcessInputId() {
- return processInputId;
- }
-
- public void setProcessInputId(int processInputId) {
- this.processInputId = processInputId;
- }
-
- @Basic
@Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
@@ -70,7 +55,7 @@ public class ProcessInput {
this.processId = processId;
}
- @Basic
+ @Id
@Column(name = "INPUT_NAME")
public String getInputName() {
return inputName;
@@ -187,7 +172,6 @@ public class ProcessInput {
ProcessInput that = (ProcessInput) o;
- if (processInputId != that.processInputId) return false;
if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
return false;
if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
@@ -210,8 +194,7 @@ public class ProcessInput {
@Override
public int hashCode() {
- int result = processInputId;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ int result = processId != null ? processId.hashCode() : 0;
result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
new file mode 100644
index 0000000..8731d36
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ProcessInputPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ProcessInputPK.class);
+ private String processId;
+ private String inputName;
+
+ @Column(name = "PROCESS_ID")
+ @Basic
+ @Id
+ public String getProcessId() {
+ return processId;
+ }
+
+ public void setProcessId(String processId) {
+ this.processId = processId;
+ }
+
+ @Column(name = "INPUT_NAME")
+ @Basic
+ @Id
+ public String getInputName() {
+ return inputName;
+ }
+
+ public void setInputName(String inputName) {
+ this.inputName = inputName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessInputPK that = (ProcessInputPK) o;
+
+ if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
+ if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = processId != null ? processId.hashCode() : 0;
+ result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
index 0290539..7e38311 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
@@ -28,10 +28,12 @@ import java.lang.*;
@Entity
@Table(name = "PROCESS_OUTPUT")
+@IdClass(ProcessOutputPK.class)
public class ProcessOutput {
private final static Logger logger = LoggerFactory.getLogger(ProcessOutput.class);
- private int processOutputId;
private String processId;
+ private String outputName;
+ private String outputValue;
private String dataType;
private String applicationArgument;
private Boolean isRequired;
@@ -41,29 +43,34 @@ public class ProcessOutput {
private String searchQuery;
private Process process;
- public void setProcessOutputId(Integer processOutputId) {
- this.processOutputId = processOutputId;
+ @Id
+ @Column(name = "PROCESS_ID")
+ public String getProcessId() {
+ return processId;
+ }
+
+ public void setProcessId(String processId) {
+ this.processId = processId;
}
@Id
- @GeneratedValue
- @Column(name = "PROCESS_OUTPUT_ID")
- public int getProcessOutputId() {
- return processOutputId;
+ @Column(name = "OUTPUT_NAME")
+ public String getOutputName() {
+ return outputName;
}
- public void setProcessOutputId(int processOutputId) {
- this.processOutputId = processOutputId;
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
}
@Basic
- @Column(name = "PROCESS_ID")
- public String getProcessId() {
- return processId;
+ @Column(name = "OUTPUT_VALUE")
+ public String getOutputValue() {
+ return outputValue;
}
- public void setProcessId(String processId) {
- this.processId = processId;
+ public void setOutputValue(String outputValue) {
+ this.outputValue = outputValue;
}
@Basic
@@ -142,8 +149,10 @@ public class ProcessOutput {
if (o == null || getClass() != o.getClass()) return false;
ProcessOutput that = (ProcessOutput) o;
-
- if (processOutputId != that.processOutputId) return false;
+ if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
+ return false;
+ if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
+ return false;
if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
return false;
if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
@@ -160,8 +169,9 @@ public class ProcessOutput {
@Override
public int hashCode() {
- int result = processOutputId;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ int result = processId != null ? processId.hashCode() : 0;
+ result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
new file mode 100644
index 0000000..5a64b86
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
@@ -0,0 +1,76 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Basic;
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ProcessOutputPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ProcessOutputPK.class);
+ private String processId;
+ private String outputName;
+
+ @Column(name = "PROCESS_ID")
+ @Basic
+ @Id
+ public String getProcessId() {
+ return processId;
+ }
+
+ public void setProcessId(String processId) {
+ this.processId = processId;
+ }
+
+ @Column(name = "OUTPUT_NAME")
+ @Id
+ public String getOutputName() {
+ return outputName;
+ }
+
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessOutputPK that = (ProcessOutputPK) o;
+
+ if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false;
+ if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = processId != null ? processId.hashCode() : 0;
+ result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
index c322dc3..ced0135 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
@@ -29,8 +29,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "PROCESS_STATUS")
+@IdClass(ProcessStatusPK.class)
public class ProcessStatus {
private final static Logger logger = LoggerFactory.getLogger(ProcessStatus.class);
+ private String statusId;
private String processId;
private String state;
private Timestamp timeOfStateChange;
@@ -38,6 +40,16 @@ public class ProcessStatus {
private Process process;
@Id
+ @Column(name = "STATUS_ID")
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Id
@Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
@@ -83,7 +95,7 @@ public class ProcessStatus {
if (o == null || getClass() != o.getClass()) return false;
ProcessStatus that = (ProcessStatus) o;
-
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
if (state != null ? !state.equals(that.state) : that.state != null) return false;
@@ -95,14 +107,15 @@ public class ProcessStatus {
@Override
public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (processId != null ? processId.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
result = 31 * result + (reason != null ? reason.hashCode() : 0);
return result;
}
- @OneToOne
+ @ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID", nullable = false)
public Process getProcess() {
return process;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
new file mode 100644
index 0000000..a57a4d8
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ProcessStatusPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ProcessStatusPK.class);
+ private String statusId;
+ private String processId;
+
+ @Column(name = "STATUS_ID")
+ @Id
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Column(name = "PROCESS_ID")
+ @Id
+ public String getProcessId() {
+ return processId;
+ }
+
+ public void setProcessId(String processId) {
+ this.processId = processId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProcessStatusPK that = (ProcessStatusPK) o;
+
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+ if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
index c2ae505..60a755b 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
@@ -27,7 +27,7 @@ import javax.persistence.*;
@Entity
@Table(name = "PROJECT_USER")
-@IdClass(ProjectUsersPK.class)
+@IdClass(ProjectUserPK.class)
public class ProjectUser {
private final static Logger logger = LoggerFactory.getLogger(ProjectUser.class);
private String projectId;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
new file mode 100644
index 0000000..5cf3364
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class ProjectUserPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(ProjectUserPK.class);
+ private String projectId;
+ private String userName;
+
+ @Column(name = "PROJECT_ID")
+ @Id
+ public String getProjectId() {
+ return projectId;
+ }
+
+ public void setProjectId(String projectId) {
+ this.projectId = projectId;
+ }
+
+ @Column(name = "USER_NAME")
+ @Id
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ ProjectUserPK that = (ProjectUserPK) o;
+
+ if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
+ if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = projectId != null ? projectId.hashCode() : 0;
+ result = 31 * result + (userName != null ? userName.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUsersPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUsersPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUsersPK.java
deleted file mode 100644
index 8bd0e89..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUsersPK.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.experiment.catalog.model;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.Column;
-import javax.persistence.Id;
-import java.io.Serializable;
-
-public class ProjectUsersPK implements Serializable {
- private final static Logger logger = LoggerFactory.getLogger(ProjectUsersPK.class);
- private String projectId;
- private String userName;
-
- @Column(name = "PROJECT_ID")
- @Id
- public String getProjectId() {
- return projectId;
- }
-
- public void setProjectId(String projectId) {
- this.projectId = projectId;
- }
-
- @Column(name = "USER_NAME")
- @Id
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProjectUsersPK that = (ProjectUsersPK) o;
-
- if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = projectId != null ? projectId.hashCode() : 0;
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
- return result;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
index 2e7fc07..6f8d7b1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
@@ -26,6 +26,7 @@ import org.slf4j.LoggerFactory;
import javax.persistence.*;
import java.lang.*;
import java.sql.Timestamp;
+import java.util.Collection;
@Entity
@Table(name = "TASK")
@@ -39,8 +40,8 @@ public class Task {
private String taskDetail;
private Byte taskInternalStore;
private Process process;
- private TaskError taskError;
- private TaskStatus taskStatus;
+ private Collection<TaskError> taskErrors;
+ private Collection<TaskStatus> taskStatuses;
@Id
@Column(name = "TASK_ID")
@@ -155,21 +156,21 @@ public class Task {
this.process = processByParentProcessId;
}
- @OneToOne(mappedBy = "task")
- public TaskError getTaskError() {
- return taskError;
+ @OneToMany(mappedBy = "task")
+ public Collection<TaskError> getTaskErrors() {
+ return taskErrors;
}
- public void setTaskError(TaskError taskErrorsByTaskId) {
- this.taskError = taskErrorsByTaskId;
+ public void setTaskErrors(Collection<TaskError> taskErrorsByTaskId) {
+ this.taskErrors = taskErrorsByTaskId;
}
- @OneToOne(mappedBy = "task")
- public TaskStatus getTaskStatus() {
- return taskStatus;
+ @OneToMany(mappedBy = "task")
+ public Collection<TaskStatus> getTaskStatuses() {
+ return taskStatuses;
}
- public void setTaskStatus(TaskStatus taskStatusesByTaskId) {
- this.taskStatus = taskStatusesByTaskId;
+ public void setTaskStatuses(Collection<TaskStatus> taskStatusesByTaskId) {
+ this.taskStatuses = taskStatusesByTaskId;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
index 3efe523..375231d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
@@ -28,8 +28,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "TASK_ERROR")
+@IdClass(TaskErrorPK.class)
public class TaskError {
private final static Logger logger = LoggerFactory.getLogger(TaskError.class);
+ private String errorId;
private String taskId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -39,6 +41,16 @@ public class TaskError {
private Task task;
@Id
+ @Column(name = "ERROR_ID")
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
+ @Id
@Column(name = "TASK_ID")
public String getTaskId() {
return taskId;
@@ -104,7 +116,7 @@ public class TaskError {
if (o == null || getClass() != o.getClass()) return false;
TaskError that = (TaskError) o;
-
+ if (errorId != that.errorId) return false;
if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
return false;
if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
@@ -121,7 +133,8 @@ public class TaskError {
@Override
public int hashCode() {
- int result = taskId != null ? taskId.hashCode() : 0;
+ int result = errorId != null ? errorId.hashCode() : 0;
+ result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
@@ -130,7 +143,7 @@ public class TaskError {
return result;
}
- @OneToOne
+ @ManyToOne
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID", nullable = false)
public Task getTask() {
return task;
[11/11] airavata git commit: Fixing minor issues and fixing the
registry test cases
Posted by sc...@apache.org.
Fixing minor issues and fixing the registry test cases
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/cb5d3aef
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/cb5d3aef
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/cb5d3aef
Branch: refs/heads/master
Commit: cb5d3aef069d7116f65a26e906bad3f567242615
Parents: 21de9e0
Author: Supun Nakandala <sc...@apache.org>
Authored: Sun Jun 21 02:31:16 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sun Jun 21 02:31:16 2015 +0530
----------------------------------------------------------------------
.../experiment/catalog/ExpCatResourceUtils.java | 4 +-
.../catalog/impl/ExperimentCatalogImpl.java | 271 +-
.../catalog/impl/ExperimentRegistry.java | 3021 +++++++++---------
.../experiment/catalog/model/Experiment.java | 106 +-
.../catalog/model/ExperimentError.java | 66 +-
.../catalog/model/ExperimentErrorPK.java | 9 +-
.../catalog/model/ExperimentInput.java | 86 +-
.../catalog/model/ExperimentInputPK.java | 8 +-
.../catalog/model/ExperimentOutput.java | 76 +-
.../catalog/model/ExperimentOutputPK.java | 9 +-
.../catalog/model/ExperimentStatus.java | 50 +-
.../catalog/model/ExperimentStatusPK.java | 8 +-
.../catalog/model/ExperimentSummary.java | 78 +-
.../core/experiment/catalog/model/Gateway.java | 52 +-
.../experiment/catalog/model/GatewayWorker.java | 44 +-
.../catalog/model/GatewayWorkerPK.java | 8 +-
.../core/experiment/catalog/model/Process.java | 68 +-
.../experiment/catalog/model/ProcessError.java | 66 +-
.../catalog/model/ProcessErrorPK.java | 8 +-
.../experiment/catalog/model/ProcessInput.java | 86 +-
.../catalog/model/ProcessInputPK.java | 8 +-
.../experiment/catalog/model/ProcessOutput.java | 76 +-
.../catalog/model/ProcessOutputPK.java | 9 +-
.../catalog/model/ProcessResourceSchedule.java | 72 +-
.../experiment/catalog/model/ProcessStatus.java | 50 +-
.../catalog/model/ProcessStatusPK.java | 8 +-
.../core/experiment/catalog/model/Project.java | 82 +-
.../experiment/catalog/model/ProjectUser.java | 44 +-
.../experiment/catalog/model/ProjectUserPK.java | 8 +-
.../core/experiment/catalog/model/Task.java | 64 +-
.../experiment/catalog/model/TaskError.java | 64 +-
.../experiment/catalog/model/TaskErrorPK.java | 8 +-
.../experiment/catalog/model/TaskStatus.java | 50 +-
.../experiment/catalog/model/TaskStatusPK.java | 8 +-
.../core/experiment/catalog/model/User.java | 115 -
.../catalog/model/UserConfigurationData.java | 104 +-
.../core/experiment/catalog/model/Users.java | 115 +
.../resources/AbstractExpCatResource.java | 26 +-
.../catalog/resources/ExperimentResource.java | 5 +-
.../catalog/resources/GatewayResource.java | 20 +-
.../catalog/resources/ProcessResource.java | 4 +-
.../catalog/resources/ProjectResource.java | 10 +-
.../catalog/resources/ProjectUserResource.java | 4 +-
.../catalog/resources/UserResource.java | 6 +-
.../experiment/catalog/resources/Utils.java | 74 +-
.../catalog/resources/WorkerResource.java | 4 +-
.../src/main/resources/META-INF/persistence.xml | 2 +-
.../src/main/resources/expcatalog-derby.sql | 76 +-
.../src/main/resources/expcatalog-mysql.sql | 50 +-
.../catalog/ExperimentInputResourceTest.java | 2 +-
.../catalog/ExperimentOutputResourceTest.java | 2 +-
.../experiment/catalog/GatewayResourceTest.java | 3 +-
.../src/test/resources/expcatalog-derby.sql | 477 ++-
.../registry/cpi/ExpCatChildDataType.java | 28 +-
.../cpi/ExperimentCatalogModelType.java | 28 +-
55 files changed, 2815 insertions(+), 3015 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
index e8c5607..1dc2625 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/ExpCatResourceUtils.java
@@ -158,7 +158,7 @@ public class ExpCatResourceUtils {
try {
if (isUserExist(userName)) {
em = getEntityManager();
- User user = em.find(User.class, userName);
+ Users user = em.find(Users.class, userName);
UserResource userResource = (UserResource)Utils.getResource(ResourceType.USER, user);
em.close();
return userResource;
@@ -313,7 +313,7 @@ public class ExpCatResourceUtils {
userResource.save();
}
Gateway gateway = em.find(Gateway.class, gatewayResource.getGatewayId());
- User user = em.find(User.class, userResource.getUserName());
+ Users user = em.find(Users.class, userResource.getUserName());
GatewayWorker gatewayWorker = new GatewayWorker();
gatewayWorker.setGateway(gateway);
gatewayWorker.setUser(user);
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
index 94a881e..e52e56a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/impl/ExperimentCatalogImpl.java
@@ -25,15 +25,14 @@ import org.apache.airavata.common.exception.ApplicationSettingsException;
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.model.application.io.OutputDataObjectType;
import org.apache.airavata.model.commons.ErrorModel;
-import org.apache.airavata.model.job.JobModel;
-import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.experiment.ExperimentSummaryModel;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
+import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.status.ExperimentStatus;
-import org.apache.airavata.model.status.JobStatus;
-import org.apache.airavata.model.status.TaskStatus;
import org.apache.airavata.model.task.TaskModel;
import org.apache.airavata.model.workspace.Gateway;
import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.experiment.*;
import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.resources.GatewayResource;
import org.apache.airavata.registry.core.experiment.catalog.resources.UserResource;
@@ -142,44 +141,26 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
public Object add(ExpCatChildDataType dataType, Object newObjectToAdd, Object dependentIdentifier) throws RegistryException {
try {
switch (dataType) {
- case EXPERIMENT_CONFIGURATION_DATA:
+ case USER_CONFIGURATION_DATA:
return experimentRegistry.addUserConfigData((UserConfigurationDataModel) newObjectToAdd, (String) dependentIdentifier);
case EXPERIMENT_OUTPUT:
return experimentRegistry.addExpOutputs((List<OutputDataObjectType>) newObjectToAdd, (String) dependentIdentifier);
case EXPERIMENT_STATUS:
return experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToAdd, (String) dependentIdentifier);
-// case WORKFLOW_NODE_DETAIL:
-// return experimentRegistry.addWorkflowNodeDetails((WorkflowNodeDetails) newObjectToAdd, (String) dependentIdentifier);
-// case WORKFLOW_NODE_STATUS:
-// return experimentRegistry.addWorkflowNodeStatus((WorkflowNodeStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case NODE_OUTPUT:
-// return experimentRegistry.addNodeOutputs((List<OutputDataObjectType>) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case TASK_DETAIL:
-// return experimentRegistry.addTaskDetails((TaskModel) newObjectToAdd, (String) dependentIdentifier);
- case APPLICATION_OUTPUT:
- return experimentRegistry.addApplicationOutputs((List<OutputDataObjectType>) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
+ case EXPERIMENT_ERROR:
+ return experimentRegistry.updateExperimentError((ErrorModel) newObjectToAdd, (String) dependentIdentifier);
+ case PROCESS_RESOURCE_SCHEDULE:
+ return experimentRegistry.addUserConfigData((UserConfigurationDataModel) newObjectToAdd, (String) dependentIdentifier);
+ case PROCESS_OUTPUT:
+ return experimentRegistry.addExpOutputs((List<OutputDataObjectType>) newObjectToAdd, (String) dependentIdentifier);
+ case PROCESS_STATUS:
+ return experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToAdd, (String) dependentIdentifier);
+ case PROCESS_ERROR:
+ return experimentRegistry.updateExperimentError((ErrorModel) newObjectToAdd, (String) dependentIdentifier);
case TASK_STATUS:
- return experimentRegistry.addTaskStatus((TaskStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case JOB_DETAIL:
-// return experimentRegistry.addJobDetails((JobDetails) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
- case JOB_STATUS:
- return experimentRegistry.addJobStatus((JobStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case APPLICATION_STATUS:
-// return experimentRegistry.addApplicationStatus((ApplicationStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case DATA_TRANSFER_DETAIL:
-// return experimentRegistry.addDataTransferDetails((DataTransferDetails) newObjectToAdd, (String) dependentIdentifier);
-// case TRANSFER_STATUS:
-// return experimentRegistry.addTransferStatus((TransferStatus) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
- case COMPUTATIONAL_RESOURCE_SCHEDULING:
- return experimentRegistry.addComputationalResourceScheduling((ComputationalResourceSchedulingModel) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case ADVANCE_OUTPUT_DATA_HANDLING:
-// return experimentRegistry.addOutputDataHandling((AdvancedOutputDataHandling) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case ADVANCE_INPUT_DATA_HANDLING:
-// return experimentRegistry.addInputDataHandling((AdvancedInputDataHandling) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
-// case QOS_PARAM:
-// return experimentRegistry.addQosParams((QualityOfServiceParams) newObjectToAdd, (CompositeIdentifier) dependentIdentifier);
- case ERROR_DETAIL:
- return experimentRegistry.addErrorDetails((ErrorModel) newObjectToAdd, dependentIdentifier);
+ return experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToAdd, (String) dependentIdentifier);
+ case TASK_ERROR:
+ return experimentRegistry.updateExperimentError((ErrorModel) newObjectToAdd, (String) dependentIdentifier);
default:
logger.error("Unsupported dependent data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -215,7 +196,7 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
case EXPERIMENT:
experimentRegistry.updateExperiment((ExperimentModel) newObjectToUpdate, (String) identifier);
break;
- case EXPERIMENT_CONFIGURATION_DATA:
+ case USER_CONFIGURATION_DATA:
experimentRegistry.updateUserConfigData((UserConfigurationDataModel) newObjectToUpdate, (String) identifier);
break;
case EXPERIMENT_OUTPUT:
@@ -224,51 +205,24 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
case EXPERIMENT_STATUS:
experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
break;
-// case WORKFLOW_NODE_DETAIL:
-// experimentRegistry.updateWorkflowNodeDetails((WorkflowNodeDetails) newObjectToUpdate, (String) identifier);
-// break;
-// case WORKFLOW_NODE_STATUS:
-// experimentRegistry.updateWorkflowNodeStatus((WorkflowNodeStatus) newObjectToUpdate, (String) identifier);
-// break;
-// case NODE_OUTPUT:
-// experimentRegistry.updateNodeOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier);
-// break;
-// case TASK_DETAIL:
-// experimentRegistry.updateTaskDetails((TaskDetails) newObjectToUpdate, (String) identifier);
-// break;
- case APPLICATION_OUTPUT:
- experimentRegistry.updateAppOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier);
+ case EXPERIMENT_ERROR:
+ experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
break;
- case TASK_STATUS:
- experimentRegistry.updateTaskStatus((TaskStatus) newObjectToUpdate, (String) identifier);
+ case PROCESS_RESOURCE_SCHEDULE:
+ experimentRegistry.updateExpOutputs((List<OutputDataObjectType>) newObjectToUpdate, (String) identifier);
break;
- case JOB_DETAIL:
- experimentRegistry.updateJobDetails((JobModel) newObjectToUpdate, (CompositeIdentifier) identifier);
+ case PROCESS_STATUS:
+ experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
break;
- case JOB_STATUS:
- experimentRegistry.updateJobStatus((JobStatus) newObjectToUpdate, (CompositeIdentifier) identifier);
+ case PROCESS_ERROR:
+ experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
break;
-// case APPLICATION_STATUS:
-// experimentRegistry.updateApplicationStatus((ApplicationStatus) newObjectToUpdate, (String) identifier);
-// break;
-// case DATA_TRANSFER_DETAIL:
-// experimentRegistry.updateDataTransferDetails((DataTransferDetails) newObjectToUpdate, (String) identifier);
-// break;
-// case TRANSFER_STATUS:
-// experimentRegistry.updateTransferStatus((TransferStatus) newObjectToUpdate, (String) identifier);
-// break;
- case COMPUTATIONAL_RESOURCE_SCHEDULING:
- experimentRegistry.updateScheduling((ComputationalResourceSchedulingModel) newObjectToUpdate, (String) identifier, dataType.toString());
+ case TASK_STATUS:
+ experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
+ break;
+ case TASK_ERROR:
+ experimentRegistry.updateExperimentStatus((ExperimentStatus) newObjectToUpdate, (String) identifier);
break;
-// case ADVANCE_INPUT_DATA_HANDLING:
-// experimentRegistry.updateInputDataHandling((AdvancedInputDataHandling) newObjectToUpdate, (String) identifier, dataType.toString());
-// break;
-// case ADVANCE_OUTPUT_DATA_HANDLING:
-// experimentRegistry.updateOutputDataHandling((AdvancedOutputDataHandling) newObjectToUpdate, (String) identifier, dataType.toString());
-// break;
-// case QOS_PARAM:
-// experimentRegistry.updateQOSParams((QualityOfServiceParams) newObjectToUpdate, (String) identifier, dataType.toString());
-// break;
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -300,8 +254,8 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
case EXPERIMENT:
experimentRegistry.updateExperimentField((String) identifier, fieldName, value);
break;
- case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.updateExpConfigDataField((String) identifier, fieldName, value);
+ case USER_CONFIGURATION_DATA:
+ experimentRegistry.updateUserConfigDataField((String) identifier, fieldName, value);
break;
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
@@ -334,42 +288,34 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
return gatewayRegistry.getGateway((String)identifier);
case EXPERIMENT:
return experimentRegistry.getExperiment((String) identifier, null);
- case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.getConfigData((String) identifier, null);
+ case USER_CONFIGURATION_DATA:
+ return experimentRegistry.getUserConfigData((String) identifier, null);
+ case EXPERIMENT_INPUT:
+ return experimentRegistry.getExperimentInputs((String) identifier);
case EXPERIMENT_OUTPUT:
return experimentRegistry.getExperimentOutputs((String) identifier);
case EXPERIMENT_STATUS:
return experimentRegistry.getExperimentStatus((String) identifier);
-// case WORKFLOW_NODE_DETAIL:
-// return experimentRegistry.getWorkflowNodeDetails((String) identifier);
-// case WORKFLOW_NODE_STATUS:
-// return experimentRegistry.getWorkflowNodeStatus((String) identifier);
-// case NODE_OUTPUT:
-// return experimentRegistry.getNodeOutputs((String) identifier);
- case TASK_DETAIL:
- return experimentRegistry.getTaskDetails((String) identifier);
- case APPLICATION_OUTPUT:
- return experimentRegistry.getApplicationOutputs((String) identifier);
+ case EXPERIMENT_ERROR:
+ return experimentRegistry.getExperimentError((String) identifier);
+ case PROCESS:
+ return experimentRegistry.getProcess((String) identifier, null);
+ case PROCESS_RESOURCE_SCHEDULE:
+ return experimentRegistry.getProcessResourceSchedule((String) identifier, null);
+ case PROCESS_INPUT:
+ return experimentRegistry.getProcessInputs((String) identifier);
+ case PROCESS_OUTPUT:
+ return experimentRegistry.getProcessOutputs((String) identifier);
+ case PROCESS_STATUS:
+ return experimentRegistry.getProcessStatus((String) identifier);
+ case PROCESS_ERROR:
+ return experimentRegistry.getProcessError((String) identifier);
+ case TASK:
+ return experimentRegistry.getTask((String) identifier);
case TASK_STATUS:
return experimentRegistry.getTaskStatus((String) identifier);
- case JOB_DETAIL:
- return experimentRegistry.getJobDetails((CompositeIdentifier) identifier);
- case JOB_STATUS:
- return experimentRegistry.getJobStatus((CompositeIdentifier) identifier);
-// case APPLICATION_STATUS:
-// return experimentRegistry.getApplicationStatus((CompositeIdentifier) identifier);
-// case DATA_TRANSFER_DETAIL:
-// return experimentRegistry.getDataTransferDetails((String) identifier);
-// case TRANSFER_STATUS:
-// return experimentRegistry.getDataTransferStatus((String) identifier);
- case COMPUTATIONAL_RESOURCE_SCHEDULING:
- return experimentRegistry.getComputationalScheduling(dataType, (String) identifier);
-// case ADVANCE_INPUT_DATA_HANDLING:
-// return experimentRegistry.getInputDataHandling(dataType, (String) identifier);
-// case ADVANCE_OUTPUT_DATA_HANDLING:
-// return experimentRegistry.getOutputDataHandling(dataType, (String) identifier);
-// case QOS_PARAM:
-// return experimentRegistry.getQosParams(dataType, (String) identifier);
+ case TASK_ERROR:
+ return experimentRegistry.getTaskError((String) identifier);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -413,40 +359,16 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
result.add(experiment);
}
return result;
-// case WORKFLOW_NODE_DETAIL:
-// List<WorkflowNodeDetails> wfNodeDetails = experimentRegistry.getWFNodeDetails(fieldName, value);
-// for (WorkflowNodeDetails wf : wfNodeDetails) {
-// result.add(wf);
-// }
-// return result;
-// case WORKFLOW_NODE_STATUS:
-// List<WorkflowNodeStatus> wfNodeStatusList = experimentRegistry.getWFNodeStatusList(fieldName, value);
-// for (WorkflowNodeStatus wfs : wfNodeStatusList) {
-// result.add(wfs);
-// }
-// return result;
- case TASK_DETAIL:
- List<TaskModel> taskDetails = experimentRegistry.getTaskDetails(fieldName, value);
- for (TaskModel task : taskDetails) {
- result.add(task);
+ case PROCESS:
+ List<ProcessModel> processList = experimentRegistry.getProcessList(fieldName, value);
+ for (ProcessModel process : processList) {
+ result.add(process);
}
return result;
- case JOB_DETAIL:
- List<JobModel> jobDetails = experimentRegistry.getJobDetails(fieldName, value);
- for (JobModel job : jobDetails) {
- result.add(job);
- }
- return result;
-// case DATA_TRANSFER_DETAIL:
-// List<DataTransferDetails> dataTransferDetails = experimentRegistry.getDataTransferDetails(fieldName, value);
-// for (DataTransferDetails transferDetails : dataTransferDetails) {
-// result.add(transferDetails);
-// }
-// return result;
- case ERROR_DETAIL:
- List<ErrorModel> errorDetails = experimentRegistry.getErrorDetails(fieldName, value);
- for (ErrorModel error : errorDetails) {
- result.add(error);
+ case TASK:
+ List<TaskModel> taskList = experimentRegistry.getTaskList(fieldName, value);
+ for (TaskModel task : taskList) {
+ result.add(task);
}
return result;
default:
@@ -582,8 +504,8 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
switch (dataType) {
case EXPERIMENT:
return experimentRegistry.getExperiment((String) identifier, field);
- case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.getConfigData((String) identifier, field);
+ case USER_CONFIGURATION_DATA:
+ return experimentRegistry.getUserConfigData((String) identifier, field);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -615,16 +537,10 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
return projectRegistry.getProjectIDs(fieldName, value);
case EXPERIMENT:
return experimentRegistry.getExperimentIDs(fieldName, value);
- case EXPERIMENT_CONFIGURATION_DATA:
- return experimentRegistry.getExperimentIDs(fieldName, value);
-// case WORKFLOW_NODE_DETAIL:
-// return experimentRegistry.getWorkflowNodeIds(fieldName, value);
- case TASK_DETAIL:
+ case PROCESS:
return experimentRegistry.getTaskDetailIds(fieldName, value);
- case JOB_DETAIL:
+ case TASK:
return experimentRegistry.getJobDetailIds(fieldName, value);
-// case DATA_TRANSFER_DETAIL:
-// return experimentRegistry.getTransferDetailIds(fieldName, value);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
@@ -657,32 +573,17 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
case EXPERIMENT:
experimentRegistry.removeExperiment((String) identifier);
break;
- case EXPERIMENT_CONFIGURATION_DATA:
- experimentRegistry.removeExperimentConfigData((String) identifier);
+ case USER_CONFIGURATION_DATA:
+ experimentRegistry.removeUserConfigData((String) identifier);
break;
- case WORKFLOW_NODE_DETAIL:
+ case PROCESS:
experimentRegistry.removeWorkflowNode((String) identifier);
break;
- case TASK_DETAIL:
- experimentRegistry.removeTaskDetails((String) identifier);
- break;
- case JOB_DETAIL:
- experimentRegistry.removeJobDetails((CompositeIdentifier) identifier);
- break;
- case DATA_TRANSFER_DETAIL:
- experimentRegistry.removeDataTransferDetails((String) identifier);
- break;
- case COMPUTATIONAL_RESOURCE_SCHEDULING:
+ case PROCESS_RESOURCE_SCHEDULE:
experimentRegistry.removeComputationalScheduling(dataType, (String) identifier);
break;
- case ADVANCE_OUTPUT_DATA_HANDLING:
- experimentRegistry.removeOutputDataHandling(dataType, (String) identifier);
- break;
- case ADVANCE_INPUT_DATA_HANDLING:
- experimentRegistry.removeInputDataHandling(dataType, (String) identifier);
- break;
- case QOS_PARAM:
- experimentRegistry.removeQOSParams(dataType, (String) identifier);
+ case TASK:
+ experimentRegistry.removeTaskDetails((String) identifier);
break;
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
@@ -709,29 +610,19 @@ public class ExperimentCatalogImpl implements ExperimentCatalog {
try {
switch (dataType) {
case PROJECT:
- return projectRegistry.isProjectExist((String)identifier);
+ return projectRegistry.isProjectExist((String) identifier);
case GATEWAY:
- return gatewayRegistry.isGatewayExist((String)identifier);
+ return gatewayRegistry.isGatewayExist((String) identifier);
case EXPERIMENT:
return experimentRegistry.isExperimentExist((String) identifier);
- case EXPERIMENT_CONFIGURATION_DATA:
+ case USER_CONFIGURATION_DATA:
return experimentRegistry.isExperimentConfigDataExist((String) identifier);
- case WORKFLOW_NODE_DETAIL:
+ case PROCESS:
return experimentRegistry.isWFNodeExist((String) identifier);
- case TASK_DETAIL:
- return experimentRegistry.isTaskDetailExist((String) identifier);
- case JOB_DETAIL:
- return experimentRegistry.isJobDetailExist((CompositeIdentifier) identifier);
- case DATA_TRANSFER_DETAIL:
- return experimentRegistry.isTransferDetailExist((String) identifier);
- case COMPUTATIONAL_RESOURCE_SCHEDULING:
+ case PROCESS_RESOURCE_SCHEDULE:
return experimentRegistry.isComputationalSchedulingExist(dataType, (String) identifier);
- case ADVANCE_INPUT_DATA_HANDLING:
- return experimentRegistry.isInputDataHandlingExist(dataType, (String) identifier);
- case ADVANCE_OUTPUT_DATA_HANDLING:
- return experimentRegistry.isOutputDataHandlingExist(dataType, (String) identifier);
- case QOS_PARAM:
- return experimentRegistry.isQOSParamsExist(dataType, (String) identifier);
+ case TASK:
+ return experimentRegistry.isTaskDetailExist((String) identifier);
default:
logger.error("Unsupported data type...", new UnsupportedOperationException());
throw new UnsupportedOperationException();
[03/11] airavata git commit: modifying the data models to contain all
the statuses and errors
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
new file mode 100644
index 0000000..ad55046
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class TaskErrorPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(TaskErrorPK.class);
+ private String errorId;
+ private String taskId;
+
+ @Column(name = "ERROR_ID")
+ @Id
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
+ @Column(name = "TASK_ID")
+ @Id
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TaskErrorPK that = (TaskErrorPK) o;
+
+ if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
+ if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = errorId != null ? errorId.hashCode() : 0;
+ result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
index 020fe1b..8b7da25 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
@@ -28,8 +28,10 @@ import java.sql.Timestamp;
@Entity
@Table(name = "TASK_STATUS")
+@IdClass(TaskStatusPK.class)
public class TaskStatus {
private final static Logger logger = LoggerFactory.getLogger(TaskStatus.class);
+ private String statusId;
private String taskId;
private String state;
private Timestamp timeOfStateChange;
@@ -37,6 +39,16 @@ public class TaskStatus {
private Task task;
@Id
+ @Column(name = "STATUS_ID")
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Id
@Column(name = "TASK_ID")
public String getTaskId() {
return taskId;
@@ -82,7 +94,7 @@ public class TaskStatus {
if (o == null || getClass() != o.getClass()) return false;
TaskStatus that = (TaskStatus) o;
-
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
if (state != null ? !state.equals(that.state) : that.state != null) return false;
if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
@@ -94,14 +106,15 @@ public class TaskStatus {
@Override
public int hashCode() {
- int result = taskId != null ? taskId.hashCode() : 0;
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
result = 31 * result + (reason != null ? reason.hashCode() : 0);
return result;
}
- @OneToOne
+ @ManyToOne
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID", nullable = false)
public Task getTask() {
return task;
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
new file mode 100644
index 0000000..3855294
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.Column;
+import javax.persistence.Id;
+import java.io.Serializable;
+
+public class TaskStatusPK implements Serializable {
+ private final static Logger logger = LoggerFactory.getLogger(TaskStatusPK.class);
+ private String statusId;
+ private String taskId;
+
+ @Column(name = "STATUS_ID")
+ @Id
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
+ @Column(name = "TASK_ID")
+ @Id
+ public String getTaskId() {
+ return taskId;
+ }
+
+ public void setTaskId(String taskId) {
+ this.taskId = taskId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ TaskStatusPK that = (TaskStatusPK) o;
+
+ if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+ if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = statusId != null ? statusId.hashCode() : 0;
+ result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+ return result;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
index 9c47b5a..18c7335 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
@@ -35,7 +35,7 @@ public class UserConfigurationData {
private Boolean shareExperimentPublically;
private Boolean throttleResources;
private String userDn;
- private Byte generateCert;
+ private Boolean generateCert;
private String resourceHostId;
private Integer totalCpuCount;
private Integer nodeCount;
@@ -107,11 +107,11 @@ public class UserConfigurationData {
@Basic
@Column(name = "GENERATE_CERT")
- public Byte getGenerateCert() {
+ public Boolean getGenerateCert() {
return generateCert;
}
- public void setGenerateCert(Byte generateCert) {
+ public void setGenerateCert(Boolean generateCert) {
this.generateCert = generateCert;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
index d250aa7..875240c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
@@ -105,6 +105,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// Task Error table
public final class TaskErrorConstants {
+ public static final String ERROR_ID = "errorId";
public static final String TASK_ID = "taskId";
public static final String CREATION_TIME = "creationTime";
public static final String ACTUAL_ERROR_MESSAGE = "actualErrorMsg";
@@ -115,6 +116,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Process Error table
public final class ProcessErrorConstants {
+ public static final String ERROR_ID = "errorId";
public static final String PROCESS_ID = "processId";
public static final String CREATION_TIME = "creationTime";
public static final String ACTUAL_ERROR_MESSAGE = "actualErrorMsg";
@@ -135,9 +137,8 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Process Input Table
public final class ProcessInputConstants {
- public static final String PROCESS_INPUT_ID = "processInputId";
public static final String PROCESS_ID = "processId";
- public static final String INPUT_KEY = "inputKey";
+ public static final String INPUT_NAME = "inputName";
public static final String INPUT_VALUE = "inputValue";
public static final String DATA_TYPE = "dataType";
public static final String APPLICATION_ARGUMENT = "applicationArgument";
@@ -152,8 +153,9 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Process Output Table
public final class ProcessOutputConstants {
- public static final String PROCESS_OUTPUT_ID = "processOutputId";
public static final String PROCESS_ID = "processId";
+ public static final String OUTPUT_NAME = "outputName";
+ public static final String OUTPUT_VALUE = "outputValue";
public static final String DATA_TYPE = "dataType";
public static final String APPLICATION_ARGUMENT = "applicationArgument";
public static final String IS_REQUIRED = "isRequired";
@@ -165,9 +167,8 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Experiment Input Table
public final class ExperimentInputConstants {
- public static final String EXPERIMENT_INPUT_ID = "experimentInputId";
public static final String EXPERIMENT_ID = "experimentId";
- public static final String INPUT_KEY = "inputKey";
+ public static final String INPUT_NAME = "inputName";
public static final String INPUT_VALUE = "inputValue";
public static final String DATA_TYPE = "dataType";
public static final String APPLICATION_ARGUMENT = "applicationArgument";
@@ -182,8 +183,9 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Experiment Output Table
public final class ExperimentOutputConstants {
- public static final String EXPERIMENT_OUTPUT_ID = "experimentOutputId";
public static final String EXPERIMENT_ID = "experimentId";
+ public static final String OUTPUT_NAME = "outputName";
+ public static final String OUTPUT_VALUE = "outputValue";
public static final String DATA_TYPE = "dataType";
public static final String APPLICATION_ARGUMENT = "applicationArgument";
public static final String IS_REQUIRED = "isRequired";
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
index 23a6055..b07bd82 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
@@ -35,6 +35,7 @@ import java.util.List;
public class ExperimentErrorResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ExperimentErrorResource.class);
+ private String errorId;
private String experimentId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -42,6 +43,14 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
private Boolean transientOrPersistent;
private String rootCauseErrorIdList;
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
public String getExperimentId() {
return experimentId;
}
@@ -127,6 +136,7 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
if(experimentError == null){
experimentError = new ExperimentError();
}
+ experimentError.setErrorId(errorId);
experimentError.setExperimentId(experimentId);
experimentError.setActualErrorMessage(actualErrorMessage);
experimentError.setUserFriendlyMessage(userFriendlyMessage);
@@ -147,4 +157,4 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
}
}
}
-}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
index 9a8124e..974baaf 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentOutputResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentOutput;
+import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentOutputPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,8 +35,9 @@ import java.util.List;
public class ExperimentOutputResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ExperimentOutputResource.class);
- private int experimentOutputId;
private String experimentId;
+ private String outputName;
+ private String outputValue;
private String dataType;
private String applicationArgument;
private Boolean isRequired;
@@ -44,14 +46,6 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
private String location;
private String searchQuery;
- public int getExperimentOutputId() {
- return experimentOutputId;
- }
-
- public void setExperimentOutputId(int experimentOutputId) {
- this.experimentOutputId = experimentOutputId;
- }
-
public String getExperimentId() {
return experimentId;
}
@@ -60,6 +54,22 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
this.experimentId = experimentId;
}
+ public String getOutputName() {
+ return outputName;
+ }
+
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
+ }
+
+ public String getOutputValue() {
+ return outputValue;
+ }
+
+ public void setOutputValue(String outputValue) {
+ this.outputValue = outputValue;
+ }
+
public String getDataType() {
return dataType;
}
@@ -149,12 +159,16 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
throw new RegistryException("Does not have the experiment id");
}
ExperimentOutput experimentOutput;
- experimentOutput = em.find(ExperimentOutput.class, experimentOutputId);
+ ExperimentOutputPK experimentOutputPK = new ExperimentOutputPK();
+ experimentOutputPK.setExperimentId(experimentId);
+ experimentOutputPK.setOutputName(outputName);
+ experimentOutput = em.find(ExperimentOutput.class, experimentOutputPK);
if(experimentOutput == null){
experimentOutput = new ExperimentOutput();
}
- experimentOutput.setExperimentOutputId(experimentOutputId);
experimentOutput.setExperimentId(experimentId);
+ experimentOutput.setOutputName(outputName);
+ experimentOutput.setOutputValue(outputValue);
experimentOutput.setDataType(dataType);
experimentOutput.setApplicationArgument(applicationArgument);
experimentOutput.setIsRequired(isRequired);
@@ -165,7 +179,6 @@ public class ExperimentOutputResource extends AbstractExpCatResource {
em.persist(experimentOutput);
em.getTransaction().commit();
em.close();
- this.experimentOutputId = experimentOutput.getExperimentOutputId();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RegistryException(e);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
index 9aa35f2..8ca7c05 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
@@ -203,13 +203,15 @@ public class ExperimentResource extends AbstractExpCatResource {
break;
case EXPERIMENT_INPUT:
generator = new QueryGenerator(EXPERIMENT_INPUT);
- generator.setParameter(ExperimentInputConstants.EXPERIMENT_INPUT_ID, name);
+ generator.setParameter(ExperimentInputConstants.INPUT_NAME, name);
+ generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, experimentId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
case EXPERIMENT_OUTPUT:
generator = new QueryGenerator(EXPERIMENT_OUTPUT);
- generator.setParameter(ExperimentOutputConstants.EXPERIMENT_OUTPUT_ID, name);
+ generator.setParameter(ExperimentOutputConstants.OUTPUT_NAME, name);
+ generator.setParameter(ExperimentOutputConstants.EXPERIMENT_ID, experimentId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
@@ -274,7 +276,7 @@ public class ExperimentResource extends AbstractExpCatResource {
return processErrorResource;
case EXPERIMENT_INPUT:
generator = new QueryGenerator(EXPERIMENT_INPUT);
- generator.setParameter(ExperimentInputConstants.EXPERIMENT_INPUT_ID, name);
+ generator.setParameter(ExperimentInputConstants.INPUT_NAME, name);
generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, experimentId);
q = generator.selectQuery(em);
ExperimentInput experimentInput = (ExperimentInput) q.getSingleResult();
@@ -284,7 +286,7 @@ public class ExperimentResource extends AbstractExpCatResource {
return experimentInputResource;
case EXPERIMENT_OUTPUT:
generator = new QueryGenerator(EXPERIMENT_OUTPUT);
- generator.setParameter(ExperimentOutputConstants.EXPERIMENT_OUTPUT_ID, name);
+ generator.setParameter(ExperimentOutputConstants.OUTPUT_NAME, name);
generator.setParameter(ExperimentInputConstants.EXPERIMENT_ID, experimentId);
q = generator.selectQuery(em);
ExperimentOutput experimentOutput = (ExperimentOutput) q.getSingleResult();
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
index 2f1f6de..343b6e4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
@@ -35,6 +35,7 @@ import java.util.List;
public class ProcessErrorResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ProcessErrorResource.class);
+ private String errorId;
private String processId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -42,6 +43,14 @@ public class ProcessErrorResource extends AbstractExpCatResource {
private Boolean transientOrPersistent;
private String rootCauseErrorIdList;
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
public String getProcessId() {
return processId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
index 521284a..6da7297 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
@@ -189,7 +189,6 @@ public class ProcessInputResource extends AbstractExpCatResource {
if(processInput == null){
processInput = new ProcessInput();
}
- processInput.setProcessInputId(processInputId);
processInput.setProcessId(processId);
processInput.setInputName(inputName);
processInput.setInputValue(inputValue);
@@ -205,7 +204,6 @@ public class ProcessInputResource extends AbstractExpCatResource {
em.persist(processInput);
em.getTransaction().commit();
em.close();
- this.processInputId = processInput.getProcessInputId();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RegistryException(e);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
index 1d496d9..f1ec1f0 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessOutputResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProcessOutput;
+import org.apache.airavata.registry.core.experiment.catalog.model.ProcessOutputPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,8 +35,9 @@ import java.util.List;
public class ProcessOutputResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ProcessOutputResource.class);
- private int processOutputId;
private String processId;
+ private String outputName;
+ private String outputValue;
private String dataType;
private String applicationArgument;
private Boolean isRequired;
@@ -44,14 +46,6 @@ public class ProcessOutputResource extends AbstractExpCatResource {
private String location;
private String searchQuery;
- public int getProcessOutputId() {
- return processOutputId;
- }
-
- public void setProcessOutputId(int processOutputId) {
- this.processOutputId = processOutputId;
- }
-
public String getProcessId() {
return processId;
}
@@ -60,6 +54,22 @@ public class ProcessOutputResource extends AbstractExpCatResource {
this.processId = processId;
}
+ public String getOutputName() {
+ return outputName;
+ }
+
+ public void setOutputName(String outputName) {
+ this.outputName = outputName;
+ }
+
+ public String getOutputValue() {
+ return outputValue;
+ }
+
+ public void setOutputValue(String outputValue) {
+ this.outputValue = outputValue;
+ }
+
public String getDataType() {
return dataType;
}
@@ -149,12 +159,16 @@ public class ProcessOutputResource extends AbstractExpCatResource {
throw new RegistryException("Does not have the process id");
}
ProcessOutput processOutput;
- processOutput = em.find(ProcessOutput.class, processOutputId);
+ ProcessOutputPK processOutputPK = new ProcessOutputPK();
+ processOutputPK.setProcessId(processId);
+ processOutputPK.setOutputName(outputName);
+ processOutput = em.find(ProcessOutput.class, processOutputPK);
if(processOutput == null){
processOutput = new ProcessOutput();
}
- processOutput.setProcessOutputId(processOutputId);
processOutput.setProcessId(processId);
+ processOutput.setOutputName(outputName);
+ processOutput.setOutputValue(outputValue);
processOutput.setDataType(dataType);
processOutput.setApplicationArgument(applicationArgument);
processOutput.setIsRequired(isRequired);
@@ -165,7 +179,6 @@ public class ProcessOutputResource extends AbstractExpCatResource {
em.persist(processOutput);
em.getTransaction().commit();
em.close();
- this.processOutputId = processOutput.getProcessOutputId();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RegistryException(e);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index 99a3405..6faed3c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -158,13 +158,15 @@ public class ProcessResource extends AbstractExpCatResource {
break;
case PROCESS_INPUT:
generator = new QueryGenerator(PROCESS_INPUT);
- generator.setParameter(ProcessInputConstants.PROCESS_INPUT_ID, name);
+ generator.setParameter(ProcessInputConstants.INPUT_NAME, name);
+ generator.setParameter(ProcessInputConstants.PROCESS_ID, processId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
case PROCESS_OUTPUT:
generator = new QueryGenerator(PROCESS_OUTPUT);
- generator.setParameter(ProcessOutputConstants.PROCESS_OUTPUT_ID, name);
+ generator.setParameter(ProcessOutputConstants.OUTPUT_NAME, name);
+ generator.setParameter(ProcessOutputConstants.PROCESS_ID, processId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
@@ -229,7 +231,7 @@ public class ProcessResource extends AbstractExpCatResource {
return processErrorResource;
case PROCESS_INPUT:
generator = new QueryGenerator(PROCESS_INPUT);
- generator.setParameter(ProcessInputConstants.PROCESS_INPUT_ID, name);
+ generator.setParameter(ProcessInputConstants.INPUT_NAME, name);
generator.setParameter(ProcessInputConstants.PROCESS_ID, processId);
q = generator.selectQuery(em);
ProcessInput processInput = (ProcessInput) q.getSingleResult();
@@ -239,7 +241,7 @@ public class ProcessResource extends AbstractExpCatResource {
return processInputResource;
case PROCESS_OUTPUT:
generator = new QueryGenerator(PROCESS_OUTPUT);
- generator.setParameter(ProcessOutputConstants.PROCESS_OUTPUT_ID, name);
+ generator.setParameter(ProcessOutputConstants.OUTPUT_NAME, name);
generator.setParameter(ProcessInputConstants.PROCESS_ID, processId);
q = generator.selectQuery(em);
ProcessOutput processOutput = (ProcessOutput) q.getSingleResult();
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
index 0bd74e8..433b62e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
@@ -25,7 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUser;
-import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUsersPK;
+import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUserPK;
import org.apache.airavata.registry.core.experiment.catalog.model.Project;
import org.apache.airavata.registry.core.experiment.catalog.model.User;
import org.apache.airavata.registry.cpi.RegistryException;
@@ -86,10 +86,10 @@ public class ProjectUserResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
- ProjectUsersPK projectUsersPK = new ProjectUsersPK();
- projectUsersPK.setProjectId(projectId);
- projectUsersPK.setUserName(userName);
- ProjectUser existingPrUser = em.find(ProjectUser.class, projectUsersPK);
+ ProjectUserPK projectUserPK = new ProjectUserPK();
+ projectUserPK.setProjectId(projectId);
+ projectUserPK.setUserName(userName);
+ ProjectUser existingPrUser = em.find(ProjectUser.class, projectUserPK);
em.close();
em = ExpCatResourceUtils.getEntityManager();
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
index 1384192..b57a348 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
@@ -35,6 +35,7 @@ import java.util.List;
public class TaskErrorResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(TaskErrorResource.class);
+ private String errorId;
private String taskId;
private Timestamp creationTime;
private String actualErrorMessage;
@@ -42,6 +43,14 @@ public class TaskErrorResource extends AbstractExpCatResource {
private Boolean transientOrPersistent;
private String rootCauseErrorIdList;
+ public String getErrorId() {
+ return errorId;
+ }
+
+ public void setErrorId(String errorId) {
+ this.errorId = errorId;
+ }
+
public String getTaskId() {
return taskId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
index 702f5eb..01a0a9c 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
@@ -179,7 +179,7 @@ public class TaskResource extends AbstractExpCatResource {
return statusResource;
case TASK_ERROR:
generator = new QueryGenerator(TASK_ERROR);
- generator.setParameter(TaskErrorConstants.TASK_ID, name);
+ generator.setParameter(TaskErrorConstants.ERROR_ID, name);
q = generator.selectQuery(em);
TaskError error = (TaskError) q.getSingleResult();
TaskErrorResource errorResource = (TaskErrorResource) Utils.getResource(
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
index ad4c84b..da90c4a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserConfigurationDataResource.java
@@ -40,7 +40,7 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
private Boolean shareExperimentPublically;
private Boolean throttleResources;
private String userDn;
- private Byte generateCert;
+ private Boolean generateCert;
private String resourceHostId;
private Integer totalCpuCount;
private Integer nodeCount;
@@ -153,11 +153,11 @@ public class UserConfigurationDataResource extends AbstractExpCatResource {
this.userDn = userDn;
}
- public Byte getGenerateCert() {
+ public Boolean getGenerateCert() {
return generateCert;
}
- public void setGenerateCert(Byte generateCert) {
+ public void setGenerateCert(Boolean generateCert) {
this.generateCert = generateCert;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
index 6ee8ab6..edec50f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/utils/ThriftDataModelConversion.java
@@ -21,28 +21,28 @@
package org.apache.airavata.registry.core.experiment.catalog.utils;
-import org.apache.airavata.common.utils.AiravataUtils;
import org.apache.airavata.model.application.io.DataType;
import org.apache.airavata.model.application.io.InputDataObjectType;
import org.apache.airavata.model.application.io.OutputDataObjectType;
import org.apache.airavata.model.commons.ErrorModel;
-import org.apache.airavata.model.job.JobModel;
+import org.apache.airavata.model.experiment.ExperimentModel;
+import org.apache.airavata.model.experiment.ExperimentSummaryModel;
+import org.apache.airavata.model.experiment.UserConfigurationDataModel;
import org.apache.airavata.model.process.ProcessModel;
import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
import org.apache.airavata.model.status.*;
import org.apache.airavata.model.task.TaskModel;
+import org.apache.airavata.model.task.TaskTypes;
import org.apache.airavata.model.workspace.Gateway;
import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.model.experiment.*;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
-import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.resources.*;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ProjectUserResource;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
public class ThriftDataModelConversion {
@@ -88,113 +88,91 @@ public class ThriftDataModelConversion {
return gateways;
}
+ public static ExperimentSummaryModel getExperimentSummary(ExperimentSummaryResource experimentSummaryResource) throws RegistryException {
+ if (experimentSummaryResource != null){
+ ExperimentSummaryModel experimentSummary = new ExperimentSummaryModel();
+ experimentSummary.setProjectId(experimentSummaryResource.getProjectId());
+ experimentSummary.setExperimentId(experimentSummaryResource.getExperimentId());
+ experimentSummary.setCreationTime(experimentSummaryResource.getCreationTime().getTime());
+ experimentSummary.setUserName(experimentSummaryResource.getUserName());
+ experimentSummary.setName(experimentSummaryResource.getExperimentName());
+ experimentSummary.setDescription(experimentSummaryResource.getDescription());
+ experimentSummary.setApplicationId(experimentSummaryResource.getApplicationId());
+ //Todo state and state update time
+ return experimentSummary;
+ }
+ return null;
+ }
+
public static ExperimentModel getExperiment(ExperimentResource experimentResource) throws RegistryException {
if (experimentResource != null){
ExperimentModel experiment = new ExperimentModel();
experiment.setProjectId(experimentResource.getProjectId());
- experiment.setExperimentId(experimentResource.getExpID());
+ experiment.setExperimentId(experimentResource.getExperimentId());
experiment.setCreationTime(experimentResource.getCreationTime().getTime());
- experiment.setUserName(experimentResource.getExecutionUser());
- experiment.setExperimentName(experimentResource.getExpName());
+ experiment.setUserName(experimentResource.getUserName());
+ experiment.setExperimentName(experimentResource.getExperimentName());
experiment.setDescription(experimentResource.getDescription());
experiment.setExecutionId(experimentResource.getApplicationId());
- experiment.setEnableEmailNotification(experimentResource.isEnableEmailNotifications());
+ experiment.setEnableEmailNotification(experimentResource.getEnableEmailNotification());
experiment.setGatewayExecutionId(experimentResource.getGatewayExecutionId());
if (experiment.isEnableEmailNotification()){
- List<NotificationEmailResource> notificationEmails = experimentResource.getNotificationEmails();
- experiment.setEmailAddresses(getEmailAddresses(notificationEmails));
+ String notificationEmails = experimentResource.getEmailAddresses();
+ experiment.setEmailAddresses(getEmailAddresses(notificationEmails.split(",")));
}
List<ExperimentInputResource> experimentInputs = experimentResource.getExperimentInputs();
experiment.setExperimentInputs(getExpInputs(experimentInputs));
List<ExperimentOutputResource> experimentOutputs = experimentResource.getExperimentOutputs();
experiment.setExperimentOutputs(getExpOutputs(experimentOutputs));
- StatusResource experimentStatus = experimentResource.getExperimentStatus();
+ ExperimentStatusResource experimentStatus = experimentResource.getExperimentStatus();
if (experimentStatus != null){
experiment.setExperimentStatus(getExperimentStatus(experimentStatus));
}
- List<ErrorDetailResource> errorDetails = experimentResource.getErrorDetails();
+ List<ExperimentErrorResource> errorDetails = experimentResource.getExperimentErrors();
if (errorDetails!= null && !errorDetails.isEmpty()){
- experiment.setErrors(getErrorDetailList(errorDetails));
+ experiment.setErrors(getExperimentErrorList(errorDetails));
}
- if (experimentResource.isExists(ResourceType.CONFIG_DATA, experimentResource.getExpID())){
- ConfigDataResource userConfigData = experimentResource.getUserConfigData(experimentResource.getExpID());
- experiment.setUserConfigurationData(getUserConfigData(userConfigData));
+ UserConfigurationDataResource userConfigurationDataResource
+ = experimentResource.getUserConfigurationDataResource();
+ if(userConfigurationDataResource != null){
+ experiment.setUserConfigurationData(getUserConfigData(userConfigurationDataResource));
}
return experiment;
}
return null;
}
- public static ExperimentSummaryModel getExperimentSummary(ExperimentSummaryResource experimentSummaryResource) throws RegistryException {
- if (experimentSummaryResource != null){
- ExperimentSummaryModel experimentSummary = new ExperimentSummaryModel();
- experimentSummary.setProjectId(experimentSummaryResource.getProjectID());
- experimentSummary.setExperimentId(experimentSummaryResource.getExpID());
- experimentSummary.setCreationTime(experimentSummaryResource.getCreationTime().getTime());
- experimentSummary.setUserName(experimentSummaryResource.getExecutionUser());
- experimentSummary.setName(experimentSummaryResource.getExpName());
- experimentSummary.setDescription(experimentSummaryResource.getDescription());
- experimentSummary.setApplicationId(experimentSummaryResource.getApplicationId());
- StatusResource experimentStatus = experimentSummaryResource.getStatus();
- if (experimentStatus != null){
- experimentSummary.setExperimentStatus(getExperimentStatus(experimentStatus));
- }
- return experimentSummary;
- }
- return null;
- }
-
public static InputDataObjectType getInput(Object object){
if (object != null){
InputDataObjectType dataObjectType = new InputDataObjectType();
if (object instanceof ExperimentInputResource){
- ExperimentInputResource expInput = (ExperimentInputResource) object;
- dataObjectType.setName(expInput.getExperimentKey());
- dataObjectType.setValue(expInput.getValue());
- if (expInput.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(expInput.getDataType()));
- }
- dataObjectType.setMetaData(expInput.getMetadata());
- dataObjectType.setApplicationArgument(expInput.getAppArgument());
- dataObjectType.setStandardInput(expInput.isStandardInput());
- dataObjectType.setUserFriendlyDescription(expInput.getUserFriendlyDesc());
- dataObjectType.setInputOrder(expInput.getInputOrder());
- dataObjectType.setIsRequired(expInput.getRequired());
- dataObjectType.setRequiredToAddedToCommandLine(expInput.getRequiredToCMD());
- dataObjectType.setDataStaged(expInput.isDataStaged());
- return dataObjectType;
- }else if (object instanceof NodeInputResource){
- NodeInputResource nodeInputResource = (NodeInputResource)object;
- dataObjectType.setName(nodeInputResource.getInputKey());
- dataObjectType.setValue(nodeInputResource.getValue());
- if (nodeInputResource.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(nodeInputResource.getDataType()));
- }
- dataObjectType.setMetaData(nodeInputResource.getMetadata());
- dataObjectType.setApplicationArgument(nodeInputResource.getAppArgument());
- dataObjectType.setStandardInput(nodeInputResource.isStandardInput());
- dataObjectType.setUserFriendlyDescription(nodeInputResource.getUserFriendlyDesc());
- dataObjectType.setInputOrder(nodeInputResource.getInputOrder());
- dataObjectType.setIsRequired(nodeInputResource.getRequired());
- dataObjectType.setRequiredToAddedToCommandLine(nodeInputResource.getRequiredToCMD());
- dataObjectType.setDataStaged(nodeInputResource.isDataStaged());
+ ExperimentInputResource inputResource = (ExperimentInputResource) object;
+ dataObjectType.setName(inputResource.getInputName());
+ dataObjectType.setValue(inputResource.getInputValue());
+ dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
+ dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
+ dataObjectType.setStandardInput(inputResource.getStandardInput());
+ dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
+ dataObjectType.setMetaData(inputResource.getMetadata());
+ dataObjectType.setInputOrder(inputResource.getInputOrder());
+ dataObjectType.setIsRequired(inputResource.getIsRequired());
+ dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
+ dataObjectType.setDataStaged(inputResource.getDataStaged());
return dataObjectType;
- }else if (object instanceof ApplicationInputResource){
- ApplicationInputResource inputResource = (ApplicationInputResource)object;
- dataObjectType.setName(inputResource.getInputKey());
- dataObjectType.setValue(inputResource.getValue());
- if (inputResource.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
- }
+ }else if (object instanceof ProcessInputResource){
+ ProcessInputResource inputResource = (ProcessInputResource)object;
+ dataObjectType.setName(inputResource.getInputName());
+ dataObjectType.setValue(inputResource.getInputValue());
+ dataObjectType.setType(DataType.valueOf(inputResource.getDataType()));
+ dataObjectType.setApplicationArgument(inputResource.getApplicationArgument());
+ dataObjectType.setStandardInput(inputResource.getStandardInput());
+ dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDescription());
dataObjectType.setMetaData(inputResource.getMetadata());
- dataObjectType.setApplicationArgument(inputResource.getAppArgument());
- dataObjectType.setStandardInput(inputResource.isStandardInput());
- dataObjectType.setUserFriendlyDescription(inputResource.getUserFriendlyDesc());
dataObjectType.setInputOrder(inputResource.getInputOrder());
- dataObjectType.setIsRequired(inputResource.isRequired());
- dataObjectType.setRequiredToAddedToCommandLine(inputResource.isRequiredToCMD());
- dataObjectType.setDataStaged(inputResource.isDataStaged());
+ dataObjectType.setIsRequired(inputResource.getIsRequired());
+ dataObjectType.setRequiredToAddedToCommandLine(inputResource.getRequiredToAddedToCmd());
+ dataObjectType.setDataStaged(inputResource.getDataStaged());
return dataObjectType;
}else {
return null;
@@ -207,61 +185,41 @@ public class ThriftDataModelConversion {
if (object != null){
OutputDataObjectType dataObjectType = new OutputDataObjectType();
if (object instanceof ExperimentOutputResource){
- ExperimentOutputResource expOutput = (ExperimentOutputResource)object;
- dataObjectType.setName(expOutput.getExperimentKey());
- dataObjectType.setValue(expOutput.getValue());
- if (expOutput.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(expOutput.getDataType()));
- }
- dataObjectType.setIsRequired(expOutput.getRequired());
- dataObjectType.setRequiredToAddedToCommandLine(expOutput.getRequiredToCMD());
- dataObjectType.setDataMovement(expOutput.isDataMovement());
- dataObjectType.setLocation(expOutput.getDataNameLocation());
- dataObjectType.setSearchQuery(expOutput.getSearchQuery());
- dataObjectType.setApplicationArgument(expOutput.getAppArgument());
- return dataObjectType;
- }else if (object instanceof NodeOutputResource){
- NodeOutputResource nodeOutputResource = (NodeOutputResource)object;
- dataObjectType.setName(nodeOutputResource.getOutputKey());
- dataObjectType.setValue(nodeOutputResource.getValue());
- if (nodeOutputResource.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(nodeOutputResource.getDataType()));
- }
- dataObjectType.setIsRequired(nodeOutputResource.getRequired());
- dataObjectType.setRequiredToAddedToCommandLine(nodeOutputResource.getRequiredToCMD());
- dataObjectType.setDataMovement(nodeOutputResource.isDataMovement());
- dataObjectType.setLocation(nodeOutputResource.getDataNameLocation());
- dataObjectType.setSearchQuery(nodeOutputResource.getSearchQuery());
- dataObjectType.setApplicationArgument(nodeOutputResource.getAppArgument());
+ ExperimentOutputResource outputResource = (ExperimentOutputResource)object;
+ dataObjectType.setName(outputResource.getOutputName());
+ dataObjectType.setValue(outputResource.getOutputValue());
+ dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
+ dataObjectType.setApplicationArgument(outputResource.getApplicationArgument());
+ dataObjectType.setIsRequired(outputResource.getIsRequired());
+ dataObjectType.setRequiredToAddedToCommandLine(outputResource.getRequiredToAddedToCmd());
+ dataObjectType.setDataMovement(outputResource.getDataMovement());
+ dataObjectType.setLocation(outputResource.getLocation());
+ dataObjectType.setSearchQuery(outputResource.getSearchQuery());
return dataObjectType;
- }else if (object instanceof ApplicationOutputResource){
- ApplicationOutputResource outputResource = (ApplicationOutputResource)object;
- dataObjectType.setName(outputResource.getOutputKey());
- dataObjectType.setValue(outputResource.getValue());
- dataObjectType.setIsRequired(outputResource.isRequired());
- dataObjectType.setRequiredToAddedToCommandLine(outputResource.isRequiredToCMD());
- if (outputResource.getDataType() != null){
- dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
- }
- dataObjectType.setDataMovement(outputResource.isDataMovement());
- dataObjectType.setLocation(outputResource.getDataNameLocation());
+ }else if (object instanceof ProcessOutputResource) {
+ ProcessOutputResource outputResource = (ProcessOutputResource) object;
+ dataObjectType.setName(outputResource.getOutputName());
+ dataObjectType.setValue(outputResource.getOutputValue());
+ dataObjectType.setType(DataType.valueOf(outputResource.getDataType()));
+ dataObjectType.setApplicationArgument(outputResource.getApplicationArgument());
+ dataObjectType.setIsRequired(outputResource.getIsRequired());
+ dataObjectType.setRequiredToAddedToCommandLine(outputResource.getRequiredToAddedToCmd());
+ dataObjectType.setDataMovement(outputResource.getDataMovement());
+ dataObjectType.setLocation(outputResource.getLocation());
dataObjectType.setSearchQuery(outputResource.getSearchQuery());
- dataObjectType.setApplicationArgument(outputResource.getAppArgument());
return dataObjectType;
- }else {
+ } else {
return null;
}
}
return null;
}
- public static List<String> getEmailAddresses (List<NotificationEmailResource> resourceList){
+ public static List<String> getEmailAddresses (String[] resourceList){
List<String> emailAddresses = new ArrayList<String>();
- if (resourceList != null && !resourceList.isEmpty()){
- for (NotificationEmailResource emailResource : resourceList){
- emailAddresses.add(emailResource.getEmailAddress());
+ for (String email : resourceList){
+ emailAddresses.add(email);
}
- }
return emailAddresses;
}
@@ -287,10 +245,10 @@ public class ThriftDataModelConversion {
return exOutputs;
}
- public static List<InputDataObjectType> getNodeInputs (List<NodeInputResource> nodeInputResources){
+ public static List<InputDataObjectType> getProcessInputs (List<ProcessInputResource> processInputResources){
List<InputDataObjectType> nodeInputs = new ArrayList<InputDataObjectType>();
- if (nodeInputResources != null && !nodeInputResources.isEmpty()){
- for (NodeInputResource inputResource : nodeInputResources){
+ if (processInputResources != null && !processInputResources.isEmpty()){
+ for (ProcessInputResource inputResource : processInputResources){
InputDataObjectType nodeInput = getInput(inputResource);
nodeInputs.add(nodeInput);
}
@@ -298,319 +256,195 @@ public class ThriftDataModelConversion {
return nodeInputs;
}
- public static List<OutputDataObjectType> getNodeOutputs (List<NodeOutputResource> nodeOutputResourceList){
- List<OutputDataObjectType> nodeOutputs = new ArrayList<OutputDataObjectType>();
- if (nodeOutputResourceList != null && !nodeOutputResourceList.isEmpty()){
- for (NodeOutputResource outputResource : nodeOutputResourceList){
+ public static List<OutputDataObjectType> getProcessOutputs (List<ProcessOutputResource> processOutputResources){
+ List<OutputDataObjectType> processOutputs = new ArrayList<OutputDataObjectType>();
+ if (processOutputResources != null && !processOutputResources.isEmpty()){
+ for (ProcessOutputResource outputResource : processOutputResources){
OutputDataObjectType output = getOutput(outputResource);
- nodeOutputs.add(output);
- }
- }
- return nodeOutputs;
- }
-
- public static List<InputDataObjectType> getApplicationInputs (List<ApplicationInputResource> applicationInputResources){
- List<InputDataObjectType> appInputs = new ArrayList<InputDataObjectType>();
- if (applicationInputResources != null && !applicationInputResources.isEmpty()){
- for (ApplicationInputResource inputResource : applicationInputResources){
- InputDataObjectType appInput = getInput(inputResource);
- appInputs.add(appInput);
+ processOutputs.add(output);
}
}
- return appInputs;
+ return processOutputs;
}
- public static List<OutputDataObjectType> getApplicationOutputs (List<ApplicationOutputResource> outputResources){
- List<OutputDataObjectType> appOutputs = new ArrayList<OutputDataObjectType>();
- if (outputResources != null && !outputResources.isEmpty()){
- for (ApplicationOutputResource outputResource : outputResources){
- OutputDataObjectType output = getOutput(outputResource);
- appOutputs.add(output);
- }
- }
- return appOutputs;
- }
-
- public static ExperimentStatus getExperimentStatus(StatusResource status){
+ public static ExperimentStatus getExperimentStatus(ExperimentStatusResource status){
if (status != null){
ExperimentStatus experimentStatus = new ExperimentStatus();
if (status.getState() == null || status.getState().equals("")){
status.setState("UNKNOWN");
}
experimentStatus.setState(ExperimentState.valueOf(status.getState()));
- experimentStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+ experimentStatus.setTimeOfStateChange(status.getTimeOfStateChange().getTime());
+ experimentStatus.setReason(status.getReason());
return experimentStatus;
}
return null;
}
- public static ProcessStatus getProcessStatus (StatusResource status){
+ public static ProcessStatus getProcessStatus (ProcessStatusResource status){
if (status != null){
ProcessStatus processStatus = new ProcessStatus();
if (status.getState() == null || status.getState().equals("")){
status.setState("UNKNOWN");
}
processStatus.setState(ProcessState.valueOf(status.getState()));
- processStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+ processStatus.setTimeOfStateChange(status.getTimeOfStateChange().getTime());
+ processStatus.setReason(status.getReason());
return processStatus;
}
return null;
}
- public static TaskStatus getTaskStatus (StatusResource status){
+ public static TaskStatus getTaskStatus (TaskStatusResource status){
if (status != null){
TaskStatus taskStatus = new TaskStatus();
if (status.getState() == null || status.getState().equals("")){
status.setState("UNKNOWN");
}
taskStatus.setState(TaskState.valueOf(status.getState()));
- taskStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
+ taskStatus.setTimeOfStateChange(status.getTimeOfStateChange().getTime());
+ taskStatus.setReason(status.getReason());
return taskStatus;
}
return null;
}
- public static JobStatus getJobStatus (StatusResource status){
- if (status != null){
- JobStatus jobStatus = new JobStatus();
- if (status.getState() == null || status.getState().equals("")){
- status.setState("UNKNOWN");
- }
- jobStatus.setJobState(JobState.valueOf(status.getState()));
- if (status.getStatusUpdateTime() == null){
- jobStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
- }else {
- jobStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
- }
- return jobStatus;
- }
- return null;
- }
-
-// public static TransferStatus getTransferStatus (StatusResource status){
-// if (status != null){
-// TransferStatus transferStatus = new TransferStatus();
-// if (status.getState() == null || status.getState().equals("")){
-// status.setState("UNKNOWN");
-// }
-// transferStatus.setTransferState(TransferState.valueOf(status.getState()));
-// transferStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
-// return transferStatus;
-// }
-// return null;
-// }
-
-// public static ApplicationStatus getApplicationStatus (StatusResource status){
-// if (status != null){
-// ApplicationStatus applicationStatus = new ApplicationStatus();
-// if (status.getState() == null || status.getState().equals("")){
-// status.setState("UNKNOWN");
-// }
-// applicationStatus.setApplicationState(status.getState());
-// applicationStatus.setTimeOfStateChange(status.getStatusUpdateTime().getTime());
-// return applicationStatus;
-// }
-// return null;
-// }
-//
-// public static List<WorkflowNodeStatus> getWorkflowNodeStatusList(List<StatusResource> statuses){
-// List<WorkflowNodeStatus> wfNodeStatuses = new ArrayList<WorkflowNodeStatus>();
-// if (statuses != null && !statuses.isEmpty()){
-// for (StatusResource statusResource : statuses){
-// wfNodeStatuses.add(getWorkflowNodeStatus(statusResource));
-// }
-// }
-// return wfNodeStatuses;
-// }
-
-// public static WorkflowNodeDetails getWorkflowNodeDetails(WorkflowNodeDetailResource nodeDetailResource) throws RegistryException {
-// if (nodeDetailResource != null){
-// WorkflowNodeDetails wfNode = new WorkflowNodeDetails();
-// wfNode.setNodeInstanceId(nodeDetailResource.getNodeInstanceId());
-// wfNode.setCreationTime(nodeDetailResource.getCreationTime().getTime());
-// wfNode.setNodeName(nodeDetailResource.getNodeName());
-// List<NodeInputResource> nodeInputs = nodeDetailResource.getNodeInputs();
-// wfNode.setNodeInputs(getNodeInputs(nodeInputs));
-// List<NodeOutputResource> nodeOutputs = nodeDetailResource.getNodeOutputs();
-// wfNode.setNodeOutputs(getNodeOutputs(nodeOutputs));
-// List<TaskDetailResource> taskDetails = nodeDetailResource.getTaskDetails();
-// wfNode.setTaskDetailsList(getTaskDetailsList(taskDetails));
-// wfNode.setWorkflowNodeStatus(getWorkflowNodeStatus(nodeDetailResource.getWorkflowNodeStatus()));
-// List<ErrorDetailResource> errorDetails = nodeDetailResource.getErrorDetails();
-// wfNode.setErrors(getErrorDetailList(errorDetails));
-// wfNode.setExecutionUnit(ExecutionUnit.valueOf(nodeDetailResource.getExecutionUnit()));
-// wfNode.setExecutionUnitData(nodeDetailResource.getExecutionUnitData());
-// return wfNode;
-// }
-// return null;
-// }
-//
-// public static List<WorkflowNodeDetails> getWfNodeList (List<WorkflowNodeDetailResource> resources) throws RegistryException {
-// List<WorkflowNodeDetails> workflowNodeDetailsList = new ArrayList<WorkflowNodeDetails>();
-// if (resources != null && !resources.isEmpty()){
-// for (WorkflowNodeDetailResource resource : resources){
-// workflowNodeDetailsList.add(getWorkflowNodeDetails(resource));
-// }
-// }
-// return workflowNodeDetailsList;
-// }
-
public static ProcessModel getProcesModel (ProcessResource processResource) throws RegistryException {
if (processResource != null){
ProcessModel processModel = new ProcessModel();
- String taskId = processResource.getTaskId();
- processModel.setProcessId(taskId);
- processModel.setApplicationInterfaceId(processResource.getApplicationId());
- List<ApplicationInputResource> applicationInputs = processResource.getApplicationInputs();
- processModel.setProcessInputs(getApplicationInputs(applicationInputs));
- List<ApplicationOutputResource> applicationOutputs = processResource.getApplicationOutputs();
- processModel.setProcessOutputs(getApplicationOutputs(applicationOutputs));
- processModel.setEnableEmailNotification(processResource.isEnableEmailNotifications());
- if (processModel.isEnableEmailNotification()){
- List<NotificationEmailResource> notificationEmails = processResource.getNotificationEmails();
- processModel.setEmailAddresses(getEmailAddresses(notificationEmails));
- }
- processModel.setApplicationDeploymentId(processResource.getApplicationDeploymentId());
- if (processResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, taskId)){
- ComputationSchedulingResource computationScheduling = processResource.getComputationScheduling(taskId);
- processModel.setResourceSchedule(getComputationalResourceScheduling(computationScheduling));
- }
+ processModel.setProcessId(processResource.getProcessId());
+ processModel.setExperimentId(processResource.getExperimentId());
+ processModel.setCreationTime(processResource.getCreationTime().getTime());
+ processModel.setLastUpdateTime(processResource.getLastUpdateTime().getTime());
+ processModel.setProcessDetail(processResource.getProcessDetail());
+ processModel.setApplicationInterfaceId(processResource.getApplicationInterfaceId());
+ processModel.setTaskDag(processResource.getTaskDag());
+
+ processModel.setProcessInputs(getProcessInputs(processResource.getProcessInputs()));
+ processModel.setProcessOutputs(getProcessOutputs(processResource.getProcessOutputs()));
+
+ processModel.setProcessError(getErrorModel(processResource.getProcessError()));
+ processModel.setProcessStatus(getProcessStatus(processResource.getProcessStatus()));
+
+ processModel.setResourceSchedule(getProcessResourceSchedule(processResource.getProcessResourceSchedule()));
+
+ processModel.setTasks(getTaskModelList(processResource.getTaskList()));
- processModel.setProcessStatus(getProcessStatus(processResource.getTaskStatus()));
-// List<JobDetailResource> jobDetailList = taskDetailResource.getJobDetailList();
-// processModel.setJobDetailsList(getJobDetailsList(jobDetailList));
-// processModel.setProcessError(getErrorDetails(taskDetailResource.getErrorDetailList().get(0)));
-// processModel.setDataTransferDetailsList(getDataTransferlList(taskDetailResource.getDataTransferDetailList()));
return processModel;
}
return null;
}
- public static List<TaskModel> getTaskDetailsList (List<ProcessResource> resources) throws RegistryException {
+ public static List<TaskModel> getTaskModelList (List<TaskResource> resources) throws RegistryException {
List<TaskModel> taskDetailsList = new ArrayList<TaskModel>();
if (resources != null && !resources.isEmpty()){
- for (ProcessResource resource : resources){
+ for (TaskResource resource : resources){
taskDetailsList.add(getTaskModel(resource));
}
}
return taskDetailsList;
}
- //FIXME: should fill according to registry object
- public static TaskModel getTaskModel (ProcessResource processResource){
+ public static TaskModel getTaskModel (TaskResource taskResource) throws RegistryException {
TaskModel model = new TaskModel();
- return model;
- }
-
- public static List<JobModel> getJobDetailsList(List<TaskResource> jobs) throws RegistryException {
- List<JobModel> jobDetailsList = new ArrayList<JobModel>();
- if (jobs != null && !jobs.isEmpty()){
- for (TaskResource resource : jobs){
- jobDetailsList.add(getJobDetail(resource));
- }
- }
- return jobDetailsList;
- }
+ model.setTaskId(taskResource.getTaskId());
+ model.setTaskType(TaskTypes.valueOf(taskResource.getTaskType()));
+ model.setParentProcessId(taskResource.getParentProcessId());
+ model.setCreationTime(taskResource.getCreationTime().getTime());
+ model.setLastUpdateTime(taskResource.getLastUpdateTime().getTime());
+ model.setTaskDetail(taskResource.getTaskDetail());
+ model.setTaskInternalStore(taskResource.getTaskInternalStore());
+ model.setTaskStatus(getTaskStatus(taskResource.getTaskStatus()));
+ model.setTaskError(getErrorModel(taskResource.getTaskError()));
- public static JobModel getJobDetail(TaskResource taskResource) throws RegistryException {
- if (taskResource != null){
- JobModel jobDetails = new JobModel();
- jobDetails.setJobId(taskResource.getJobId());
- jobDetails.setJobDescription(taskResource.getJobDescription());
- jobDetails.setCreationTime(taskResource.getCreationTime().getTime());
- StatusResource jobStatus = taskResource.getJobStatus();
- jobDetails.setJobStatus(getJobStatus(jobStatus));
- jobDetails.setJobName(taskResource.getJobName());
- jobDetails.setWorkingDir(taskResource.getWorkingDir());
- StatusResource applicationStatus = taskResource.getApplicationStatus();
- jobDetails.setJobStatus(getJobStatus(applicationStatus));
- jobDetails.setComputeResourceConsumed(taskResource.getComputeResourceConsumed());
- return jobDetails;
- }
- return null;
+ return model;
}
- public static ErrorModel getErrorDetails (ErrorDetailResource resource){
- if (resource != null){
- ErrorModel errorDetails = new ErrorModel();
- errorDetails.setErrorId(String.valueOf(resource.getErrorId()));
- errorDetails.setCreationTime(resource.getCreationTime().getTime());
- errorDetails.setActualErrorMessage(resource.getActualErrorMsg());
- errorDetails.setUserFriendlyMessage(resource.getUserFriendlyErrorMsg());
- errorDetails.setTransientOrPersistent(resource.isTransientPersistent());
- return errorDetails;
+
+ public static ErrorModel getErrorModel (Object object){
+ if (object != null) {
+ ErrorModel errorModel = new ErrorModel();
+ if (object instanceof ExperimentErrorResource) {
+ ExperimentErrorResource errorResource = (ExperimentErrorResource) object;
+ errorModel.setErrorId(errorResource.getErrorId());
+ errorModel.setCreationTime(errorResource.getCreationTime().getTime());
+ errorModel.setActualErrorMessage(errorResource.getActualErrorMessage());
+ errorModel.setUserFriendlyMessage(errorResource.getUserFriendlyMessage());
+ errorModel.setTransientOrPersistent(errorResource.getTransientOrPersistent());
+ errorModel.setRootCauseErrorIdList(Arrays.asList(errorResource.getRootCauseErrorIdList().split(",")));
+ return errorModel;
+ } else if (object instanceof ProcessOutputResource) {
+ ProcessErrorResource errorResource = (ProcessErrorResource) object;
+ errorModel.setErrorId(errorResource.getErrorId());
+ errorModel.setCreationTime(errorResource.getCreationTime().getTime());
+ errorModel.setActualErrorMessage(errorResource.getActualErrorMessage());
+ errorModel.setUserFriendlyMessage(errorResource.getUserFriendlyMessage());
+ errorModel.setTransientOrPersistent(errorResource.getTransientOrPersistent());
+ errorModel.setRootCauseErrorIdList(Arrays.asList(errorResource.getRootCauseErrorIdList().split(",")));
+ return errorModel;
+ } else if (object instanceof TaskErrorResource) {
+ TaskErrorResource errorResource = (TaskErrorResource) object;
+ errorModel.setErrorId(errorResource.getErrorId());
+ errorModel.setCreationTime(errorResource.getCreationTime().getTime());
+ errorModel.setActualErrorMessage(errorResource.getActualErrorMessage());
+ errorModel.setUserFriendlyMessage(errorResource.getUserFriendlyMessage());
+ errorModel.setTransientOrPersistent(errorResource.getTransientOrPersistent());
+ errorModel.setRootCauseErrorIdList(Arrays.asList(errorResource.getRootCauseErrorIdList().split(",")));
+ return errorModel;
+ } else {
+ return null;
+ }
}
return null;
}
- public static List<ErrorModel> getErrorDetailList (List<ErrorDetailResource> errorDetailResources){
- List<ErrorModel> errorDetailsList = new ArrayList<ErrorModel>();
- if (errorDetailResources != null && !errorDetailResources.isEmpty()){
- for (ErrorDetailResource errorDetailResource : errorDetailResources){
- errorDetailsList.add(getErrorDetails(errorDetailResource));
+ public static List<ErrorModel> getExperimentErrorList(List<ExperimentErrorResource> errorResources){
+ List<ErrorModel> errorList = new ArrayList<ErrorModel>();
+ if (errorResources != null && !errorResources.isEmpty()){
+ for (ExperimentErrorResource errorResource : errorResources){
+ errorList.add(getErrorModel(errorResource));
}
}
- return errorDetailsList;
+ return errorList;
}
-//
-// public static DataTransferDetails getDataTransferDetail (DataTransferDetailResource resource) throws RegistryException {
-// if (resource != null){
-// DataTransferDetails details = new DataTransferDetails();
-// details.setTransferID(resource.getTransferId());
-// details.setCreationTime(resource.getCreationTime().getTime());
-// details.setTransferDescription(resource.getTransferDescription());
-// details.setTransferStatus(getTransferStatus(resource.getDataTransferStatus()));
-// return details;
-// }
-// return null;
-// }
-//
-// public static List<DataTransferDetails> getDataTransferlList (List<DataTransferDetailResource> resources) throws RegistryException {
-// List<DataTransferDetails> transferDetailsList = new ArrayList<DataTransferDetails>();
-// if (resources != null && !resources.isEmpty()){
-// for (DataTransferDetailResource resource : resources){
-// transferDetailsList.add(getDataTransferDetail(resource));
-// }
-// }
-// return transferDetailsList;
-// }
-
-
- public static UserConfigurationDataModel getUserConfigData (ConfigDataResource resource) throws RegistryException {
+
+ public static UserConfigurationDataModel getUserConfigData (UserConfigurationDataResource resource) throws RegistryException {
if (resource != null){
UserConfigurationDataModel data = new UserConfigurationDataModel();
- data.setAiravataAutoSchedule(resource.isAiravataAutoSchedule());
- data.setOverrideManualScheduledParams(resource.isOverrideManualParams());
- data.setShareExperimentPublicly(resource.isShareExp());
+ data.setAiravataAutoSchedule(resource.getAiravataAutoSchedule());
+ data.setOverrideManualScheduledParams(resource.getOverrideManualScheduledParams());
+ data.setShareExperimentPublicly(resource.getShareExperimentPublically());
data.setUserDN(resource.getUserDn());
- data.setGenerateCert(resource.isGenerateCert());
- String expID = resource.getExperimentId();
- ExperimentResource experimentResource = new ExperimentResource();
- experimentResource.setExpID(expID);
- if (experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, expID)){
- ComputationSchedulingResource computationScheduling = experimentResource.getComputationScheduling(expID);
- data.setComputationalResourceScheduling(getComputationalResourceScheduling(computationScheduling));
- }
+ data.setGenerateCert(resource.getGenerateCert());
+
+ ComputationalResourceSchedulingModel resourceSchedulingModel = new ComputationalResourceSchedulingModel();
+ resourceSchedulingModel.setResourceHostId(resource.getResourceHostId());
+ resourceSchedulingModel.setTotalCPUCount(resource.getTotalCpuCount());
+ resourceSchedulingModel.setNodeCount(resource.getNodeCount());
+ resourceSchedulingModel.setNumberOfThreads(resource.getNumberOfThreads());
+ resourceSchedulingModel.setQueueName(resource.getQueueName());
+ resourceSchedulingModel.setWallTimeLimit(resource.getWallTimeLimit());
+ resourceSchedulingModel.setTotalPhysicalMemory(resource.getTotalPhysicalMemory());
+ data.setComputationalResourceScheduling(resourceSchedulingModel);
+
return data;
}
return null;
}
-
- public static ComputationalResourceSchedulingModel getComputationalResourceScheduling (ComputationSchedulingResource csr){
- if (csr != null){
- ComputationalResourceSchedulingModel scheduling = new ComputationalResourceSchedulingModel();
- scheduling.setResourceHostId(csr.getResourceHostId());
- scheduling.setTotalCPUCount(csr.getCpuCount());
- scheduling.setNodeCount(csr.getNodeCount());
- scheduling.setNumberOfThreads(csr.getNumberOfThreads());
- scheduling.setQueueName(csr.getQueueName());
- scheduling.setWallTimeLimit(csr.getWalltimeLimit());
- scheduling.setTotalPhysicalMemory(csr.getPhysicalMemory());
- scheduling.setChessisNumber(csr.getChessisName());
- return scheduling;
+ public static ComputationalResourceSchedulingModel getProcessResourceSchedule (ProcessResourceScheduleResource resource){
+ if (resource != null){
+ ComputationalResourceSchedulingModel resourceSchedulingModel = new ComputationalResourceSchedulingModel();
+ resourceSchedulingModel.setResourceHostId(resource.getResourceHostId());
+ resourceSchedulingModel.setTotalCPUCount(resource.getTotalCpuCount());
+ resourceSchedulingModel.setNodeCount(resource.getNodeCount());
+ resourceSchedulingModel.setNumberOfThreads(resource.getNumberOfThreads());
+ resourceSchedulingModel.setQueueName(resource.getQueueName());
+ resourceSchedulingModel.setWallTimeLimit(resource.getWallTimeLimit());
+ resourceSchedulingModel.setTotalPhysicalMemory(resource.getTotalPhysicalMemory());
+ return resourceSchedulingModel;
}
return null;
}
-}
+}
\ No newline at end of file
[05/11] airavata git commit: minor modifications for the experiment
registry model and resources layer
Posted by sc...@apache.org.
minor modifications for the experiment registry model and resources layer
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/066030bc
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/066030bc
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/066030bc
Branch: refs/heads/master
Commit: 066030bc53f00d3378655f0cda50ec5bfbf6c924
Parents: 3a00366
Author: Supun Nakandala <sc...@apache.org>
Authored: Sat Jun 20 18:18:00 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sat Jun 20 18:18:00 2015 +0530
----------------------------------------------------------------------
.../catalog/model/ExperimentInputPK.java | 7 +-
.../catalog/model/ExperimentOutputPK.java | 5 +-
.../catalog/model/ExperimentStatusPK.java | 4 +-
.../catalog/model/ExperimentSummary.java | 7 +-
.../catalog/model/GatewayWorkerPK.java | 5 +-
.../catalog/model/ProcessErrorPK.java | 4 +-
.../catalog/model/ProcessInputPK.java | 7 +-
.../catalog/model/ProcessOutputPK.java | 5 +-
.../catalog/model/ProcessStatusPK.java | 5 +-
.../experiment/catalog/model/ProjectUserPK.java | 4 +-
.../experiment/catalog/model/TaskStatusPK.java | 4 +-
.../resources/AbstractExpCatResource.java | 4 +
.../resources/ExperimentErrorResource.java | 10 +-
.../resources/ExperimentInputResource.java | 17 +--
.../catalog/resources/ExperimentResource.java | 76 ++++++++--
.../resources/ExperimentStatusResource.java | 19 ++-
.../catalog/resources/ProcessErrorResource.java | 10 +-
.../catalog/resources/ProcessInputResource.java | 15 +-
.../catalog/resources/ProcessResource.java | 88 ++++++++++-
.../resources/ProcessStatusResource.java | 19 ++-
.../catalog/resources/TaskErrorResource.java | 11 +-
.../catalog/resources/TaskResource.java | 152 +++++++++++++++----
.../catalog/resources/TaskStatusResource.java | 19 ++-
23 files changed, 373 insertions(+), 124 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
index c84b541..1db370e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
@@ -23,7 +23,6 @@ package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
@@ -33,9 +32,8 @@ public class ExperimentInputPK implements Serializable {
private String experimentId;
private String inputName;
- @Column(name = "EXPERIMENT_ID")
- @Basic
@Id
+ @Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
}
@@ -44,9 +42,8 @@ public class ExperimentInputPK implements Serializable {
this.experimentId = experimentId;
}
- @Column(name = "INPUT_NAME")
- @Basic
@Id
+ @Column(name = "INPUT_NAME")
public String getInputName() {
return inputName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
index 08285c1..ac52859 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
@@ -33,9 +33,8 @@ public class ExperimentOutputPK implements Serializable {
private String experimentId;
private String outputName;
- @Column(name = "EXPERIMENT_ID")
- @Basic
@Id
+ @Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
}
@@ -44,8 +43,8 @@ public class ExperimentOutputPK implements Serializable {
this.experimentId = experimentId;
}
- @Column(name = "OUTPUT_NAME")
@Id
+ @Column(name = "OUTPUT_NAME")
public String getOutputName() {
return outputName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
index de17178..98d928d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
@@ -32,8 +32,8 @@ public class ExperimentStatusPK implements Serializable {
private String statusId;
private String experimentId;
- @Column(name = "STATUS_ID")
@Id
+ @Column(name = "STATUS_ID")
public String getStatusId() {
return statusId;
}
@@ -42,8 +42,8 @@ public class ExperimentStatusPK implements Serializable {
this.statusId = statusId;
}
- @Column(name = "EXPERIMENT_ID")
@Id
+ @Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
index 0323d01..bc88d93 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
@@ -23,10 +23,7 @@ package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.persistence.Basic;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
import java.sql.Timestamp;
@Entity
@@ -44,7 +41,7 @@ public class ExperimentSummary {
private String resourceHostId;
private Timestamp timeOfStateChange;
- @Basic
+ @Id
@Column(name = "EXPERIMENT_ID")
public String getExperimentId() {
return experimentId;
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
index 449f890..1820042 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
@@ -32,8 +32,8 @@ public class GatewayWorkerPK implements Serializable {
private String gatewayId;
private String userName;
- @Column(name = "GATEWAY_ID")
@Id
+ @Column(name = "GATEWAY_ID")
public String getGatewayId() {
return gatewayId;
}
@@ -42,8 +42,9 @@ public class GatewayWorkerPK implements Serializable {
this.gatewayId = gatewayId;
}
- @Column(name = "USER_NAME")
+
@Id
+ @Column(name = "USER_NAME")
public String getUserName() {
return userName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
index c335016..5dd05dc 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
@@ -32,8 +32,8 @@ public class ProcessErrorPK implements Serializable {
private String errorId;
private String processId;
- @Column(name = "ERROR_ID")
@Id
+ @Column(name = "ERROR_ID")
public String getErrorId() {
return errorId;
}
@@ -42,8 +42,8 @@ public class ProcessErrorPK implements Serializable {
this.errorId = errorId;
}
- @Column(name = "PROCESS_ID")
@Id
+ @Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
index 8731d36..6650e07 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
@@ -23,7 +23,6 @@ package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
@@ -33,9 +32,8 @@ public class ProcessInputPK implements Serializable {
private String processId;
private String inputName;
- @Column(name = "PROCESS_ID")
- @Basic
@Id
+ @Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
}
@@ -44,9 +42,8 @@ public class ProcessInputPK implements Serializable {
this.processId = processId;
}
- @Column(name = "INPUT_NAME")
- @Basic
@Id
+ @Column(name = "INPUT_NAME")
public String getInputName() {
return inputName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
index 5a64b86..0d98d4d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
@@ -33,9 +33,8 @@ public class ProcessOutputPK implements Serializable {
private String processId;
private String outputName;
- @Column(name = "PROCESS_ID")
- @Basic
@Id
+ @Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
}
@@ -44,8 +43,8 @@ public class ProcessOutputPK implements Serializable {
this.processId = processId;
}
- @Column(name = "OUTPUT_NAME")
@Id
+ @Column(name = "OUTPUT_NAME")
public String getOutputName() {
return outputName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
index a57a4d8..3158e15 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
@@ -32,8 +32,9 @@ public class ProcessStatusPK implements Serializable {
private String statusId;
private String processId;
- @Column(name = "STATUS_ID")
+
@Id
+ @Column(name = "STATUS_ID")
public String getStatusId() {
return statusId;
}
@@ -42,8 +43,8 @@ public class ProcessStatusPK implements Serializable {
this.statusId = statusId;
}
- @Column(name = "PROCESS_ID")
@Id
+ @Column(name = "PROCESS_ID")
public String getProcessId() {
return processId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
index 5cf3364..2d32627 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
@@ -32,8 +32,8 @@ public class ProjectUserPK implements Serializable {
private String projectId;
private String userName;
- @Column(name = "PROJECT_ID")
@Id
+ @Column(name = "PROJECT_ID")
public String getProjectId() {
return projectId;
}
@@ -42,8 +42,8 @@ public class ProjectUserPK implements Serializable {
this.projectId = projectId;
}
- @Column(name = "USER_NAME")
@Id
+ @Column(name = "USER_NAME")
public String getUserName() {
return userName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
index 3855294..502852b 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
@@ -32,8 +32,8 @@ public class TaskStatusPK implements Serializable {
private String statusId;
private String taskId;
- @Column(name = "STATUS_ID")
@Id
+ @Column(name = "STATUS_ID")
public String getStatusId() {
return statusId;
}
@@ -42,8 +42,8 @@ public class TaskStatusPK implements Serializable {
this.statusId = statusId;
}
- @Column(name = "TASK_ID")
@Id
+ @Column(name = "TASK_ID")
public String getTaskId() {
return taskId;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
index 875240c..8faf1aa 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
@@ -127,6 +127,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
//Experiment Error table
public final class ExperimentErrorConstants {
+ public static final String ERROR_ID = "errorId";
public static final String EXPERIMENT_ID = "experimentId";
public static final String CREATION_TIME = "creationTime";
public static final String ACTUAL_ERROR_MESSAGE = "actualErrorMsg";
@@ -213,6 +214,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// Task Status table
public final class TaskStatusConstants {
+ public static final String STATUS_ID = "statusId";
public static final String TASK_ID = "taskId";
public static final String STATE = "state";
public static final String TIME_OF_STATE_CHANGE = "timeOfStateChange";
@@ -221,6 +223,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// Process Status table
public final class ProcessStatusConstants {
+ public static final String STATUS_ID = "statusId";
public static final String PROCESS_ID = "processId";
public static final String STATE = "state";
public static final String TIME_OF_STATE_CHANGE = "timeOfStateChange";
@@ -229,6 +232,7 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// Experiment Status table
public final class ExperimentStatusConstants {
+ public static final String STATUS_ID = "statusId";
public static final String EXPERIMENT_ID = "experimentId";
public static final String STATE = "state";
public static final String TIME_OF_STATE_CHANGE = "timeOfStateChange";
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
index b07bd82..1a35455 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentErrorResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentError;
+import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentErrorPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -129,10 +130,13 @@ public class ExperimentErrorResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
ExperimentError experimentError;
- if(experimentId == null || actualErrorMessage == null){
- throw new RegistryException("Does not have the experiment id or error message");
+ if(experimentId == null || errorId == null){
+ throw new RegistryException("Does not have the experiment id or error id");
}
- experimentError = em.find(ExperimentError.class, experimentId);
+ ExperimentErrorPK experimentErrorPK = new ExperimentErrorPK();
+ experimentErrorPK.setExperimentId(experimentId);
+ experimentErrorPK.setErrorId(errorId);
+ experimentError = em.find(ExperimentError.class, experimentErrorPK);
if(experimentError == null){
experimentError = new ExperimentError();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
index 3415b2b..5c6524d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentInputResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentInput;
+import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentInputPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,7 +35,6 @@ import java.util.List;
public class ExperimentInputResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ExperimentInputResource.class);
- private int experimentInputId;
private String experimentId;
private String inputName;
private String inputValue;
@@ -48,14 +48,6 @@ public class ExperimentInputResource extends AbstractExpCatResource {
private Boolean requiredToAddedToCmd;
private Boolean dataStaged;
- public int getExperimentInputId() {
- return experimentInputId;
- }
-
- public void setExperimentInputId(int experimentInputId) {
- this.experimentInputId = experimentInputId;
- }
-
public String getExperimentId() {
return experimentId;
}
@@ -185,11 +177,13 @@ public class ExperimentInputResource extends AbstractExpCatResource {
throw new RegistryException("Does not have the experiment id");
}
ExperimentInput experimentInput;
- experimentInput = em.find(ExperimentInput.class, experimentInputId);
+ ExperimentInputPK experimentInputPK = new ExperimentInputPK();
+ experimentInputPK.setExperimentId(experimentId);
+ experimentInputPK.setInputName(inputName);
+ experimentInput = em.find(ExperimentInput.class, experimentInputPK);
if(experimentInput == null){
experimentInput = new ExperimentInput();
}
- experimentInput.setExperimentInputId(experimentInputId);
experimentInput.setExperimentId(experimentId);
experimentInput.setInputName(inputName);
experimentInput.setInputValue(inputValue);
@@ -205,7 +199,6 @@ public class ExperimentInputResource extends AbstractExpCatResource {
em.persist(experimentInput);
em.getTransaction().commit();
em.close();
- this.experimentInputId = experimentInput.getExperimentInputId();
} catch (Exception e) {
logger.error(e.getMessage(), e);
throw new RegistryException(e);
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
index 8ca7c05..26a1ea1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
@@ -191,13 +191,15 @@ public class ExperimentResource extends AbstractExpCatResource {
switch (type) {
case EXPERIMENT_ERROR:
generator = new QueryGenerator(EXPERIMENT_ERROR);
- generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, name);
+ generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, experimentId);
+ generator.setParameter(ExperimentErrorConstants.ERROR_ID, name);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
case EXPERIMENT_STATUS:
generator = new QueryGenerator(EXPERIMENT_STATUS);
- generator.setParameter(ExperimentStatusConstants.EXPERIMENT_ID, name);
+ generator.setParameter(ExperimentStatusConstants.EXPERIMENT_ID, experimentId);
+ generator.setParameter(ExperimentStatusConstants.STATUS_ID, name);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
@@ -258,7 +260,8 @@ public class ExperimentResource extends AbstractExpCatResource {
switch (type) {
case EXPERIMENT_STATUS:
generator = new QueryGenerator(EXPERIMENT_STATUS);
- generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
+ generator.setParameter(ExperimentStatusConstants.STATUS_ID, name);
+ generator.setParameter(ExperimentStatusConstants.EXPERIMENT_ID, experimentId);
q = generator.selectQuery(em);
ExperimentStatus status = (ExperimentStatus) q.getSingleResult();
ExperimentStatusResource statusResource = (ExperimentStatusResource) Utils.getResource(ResourceType.EXPERIMENT_STATUS, status);
@@ -267,7 +270,8 @@ public class ExperimentResource extends AbstractExpCatResource {
return statusResource;
case EXPERIMENT_ERROR:
generator = new QueryGenerator(EXPERIMENT_ERROR);
- generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, name);
+ generator.setParameter(ExperimentErrorConstants.ERROR_ID, name);
+ generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, experimentId);
q = generator.selectQuery(em);
ExperimentError experimentError = (ExperimentError) q.getSingleResult();
ExperimentErrorResource processErrorResource = (ExperimentErrorResource) Utils.getResource(ResourceType.EXPERIMENT_ERROR, experimentError);
@@ -384,17 +388,31 @@ public class ExperimentResource extends AbstractExpCatResource {
}
}
break;
- case PROCESS_ERROR:
+ case EXPERIMENT_ERROR:
generator = new QueryGenerator(EXPERIMENT_ERROR);
generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, experimentId);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
- ProcessError processError = (ProcessError) result;
- ProcessErrorResource processErrorResource =
- (ProcessErrorResource) Utils.getResource(ResourceType.PROCESS_ERROR, processError);
- resourceList.add(processErrorResource);
+ ExperimentError experimentError = (ExperimentError) result;
+ ExperimentErrorResource experimentErrorResource =
+ (ExperimentErrorResource) Utils.getResource(ResourceType.EXPERIMENT_ERROR, experimentError);
+ resourceList.add(experimentErrorResource);
+ }
+ }
+ break;
+ case EXPERIMENT_STATUS:
+ generator = new QueryGenerator(EXPERIMENT_STATUS);
+ generator.setParameter(ExperimentStatusConstants.EXPERIMENT_ID, experimentId);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ ExperimentStatus experimentStatus = (ExperimentStatus) result;
+ ExperimentStatusResource experimentStatusResource =
+ (ExperimentStatusResource) Utils.getResource(ResourceType.EXPERIMENT_STATUS, experimentStatus);
+ resourceList.add(experimentStatusResource);
}
}
break;
@@ -424,6 +442,7 @@ public class ExperimentResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
+
Experiment experiment = em.find(Experiment.class, experimentId);
em.close();
em = ExpCatResourceUtils.getEntityManager();
@@ -478,9 +497,29 @@ public class ExperimentResource extends AbstractExpCatResource {
return outputResources;
}
+ public List<ExperimentStatusResource> getExperimentStatuses() throws RegistryException{
+ List<ExperimentStatusResource> experimentStatusResources = new ArrayList();
+ List<ExperimentCatResource> resources = get(ResourceType.EXPERIMENT_STATUS);
+ for (ExperimentCatResource resource : resources) {
+ ExperimentStatusResource statusResource = (ExperimentStatusResource) resource;
+ experimentStatusResources.add(statusResource);
+ }
+ return experimentStatusResources;
+ }
+
public ExperimentStatusResource getExperimentStatus() throws RegistryException{
- ExperimentCatResource resource = get(ResourceType.EXPERIMENT_STATUS, executionId);
- return (ExperimentStatusResource)resource;
+ List<ExperimentStatusResource> experimentStatusResources = getExperimentStatuses();
+ if(experimentStatusResources.size() == 0){
+ return null;
+ }else{
+ ExperimentStatusResource max = experimentStatusResources.get(0);
+ for(int i=1; i<experimentStatusResources.size();i++){
+ if(experimentStatusResources.get(i).getTimeOfStateChange().after(max.getTimeOfStateChange())){
+ max = experimentStatusResources.get(i);
+ }
+ }
+ return max;
+ }
}
public List<ExperimentErrorResource> getExperimentErrors() throws RegistryException{
@@ -493,6 +532,21 @@ public class ExperimentResource extends AbstractExpCatResource {
return experimentErrorResources;
}
+ public ExperimentErrorResource getExperimentError() throws RegistryException{
+ List<ExperimentErrorResource> experimentErrorResources = getExperimentErrors();
+ if(experimentErrorResources.size() == 0){
+ return null;
+ }else{
+ ExperimentErrorResource max = experimentErrorResources.get(0);
+ for(int i=1; i<experimentErrorResources.size();i++){
+ if(experimentErrorResources.get(i).getCreationTime().after(max.getCreationTime())){
+ max = experimentErrorResources.get(i);
+ }
+ }
+ return max;
+ }
+ }
+
public UserConfigurationDataResource getUserConfigurationDataResource() throws RegistryException{
ExperimentCatResource resource = get(ResourceType.USER_CONFIGURATION_DATA, experimentId);
return (UserConfigurationDataResource)resource;
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
index 53ef1da..558762e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentStatusResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentStatus;
+import org.apache.airavata.registry.core.experiment.catalog.model.ExperimentStatusPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,11 +36,20 @@ import java.util.List;
public class ExperimentStatusResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ExperimentStatusResource.class);
+ private String statusId;
private String experimentId;
private String state;
private Timestamp timeOfStateChange;
private String reason;
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
public String getExperimentId() {
return experimentId;
}
@@ -102,10 +112,13 @@ public class ExperimentStatusResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
ExperimentStatus experimentStatus;
- if(experimentId == null || state == null){
- throw new RegistryException("Does not have the experiment id or state");
+ if(experimentId == null || statusId == null){
+ throw new RegistryException("Does not have the experiment id or status id");
}
- experimentStatus = em.find(ExperimentStatus.class, experimentId);
+ ExperimentStatusPK experimentStatusPK = new ExperimentStatusPK();
+ experimentStatusPK.setStatusId(statusId);
+ experimentStatusPK.setExperimentId(experimentId);
+ experimentStatus = em.find(ExperimentStatus.class, experimentStatusPK);
if(experimentStatus == null){
experimentStatus = new ExperimentStatus();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
index 343b6e4..127b4c0 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessErrorResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProcessError;
+import org.apache.airavata.registry.core.experiment.catalog.model.ProcessErrorPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -129,10 +130,13 @@ public class ProcessErrorResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
ProcessError processError;
- if(processId == null || actualErrorMessage == null){
- throw new RegistryException("Does not have the process id or error message");
+ if(processId == null || errorId == null){
+ throw new RegistryException("Does not have the process id or error id");
}
- processError = em.find(ProcessError.class, processId);
+ ProcessErrorPK processErrorPK = new ProcessErrorPK();
+ processErrorPK.setProcessId(processId);
+ processErrorPK.setErrorId(errorId);
+ processError = em.find(ProcessError.class, processErrorPK);
if(processError == null){
processError = new ProcessError();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
index 6da7297..5a1eff9 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessInputResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProcessInput;
+import org.apache.airavata.registry.core.experiment.catalog.model.ProcessInputPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,7 +35,6 @@ import java.util.List;
public class ProcessInputResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ProcessInputResource.class);
- private int processInputId;
private String processId;
private String inputName;
private String inputValue;
@@ -48,14 +48,6 @@ public class ProcessInputResource extends AbstractExpCatResource {
private Boolean requiredToAddedToCmd;
private Boolean dataStaged;
- public int getProcessInputId() {
- return processInputId;
- }
-
- public void setProcessInputId(int processInputId) {
- this.processInputId = processInputId;
- }
-
public String getProcessId() {
return processId;
}
@@ -185,7 +177,10 @@ public class ProcessInputResource extends AbstractExpCatResource {
throw new RegistryException("Does not have the process id");
}
ProcessInput processInput;
- processInput = em.find(ProcessInput.class, processInputId);
+ ProcessInputPK processInputPk = new ProcessInputPK();
+ processInputPk.setProcessId(processId);
+ processInputPk.setInputName(inputName);
+ processInput = em.find(ProcessInput.class, processInputPk);
if(processInput == null){
processInput = new ProcessInput();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index 6faed3c..e162d45 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -146,13 +146,15 @@ public class ProcessResource extends AbstractExpCatResource {
switch (type) {
case PROCESS_ERROR:
generator = new QueryGenerator(PROCESS_ERROR);
- generator.setParameter(ProcessErrorConstants.PROCESS_ID, name);
+ generator.setParameter(ProcessErrorConstants.ERROR_ID, name);
+ generator.setParameter(ProcessErrorConstants.PROCESS_ID, processId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
case PROCESS_STATUS:
generator = new QueryGenerator(PROCESS_STATUS);
- generator.setParameter(ProcessStatusConstants.PROCESS_ID, name);
+ generator.setParameter(ProcessStatusConstants.STATUS_ID, name);
+ generator.setParameter(ProcessStatusConstants.PROCESS_ID, processId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
@@ -213,7 +215,8 @@ public class ProcessResource extends AbstractExpCatResource {
switch (type) {
case PROCESS_STATUS:
generator = new QueryGenerator(PROCESS_STATUS);
- generator.setParameter(ProcessStatusConstants.PROCESS_ID, name);
+ generator.setParameter(ProcessStatusConstants.STATUS_ID, name);
+ generator.setParameter(ProcessStatusConstants.PROCESS_ID, processId);
q = generator.selectQuery(em);
ProcessStatus status = (ProcessStatus) q.getSingleResult();
ProcessStatusResource statusResource = (ProcessStatusResource) Utils.getResource(ResourceType.PROCESS_STATUS, status);
@@ -222,7 +225,8 @@ public class ProcessResource extends AbstractExpCatResource {
return statusResource;
case PROCESS_ERROR:
generator = new QueryGenerator(PROCESS_ERROR);
- generator.setParameter(ProcessErrorConstants.PROCESS_ID, name);
+ generator.setParameter(ProcessErrorConstants.ERROR_ID, name);
+ generator.setParameter(ProcessErrorConstants.PROCESS_ID, processId);
q = generator.selectQuery(em);
ProcessError processError = (ProcessError) q.getSingleResult();
ProcessErrorResource processErrorResource = (ProcessErrorResource) Utils.getResource(ResourceType.PROCESS_ERROR, processError);
@@ -340,6 +344,34 @@ public class ProcessResource extends AbstractExpCatResource {
}
}
break;
+ case PROCESS_ERROR:
+ generator = new QueryGenerator(PROCESS_ERROR);
+ generator.setParameter(ProcessErrorConstants.PROCESS_ID, processId);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ ProcessError processError = (ProcessError) result;
+ ProcessErrorResource processErrorResource =
+ (ProcessErrorResource) Utils.getResource(ResourceType.PROCESS_ERROR, processError);
+ resourceList.add(processErrorResource);
+ }
+ }
+ break;
+ case PROCESS_STATUS:
+ generator = new QueryGenerator(PROCESS_STATUS);
+ generator.setParameter(ProcessStatusConstants.PROCESS_ID, processId);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ ProcessStatus processStatus = (ProcessStatus) result;
+ ProcessStatusResource processStatusResource =
+ (ProcessStatusResource) Utils.getResource(ResourceType.PROCESS_STATUS, processStatus);
+ resourceList.add(processStatusResource);
+ }
+ }
+ break;
default:
em.getTransaction().commit();
em.close();
@@ -416,14 +448,54 @@ public class ProcessResource extends AbstractExpCatResource {
return outputResources;
}
+ public List<ProcessStatusResource> getProcessStatuses() throws RegistryException{
+ List<ProcessStatusResource> processStatusResources = new ArrayList();
+ List<ExperimentCatResource> resources = get(ResourceType.PROCESS_STATUS);
+ for (ExperimentCatResource resource : resources) {
+ ProcessStatusResource statusResource = (ProcessStatusResource) resource;
+ processStatusResources.add(statusResource);
+ }
+ return processStatusResources;
+ }
+
public ProcessStatusResource getProcessStatus() throws RegistryException{
- ExperimentCatResource resource = get(ResourceType.PROCESS_STATUS, processId);
- return (ProcessStatusResource)resource;
+ List<ProcessStatusResource> processStatusResources = getProcessStatuses();
+ if(processStatusResources.size() == 0){
+ return null;
+ }else{
+ ProcessStatusResource max = processStatusResources.get(0);
+ for(int i=1; i<processStatusResources.size();i++){
+ if(processStatusResources.get(i).getTimeOfStateChange().after(max.getTimeOfStateChange())){
+ max = processStatusResources.get(i);
+ }
+ }
+ return max;
+ }
+ }
+
+ public List<ProcessErrorResource> getProcessErrors() throws RegistryException{
+ List<ProcessErrorResource> processErrorResources = new ArrayList();
+ List<ExperimentCatResource> resources = get(ResourceType.PROCESS_ERROR);
+ for (ExperimentCatResource resource : resources) {
+ ProcessErrorResource errorResource = (ProcessErrorResource) resource;
+ processErrorResources.add(errorResource);
+ }
+ return processErrorResources;
}
public ProcessErrorResource getProcessError() throws RegistryException{
- ExperimentCatResource resource = get(ResourceType.PROCESS_ERROR, processId);
- return (ProcessErrorResource)resource;
+ List<ProcessErrorResource> processErrorResources = getProcessErrors();
+ if(processErrorResources.size() == 0){
+ return null;
+ }else{
+ ProcessErrorResource max = processErrorResources.get(0);
+ for(int i=1; i<processErrorResources.size();i++){
+ if(processErrorResources.get(i).getCreationTime().after(max.getCreationTime())){
+ max = processErrorResources.get(i);
+ }
+ }
+ return max;
+ }
}
public ProcessResourceScheduleResource getProcessResourceSchedule() throws RegistryException{
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
index 4ae5298..6892510 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessStatusResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProcessStatus;
+import org.apache.airavata.registry.core.experiment.catalog.model.ProcessStatusPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,11 +36,20 @@ import java.util.List;
public class ProcessStatusResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(ProcessStatusResource.class);
+ private String statusId;
private String processId;
private String state;
private Timestamp timeOfStateChange;
private String reason;
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
public String getProcessId() {
return processId;
}
@@ -102,10 +112,13 @@ public class ProcessStatusResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
ProcessStatus processStatus;
- if(processId == null || state == null){
- throw new RegistryException("Does not have the process id or state");
+ if(processId == null || statusId == null){
+ throw new RegistryException("Does not have the process id or status id");
}
- processStatus = em.find(ProcessStatus.class, processId);
+ ProcessStatusPK processStatusPK = new ProcessStatusPK();
+ processStatusPK.setStatusId(statusId);
+ processStatusPK.setProcessId(processId);
+ processStatus = em.find(ProcessStatus.class, processStatusPK);
if(processStatus == null){
processStatus = new ProcessStatus();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
index b57a348..b8239c4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskErrorResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.TaskError;
+import org.apache.airavata.registry.core.experiment.catalog.model.TaskErrorPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -129,13 +130,17 @@ public class TaskErrorResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
TaskError taskError;
- if(taskId == null || actualErrorMessage == null){
- throw new RegistryException("Does not have the task id or error message");
+ if(taskId == null || errorId == null){
+ throw new RegistryException("Does not have the task id or error id");
}
- taskError = em.find(TaskError.class, taskId);
+ TaskErrorPK taskErrorPK = new TaskErrorPK();
+ taskErrorPK.setTaskId(taskId);
+ taskErrorPK.setErrorId(errorId);
+ taskError = em.find(TaskError.class, taskErrorPK);
if(taskError == null){
taskError = new TaskError();
}
+
taskError.setTaskId(taskId);
taskError.setActualErrorMessage(actualErrorMessage);
taskError.setUserFriendlyMessage(userFriendlyMessage);
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
index 01a0a9c..862c2a4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
@@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import java.sql.Timestamp;
+import java.util.ArrayList;
import java.util.List;
public class TaskResource extends AbstractExpCatResource {
@@ -130,13 +131,15 @@ public class TaskResource extends AbstractExpCatResource {
switch (type) {
case TASK_STATUS:
generator = new QueryGenerator(TASK_STATUS);
- generator.setParameter(TaskStatusConstants.TASK_ID, name);
+ generator.setParameter(TaskStatusConstants.STATUS_ID, name);
+ generator.setParameter(TaskStatusConstants.TASK_ID, taskId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
case TASK_ERROR:
generator = new QueryGenerator(TASK_ERROR);
- generator.setParameter(TaskErrorConstants.TASK_ID, name);
+ generator.setParameter(TaskErrorConstants.ERROR_ID, name);
+ generator.setParameter(TaskErrorConstants.TASK_ID, taskId);
q = generator.deleteQuery(em);
q.executeUpdate();
break;
@@ -170,7 +173,8 @@ public class TaskResource extends AbstractExpCatResource {
switch (type) {
case TASK_STATUS:
generator = new QueryGenerator(TASK_STATUS);
- generator.setParameter(TaskStatusConstants.TASK_ID, name);
+ generator.setParameter(TaskStatusConstants.STATUS_ID, name);
+ generator.setParameter(TaskStatusConstants.TASK_ID, taskId);
q = generator.selectQuery(em);
TaskStatus status = (TaskStatus) q.getSingleResult();
TaskStatusResource statusResource = (TaskStatusResource) Utils.getResource(ResourceType.TASK_STATUS, status);
@@ -180,6 +184,7 @@ public class TaskResource extends AbstractExpCatResource {
case TASK_ERROR:
generator = new QueryGenerator(TASK_ERROR);
generator.setParameter(TaskErrorConstants.ERROR_ID, name);
+ generator.setParameter(TaskErrorConstants.TASK_ID, taskId);
q = generator.selectQuery(em);
TaskError error = (TaskError) q.getSingleResult();
TaskErrorResource errorResource = (TaskErrorResource) Utils.getResource(
@@ -209,8 +214,63 @@ public class TaskResource extends AbstractExpCatResource {
public List<ExperimentCatResource> get(ResourceType type) throws RegistryException{
- logger.error("Unsupported resource type for task resource.", new UnsupportedOperationException());
- throw new UnsupportedOperationException();
+ List<ExperimentCatResource> resourceList = new ArrayList<ExperimentCatResource>();
+ EntityManager em = null;
+ try {
+ em = ExpCatResourceUtils.getEntityManager();
+ em.getTransaction().begin();
+ Query q;
+ QueryGenerator generator;
+ List results;
+ switch (type) {
+ case TASK_ERROR:
+ generator = new QueryGenerator(TASK_ERROR);
+ generator.setParameter(TaskErrorConstants.TASK_ID, taskId);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ TaskError taskError = (TaskError) result;
+ TaskErrorResource taskErrorResource =
+ (TaskErrorResource) Utils.getResource(ResourceType.TASK_ERROR, taskError);
+ resourceList.add(taskErrorResource);
+ }
+ }
+ break;
+ case TASK_STATUS:
+ generator = new QueryGenerator(TASK_STATUS);
+ generator.setParameter(TaskStatusConstants.TASK_ID, taskId);
+ q = generator.selectQuery(em);
+ results = q.getResultList();
+ if (results.size() != 0) {
+ for (Object result : results) {
+ TaskStatus taskStatus = (TaskStatus) result;
+ TaskStatusResource taskStatusResource =
+ (TaskStatusResource) Utils.getResource(ResourceType.TASK_STATUS, taskStatus);
+ resourceList.add(taskStatusResource);
+ }
+ }
+ break;
+ default:
+ em.getTransaction().commit();
+ em.close();
+ logger.error("Unsupported resource type for task resource.", new UnsupportedOperationException());
+ throw new UnsupportedOperationException();
+ }
+ em.getTransaction().commit();
+ em.close();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ throw new RegistryException(e);
+ } finally {
+ if (em != null && em.isOpen()) {
+ if (em.getTransaction().isActive()){
+ em.getTransaction().rollback();
+ }
+ em.close();
+ }
+ }
+ return resourceList;
}
@@ -218,30 +278,22 @@ public class TaskResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
- Task existingTask = em.find(Task.class, taskId);
+ Task task = em.find(Task.class, taskId);
em.close();
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
- if (existingTask != null) {
- existingTask.setTaskType(taskType);
- existingTask.setParentProcessId(parentProcessId);
- existingTask.setCreationTime(creationTime);
- existingTask.setLastUpdateTime(lastUpdateTime);
- existingTask.setTaskDetail(taskDetail);
- existingTask.setTaskInternalStore(taskInternalStore);
- em.merge(existingTask);
- } else {
- Task task = new Task();
- task.setTaskId(taskId);
- task.setTaskType(taskType);
- task.setParentProcessId(parentProcessId);
- task.setCreationTime(creationTime);
- task.setLastUpdateTime(lastUpdateTime);
- task.setTaskDetail(taskDetail);
- task.setTaskInternalStore(taskInternalStore);
- em.persist(task);
+ if(task == null){
+ task = new Task();
}
+ task.setTaskId(taskId);
+ task.setTaskType(taskType);
+ task.setParentProcessId(parentProcessId);
+ task.setCreationTime(creationTime);
+ task.setLastUpdateTime(lastUpdateTime);
+ task.setTaskDetail(taskDetail);
+ task.setTaskInternalStore(taskInternalStore);
+ em.persist(task);
em.getTransaction().commit();
em.close();
} catch (Exception e) {
@@ -257,17 +309,53 @@ public class TaskResource extends AbstractExpCatResource {
}
}
+ public List<TaskStatusResource> getTaskStatuses() throws RegistryException{
+ List<TaskStatusResource> taskStatusResources = new ArrayList();
+ List<ExperimentCatResource> resources = get(ResourceType.TASK_STATUS);
+ for (ExperimentCatResource resource : resources) {
+ TaskStatusResource statusResource = (TaskStatusResource) resource;
+ taskStatusResources.add(statusResource);
+ }
+ return taskStatusResources;
+ }
+
public TaskStatusResource getTaskStatus() throws RegistryException{
- ExperimentCatResource resource = get(ResourceType.TASK_STATUS, taskId);
- TaskStatusResource status = (TaskStatusResource) resource;
- if (status.getState() == null || status.getState().equals("") ){
- status.setState("UNKNOWN");
+ List<TaskStatusResource> taskStatusResources = getTaskStatuses();
+ if(taskStatusResources.size() == 0){
+ return null;
+ }else{
+ TaskStatusResource max = taskStatusResources.get(0);
+ for(int i=1; i<taskStatusResources.size();i++){
+ if(taskStatusResources.get(i).getTimeOfStateChange().after(max.getTimeOfStateChange())){
+ max = taskStatusResources.get(i);
+ }
+ }
+ return max;
}
- return status;
}
- public TaskErrorResource getTaskError () throws RegistryException{
- ExperimentCatResource resource = get(ResourceType.TASK_ERROR, taskId);;
- return (TaskErrorResource) resource;
+ public List<TaskErrorResource> getTaskErrors() throws RegistryException{
+ List<TaskErrorResource> taskErrorResources = new ArrayList();
+ List<ExperimentCatResource> resources = get(ResourceType.TASK_ERROR);
+ for (ExperimentCatResource resource : resources) {
+ TaskErrorResource errorResource = (TaskErrorResource) resource;
+ taskErrorResources.add(errorResource);
+ }
+ return taskErrorResources;
+ }
+
+ public TaskErrorResource getTaskError() throws RegistryException{
+ List<TaskErrorResource> taskErrorResources = getTaskErrors();
+ if(taskErrorResources.size() == 0){
+ return null;
+ }else{
+ TaskErrorResource max = taskErrorResources.get(0);
+ for(int i=1; i<taskErrorResources.size();i++){
+ if(taskErrorResources.get(i).getCreationTime().after(max.getCreationTime())){
+ max = taskErrorResources.get(i);
+ }
+ }
+ return max;
+ }
}
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/066030bc/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
index 24650b1..fbc812f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskStatusResource.java
@@ -25,6 +25,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.TaskStatus;
+import org.apache.airavata.registry.core.experiment.catalog.model.TaskStatusPK;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,11 +36,20 @@ import java.util.List;
public class TaskStatusResource extends AbstractExpCatResource {
private static final Logger logger = LoggerFactory.getLogger(TaskStatusResource.class);
+ private String statusId;
private String taskId;
private String state;
private Timestamp timeOfStateChange;
private String reason;
+ public String getStatusId() {
+ return statusId;
+ }
+
+ public void setStatusId(String statusId) {
+ this.statusId = statusId;
+ }
+
public String getTaskId() {
return taskId;
}
@@ -102,10 +112,13 @@ public class TaskStatusResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
TaskStatus taskStatus;
- if(taskId == null || state == null){
- throw new RegistryException("Does not have the task id or state");
+ if(taskId == null || statusId == null){
+ throw new RegistryException("Does not have the task id or status id");
}
- taskStatus = em.find(TaskStatus.class, taskId);
+ TaskStatusPK taskStatusPK = new TaskStatusPK();
+ taskStatusPK.setTaskId(taskId);
+ taskStatusPK.setStatusId(statusId);
+ taskStatus = em.find(TaskStatus.class, taskStatusPK);
if(taskStatus == null){
taskStatus = new TaskStatus();
}
[02/11] airavata git commit: modifying the data models to contain all
the statuses and errors
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index a867b91..be1a62d 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -106,6 +106,7 @@ CREATE TABLE EXPERIMENT_OUTPUT
(
EXPERIMENT_ID varchar(255),
OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE CLOB,
DATA_TYPE varchar(255),
APPLICATION_ARGUMENT varchar(255),
IS_REQUIRED BOOLEAN,
@@ -119,24 +120,25 @@ CREATE TABLE EXPERIMENT_OUTPUT
CREATE TABLE EXPERIMENT_STATUS (
+ STATUS_ID varchar(255),
EXPERIMENT_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (EXPERIMENT_ID),
+ PRIMARY KEY (STATUS_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID varchar(255) NOT NULL,
+ ERROR_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
ROOT_CAUSE_ERROR_ID_LIST CLOB,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
@@ -159,12 +161,17 @@ CREATE TABLE USER_CONFIGURATION_DATA (
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
+CREATE VIEW LATEST_EXPERIMENT_STATUS AS
+ select ES1.EXPERIMENT_ID AS EXPERIMENT_ID, ES1.STATE AS STATE, ES1.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from EXPERIMENT_STATUS ES1 LEFT JOIN EXPERIMENT_STATUS ES2 ON (ES1.EXPERIMENT_ID = ES2.EXPERIMENT_ID
+ AND ES1.TIME_OF_STATE_CHANGE < ES2.TIME_OF_STATE_CHANGE) WHERE ES2.TIME_OF_STATE_CHANGE is NULL;
+
CREATE VIEW EXPERIMENT_SUMMARY AS
select E.EXPERIMENT_ID AS EXPERIMENT_ID, E.PROJECT_ID AS PROJECT_ID,
E.USER_NAME AS USER_NAME, E.APPLICATION_ID AS APPLICATION_ID, E.EXPERIMENT_NAME AS EXPERIMENT_NAME,
E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
- from ((EXPERIMENT E left join EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
+ from ((EXPERIMENT E left join LATEST_EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where 1;
CREATE TABLE PROCESS (
@@ -201,6 +208,7 @@ CREATE TABLE PROCESS_OUTPUT
(
PROCESS_ID varchar(255),
OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE CLOB,
DATA_TYPE varchar(255),
APPLICATION_ARGUMENT varchar(255),
IS_REQUIRED BOOLEAN,
@@ -214,24 +222,25 @@ CREATE TABLE PROCESS_OUTPUT
CREATE TABLE PROCESS_STATUS (
+ STATUS_ID varchar(255),
PROCESS_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (PROCESS_ID),
+ PRIMARY KEY (STATUS_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
CREATE TABLE PROCESS_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- PROCESS_ID varchar(255) NOT NULL,
+ ERROR_ID varchar(255),
+ PROCESS_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
ROOT_CAUSE_ERROR_ID_LIST CLOB,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
@@ -260,23 +269,24 @@ CREATE TABLE TASK (
);
CREATE TABLE TASK_STATUS (
+ STATUS_ID varchar(255),
TASK_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (TASK_ID),
+ PRIMARY KEY (STATUS_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE EXPERIMENT_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- TASK_ID varchar(255) NOT NULL,
+CREATE TABLE TASK_ERROR (
+ ERROR_ID varchar(255),
+ TASK_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
ROOT_CAUSE_ERROR_ID_LIST CLOB,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
http://git-wip-us.apache.org/repos/asf/airavata/blob/3a003666/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index 4d19f51..1edb50c 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -106,6 +106,7 @@ CREATE TABLE EXPERIMENT_OUTPUT
(
EXPERIMENT_ID varchar(255),
OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE text,
DATA_TYPE varchar(255),
APPLICATION_ARGUMENT varchar(255),
IS_REQUIRED tinyint(1),
@@ -119,24 +120,25 @@ CREATE TABLE EXPERIMENT_OUTPUT
CREATE TABLE EXPERIMENT_STATUS (
+ STATUS_ID varchar(255),
EXPERIMENT_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (EXPERIMENT_ID),
+ PRIMARY KEY (STATUS_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- EXPERIMENT_ID varchar(255) NOT NULL,
+ ERROR_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
ROOT_CAUSE_ERROR_ID_LIST text,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
@@ -159,14 +161,21 @@ CREATE TABLE USER_CONFIGURATION_DATA (
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
+
+CREATE VIEW LATEST_EXPERIMENT_STATUS AS
+ select ES1.EXPERIMENT_ID AS EXPERIMENT_ID, ES1.STATE AS STATE, ES1.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from EXPERIMENT_STATUS ES1 LEFT JOIN EXPERIMENT_STATUS ES2 ON (ES1.EXPERIMENT_ID = ES2.EXPERIMENT_ID
+ AND ES1.TIME_OF_STATE_CHANGE < ES2.TIME_OF_STATE_CHANGE) WHERE ES2.TIME_OF_STATE_CHANGE is NULL;
+
CREATE VIEW EXPERIMENT_SUMMARY AS
select E.EXPERIMENT_ID AS EXPERIMENT_ID, E.PROJECT_ID AS PROJECT_ID,
E.USER_NAME AS USER_NAME, E.APPLICATION_ID AS APPLICATION_ID, E.EXPERIMENT_NAME AS EXPERIMENT_NAME,
E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
- from ((EXPERIMENT E left join EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
+ from ((EXPERIMENT E left join LATEST_EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where 1;
+
CREATE TABLE PROCESS (
PROCESS_ID varchar(255),
EXPERIMENT_ID varchar(255),
@@ -201,6 +210,7 @@ CREATE TABLE PROCESS_OUTPUT
(
PROCESS_ID varchar(255),
OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE text,
DATA_TYPE varchar(255),
APPLICATION_ARGUMENT varchar(255),
IS_REQUIRED tinyint(1),
@@ -214,24 +224,25 @@ CREATE TABLE PROCESS_OUTPUT
CREATE TABLE PROCESS_STATUS (
+ STATUS_ID varchar(255),
PROCESS_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (PROCESS_ID),
+ PRIMARY KEY (STATUS_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
CREATE TABLE PROCESS_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- PROCESS_ID varchar(255) NOT NULL,
+ ERROR_ID varchar(255),
+ PROCESS_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
ROOT_CAUSE_ERROR_ID_LIST text,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
@@ -260,23 +271,24 @@ CREATE TABLE TASK (
);
CREATE TABLE TASK_STATUS (
+ STATUS_ID varchar(255),
TASK_ID varchar(255),
STATE varchar(255),
TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
- PRIMARY KEY (TASK_ID),
+ PRIMARY KEY (STATUS_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE EXPERIMENT_ERROR (
- ERROR_ID int(11) NOT NULL AUTO_INCREMENT,
- TASK_ID varchar(255) NOT NULL,
+CREATE TABLE TASK_ERROR (
+ ERROR_ID varchar(255),
+ TASK_ID varchar(255),
CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
ROOT_CAUSE_ERROR_ID_LIST text,
- PRIMARY KEY (ERROR_ID),
+ PRIMARY KEY (ERROR_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
[06/11] airavata git commit: fixing registry test cases compilation
issues
Posted by sc...@apache.org.
fixing registry test cases compilation issues
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/21de9e05
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/21de9e05
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/21de9e05
Branch: refs/heads/master
Commit: 21de9e0521282428a1ed672248da6fecac7770b7
Parents: 066030b
Author: Supun Nakandala <sc...@apache.org>
Authored: Sat Jun 20 18:39:33 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Sat Jun 20 18:39:33 2015 +0530
----------------------------------------------------------------------
.../catalog/ComputationalSchedulingTest.java | 85 ------
.../catalog/ConfigurationResourceTest.java | 58 ----
.../catalog/ExperimentInputResourceTest.java | 12 +-
.../catalog/ExperimentOutputResourceTest.java | 14 +-
.../catalog/ExperimentResourceTest.java | 18 +-
.../catalog/ExperimentUseCaseTest.java | 300 -------------------
.../experiment/catalog/GatewayResourceTest.java | 12 +-
.../experiment/catalog/ProcessResourceTest.java | 82 +++++
.../catalog/TaskDetailResourceTest.java | 97 ------
.../catalog/UserConfigurationDataTest.java | 83 +++++
.../catalog/WorkflowNodeDetailResourceTest.java | 88 ------
11 files changed, 193 insertions(+), 656 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ComputationalSchedulingTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ComputationalSchedulingTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ComputationalSchedulingTest.java
deleted file mode 100644
index 9b9e945..0000000
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ComputationalSchedulingTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.experiment.catalog;
-
-import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ComputationSchedulingResource;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.sql.Timestamp;
-import java.util.Date;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-public class ComputationalSchedulingTest extends AbstractResourceTest {
- private ExperimentResource experimentResource;
- private ComputationSchedulingResource schedulingResource;
- private String experimentID = "testExpID";
-
- @Override
- @Before
- public void setUp() throws Exception {
- super.setUp();
- experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
- experimentResource.setProjectId(getProjectResource().getId());
- Timestamp currentDate = new Timestamp(new Date().getTime());
- experimentResource.setCreationTime(currentDate);
- experimentResource.setApplicationId("testApplication");
- experimentResource.setApplicationVersion("1.0");
- experimentResource.setDescription("Test Application");
- experimentResource.setExpName("TestExperiment");
- experimentResource.save();
-
- schedulingResource = (ComputationSchedulingResource)experimentResource.create(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING);
- schedulingResource.setResourceHostId("testResource");
- schedulingResource.setCpuCount(10);
- schedulingResource.setNodeCount(5);
- schedulingResource.setPhysicalMemory(1000);
- schedulingResource.setProjectName("project1");
- schedulingResource.setQueueName("testQueue");
- schedulingResource.save();
- System.out.println("scheduling id : " + schedulingResource.getSchedulingId());
- }
-
-
- @Test
- public void testSave() throws Exception {
- assertTrue("Computational schedule successfully", experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, experimentID));
- }
-
- @Test
- public void testRemove() throws Exception {
- experimentResource.remove(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, experimentID);
- assertFalse("Computational schedule removed successfully", experimentResource.isExists(ResourceType.COMPUTATIONAL_RESOURCE_SCHEDULING, experimentID));
- }
-
- @After
- public void tearDown() throws Exception {
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ConfigurationResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ConfigurationResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ConfigurationResourceTest.java
deleted file mode 100644
index fdcc553..0000000
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ConfigurationResourceTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-package org.apache.airavata.experiment.catalog;
-import static org.junit.Assert.*;
-
-import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ConfigurationResource;
-import org.junit.After;
-import org.junit.Test;
-
-import java.sql.Timestamp;
-import java.util.Calendar;
-
-public class ConfigurationResourceTest extends AbstractResourceTest {
-
- @Override
- public void setUp() throws Exception {
- super.setUp();
- }
- @Test
- public void testSave() throws Exception {
- ConfigurationResource configuration = ExpCatResourceUtils.createConfiguration("testConfigKey");
- configuration.setConfigVal("testConfigValue");
- Calendar calender = Calendar.getInstance();
- java.util.Date d = calender.getTime();
- Timestamp currentTime = new Timestamp(d.getTime());
- configuration.setExpireDate(currentTime);
- configuration.setCategoryID("SYSTEM");
- configuration.save();
-
- assertTrue("Configuration Save succuessful", ExpCatResourceUtils.isConfigurationExist("testConfigKey"));
- //remove test configuration
- ExpCatResourceUtils.removeConfiguration("testConfigKey");
- }
-
- @After
- public void tearDown() throws Exception {
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
index aaf4f9d..20c88e9 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
@@ -41,20 +41,20 @@ public class ExperimentInputResourceTest extends AbstractResourceTest {
public void setUp() throws Exception {
super.setUp();
experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
+ experimentResource.setExperimentId(experimentID);
+ experimentResource.setUserName(getWorkerResource().getUser());
experimentResource.setProjectId(getProjectResource().getId());
experimentResource.setCreationTime(getCurrentTimestamp());
experimentResource.setApplicationId("testApplication");
- experimentResource.setApplicationVersion("1.0");
+ experimentResource.setExecutionId("1.0");
experimentResource.setDescription("Test Application");
- experimentResource.setExpName("TestExperiment");
+ experimentResource.setExperimentName("TestExperiment");
experimentResource.save();
experimentInputResource = (ExperimentInputResource)experimentResource.create(ResourceType.EXPERIMENT_INPUT);
experimentInputResource.setExperimentId(experimentID);
- experimentInputResource.setExperimentKey("testKey");
- experimentInputResource.setValue("testValue");
+ experimentInputResource.setInputName("testKey");
+ experimentInputResource.setInputValue("testValue");
experimentInputResource.setDataType("string");
experimentInputResource.save();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
index 7e7ccde..9f3a2b6 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
@@ -41,20 +41,20 @@ public class ExperimentOutputResourceTest extends AbstractResourceTest {
public void setUp() throws Exception {
super.setUp();
experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
+ experimentResource.setExperimentId(experimentID);
+ experimentResource.setUserName(getWorkerResource().getUser());
experimentResource.setProjectId(getProjectResource().getId());
experimentResource.setCreationTime(getCurrentTimestamp());
experimentResource.setApplicationId("testApplication");
- experimentResource.setApplicationVersion("1.0");
+ experimentResource.setExecutionId("1.0");
experimentResource.setDescription("Test Application");
- experimentResource.setExpName("TestExperiment");
+ experimentResource.setExperimentName("TestExperiment");
experimentResource.save();
outputResource = (ExperimentOutputResource)experimentResource.create(ResourceType.EXPERIMENT_OUTPUT);
- outputResource.setExperimentId(experimentResource.getExpID());
- outputResource.setExperimentKey("testKey");
- outputResource.setValue("testValue");
+ outputResource.setExperimentId(experimentResource.getExperimentId());
+ outputResource.setOutputName("testKey");
+ outputResource.setOutputValue("testValue");
outputResource.setDataType("string");
outputResource.save();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentResourceTest.java
index 0a24102..e90883f 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentResourceTest.java
@@ -21,16 +21,16 @@
package org.apache.airavata.experiment.catalog;
-import static org.junit.Assert.*;
-
-import java.sql.Timestamp;
-import java.util.Date;
-
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
import org.junit.After;
import org.junit.Test;
+import java.sql.Timestamp;
+import java.util.Date;
+
+import static org.junit.Assert.*;
+
public class ExperimentResourceTest extends AbstractResourceTest {
private ExperimentResource experimentResource;
private String experimentID = "testExpID";
@@ -39,15 +39,15 @@ public class ExperimentResourceTest extends AbstractResourceTest {
public void setUp() throws Exception {
super.setUp();
experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
+ experimentResource.setExperimentId(experimentID);
+ experimentResource.setUserName(getWorkerResource().getUser());
experimentResource.setProjectId(getProjectResource().getId());
Timestamp currentDate = new Timestamp(new Date().getTime());
experimentResource.setCreationTime(currentDate);
experimentResource.setApplicationId("testApplication");
- experimentResource.setApplicationVersion("1.0");
+ experimentResource.setExecutionId("1.0");
experimentResource.setDescription("Test Application");
- experimentResource.setExpName("TestExperiment");
+ experimentResource.setExperimentName("TestExperiment");
experimentResource.save();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java
deleted file mode 100644
index 75b347d..0000000
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentUseCaseTest.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.experiment.catalog;
-
-import junit.framework.Assert;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.experiment.catalog.util.Initialize;
-import org.apache.airavata.model.application.io.InputDataObjectType;
-import org.apache.airavata.model.application.io.OutputDataObjectType;
-import org.apache.airavata.model.experiment.ExperimentModel;
-import org.apache.airavata.model.experiment.ExperimentSummaryModel;
-import org.apache.airavata.model.experiment.UserConfigurationDataModel;
-import org.apache.airavata.model.scheduling.ComputationalResourceSchedulingModel;
-import org.apache.airavata.model.status.ExperimentState;
-import org.apache.airavata.model.workspace.Project;
-import org.apache.airavata.registry.core.experiment.catalog.impl.RegistryFactory;
-import org.apache.airavata.registry.cpi.*;
-import org.apache.airavata.registry.cpi.utils.Constants;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * This class contains test cases for the RegistryImpl class which is the default registry
- * implementation. These test cases are written from the perspective of the Airavata API
- * such as creating/updating/deleting/searching projects and experiments etc.
- */
-public class ExperimentUseCaseTest {
-
- private static ExperimentCatalog experimentCatalog;
- private static Initialize initialize;
-
- @BeforeClass
- public static void setupBeforeClass() throws RegistryException, SQLException {
- initialize = new Initialize("expcatalog-derby.sql");
- initialize.initializeDB();
- experimentCatalog = RegistryFactory.getDefaultExpCatalog();
- }
-
- @Test
- public void testProject(){
- try {
- String TAG = System.currentTimeMillis() + "";
-
- String gatewayId = ServerSettings.getDefaultUserGateway();
-
- //testing the creation of a project
- Project project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("TestProject"+TAG);
- project.setDescription("This is a test project"+TAG);
- String projectId1 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId1);
-
- //testing the update of a project
- Project updatedProject = new Project();
- updatedProject.setProjectID(projectId1);
- updatedProject.setOwner("TestUser"+TAG);
- updatedProject.setName("UpdatedTestProject"+TAG);
- updatedProject.setDescription("This is an updated test project"+TAG);
- experimentCatalog.update(ExperimentCatalogModelType.PROJECT, updatedProject, projectId1);
-
- //testing project retrieval
- Project retrievedProject = (Project) experimentCatalog.get(ExperimentCatalogModelType.PROJECT, projectId1);
- Assert.assertEquals(updatedProject.getProjectID(), retrievedProject.getProjectID());
- Assert.assertEquals(updatedProject.getOwner(), retrievedProject.getOwner());
- Assert.assertEquals(updatedProject.getName(), retrievedProject.getName());
- Assert.assertEquals(updatedProject.getDescription(), retrievedProject.getDescription());
- Assert.assertNotNull(retrievedProject.getCreationTime());
- //created user should be in the shared users list
- Assert.assertTrue(retrievedProject.getSharedUsers().size()==1);
-
- //creating more projects for the same user
- project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("Project Terrible"+TAG);
- project.setDescription("This is a test project_2"+TAG);
- String projectId2 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId2);
-
- project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("Project Funny"+TAG);
- project.setDescription("This is a test project_3"+TAG);
- String projectId3 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId3);
-
- project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("Project Stupid"+TAG);
- project.setDescription("This is a test project_4"+TAG);
- String projectId4 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId4);
-
- project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("Project Boring"+TAG);
- project.setDescription("This is a test project_5"+TAG);
- String projectId5 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId5);
-
- //test get all projects created by the user
- List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.PROJECT,
- Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
- Assert.assertTrue(list.size()==5);
-
- //search project by project name
- Map<String, String> filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
- filters.put(Constants.FieldConstants.ProjectConstants.PROJECT_NAME, "Terrible"+TAG);
- list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters);
- Assert.assertTrue(list.size()==1);
-
- //search project by project description
- filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
- filters.put(Constants.FieldConstants.ProjectConstants.DESCRIPTION, "test project_2"+TAG);
- list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters);
- Assert.assertTrue(list.size()==1);
-
- //search project with only ownername
- filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
- list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters);
- Assert.assertTrue(list.size()==5);
-
- //search projects with pagination
- filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ProjectConstants.OWNER, "TestUser"+TAG);
- list = experimentCatalog.search(ExperimentCatalogModelType.PROJECT, filters, 2, 2,
- Constants.FieldConstants.ProjectConstants.CREATION_TIME, ResultOrderType.DESC);
- Assert.assertTrue(list.size()==2);
- Project project1 = (Project)list.get(0);
- Project project2 = (Project)list.get(1);
- Assert.assertTrue(project1.getCreationTime()-project2.getCreationTime() > 0);
- } catch (RegistryException e) {
- e.printStackTrace();
- Assert.fail();
- } catch (ApplicationSettingsException e) {
- e.printStackTrace();
- }
- }
-
- @Test
- public void testExperiment(){
- try {
- long time = System.currentTimeMillis();
- String TAG = time + "";
-
- String gatewayId = ServerSettings.getDefaultUserGateway();
-
- //creating project
- Project project = new Project();
- project.setOwner("TestUser"+TAG);
- project.setName("TestProject"+TAG);
- project.setDescription("This is a test project"+TAG);
- String projectId1 = (String) experimentCatalog.add(ExpCatParentDataType.PROJECT, project, gatewayId);
- Assert.assertNotNull(projectId1);
-
- //creating sample echo experiment. assumes echo application is already defined
- InputDataObjectType inputDataObjectType = new InputDataObjectType();
- inputDataObjectType.setName("Input_to_Echo");
- inputDataObjectType.setValue("Hello World");
-
- ComputationalResourceSchedulingModel scheduling = new ComputationalResourceSchedulingModel();
- scheduling.setResourceHostId(UUID.randomUUID().toString());
-// scheduling.setComputationalProjectAccount("TG-STA110014S");
- scheduling.setTotalCPUCount(1);
- scheduling.setNodeCount(1);
- scheduling.setWallTimeLimit(15);
- scheduling.setQueueName("normal");
-
- UserConfigurationDataModel userConfigurationData = new UserConfigurationDataModel();
- userConfigurationData.setAiravataAutoSchedule(false);
- userConfigurationData.setOverrideManualScheduledParams(false);
- userConfigurationData.setComputationalResourceScheduling(scheduling);
-
- ExperimentModel experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment" + TAG);
- experiment.setDescription("Test 1 experiment");
- experiment.setExecutionId(UUID.randomUUID().toString());
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId1 = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, experiment, gatewayId);
- Assert.assertNotNull(experimentId1);
-
- //retrieving the stored experiment
- ExperimentModel retrievedExperiment = (ExperimentModel) experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
- experimentId1);
- Assert.assertNotNull(retrievedExperiment);
- Assert.assertEquals(retrievedExperiment.getProjectId(), experiment.getProjectId());
- Assert.assertEquals(retrievedExperiment.getDescription(), experiment.getDescription());
- Assert.assertEquals(retrievedExperiment.getExperimentName(), experiment.getExperimentName());
- Assert.assertEquals(retrievedExperiment.getExecutionId(), experiment.getExecutionId());
- Assert.assertNotNull(retrievedExperiment.getUserConfigurationData());
- Assert.assertNotNull(retrievedExperiment.getExperimentInputs());
-
- //updating an existing experiment
- experiment.setExperimentName("NewExperimentName" + TAG);
- OutputDataObjectType outputDataObjectType = new OutputDataObjectType();
- outputDataObjectType.setName("Output_to_Echo");
- outputDataObjectType.setValue("Hello World");
- experiment.addToExperimentOutputs(outputDataObjectType);
- experimentCatalog.update(ExperimentCatalogModelType.EXPERIMENT, experiment, experimentId1);
-
- //creating more experiments
- experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment2" + TAG);
- experiment.setDescription("Test 2 experiment");
- experiment.setExecutionId(UUID.randomUUID().toString());
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId2 = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, experiment, gatewayId);
- Assert.assertNotNull(experimentId2);
-
- experiment = new ExperimentModel();
- experiment.setProjectId(projectId1);
- experiment.setUserName("TestUser" + TAG);
- experiment.setExperimentName("TestExperiment3" + TAG);
- experiment.setDescription("Test 3 experiment");
- experiment.setExecutionId(UUID.randomUUID().toString());
- experiment.setUserConfigurationData(userConfigurationData);
- experiment.addToExperimentInputs(inputDataObjectType);
-
- String experimentId3 = (String) experimentCatalog.add(ExpCatParentDataType.EXPERIMENT, experiment, gatewayId);
- Assert.assertNotNull(experimentId3);
-
- //searching experiments by
- Map<String, String> filters = new HashMap<String, String>();
- filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
- filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
- filters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_NAME, "Experiment2");
- filters.put(Constants.FieldConstants.ExperimentConstants.EXPERIMENT_STATUS, ExperimentState.CREATED.toString());
- filters.put(Constants.FieldConstants.ExperimentConstants.FROM_DATE, time - 999999999 + "");
- filters.put(Constants.FieldConstants.ExperimentConstants.TO_DATE, time + 999999999 + "");
- List<Object> results = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT, filters);
- Assert.assertTrue(results.size()==1);
-
- //retrieving all experiments in project
- List<Object> list = experimentCatalog.get(ExperimentCatalogModelType.EXPERIMENT,
- Constants.FieldConstants.ExperimentConstants.PROJECT_ID, projectId1);
- Assert.assertTrue(list.size()==3);
-
- //searching all user experiments
- filters = new HashMap();
- filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
- filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
- list = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT, filters);
- Assert.assertTrue(list.size()==3);
-
- //searching user experiments with pagination
- filters = new HashMap();
- filters.put(Constants.FieldConstants.ExperimentConstants.USER_NAME, "TestUser" + TAG);
- filters.put(Constants.FieldConstants.ExperimentConstants.GATEWAY, gatewayId);
- list = experimentCatalog.search(ExperimentCatalogModelType.EXPERIMENT, filters, 2, 1,
- Constants.FieldConstants.ExperimentConstants.CREATION_TIME, ResultOrderType.DESC);
- Assert.assertTrue(list.size()==2);
- ExperimentSummaryModel exp1 = (ExperimentSummaryModel)list.get(0);
- ExperimentSummaryModel exp2 = (ExperimentSummaryModel)list.get(1);
- Assert.assertTrue(exp1.getCreationTime()-exp2.getCreationTime() > 0);
-
- } catch (RegistryException e) {
- e.printStackTrace();
- Assert.fail();
- } catch (ApplicationSettingsException e) {
- e.printStackTrace();
- }
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
index cb2b792..91d582c 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
@@ -21,8 +21,6 @@
package org.apache.airavata.experiment.catalog;
-import static org.junit.Assert.*;
-
import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
@@ -33,6 +31,8 @@ import org.junit.Test;
import java.sql.Timestamp;
import java.util.Date;
+import static org.junit.Assert.*;
+
public class GatewayResourceTest extends AbstractResourceTest {
private GatewayResource gatewayResource;
@@ -61,14 +61,14 @@ public class GatewayResourceTest extends AbstractResourceTest {
experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- experimentResource.setExpID("testExpID");
- experimentResource.setExecutionUser(getWorkerResource().getUser());
+ experimentResource.setExecutionId("testExpID");
+ experimentResource.setUserName(getWorkerResource().getUser());
experimentResource.setProjectId(getProjectResource().getId());
experimentResource.setCreationTime(currentDate);
experimentResource.setApplicationId("testApplication");
- experimentResource.setApplicationVersion("1.0");
+ experimentResource.setExecutionId("1.0");
experimentResource.setDescription("Test Application");
- experimentResource.setExpName("TestExperiment");
+ experimentResource.setExperimentName("TestExperiment");
experimentResource.save();
}
@Test
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
new file mode 100644
index 0000000..c2ed8f8
--- /dev/null
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ProcessResourceTest.java
@@ -0,0 +1,82 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.airavata.experiment.catalog;
+
+import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
+import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
+import org.apache.airavata.registry.core.experiment.catalog.resources.ProcessResource;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.Timestamp;
+import java.util.Date;
+
+import static org.junit.Assert.*;
+
+public class ProcessResourceTest extends AbstractResourceTest{
+
+ private ExperimentResource experimentResource;
+ private ProcessResource processResource;
+ private String experimentID = "testExpID";
+ private String processId = "processID";
+
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ Timestamp creationTime = new Timestamp(new Date().getTime());
+
+ experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
+ experimentResource.setExperimentId(experimentID);
+ experimentResource.setExperimentName(experimentID);
+ experimentResource.setUserName(getWorkerResource().getUser());
+ experimentResource.setProjectId(getProjectResource().getId());
+ experimentResource.setCreationTime(creationTime);
+ experimentResource.save();
+
+ processResource = (ProcessResource)experimentResource.create(ResourceType.PROCESS);
+ processResource.setProcessId(processId);
+ processResource.setExperimentId(experimentID);
+ processResource.setCreationTime(creationTime);
+ processResource.save();
+ }
+
+
+ @Test
+ public void testCreate() throws Exception {
+ assertNotNull("process data resource has being created ", processResource);
+ }
+
+ @Test
+ public void testSave() throws Exception {
+ assertTrue("process save successfully", experimentResource.isExists(ResourceType.PROCESS, processId));
+ }
+
+ @Test
+ public void testGet() throws Exception {
+ assertNotNull("process data retrieved successfully", experimentResource.get(ResourceType.PROCESS, processId));
+ }
+
+ @Test
+ public void testRemove() throws Exception {
+ experimentResource.remove(ResourceType.PROCESS, processId);
+ assertFalse("process data removed successfully", processResource.isExists(ResourceType.PROCESS, processId));
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java
deleted file mode 100644
index b50910b..0000000
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/TaskDetailResourceTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.airavata.experiment.catalog;
-
-import static org.junit.Assert.*;
-
-import java.sql.Timestamp;
-import java.util.Date;
-
-import org.apache.airavata.model.experiment.ExperimentType;
-import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
-import org.apache.airavata.registry.core.experiment.catalog.resources.TaskDetailResource;
-import org.apache.airavata.registry.core.experiment.catalog.resources.WorkflowNodeDetailResource;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TaskDetailResourceTest extends AbstractResourceTest{
-
- private ExperimentResource experimentResource;
- private TaskDetailResource taskDetailResource;
- private WorkflowNodeDetailResource nodeDetailResource;
- private String experimentID = "testExpID";
- private String applicationID = "testAppID";
- private String taskID = "testTask";
- private String nodeID = "testNode";
-
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- Timestamp creationTime = new Timestamp(new Date().getTime());
-
- experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExpName(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
- experimentResource.setProjectId(getProjectResource().getId());
- experimentResource.setCreationTime(creationTime);
- experimentResource.save();
-
- nodeDetailResource = (WorkflowNodeDetailResource) experimentResource.create(ResourceType.WORKFLOW_NODE_DETAIL);
- nodeDetailResource.setExperimentId(experimentResource.getExpID());
- nodeDetailResource.setNodeInstanceId(nodeID);
- nodeDetailResource.setNodeName(nodeID);
- nodeDetailResource.setCreationTime(creationTime);
- nodeDetailResource.setExecutionUnit(ExperimentType.SINGLE_APPLICATION.toString());
- nodeDetailResource.save();
-
- taskDetailResource = (TaskDetailResource)nodeDetailResource.create(ResourceType.TASK_DETAIL);
- taskDetailResource.setNodeId(nodeDetailResource.getNodeInstanceId());
- taskDetailResource.setTaskId(taskID);
- taskDetailResource.setApplicationId(applicationID);
- taskDetailResource.setApplicationVersion("1.0");
- taskDetailResource.setCreationTime(creationTime);
- taskDetailResource.save();
- }
-
-
- @Test
- public void testCreate() throws Exception {
- assertNotNull("task data resource has being created ", taskDetailResource);
- }
-
- @Test
- public void testSave() throws Exception {
- assertTrue("task save successfully", nodeDetailResource.isExists(ResourceType.TASK_DETAIL, taskID));
- }
-
- @Test
- public void testGet() throws Exception {
- assertNotNull("task data retrieved successfully", nodeDetailResource.get(ResourceType.TASK_DETAIL, taskID));
- }
-
- @Test
- public void testRemove() throws Exception {
- nodeDetailResource.remove(ResourceType.TASK_DETAIL, taskID);
- assertFalse("task data removed successfully", nodeDetailResource.isExists(ResourceType.TASK_DETAIL, taskID));
- }
-}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
new file mode 100644
index 0000000..2975e95
--- /dev/null
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/UserConfigurationDataTest.java
@@ -0,0 +1,83 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.experiment.catalog;
+
+import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
+import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
+import org.apache.airavata.registry.core.experiment.catalog.resources.UserConfigurationDataResource;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.sql.Timestamp;
+import java.util.Date;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class UserConfigurationDataTest extends AbstractResourceTest {
+ private ExperimentResource experimentResource;
+ private UserConfigurationDataResource userConfigurationData;
+ private String experimentID = "testExpID";
+
+ @Override
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
+ experimentResource.setExperimentId(experimentID);
+ experimentResource.setUserName(getWorkerResource().getUser());
+ experimentResource.setProjectId(getProjectResource().getId());
+ Timestamp currentDate = new Timestamp(new Date().getTime());
+ experimentResource.setCreationTime(currentDate);
+ experimentResource.setApplicationId("testApplication");
+ experimentResource.setExecutionId("1.0");
+ experimentResource.setDescription("Test Application");
+ experimentResource.setExperimentName("TestExperiment");
+ experimentResource.save();
+
+ userConfigurationData = (UserConfigurationDataResource)experimentResource.create(ResourceType.USER_CONFIGURATION_DATA);
+ userConfigurationData.setResourceHostId("testResource");
+ userConfigurationData.setTotalCpuCount(10);
+ userConfigurationData.setNodeCount(5);
+ userConfigurationData.setTotalPhysicalMemory(1000);
+ userConfigurationData.setQueueName("testQueue");
+ userConfigurationData.save();
+ System.out.println("scheduling id (experiment id) : " + userConfigurationData.getExperimentId());
+ }
+
+
+ @Test
+ public void testSave() throws Exception {
+ assertTrue("Computational schedule successfully", experimentResource.isExists(ResourceType.USER_CONFIGURATION_DATA, experimentID));
+ }
+
+ @Test
+ public void testRemove() throws Exception {
+ experimentResource.remove(ResourceType.USER_CONFIGURATION_DATA, experimentID);
+ assertFalse("Computational schedule removed successfully", experimentResource.isExists(ResourceType.USER_CONFIGURATION_DATA, experimentID));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/21de9e05/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/WorkflowNodeDetailResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/WorkflowNodeDetailResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/WorkflowNodeDetailResourceTest.java
deleted file mode 100644
index c55e872..0000000
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/WorkflowNodeDetailResourceTest.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.airavata.experiment.catalog;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.sql.Timestamp;
-import java.util.Date;
-
-import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
-import org.apache.airavata.registry.core.experiment.catalog.resources.ExperimentResource;
-import org.apache.airavata.registry.core.experiment.catalog.resources.WorkflowNodeDetailResource;
-import org.junit.Before;
-import org.junit.Test;
-
-public class WorkflowNodeDetailResourceTest extends AbstractResourceTest {
-
- private ExperimentResource experimentResource;
- private WorkflowNodeDetailResource nodeDetailResource;
- private String experimentID = "testExpID";
- private String applicationID = "testAppID";
- private String nodeID = "testNode";
-
- @Before
- public void setUp() throws Exception {
- super.setUp();
- Timestamp creationTime = new Timestamp(new Date().getTime());
-
- experimentResource = (ExperimentResource) getGatewayResource().create(ResourceType.EXPERIMENT);
- experimentResource.setExpID(experimentID);
- experimentResource.setExpName(experimentID);
- experimentResource.setExecutionUser(getWorkerResource().getUser());
- experimentResource.setProjectId(getProjectResource().getId());
- experimentResource.setCreationTime(creationTime);
- experimentResource.setApplicationId(applicationID);
- experimentResource.save();
-
- nodeDetailResource = (WorkflowNodeDetailResource) experimentResource.create(ResourceType.WORKFLOW_NODE_DETAIL);
- nodeDetailResource.setExperimentId(experimentResource.getExpID());
- nodeDetailResource.setNodeInstanceId(nodeID);
- nodeDetailResource.setNodeName(nodeID);
- nodeDetailResource.setCreationTime(creationTime);
- nodeDetailResource.setExecutionUnit("workflow");
- nodeDetailResource.save();
-
- }
-
- @Test
- public void testCreate() throws Exception {
- assertNotNull("task data resource has being created ", nodeDetailResource);
- }
-
- @Test
- public void testSave() throws Exception {
- assertTrue("task save successfully", experimentResource.isExists(ResourceType.WORKFLOW_NODE_DETAIL, nodeID));
- }
-
- @Test
- public void testGet() throws Exception {
- assertNotNull("task data retrieved successfully", experimentResource.get(ResourceType.WORKFLOW_NODE_DETAIL, nodeID));
- }
-
- @Test
- public void testRemove() throws Exception {
- experimentResource.remove(ResourceType.WORKFLOW_NODE_DETAIL, nodeID);
- assertFalse("task data removed successfully", experimentResource.isExists(ResourceType.WORKFLOW_NODE_DETAIL, nodeID));
- }
-
-}
[09/11] airavata git commit: Fixing minor issues and fixing the
registry test cases
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
index f4bdcbc..537d2e5 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Experiment.java
@@ -43,8 +43,8 @@ public class Experiment {
private String gatewayExecutionId;
private Boolean enableEmailNotification;
private String emailAddresses;
- private User user;
- private Project projectByProjectId;
+ private Users user;
+ private Project project;
private Collection<ExperimentError> experimentErrors;
private Collection<ExperimentInput> experimentInputs;
private Collection<ExperimentOutput> experimentOutputs;
@@ -172,70 +172,70 @@ public class Experiment {
this.emailAddresses = emailAddresses;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Experiment that = (Experiment) o;
-
- if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null)
- return false;
- if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
- if (description != null ? !description.equals(that.description) : that.description != null) return false;
- if (emailAddresses != null ? !emailAddresses.equals(that.emailAddresses) : that.emailAddresses != null)
- return false;
- if (enableEmailNotification != null ? !enableEmailNotification.equals(that.enableEmailNotification) : that.enableEmailNotification != null)
- return false;
- if (executionId != null ? !executionId.equals(that.executionId) : that.executionId != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (experimentName != null ? !experimentName.equals(that.experimentName) : that.experimentName != null)
- return false;
- if (experimentType != null ? !experimentType.equals(that.experimentType) : that.experimentType != null)
- return false;
- if (gatewayExecutionId != null ? !gatewayExecutionId.equals(that.gatewayExecutionId) : that.gatewayExecutionId != null)
- return false;
- if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
- result = 31 * result + (experimentType != null ? experimentType.hashCode() : 0);
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
- result = 31 * result + (applicationId != null ? applicationId.hashCode() : 0);
- result = 31 * result + (experimentName != null ? experimentName.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (executionId != null ? executionId.hashCode() : 0);
- result = 31 * result + (gatewayExecutionId != null ? gatewayExecutionId.hashCode() : 0);
- result = 31 * result + (enableEmailNotification != null ? enableEmailNotification.hashCode() : 0);
- result = 31 * result + (emailAddresses != null ? emailAddresses.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// Experiment that = (Experiment) o;
+//
+// if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
+// if (description != null ? !description.equals(that.description) : that.description != null) return false;
+// if (emailAddresses != null ? !emailAddresses.equals(that.emailAddresses) : that.emailAddresses != null)
+// return false;
+// if (enableEmailNotification != null ? !enableEmailNotification.equals(that.enableEmailNotification) : that.enableEmailNotification != null)
+// return false;
+// if (executionId != null ? !executionId.equals(that.executionId) : that.executionId != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (experimentName != null ? !experimentName.equals(that.experimentName) : that.experimentName != null)
+// return false;
+// if (experimentType != null ? !experimentType.equals(that.experimentType) : that.experimentType != null)
+// return false;
+// if (gatewayExecutionId != null ? !gatewayExecutionId.equals(that.gatewayExecutionId) : that.gatewayExecutionId != null)
+// return false;
+// if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
+// if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = experimentId != null ? experimentId.hashCode() : 0;
+// result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
+// result = 31 * result + (experimentType != null ? experimentType.hashCode() : 0);
+// result = 31 * result + (userName != null ? userName.hashCode() : 0);
+// result = 31 * result + (applicationId != null ? applicationId.hashCode() : 0);
+// result = 31 * result + (experimentName != null ? experimentName.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (description != null ? description.hashCode() : 0);
+// result = 31 * result + (executionId != null ? executionId.hashCode() : 0);
+// result = 31 * result + (gatewayExecutionId != null ? gatewayExecutionId.hashCode() : 0);
+// result = 31 * result + (enableEmailNotification != null ? enableEmailNotification.hashCode() : 0);
+// result = 31 * result + (emailAddresses != null ? emailAddresses.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "USER_NAME", referencedColumnName = "USER_NAME", nullable = false)
- public User getUser() {
+ public Users getUser() {
return user;
}
- public void setUser(User userByUserName) {
+ public void setUser(Users userByUserName) {
this.user = userByUserName;
}
@ManyToOne
@JoinColumn(name = "PROJECT_ID", referencedColumnName = "PROJECT_ID", nullable = false)
- public Project getProjectByProjectId() {
- return projectByProjectId;
+ public Project getProject() {
+ return project;
}
- public void setProjectByProjectId(Project projectByProjectId) {
- this.projectByProjectId = projectByProjectId;
+ public void setProject(Project projectByProjectId) {
+ this.project = projectByProjectId;
}
@OneToMany(mappedBy = "experiment")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
index b1e20ce..7bf9745 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentError.java
@@ -110,39 +110,39 @@ public class ExperimentError {
this.rootCauseErrorIdList = rootCauseErrorIdList;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ExperimentError that = (ExperimentError) o;
-
- if (errorId != that.errorId) return false;
- if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
- return false;
- if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
- return false;
- if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
- return false;
- if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
- result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
- result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
- result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ExperimentError that = (ExperimentError) o;
+//
+// if (errorId != that.errorId) return false;
+// if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
+// return false;
+// if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
+// return false;
+// if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = errorId != null ? errorId.hashCode() : 0;
+// result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
+// result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
+// result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
+// result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
index e9ac79e..4b48e27 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentErrorPK.java
@@ -52,6 +52,7 @@ public class ExperimentErrorPK implements Serializable {
this.experimentId = experimentId;
}
+
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -59,16 +60,16 @@ public class ExperimentErrorPK implements Serializable {
ExperimentErrorPK that = (ExperimentErrorPK) o;
- if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+ if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false;
+ if (getExperimentId() != null ? !getExperimentId().equals(that.getExperimentId()) : that.getExperimentId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ int result = getErrorId() != null ? getErrorId().hashCode() : 0;
+ result = 31 * result + (getExperimentId() != null ? getExperimentId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
index b331f21..dbd57ab 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInput.java
@@ -164,49 +164,49 @@ public class ExperimentInput {
this.dataStaged = dataStaged;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ExperimentInput that = (ExperimentInput) o;
-
- if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
- return false;
- if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
- if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
- if (inputOrder != null ? !inputOrder.equals(that.inputOrder) : that.inputOrder != null) return false;
- if (inputValue != null ? !inputValue.equals(that.inputValue) : that.inputValue != null) return false;
- if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
- if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false;
- if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
- return false;
- if (standardInput != null ? !standardInput.equals(that.standardInput) : that.standardInput != null)
- return false;
- if (userFriendlyDescription != null ? !userFriendlyDescription.equals(that.userFriendlyDescription) : that.userFriendlyDescription != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
- result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
- result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
- result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
- result = 31 * result + (standardInput != null ? standardInput.hashCode() : 0);
- result = 31 * result + (userFriendlyDescription != null ? userFriendlyDescription.hashCode() : 0);
- result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
- result = 31 * result + (inputOrder != null ? inputOrder.hashCode() : 0);
- result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
- result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
- result = 31 * result + (dataStaged != null ? dataStaged.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ExperimentInput that = (ExperimentInput) o;
+//
+// if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
+// return false;
+// if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
+// if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
+// if (inputOrder != null ? !inputOrder.equals(that.inputOrder) : that.inputOrder != null) return false;
+// if (inputValue != null ? !inputValue.equals(that.inputValue) : that.inputValue != null) return false;
+// if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
+// if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false;
+// if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
+// return false;
+// if (standardInput != null ? !standardInput.equals(that.standardInput) : that.standardInput != null)
+// return false;
+// if (userFriendlyDescription != null ? !userFriendlyDescription.equals(that.userFriendlyDescription) : that.userFriendlyDescription != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = experimentId != null ? experimentId.hashCode() : 0;
+// result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+// result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
+// result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+// result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
+// result = 31 * result + (standardInput != null ? standardInput.hashCode() : 0);
+// result = 31 * result + (userFriendlyDescription != null ? userFriendlyDescription.hashCode() : 0);
+// result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
+// result = 31 * result + (inputOrder != null ? inputOrder.hashCode() : 0);
+// result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
+// result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
+// result = 31 * result + (dataStaged != null ? dataStaged.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
index 1db370e..3ff3fc1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentInputPK.java
@@ -59,16 +59,16 @@ public class ExperimentInputPK implements Serializable {
ExperimentInputPK that = (ExperimentInputPK) o;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
+ if (getExperimentId() != null ? !getExperimentId().equals(that.getExperimentId()) : that.getExperimentId() != null) return false;
+ if (getInputName() != null ? !getInputName().equals(that.getInputName()) : that.getInputName() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+ int result = getExperimentId() != null ? getExperimentId().hashCode() : 0;
+ result = 31 * result + (getInputName() != null ? getInputName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
index 9962429..98c1d44 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutput.java
@@ -142,44 +142,44 @@ public class ExperimentOutput {
this.searchQuery = searchQuery;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ExperimentOutput that = (ExperimentOutput) o;
- if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
- return false;
- if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
- return false;
- if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
- return false;
- if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
- if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
- if (location != null ? !location.equals(that.location) : that.location != null) return false;
- if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
- return false;
- if (searchQuery != null ? !searchQuery.equals(that.searchQuery) : that.searchQuery != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
- result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
- result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
- result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
- result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
- result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
- result = 31 * result + (dataMovement != null ? dataMovement.hashCode() : 0);
- result = 31 * result + (location != null ? location.hashCode() : 0);
- result = 31 * result + (searchQuery != null ? searchQuery.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ExperimentOutput that = (ExperimentOutput) o;
+// if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
+// return false;
+// if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
+// return false;
+// if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
+// return false;
+// if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
+// if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
+// if (location != null ? !location.equals(that.location) : that.location != null) return false;
+// if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
+// return false;
+// if (searchQuery != null ? !searchQuery.equals(that.searchQuery) : that.searchQuery != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = experimentId != null ? experimentId.hashCode() : 0;
+// result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+// result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
+// result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+// result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
+// result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
+// result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
+// result = 31 * result + (dataMovement != null ? dataMovement.hashCode() : 0);
+// result = 31 * result + (location != null ? location.hashCode() : 0);
+// result = 31 * result + (searchQuery != null ? searchQuery.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
index ac52859..a73b00e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentOutputPK.java
@@ -23,7 +23,6 @@ package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
@@ -60,16 +59,16 @@ public class ExperimentOutputPK implements Serializable {
ExperimentOutputPK that = (ExperimentOutputPK) o;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false;
+ if (getExperimentId() != null ? !getExperimentId().equals(that.getExperimentId()) : that.getExperimentId() != null) return false;
+ if (getOutputName() != null ? !getOutputName().equals(that.getOutputName()) : that.getOutputName() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ int result = getExperimentId() != null ? getExperimentId().hashCode() : 0;
+ result = 31 * result + (getOutputName() != null ? getOutputName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
index 4db87e0..7e892f0 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatus.java
@@ -88,31 +88,31 @@ public class ExperimentStatus {
this.reason = reason;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ExperimentStatus that = (ExperimentStatus) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
- if (state != null ? !state.equals(that.state) : that.state != null) return false;
- if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
- result = 31 * result + (state != null ? state.hashCode() : 0);
- result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
- result = 31 * result + (reason != null ? reason.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ExperimentStatus that = (ExperimentStatus) o;
+// if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
+// if (state != null ? !state.equals(that.state) : that.state != null) return false;
+// if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = statusId != null ? statusId.hashCode() : 0;
+// result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+// result = 31 * result + (state != null ? state.hashCode() : 0);
+// result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
+// result = 31 * result + (reason != null ? reason.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
index 98d928d..e84e2ca 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentStatusPK.java
@@ -59,16 +59,16 @@ public class ExperimentStatusPK implements Serializable {
ExperimentStatusPK that = (ExperimentStatusPK) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+ if (getStatusId() != null ? !getStatusId().equals(that.getStatusId()) : that.getStatusId() != null) return false;
+ if (getExperimentId() != null ? !getExperimentId().equals(that.getExperimentId()) : that.getExperimentId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+ int result = getStatusId() != null ? getStatusId().hashCode() : 0;
+ result = 31 * result + (getExperimentId() != null ? getExperimentId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
index bc88d93..c1455ff 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ExperimentSummary.java
@@ -141,43 +141,43 @@ public class ExperimentSummary {
this.timeOfStateChange = timeOfStateChange;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ExperimentSummary that = (ExperimentSummary) o;
-
- if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null)
- return false;
- if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
- if (description != null ? !description.equals(that.description) : that.description != null) return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (experimentName != null ? !experimentName.equals(that.experimentName) : that.experimentName != null)
- return false;
- if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
- if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
- return false;
- if (state != null ? !state.equals(that.state) : that.state != null) return false;
- if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
- return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
- result = 31 * result + (applicationId != null ? applicationId.hashCode() : 0);
- result = 31 * result + (experimentName != null ? experimentName.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (state != null ? state.hashCode() : 0);
- result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
- result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ExperimentSummary that = (ExperimentSummary) o;
+//
+// if (applicationId != null ? !applicationId.equals(that.applicationId) : that.applicationId != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
+// if (description != null ? !description.equals(that.description) : that.description != null) return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (experimentName != null ? !experimentName.equals(that.experimentName) : that.experimentName != null)
+// return false;
+// if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
+// if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
+// return false;
+// if (state != null ? !state.equals(that.state) : that.state != null) return false;
+// if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
+// return false;
+// if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = experimentId != null ? experimentId.hashCode() : 0;
+// result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
+// result = 31 * result + (userName != null ? userName.hashCode() : 0);
+// result = 31 * result + (applicationId != null ? applicationId.hashCode() : 0);
+// result = 31 * result + (experimentName != null ? experimentName.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (description != null ? description.hashCode() : 0);
+// result = 31 * result + (state != null ? state.hashCode() : 0);
+// result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
+// result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
+// return result;
+// }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
index 6e2b86c..b8ee5f5 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Gateway.java
@@ -77,33 +77,33 @@ public class Gateway {
this.emailAddress = emailAddress;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// Gateway gateway = (Gateway) o;
+//
+// if (domain != null ? !domain.equals(gateway.domain) : gateway.domain != null) return false;
+// if (emailAddress != null ? !emailAddress.equals(gateway.emailAddress) : gateway.emailAddress != null)
+// return false;
+// if (gatewayId != null ? !gatewayId.equals(gateway.gatewayId) : gateway.gatewayId != null) return false;
+// if (gatewayName != null ? !gatewayName.equals(gateway.gatewayName) : gateway.gatewayName != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = gatewayId != null ? gatewayId.hashCode() : 0;
+// result = 31 * result + (gatewayName != null ? gatewayName.hashCode() : 0);
+// result = 31 * result + (domain != null ? domain.hashCode() : 0);
+// result = 31 * result + (emailAddress != null ? emailAddress.hashCode() : 0);
+// return result;
+// }
- Gateway gateway = (Gateway) o;
-
- if (domain != null ? !domain.equals(gateway.domain) : gateway.domain != null) return false;
- if (emailAddress != null ? !emailAddress.equals(gateway.emailAddress) : gateway.emailAddress != null)
- return false;
- if (gatewayId != null ? !gatewayId.equals(gateway.gatewayId) : gateway.gatewayId != null) return false;
- if (gatewayName != null ? !gatewayName.equals(gateway.gatewayName) : gateway.gatewayName != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = gatewayId != null ? gatewayId.hashCode() : 0;
- result = 31 * result + (gatewayName != null ? gatewayName.hashCode() : 0);
- result = 31 * result + (domain != null ? domain.hashCode() : 0);
- result = 31 * result + (emailAddress != null ? emailAddress.hashCode() : 0);
- return result;
- }
-
- @OneToMany(mappedBy = "gateways")
+ @OneToMany(mappedBy = "gateway")
public Collection<GatewayWorker> getGatewayWorkers() {
return gatewayWorkers;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorker.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorker.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorker.java
index 270bbfe..7097209 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorker.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorker.java
@@ -32,7 +32,7 @@ public class GatewayWorker {
private final static Logger logger = LoggerFactory.getLogger(GatewayWorker.class);
private String gatewayId;
private String userName;
- private User user;
+ private Users user;
private Gateway gateway;
@Id
@@ -55,33 +55,33 @@ public class GatewayWorker {
this.userName = userName;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- GatewayWorker that = (GatewayWorker) o;
-
- if (gatewayId != null ? !gatewayId.equals(that.gatewayId) : that.gatewayId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = gatewayId != null ? gatewayId.hashCode() : 0;
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// GatewayWorker that = (GatewayWorker) o;
+//
+// if (gatewayId != null ? !gatewayId.equals(that.gatewayId) : that.gatewayId != null) return false;
+// if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = gatewayId != null ? gatewayId.hashCode() : 0;
+// result = 31 * result + (userName != null ? userName.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "USER_NAME", referencedColumnName = "USER_NAME", nullable = false)
- public User getUser() {
+ public Users getUser() {
return user;
}
- public void setUser(User userByUserName) {
+ public void setUser(Users userByUserName) {
this.user = userByUserName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
index 1820042..9c8d6ed 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/GatewayWorkerPK.java
@@ -60,16 +60,16 @@ public class GatewayWorkerPK implements Serializable {
GatewayWorkerPK that = (GatewayWorkerPK) o;
- if (gatewayId != null ? !gatewayId.equals(that.gatewayId) : that.gatewayId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+ if (getGatewayId() != null ? !getGatewayId().equals(that.getGatewayId()) : that.getGatewayId() != null) return false;
+ if (getUserName() != null ? !getUserName().equals(that.getUserName()) : that.getUserName() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = gatewayId != null ? gatewayId.hashCode() : 0;
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
+ int result = getGatewayId() != null ? getGatewayId().hashCode() : 0;
+ result = 31 * result + (getUserName() != null ? getUserName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
index 9330530..71c561f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Process.java
@@ -116,40 +116,40 @@ public class Process {
this.taskDag = taskDag;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Process process = (Process) o;
-
- if (applicationInterfaceId != null ? !applicationInterfaceId.equals(process.applicationInterfaceId) : process.applicationInterfaceId != null)
- return false;
- if (creationTime != null ? !creationTime.equals(process.creationTime) : process.creationTime != null)
- return false;
- if (experimentId != null ? !experimentId.equals(process.experimentId) : process.experimentId != null)
- return false;
- if (lastUpdateTime != null ? !lastUpdateTime.equals(process.lastUpdateTime) : process.lastUpdateTime != null)
- return false;
- if (processDetail != null ? !processDetail.equals(process.processDetail) : process.processDetail != null)
- return false;
- if (processId != null ? !processId.equals(process.processId) : process.processId != null) return false;
- if (taskDag != null ? !taskDag.equals(process.taskDag) : process.taskDag != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (lastUpdateTime != null ? lastUpdateTime.hashCode() : 0);
- result = 31 * result + (processDetail != null ? processDetail.hashCode() : 0);
- result = 31 * result + (applicationInterfaceId != null ? applicationInterfaceId.hashCode() : 0);
- result = 31 * result + (taskDag != null ? taskDag.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// Process process = (Process) o;
+//
+// if (applicationInterfaceId != null ? !applicationInterfaceId.equals(process.applicationInterfaceId) : process.applicationInterfaceId != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(process.creationTime) : process.creationTime != null)
+// return false;
+// if (experimentId != null ? !experimentId.equals(process.experimentId) : process.experimentId != null)
+// return false;
+// if (lastUpdateTime != null ? !lastUpdateTime.equals(process.lastUpdateTime) : process.lastUpdateTime != null)
+// return false;
+// if (processDetail != null ? !processDetail.equals(process.processDetail) : process.processDetail != null)
+// return false;
+// if (processId != null ? !processId.equals(process.processId) : process.processId != null) return false;
+// if (taskDag != null ? !taskDag.equals(process.taskDag) : process.taskDag != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = processId != null ? processId.hashCode() : 0;
+// result = 31 * result + (experimentId != null ? experimentId.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (lastUpdateTime != null ? lastUpdateTime.hashCode() : 0);
+// result = 31 * result + (processDetail != null ? processDetail.hashCode() : 0);
+// result = 31 * result + (applicationInterfaceId != null ? applicationInterfaceId.hashCode() : 0);
+// result = 31 * result + (taskDag != null ? taskDag.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
index fa6f45e..141c4bb 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessError.java
@@ -111,39 +111,39 @@ public class ProcessError {
this.rootCauseErrorIdList = rootCauseErrorIdList;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProcessError that = (ProcessError) o;
-
- if (errorId != that.errorId) return false;
- if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
- return false;
- if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
- if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
- return false;
- if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
- return false;
- if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
- result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
- result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
- result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProcessError that = (ProcessError) o;
+//
+// if (errorId != that.errorId) return false;
+// if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
+// if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+// if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
+// return false;
+// if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
+// return false;
+// if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = errorId != null ? errorId.hashCode() : 0;
+// result = 31 * result + (processId != null ? processId.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
+// result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
+// result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
+// result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
index 5dd05dc..fc061d1 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessErrorPK.java
@@ -59,16 +59,16 @@ public class ProcessErrorPK implements Serializable {
ProcessErrorPK that = (ProcessErrorPK) o;
- if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+ if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false;
+ if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ int result = getErrorId() != null ? getErrorId().hashCode() : 0;
+ result = 31 * result + (getProcessId() != null ? getProcessId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
index ed99b64..d176d1f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInput.java
@@ -165,49 +165,49 @@ public class ProcessInput {
this.dataStaged = dataStaged;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProcessInput that = (ProcessInput) o;
-
- if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
- return false;
- if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
- if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
- if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
- if (inputOrder != null ? !inputOrder.equals(that.inputOrder) : that.inputOrder != null) return false;
- if (inputValue != null ? !inputValue.equals(that.inputValue) : that.inputValue != null) return false;
- if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
- if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
- if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
- return false;
- if (standardInput != null ? !standardInput.equals(that.standardInput) : that.standardInput != null)
- return false;
- if (userFriendlyDescription != null ? !userFriendlyDescription.equals(that.userFriendlyDescription) : that.userFriendlyDescription != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
- result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
- result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
- result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
- result = 31 * result + (standardInput != null ? standardInput.hashCode() : 0);
- result = 31 * result + (userFriendlyDescription != null ? userFriendlyDescription.hashCode() : 0);
- result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
- result = 31 * result + (inputOrder != null ? inputOrder.hashCode() : 0);
- result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
- result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
- result = 31 * result + (dataStaged != null ? dataStaged.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProcessInput that = (ProcessInput) o;
+//
+// if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
+// return false;
+// if (dataStaged != null ? !dataStaged.equals(that.dataStaged) : that.dataStaged != null) return false;
+// if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
+// if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
+// if (inputOrder != null ? !inputOrder.equals(that.inputOrder) : that.inputOrder != null) return false;
+// if (inputValue != null ? !inputValue.equals(that.inputValue) : that.inputValue != null) return false;
+// if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
+// if (metadata != null ? !metadata.equals(that.metadata) : that.metadata != null) return false;
+// if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+// if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
+// return false;
+// if (standardInput != null ? !standardInput.equals(that.standardInput) : that.standardInput != null)
+// return false;
+// if (userFriendlyDescription != null ? !userFriendlyDescription.equals(that.userFriendlyDescription) : that.userFriendlyDescription != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = processId != null ? processId.hashCode() : 0;
+// result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+// result = 31 * result + (inputValue != null ? inputValue.hashCode() : 0);
+// result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+// result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
+// result = 31 * result + (standardInput != null ? standardInput.hashCode() : 0);
+// result = 31 * result + (userFriendlyDescription != null ? userFriendlyDescription.hashCode() : 0);
+// result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
+// result = 31 * result + (inputOrder != null ? inputOrder.hashCode() : 0);
+// result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
+// result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
+// result = 31 * result + (dataStaged != null ? dataStaged.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
index 6650e07..d6f6efd 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessInputPK.java
@@ -59,16 +59,16 @@ public class ProcessInputPK implements Serializable {
ProcessInputPK that = (ProcessInputPK) o;
- if (inputName != null ? !inputName.equals(that.inputName) : that.inputName != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+ if (getInputName() != null ? !getInputName().equals(that.getInputName()) : that.getInputName() != null) return false;
+ if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (inputName != null ? inputName.hashCode() : 0);
+ int result = getProcessId() != null ? getProcessId().hashCode() : 0;
+ result = 31 * result + (getInputName() != null ? getInputName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
index 7e38311..3bc8689 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutput.java
@@ -143,44 +143,44 @@ public class ProcessOutput {
this.searchQuery = searchQuery;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProcessOutput that = (ProcessOutput) o;
- if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
- return false;
- if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
- return false;
- if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
- return false;
- if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
- if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
- if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
- if (location != null ? !location.equals(that.location) : that.location != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
- if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
- return false;
- if (searchQuery != null ? !searchQuery.equals(that.searchQuery) : that.searchQuery != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
- result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
- result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
- result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
- result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
- result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
- result = 31 * result + (dataMovement != null ? dataMovement.hashCode() : 0);
- result = 31 * result + (location != null ? location.hashCode() : 0);
- result = 31 * result + (searchQuery != null ? searchQuery.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProcessOutput that = (ProcessOutput) o;
+// if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null)
+// return false;
+// if (outputValue != null ? !outputValue.equals(that.outputValue) : that.outputValue != null)
+// return false;
+// if (applicationArgument != null ? !applicationArgument.equals(that.applicationArgument) : that.applicationArgument != null)
+// return false;
+// if (dataMovement != null ? !dataMovement.equals(that.dataMovement) : that.dataMovement != null) return false;
+// if (dataType != null ? !dataType.equals(that.dataType) : that.dataType != null) return false;
+// if (isRequired != null ? !isRequired.equals(that.isRequired) : that.isRequired != null) return false;
+// if (location != null ? !location.equals(that.location) : that.location != null) return false;
+// if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+// if (requiredToAddedToCmd != null ? !requiredToAddedToCmd.equals(that.requiredToAddedToCmd) : that.requiredToAddedToCmd != null)
+// return false;
+// if (searchQuery != null ? !searchQuery.equals(that.searchQuery) : that.searchQuery != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = processId != null ? processId.hashCode() : 0;
+// result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+// result = 31 * result + (outputValue != null ? outputValue.hashCode() : 0);
+// result = 31 * result + (dataType != null ? dataType.hashCode() : 0);
+// result = 31 * result + (applicationArgument != null ? applicationArgument.hashCode() : 0);
+// result = 31 * result + (isRequired != null ? isRequired.hashCode() : 0);
+// result = 31 * result + (requiredToAddedToCmd != null ? requiredToAddedToCmd.hashCode() : 0);
+// result = 31 * result + (dataMovement != null ? dataMovement.hashCode() : 0);
+// result = 31 * result + (location != null ? location.hashCode() : 0);
+// result = 31 * result + (searchQuery != null ? searchQuery.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
index 0d98d4d..6d09f2d 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessOutputPK.java
@@ -23,7 +23,6 @@ package org.apache.airavata.registry.core.experiment.catalog.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
@@ -60,16 +59,16 @@ public class ProcessOutputPK implements Serializable {
ProcessOutputPK that = (ProcessOutputPK) o;
- if (outputName != null ? !outputName.equals(that.outputName) : that.outputName != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+ if (getOutputName() != null ? !getOutputName().equals(that.getOutputName()) : that.getOutputName() != null) return false;
+ if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (outputName != null ? outputName.hashCode() : 0);
+ int result = getProcessId() != null ? getProcessId().hashCode() : 0;
+ result = 31 * result + (getOutputName() != null ? getOutputName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
index 9c49ffb..a473271 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessResourceSchedule.java
@@ -120,42 +120,42 @@ public class ProcessResourceSchedule {
this.totalPhysicalMemory = totalPhysicalMemory;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProcessResourceSchedule that = (ProcessResourceSchedule) o;
-
- if (nodeCount != null ? !nodeCount.equals(that.nodeCount) : that.nodeCount != null) return false;
- if (numberOfThreads != null ? !numberOfThreads.equals(that.numberOfThreads) : that.numberOfThreads != null)
- return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
- if (queueName != null ? !queueName.equals(that.queueName) : that.queueName != null) return false;
- if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
- return false;
- if (totalCpuCount != null ? !totalCpuCount.equals(that.totalCpuCount) : that.totalCpuCount != null)
- return false;
- if (totalPhysicalMemory != null ? !totalPhysicalMemory.equals(that.totalPhysicalMemory) : that.totalPhysicalMemory != null)
- return false;
- if (wallTimeLimit != null ? !wallTimeLimit.equals(that.wallTimeLimit) : that.wallTimeLimit != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = processId != null ? processId.hashCode() : 0;
- result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
- result = 31 * result + (totalCpuCount != null ? totalCpuCount.hashCode() : 0);
- result = 31 * result + (nodeCount != null ? nodeCount.hashCode() : 0);
- result = 31 * result + (numberOfThreads != null ? numberOfThreads.hashCode() : 0);
- result = 31 * result + (queueName != null ? queueName.hashCode() : 0);
- result = 31 * result + (wallTimeLimit != null ? wallTimeLimit.hashCode() : 0);
- result = 31 * result + (totalPhysicalMemory != null ? totalPhysicalMemory.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProcessResourceSchedule that = (ProcessResourceSchedule) o;
+//
+// if (nodeCount != null ? !nodeCount.equals(that.nodeCount) : that.nodeCount != null) return false;
+// if (numberOfThreads != null ? !numberOfThreads.equals(that.numberOfThreads) : that.numberOfThreads != null)
+// return false;
+// if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+// if (queueName != null ? !queueName.equals(that.queueName) : that.queueName != null) return false;
+// if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
+// return false;
+// if (totalCpuCount != null ? !totalCpuCount.equals(that.totalCpuCount) : that.totalCpuCount != null)
+// return false;
+// if (totalPhysicalMemory != null ? !totalPhysicalMemory.equals(that.totalPhysicalMemory) : that.totalPhysicalMemory != null)
+// return false;
+// if (wallTimeLimit != null ? !wallTimeLimit.equals(that.wallTimeLimit) : that.wallTimeLimit != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = processId != null ? processId.hashCode() : 0;
+// result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
+// result = 31 * result + (totalCpuCount != null ? totalCpuCount.hashCode() : 0);
+// result = 31 * result + (nodeCount != null ? nodeCount.hashCode() : 0);
+// result = 31 * result + (numberOfThreads != null ? numberOfThreads.hashCode() : 0);
+// result = 31 * result + (queueName != null ? queueName.hashCode() : 0);
+// result = 31 * result + (wallTimeLimit != null ? wallTimeLimit.hashCode() : 0);
+// result = 31 * result + (totalPhysicalMemory != null ? totalPhysicalMemory.hashCode() : 0);
+// return result;
+// }
@OneToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
index ced0135..c727953 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatus.java
@@ -89,31 +89,31 @@ public class ProcessStatus {
this.reason = reason;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProcessStatus that = (ProcessStatus) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
- if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
- if (state != null ? !state.equals(that.state) : that.state != null) return false;
- if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
- result = 31 * result + (state != null ? state.hashCode() : 0);
- result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
- result = 31 * result + (reason != null ? reason.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProcessStatus that = (ProcessStatus) o;
+// if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+// if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+// if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
+// if (state != null ? !state.equals(that.state) : that.state != null) return false;
+// if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = statusId != null ? statusId.hashCode() : 0;
+// result = 31 * result + (processId != null ? processId.hashCode() : 0);
+// result = 31 * result + (state != null ? state.hashCode() : 0);
+// result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
+// result = 31 * result + (reason != null ? reason.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "PROCESS_ID", referencedColumnName = "PROCESS_ID", nullable = false)
[07/11] airavata git commit: Fixing minor issues and fixing the
registry test cases
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
index 1edb50c..e15c79c 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-mysql.sql
@@ -27,7 +27,7 @@ CREATE TABLE GATEWAY
PRIMARY KEY (GATEWAY_ID)
);
-CREATE TABLE USER
+CREATE TABLE USERS
(
USER_NAME VARCHAR(255),
PASSWORD VARCHAR(255),
@@ -40,20 +40,20 @@ CREATE TABLE GATEWAY_WORKER
USER_NAME VARCHAR(255),
PRIMARY KEY (GATEWAY_ID, USER_NAME),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT
(
GATEWAY_ID VARCHAR(255),
USER_NAME VARCHAR(255),
- PROJECT_NAME VARCHAR(255) NOT NULL,
+ PROJECT_NAME VARCHAR(255),
PROJECT_ID VARCHAR(255),
DESCRIPTION VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (PROJECT_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT_USER
@@ -62,7 +62,7 @@ CREATE TABLE PROJECT_USER
USER_NAME VARCHAR(255),
PRIMARY KEY (PROJECT_ID,USER_NAME),
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT (
@@ -72,14 +72,14 @@ CREATE TABLE EXPERIMENT (
USER_NAME varchar(255),
APPLICATION_ID varchar(255),
EXPERIMENT_NAME varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
DESCRIPTION varchar(255),
EXECUTION_ID varchar(255),
GATEWAY_EXECUTION_ID varchar(255),
ENABLE_EMAIL_NOTIFICATION tinyint(1),
EMAIL_ADDRESSES text,
PRIMARY KEY (EXPERIMENT_ID),
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
);
@@ -123,7 +123,7 @@ CREATE TABLE EXPERIMENT_STATUS (
STATUS_ID varchar(255),
EXPERIMENT_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
PRIMARY KEY (STATUS_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
@@ -133,7 +133,7 @@ CREATE TABLE EXPERIMENT_STATUS (
CREATE TABLE EXPERIMENT_ERROR (
ERROR_ID varchar(255),
EXPERIMENT_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
@@ -179,8 +179,8 @@ CREATE VIEW EXPERIMENT_SUMMARY AS
CREATE TABLE PROCESS (
PROCESS_ID varchar(255),
EXPERIMENT_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PROCESS_DETAIL text,
APPLICATION_INTERFACE_ID varchar(255),
TASK_DAG varchar(255),
@@ -227,7 +227,7 @@ CREATE TABLE PROCESS_STATUS (
STATUS_ID varchar(255),
PROCESS_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
PRIMARY KEY (STATUS_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
@@ -237,7 +237,7 @@ CREATE TABLE PROCESS_STATUS (
CREATE TABLE PROCESS_ERROR (
ERROR_ID varchar(255),
PROCESS_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
@@ -255,15 +255,16 @@ CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
QUEUE_NAME varchar(255),
WALL_TIME_LIMIT int(11),
TOTAL_PHYSICAL_MEMORY int(11),
- PRIMARY KEY (PROCESS_ID)
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
CREATE TABLE TASK (
TASK_ID varchar(255),
TASK_TYPE varchar(255),
PARENT_PROCESS_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
TASK_DETAIL text,
TASK_INTERNAL_STORE tinyint(4),
PRIMARY KEY (TASK_ID),
@@ -274,7 +275,7 @@ CREATE TABLE TASK_STATUS (
STATUS_ID varchar(255),
TASK_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
REASON varchar(255),
PRIMARY KEY (STATUS_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
@@ -284,7 +285,7 @@ CREATE TABLE TASK_STATUS (
CREATE TABLE TASK_ERROR (
ERROR_ID varchar(255),
TASK_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE text,
USER_FRIENDLY_MESSAGE text,
TRANSIENT_OR_PERSISTENT tinyint(1),
@@ -292,3 +293,14 @@ CREATE TABLE TASK_ERROR (
PRIMARY KEY (ERROR_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255),
+ CONFIG_VAL VARCHAR(255),
+ EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ CATEGORY_ID VARCHAR (255),
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
index 20c88e9..9b11921 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentInputResourceTest.java
@@ -61,7 +61,7 @@ public class ExperimentInputResourceTest extends AbstractResourceTest {
@Test
public void testSave() throws Exception {
- assertTrue("Experiment Input saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_INPUT, experimentID));
+ assertTrue("Experiment Input saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_INPUT, "testKey"));
}
@After
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
index 9f3a2b6..1aea3bd 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/ExperimentOutputResourceTest.java
@@ -61,7 +61,7 @@ public class ExperimentOutputResourceTest extends AbstractResourceTest {
@Test
public void testSave() throws Exception {
- assertTrue("Experiment output saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_OUTPUT, experimentID));
+ assertTrue("Experiment output saved successfully", experimentResource.isExists(ResourceType.EXPERIMENT_OUTPUT, "testKey"));
}
@After
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
index 91d582c..b88d561 100644
--- a/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
+++ b/modules/registry/registry-core/src/test/java/org/apache/airavata/experiment/catalog/GatewayResourceTest.java
@@ -61,7 +61,7 @@ public class GatewayResourceTest extends AbstractResourceTest {
experimentResource = (ExperimentResource) gatewayResource.create(ResourceType.EXPERIMENT);
- experimentResource.setExecutionId("testExpID");
+ experimentResource.setExperimentId("testExpID");
experimentResource.setUserName(getWorkerResource().getUser());
experimentResource.setProjectId(getProjectResource().getId());
experimentResource.setCreationTime(currentDate);
@@ -105,7 +105,6 @@ public class GatewayResourceTest extends AbstractResourceTest {
public void testGetList() throws Exception {
assertNotNull(gatewayResource.get(ResourceType.GATEWAY_WORKER));
assertNotNull(gatewayResource.get(ResourceType.PROJECT));
- assertNotNull(gatewayResource.get(ResourceType.EXPERIMENT));
}
@Test
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
index 7ab3755..6e1174d 100644
--- a/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/test/resources/expcatalog-derby.sql
@@ -20,24 +20,13 @@
*/
CREATE TABLE GATEWAY
(
- GATEWAY_ID VARCHAR (255),
+ GATEWAY_ID VARCHAR(255),
GATEWAY_NAME VARCHAR(255),
DOMAIN VARCHAR(255),
EMAIL_ADDRESS VARCHAR(255),
PRIMARY KEY (GATEWAY_ID)
);
-CREATE TABLE CONFIGURATION
-(
- CONFIG_KEY VARCHAR(255),
- CONFIG_VAL VARCHAR(255),
- EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- CATEGORY_ID VARCHAR (255),
- PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
-
CREATE TABLE USERS
(
USER_NAME VARCHAR(255),
@@ -57,9 +46,9 @@ CREATE TABLE GATEWAY_WORKER
CREATE TABLE PROJECT
(
GATEWAY_ID VARCHAR(255),
- USER_NAME VARCHAR(255) NOT NULL,
+ USER_NAME VARCHAR(255),
+ PROJECT_NAME VARCHAR(255),
PROJECT_ID VARCHAR(255),
- PROJECT_NAME VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(255),
CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (PROJECT_ID),
@@ -76,316 +65,240 @@ CREATE TABLE PROJECT_USER
FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
-CREATE TABLE EXPERIMENT
-(
- EXPERIMENT_ID VARCHAR(255),
- GATEWAY_ID VARCHAR(255),
- EXECUTION_USER VARCHAR(255) NOT NULL,
- PROJECT_ID VARCHAR(255) NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- EXPERIMENT_NAME VARCHAR(255) NOT NULL,
- EXPERIMENT_DESCRIPTION VARCHAR(255),
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- WORKFLOW_TEMPLATE_ID VARCHAR(255),
- WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
- WORKFLOW_EXECUTION_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- GATEWAY_EXECUTION_ID VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID),
- FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (EXECUTION_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
- FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT (
+ EXPERIMENT_ID varchar(255),
+ PROJECT_ID varchar(255),
+ EXPERIMENT_TYPE varchar(255),
+ USER_NAME varchar(255),
+ APPLICATION_ID varchar(255),
+ EXPERIMENT_NAME varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ DESCRIPTION varchar(255),
+ EXECUTION_ID varchar(255),
+ GATEWAY_EXECUTION_ID varchar(255),
+ ENABLE_EMAIL_NOTIFICATION BOOLEAN,
+ EMAIL_ADDRESSES CLOB,
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
);
+
CREATE TABLE EXPERIMENT_INPUT
(
- EXPERIMENT_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE CLOB,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT BOOLEAN,
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER INT,
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_STAGED BOOLEAN,
+ PRIMARY KEY(EXPERIMENT_ID,INPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT_OUTPUT
(
- EXPERIMENT_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE CLOB,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+ EXPERIMENT_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_MOVEMENT BOOLEAN,
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(EXPERIMENT_ID,OUTPUT_NAME),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE WORKFLOW_NODE_DETAIL
-(
- EXPERIMENT_ID VARCHAR(255) NOT NULL,
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- NODE_NAME VARCHAR(255) NOT NULL,
- EXECUTION_UNIT VARCHAR(255) NOT NULL,
- EXECUTION_UNIT_DATA VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_STATUS (
+ STATUS_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
+ REASON varchar(255),
+ PRIMARY KEY (STATUS_ID, EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE TASK_DETAIL
-(
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- APPLICATION_ID VARCHAR(255),
- APPLICATION_VERSION VARCHAR(255),
- APPLICATION_DEPLOYMENT_ID VARCHAR(255),
- ALLOW_NOTIFICATION SMALLINT,
- PRIMARY KEY(TASK_ID),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-CREATE TABLE NOTIFICATION_EMAIL
-(
- EMAIL_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- EMAIL_ADDRESS VARCHAR(255),
- PRIMARY KEY(EMAIL_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE EXPERIMENT_ERROR (
+ ERROR_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID, EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE ERROR_DETAIL
-(
- ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- ACTUAL_ERROR_MESSAGE CLOB,
- USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
- TRANSIENT_OR_PERSISTENT SMALLINT,
- ERROR_CATEGORY VARCHAR(255),
- CORRECTIVE_ACTION VARCHAR(255),
- ACTIONABLE_GROUP VARCHAR(255),
- PRIMARY KEY(ERROR_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE USER_CONFIGURATION_DATA (
+ EXPERIMENT_ID varchar(255),
+ AIRAVATA_AUTO_SCHEDULE BOOLEAN,
+ OVERRIDE_MANUAL_SCHEDULED_PARAMS BOOLEAN,
+ SHARE_EXPERIMENT_PUBLICALLY BOOLEAN,
+ THROTTLE_RESOURCES BOOLEAN,
+ USER_DN varchar(255),
+ GENERATE_CERT BOOLEAN,
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT INT,
+ NODE_COUNT INT,
+ NUMBER_OF_THREADS INT,
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT INT,
+ TOTAL_PHYSICAL_MEMORY INT,
+ PRIMARY KEY (EXPERIMENT_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE APPLICATION_INPUT
-(
- TASK_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE CLOB,
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(TASK_ID,INPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
+CREATE VIEW LATEST_EXPERIMENT_STATUS AS
+ select ES1.EXPERIMENT_ID AS EXPERIMENT_ID, ES1.STATE AS STATE, ES1.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from EXPERIMENT_STATUS ES1 LEFT JOIN EXPERIMENT_STATUS ES2 ON (ES1.EXPERIMENT_ID = ES2.EXPERIMENT_ID
+ AND ES1.TIME_OF_STATE_CHANGE < ES2.TIME_OF_STATE_CHANGE) WHERE ES2.TIME_OF_STATE_CHANGE is NULL;
-CREATE TABLE APPLICATION_OUTPUT
-(
- TASK_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE CLOB,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(TASK_ID,OUTPUT_KEY),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
+CREATE VIEW EXPERIMENT_SUMMARY AS
+ select E.EXPERIMENT_ID AS EXPERIMENT_ID, E.PROJECT_ID AS PROJECT_ID,
+ E.USER_NAME AS USER_NAME, E.APPLICATION_ID AS APPLICATION_ID, E.EXPERIMENT_NAME AS EXPERIMENT_NAME,
+ E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
+ AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
+ from ((EXPERIMENT E left join LATEST_EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
+ left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where true;
-CREATE TABLE NODE_INPUT
-(
- NODE_INSTANCE_ID VARCHAR(255),
- INPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- METADATA VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- STANDARD_INPUT SMALLINT,
- USER_FRIENDLY_DESC VARCHAR(255),
- VALUE VARCHAR(255),
- INPUT_ORDER INTEGER,
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_STAGED SMALLINT,
- PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS (
+ PROCESS_ID varchar(255),
+ EXPERIMENT_ID varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ PROCESS_DETAIL CLOB,
+ APPLICATION_INTERFACE_ID varchar(255),
+ TASK_DAG varchar(255),
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
-CREATE TABLE NODE_OUTPUT
+CREATE TABLE PROCESS_INPUT
(
- NODE_INSTANCE_ID VARCHAR(255),
- OUTPUT_KEY VARCHAR(255) NOT NULL,
- DATA_TYPE VARCHAR(255),
- VALUE VARCHAR(255),
- IS_REQUIRED SMALLINT,
- REQUIRED_TO_COMMANDLINE SMALLINT,
- DATA_MOVEMENT SMALLINT,
- DATA_NAME_LOCATION VARCHAR(255),
- SEARCH_QUERY VARCHAR(255),
- APP_ARGUMENT VARCHAR(255),
- PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ INPUT_NAME varchar(255),
+ INPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ STANDARD_INPUT BOOLEAN,
+ USER_FRIENDLY_DESCRIPTION varchar(255),
+ METADATA varchar(255),
+ INPUT_ORDER INT,
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_STAGED BOOLEAN,
+ PRIMARY KEY(PROCESS_ID,INPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE JOB_DETAIL
+CREATE TABLE PROCESS_OUTPUT
(
- JOB_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_DESCRIPTION CLOB NOT NULL,
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
- JOBNAME VARCHAR (255),
- WORKING_DIR VARCHAR(255),
- PRIMARY KEY (TASK_ID, JOB_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+ PROCESS_ID varchar(255),
+ OUTPUT_NAME varchar(255),
+ OUTPUT_VALUE CLOB,
+ DATA_TYPE varchar(255),
+ APPLICATION_ARGUMENT varchar(255),
+ IS_REQUIRED BOOLEAN,
+ REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
+ DATA_MOVEMENT BOOLEAN,
+ LOCATION varchar(255),
+ SEARCH_QUERY varchar(255),
+ PRIMARY KEY(PROCESS_ID,OUTPUT_NAME),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE DATA_TRANSFER_DETAIL
-(
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- TRANSFER_DESC VARCHAR(255) NOT NULL,
- PRIMARY KEY(TRANSFER_ID),
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-CREATE TABLE STATUS
-(
- STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- NODE_INSTANCE_ID VARCHAR(255),
- TRANSFER_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- JOB_ID VARCHAR(255),
- STATE VARCHAR(255),
- STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- STATUS_TYPE VARCHAR(255),
- PRIMARY KEY(STATUS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
- FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
- FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_STATUS (
+ STATUS_ID varchar(255),
+ PROCESS_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
+ REASON varchar(255),
+ PRIMARY KEY (STATUS_ID, PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE CONFIG_DATA
-(
- EXPERIMENT_ID VARCHAR(255),
- AIRAVATA_AUTO_SCHEDULE SMALLINT NOT NULL,
- OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT NOT NULL,
- SHARE_EXPERIMENT SMALLINT,
- USER_DN VARCHAR(255),
- GENERATE_CERT SMALLINT,
- PRIMARY KEY(EXPERIMENT_ID)
-);
-CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
-(
- RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- RESOURCE_HOST_ID VARCHAR(255),
- CPU_COUNT INTEGER,
- NODE_COUNT INTEGER,
- NO_OF_THREADS INTEGER,
- QUEUE_NAME VARCHAR(255),
- WALLTIME_LIMIT INTEGER,
- JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
- TOTAL_PHYSICAL_MEMORY INTEGER,
- COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
- CHESSIS_NAME VARCHAR(255),
- PRIMARY KEY(RESOURCE_SCHEDULING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_ERROR (
+ ERROR_ID varchar(255),
+ PROCESS_ID varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID, PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
-(
- INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- WORKING_DIR_PARENT VARCHAR(255),
- UNIQUE_WORKING_DIR VARCHAR(255),
- STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
- CLEAN_AFTER_JOB SMALLINT,
- PRIMARY KEY(INPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
+ PROCESS_ID varchar(255),
+ RESOURCE_HOST_ID varchar(255),
+ TOTAL_CPU_COUNT INT,
+ NODE_COUNT INT,
+ NUMBER_OF_THREADS INT,
+ QUEUE_NAME varchar(255),
+ WALL_TIME_LIMIT INT,
+ TOTAL_PHYSICAL_MEMORY INT,
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
-(
- OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- OUTPUT_DATA_DIR VARCHAR(255),
- DATA_REG_URL VARCHAR (255),
- PERSIST_OUTPUT_DATA SMALLINT,
- PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK (
+ TASK_ID varchar(255),
+ TASK_TYPE varchar(255),
+ PARENT_PROCESS_ID varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ TASK_DETAIL CLOB,
+ TASK_INTERNAL_STORE CHAR,
+ PRIMARY KEY (TASK_ID),
+ FOREIGN KEY (PARENT_PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
-CREATE TABLE QOS_PARAM
-(
- QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
- EXPERIMENT_ID VARCHAR(255),
- TASK_ID VARCHAR(255),
- START_EXECUTION_AT VARCHAR(255),
- EXECUTE_BEFORE VARCHAR(255),
- NO_OF_RETRIES INTEGER,
- PRIMARY KEY(QOS_ID),
- FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
- FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
+CREATE TABLE TASK_STATUS (
+ STATUS_ID varchar(255),
+ TASK_ID varchar(255),
+ STATE varchar(255),
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
+ REASON varchar(255),
+ PRIMARY KEY (STATUS_ID, TASK_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE COMMUNITY_USER
-(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
- PRIMARY KEY (GATEWAY_ID, COMMUNITY_USER_NAME, TOKEN_ID)
+
+CREATE TABLE TASK_ERROR (
+ ERROR_ID varchar(255),
+ TASK_ID varchar(255),
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ ACTUAL_ERROR_MESSAGE CLOB,
+ USER_FRIENDLY_MESSAGE CLOB,
+ TRANSIENT_OR_PERSISTENT BOOLEAN,
+ ROOT_CAUSE_ERROR_ID_LIST CLOB,
+ PRIMARY KEY (ERROR_ID, TASK_ID),
+ FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
-CREATE TABLE CREDENTIALS
+CREATE TABLE CONFIGURATION
(
- GATEWAY_ID VARCHAR(256) NOT NULL,
- TOKEN_ID VARCHAR(256) NOT NULL,
- CREDENTIAL BLOB NOT NULL,
- PORTAL_USER_ID VARCHAR(256) NOT NULL,
- TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
+ CONFIG_KEY VARCHAR(255),
+ CONFIG_VAL VARCHAR(255),
+ EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ CATEGORY_ID VARCHAR (255),
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
);
-
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExpCatChildDataType.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExpCatChildDataType.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExpCatChildDataType.java
index 801c0bd..845e308 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExpCatChildDataType.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExpCatChildDataType.java
@@ -23,23 +23,15 @@ public enum ExpCatChildDataType {
EXPERIMENT_INPUT,
EXPERIMENT_OUTPUT,
EXPERIMENT_STATUS,
- WORKFLOW_NODE_DETAIL,
- TASK_DETAIL,
- WORKFLOW_NODE_STATUS,
+ EXPERIMENT_ERROR,
+ USER_CONFIGURATION_DATA,
+ PROCESS,
+ PROCESS_INPUT,
+ PROCESS_OUTPUT,
+ PROCESS_STATUS,
+ PROCESS_ERROR,
+ PROCESS_RESOURCE_SCHEDULE,
+ TASK,
TASK_STATUS,
- APPLICATION_STATUS,
- JOB_STATUS,
- TRANSFER_STATUS,
- ERROR_DETAIL,
- APPLICATION_INPUT,
- APPLICATION_OUTPUT,
- NODE_INPUT,
- NODE_OUTPUT,
- JOB_DETAIL,
- DATA_TRANSFER_DETAIL,
- EXPERIMENT_CONFIGURATION_DATA,
- COMPUTATIONAL_RESOURCE_SCHEDULING,
- ADVANCE_INPUT_DATA_HANDLING,
- ADVANCE_OUTPUT_DATA_HANDLING,
- QOS_PARAM
+ TASK_ERROR
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExperimentCatalogModelType.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExperimentCatalogModelType.java b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExperimentCatalogModelType.java
index 22d755f..18f60d1 100644
--- a/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExperimentCatalogModelType.java
+++ b/modules/registry/registry-cpi/src/main/java/org/apache/airavata/registry/cpi/ExperimentCatalogModelType.java
@@ -30,23 +30,15 @@ public enum ExperimentCatalogModelType {
EXPERIMENT_INPUT,
EXPERIMENT_OUTPUT,
EXPERIMENT_STATUS,
- WORKFLOW_NODE_DETAIL,
- TASK_DETAIL,
- WORKFLOW_NODE_STATUS,
+ EXPERIMENT_ERROR,
+ USER_CONFIGURATION_DATA,
+ PROCESS,
+ PROCESS_STATUS,
+ PROCESS_ERROR,
+ PROCESS_INPUT,
+ PROCESS_OUTPUT,
+ PROCESS_RESOURCE_SCHEDULE,
+ TASK,
TASK_STATUS,
- APPLICATION_STATUS,
- JOB_STATUS,
- TRANSFER_STATUS,
- ERROR_DETAIL,
- APPLICATION_INPUT,
- APPLICATION_OUTPUT,
- NODE_INPUT,
- NODE_OUTPUT,
- JOB_DETAIL,
- DATA_TRANSFER_DETAIL,
- EXPERIMENT_CONFIGURATION_DATA,
- COMPUTATIONAL_RESOURCE_SCHEDULING,
- ADVANCE_INPUT_DATA_HANDLING,
- ADVANCE_OUTPUT_DATA_HANDLING,
- QOS_PARAM
+ TASK_ERROR
}
[08/11] airavata git commit: Fixing minor issues and fixing the
registry test cases
Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
index 3158e15..cec3c70 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProcessStatusPK.java
@@ -60,16 +60,16 @@ public class ProcessStatusPK implements Serializable {
ProcessStatusPK that = (ProcessStatusPK) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (processId != null ? !processId.equals(that.processId) : that.processId != null) return false;
+ if (getStatusId() != null ? !getStatusId().equals(that.getStatusId()) : that.getStatusId() != null) return false;
+ if (getProcessId() != null ? !getProcessId().equals(that.getProcessId()) : that.getProcessId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (processId != null ? processId.hashCode() : 0);
+ int result = getStatusId() != null ? getStatusId().hashCode() : 0;
+ result = 31 * result + (getProcessId() != null ? getProcessId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Project.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Project.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Project.java
index d1f2261..b605a8e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Project.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Project.java
@@ -32,13 +32,13 @@ import java.util.Collection;
public class Project {
private final static Logger logger = LoggerFactory.getLogger(Project.class);
private String gatewayId;
- private String ownerName;
+ private String userName;
private String projectName;
private String projectId;
private String description;
private Timestamp creationTime;
private Collection<Experiment> experiments;
- private User user;
+ private Users user;
private Gateway gateway;
private Collection<ProjectUser> projectUsers;
@@ -53,13 +53,13 @@ public class Project {
}
@Basic
- @Column(name = "OWNER_NAME")
- public String getOwnerName() {
- return ownerName;
+ @Column(name = "USER_NAME")
+ public String getUserName() {
+ return userName;
}
- public void setOwnerName(String ownerName) {
- this.ownerName = ownerName;
+ public void setUserName(String ownerName) {
+ this.userName = ownerName;
}
@Basic
@@ -102,38 +102,38 @@ public class Project {
this.creationTime = creationTime;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// Project project = (Project) o;
+//
+// if (creationTime != null ? !creationTime.equals(project.creationTime) : project.creationTime != null)
+// return false;
+// if (description != null ? !description.equals(project.description) : project.description != null)
+// return false;
+// if (gatewayId != null ? !gatewayId.equals(project.gatewayId) : project.gatewayId != null) return false;
+// if (userName != null ? !userName.equals(project.userName) : project.userName != null) return false;
+// if (projectId != null ? !projectId.equals(project.projectId) : project.projectId != null) return false;
+// if (projectName != null ? !projectName.equals(project.projectName) : project.projectName != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = gatewayId != null ? gatewayId.hashCode() : 0;
+// result = 31 * result + (userName != null ? userName.hashCode() : 0);
+// result = 31 * result + (projectName != null ? projectName.hashCode() : 0);
+// result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
+// result = 31 * result + (description != null ? description.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// return result;
+// }
- Project project = (Project) o;
-
- if (creationTime != null ? !creationTime.equals(project.creationTime) : project.creationTime != null)
- return false;
- if (description != null ? !description.equals(project.description) : project.description != null)
- return false;
- if (gatewayId != null ? !gatewayId.equals(project.gatewayId) : project.gatewayId != null) return false;
- if (ownerName != null ? !ownerName.equals(project.ownerName) : project.ownerName != null) return false;
- if (projectId != null ? !projectId.equals(project.projectId) : project.projectId != null) return false;
- if (projectName != null ? !projectName.equals(project.projectName) : project.projectName != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = gatewayId != null ? gatewayId.hashCode() : 0;
- result = 31 * result + (ownerName != null ? ownerName.hashCode() : 0);
- result = 31 * result + (projectName != null ? projectName.hashCode() : 0);
- result = 31 * result + (projectId != null ? projectId.hashCode() : 0);
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- return result;
- }
-
- @OneToMany(mappedBy = "projectsByProjectId")
+ @OneToMany(mappedBy = "project")
public Collection<Experiment> getExperiments() {
return experiments;
}
@@ -143,12 +143,12 @@ public class Project {
}
@ManyToOne
- @JoinColumn(name = "OWNER_NAME", referencedColumnName = "USER_NAME")
- public User getUser() {
+ @JoinColumn(name = "USER_NAME", referencedColumnName = "USER_NAME")
+ public Users getUser() {
return user;
}
- public void setUser(User userByOwnerName) {
+ public void setUser(Users userByOwnerName) {
this.user = userByOwnerName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
index 60a755b..72c52b8 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUser.java
@@ -32,7 +32,7 @@ public class ProjectUser {
private final static Logger logger = LoggerFactory.getLogger(ProjectUser.class);
private String projectId;
private String userName;
- private User user;
+ private Users user;
private Project project;
@Id
@@ -55,33 +55,33 @@ public class ProjectUser {
this.userName = userName;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- ProjectUser that = (ProjectUser) o;
-
- if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = projectId != null ? projectId.hashCode() : 0;
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// ProjectUser that = (ProjectUser) o;
+//
+// if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
+// if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = projectId != null ? projectId.hashCode() : 0;
+// result = 31 * result + (userName != null ? userName.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "USER_NAME", referencedColumnName = "USER_NAME", nullable = false)
- public User getUser() {
+ public Users getUser() {
return user;
}
- public void setUser(User userByUserName) {
+ public void setUser(Users userByUserName) {
this.user = userByUserName;
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
index 2d32627..d129082 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/ProjectUserPK.java
@@ -59,16 +59,16 @@ public class ProjectUserPK implements Serializable {
ProjectUserPK that = (ProjectUserPK) o;
- if (projectId != null ? !projectId.equals(that.projectId) : that.projectId != null) return false;
- if (userName != null ? !userName.equals(that.userName) : that.userName != null) return false;
+ if (getProjectId() != null ? !getProjectId().equals(that.getProjectId()) : that.getProjectId() != null) return false;
+ if (getUserName() != null ? !getUserName().equals(that.getUserName()) : that.getUserName() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = projectId != null ? projectId.hashCode() : 0;
- result = 31 * result + (userName != null ? userName.hashCode() : 0);
+ int result = getProjectId() != null ? getProjectId().hashCode() : 0;
+ result = 31 * result + (getUserName() != null ? getUserName().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
index 6f8d7b1..5982044 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Task.java
@@ -113,38 +113,38 @@ public class Task {
this.taskInternalStore = taskInternalStore;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Task task = (Task) o;
-
- if (creationTime != null ? !creationTime.equals(task.creationTime) : task.creationTime != null) return false;
- if (lastUpdateTime != null ? !lastUpdateTime.equals(task.lastUpdateTime) : task.lastUpdateTime != null)
- return false;
- if (parentProcessId != null ? !parentProcessId.equals(task.parentProcessId) : task.parentProcessId != null)
- return false;
- if (taskDetail != null ? !taskDetail.equals(task.taskDetail) : task.taskDetail != null) return false;
- if (taskId != null ? !taskId.equals(task.taskId) : task.taskId != null) return false;
- if (taskInternalStore != null ? !taskInternalStore.equals(task.taskInternalStore) : task.taskInternalStore != null)
- return false;
- if (taskType != null ? !taskType.equals(task.taskType) : task.taskType != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = taskId != null ? taskId.hashCode() : 0;
- result = 31 * result + (taskType != null ? taskType.hashCode() : 0);
- result = 31 * result + (parentProcessId != null ? parentProcessId.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (lastUpdateTime != null ? lastUpdateTime.hashCode() : 0);
- result = 31 * result + (taskDetail != null ? taskDetail.hashCode() : 0);
- result = 31 * result + (taskInternalStore != null ? taskInternalStore.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// Task task = (Task) o;
+//
+// if (creationTime != null ? !creationTime.equals(task.creationTime) : task.creationTime != null) return false;
+// if (lastUpdateTime != null ? !lastUpdateTime.equals(task.lastUpdateTime) : task.lastUpdateTime != null)
+// return false;
+// if (parentProcessId != null ? !parentProcessId.equals(task.parentProcessId) : task.parentProcessId != null)
+// return false;
+// if (taskDetail != null ? !taskDetail.equals(task.taskDetail) : task.taskDetail != null) return false;
+// if (taskId != null ? !taskId.equals(task.taskId) : task.taskId != null) return false;
+// if (taskInternalStore != null ? !taskInternalStore.equals(task.taskInternalStore) : task.taskInternalStore != null)
+// return false;
+// if (taskType != null ? !taskType.equals(task.taskType) : task.taskType != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = taskId != null ? taskId.hashCode() : 0;
+// result = 31 * result + (taskType != null ? taskType.hashCode() : 0);
+// result = 31 * result + (parentProcessId != null ? parentProcessId.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (lastUpdateTime != null ? lastUpdateTime.hashCode() : 0);
+// result = 31 * result + (taskDetail != null ? taskDetail.hashCode() : 0);
+// result = 31 * result + (taskInternalStore != null ? taskInternalStore.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "PARENT_PROCESS_ID", referencedColumnName = "PROCESS_ID")
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
index 375231d..a96c392 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskError.java
@@ -110,38 +110,38 @@ public class TaskError {
this.rootCauseErrorIdList = rootCauseErrorIdList;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- TaskError that = (TaskError) o;
- if (errorId != that.errorId) return false;
- if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
- return false;
- if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
- if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
- return false;
- if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
- if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
- return false;
- if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
- result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
- result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
- result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
- result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
- result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// TaskError that = (TaskError) o;
+// if (errorId != that.errorId) return false;
+// if (actualErrorMessage != null ? !actualErrorMessage.equals(that.actualErrorMessage) : that.actualErrorMessage != null)
+// return false;
+// if (creationTime != null ? !creationTime.equals(that.creationTime) : that.creationTime != null) return false;
+// if (rootCauseErrorIdList != null ? !rootCauseErrorIdList.equals(that.rootCauseErrorIdList) : that.rootCauseErrorIdList != null)
+// return false;
+// if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+// if (transientOrPersistent != null ? !transientOrPersistent.equals(that.transientOrPersistent) : that.transientOrPersistent != null)
+// return false;
+// if (userFriendlyMessage != null ? !userFriendlyMessage.equals(that.userFriendlyMessage) : that.userFriendlyMessage != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = errorId != null ? errorId.hashCode() : 0;
+// result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+// result = 31 * result + (creationTime != null ? creationTime.hashCode() : 0);
+// result = 31 * result + (actualErrorMessage != null ? actualErrorMessage.hashCode() : 0);
+// result = 31 * result + (userFriendlyMessage != null ? userFriendlyMessage.hashCode() : 0);
+// result = 31 * result + (transientOrPersistent != null ? transientOrPersistent.hashCode() : 0);
+// result = 31 * result + (rootCauseErrorIdList != null ? rootCauseErrorIdList.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
index ad55046..177158b 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskErrorPK.java
@@ -59,16 +59,16 @@ public class TaskErrorPK implements Serializable {
TaskErrorPK that = (TaskErrorPK) o;
- if (errorId != null ? !errorId.equals(that.errorId) : that.errorId != null) return false;
- if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+ if (getErrorId() != null ? !getErrorId().equals(that.getErrorId()) : that.getErrorId() != null) return false;
+ if (getTaskId() != null ? !getTaskId().equals(that.getTaskId()) : that.getTaskId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = errorId != null ? errorId.hashCode() : 0;
- result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+ int result = getErrorId() != null ? getErrorId().hashCode() : 0;
+ result = 31 * result + (getTaskId() != null ? getTaskId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
index 8b7da25..1e08a43 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatus.java
@@ -88,31 +88,31 @@ public class TaskStatus {
this.reason = reason;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- TaskStatus that = (TaskStatus) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
- if (state != null ? !state.equals(that.state) : that.state != null) return false;
- if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
- if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
- result = 31 * result + (state != null ? state.hashCode() : 0);
- result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
- result = 31 * result + (reason != null ? reason.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// TaskStatus that = (TaskStatus) o;
+// if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
+// if (reason != null ? !reason.equals(that.reason) : that.reason != null) return false;
+// if (state != null ? !state.equals(that.state) : that.state != null) return false;
+// if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+// if (timeOfStateChange != null ? !timeOfStateChange.equals(that.timeOfStateChange) : that.timeOfStateChange != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = statusId != null ? statusId.hashCode() : 0;
+// result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+// result = 31 * result + (state != null ? state.hashCode() : 0);
+// result = 31 * result + (timeOfStateChange != null ? timeOfStateChange.hashCode() : 0);
+// result = 31 * result + (reason != null ? reason.hashCode() : 0);
+// return result;
+// }
@ManyToOne
@JoinColumn(name = "TASK_ID", referencedColumnName = "TASK_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
index 502852b..f7c5ac5 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/TaskStatusPK.java
@@ -59,16 +59,16 @@ public class TaskStatusPK implements Serializable {
TaskStatusPK that = (TaskStatusPK) o;
- if (statusId != null ? !statusId.equals(that.statusId) : that.statusId != null) return false;
- if (taskId != null ? !taskId.equals(that.taskId) : that.taskId != null) return false;
+ if (getStatusId() != null ? !getStatusId().equals(that.getStatusId()) : that.getStatusId() != null) return false;
+ if (getTaskId() != null ? !getTaskId().equals(that.getTaskId()) : that.getTaskId() != null) return false;
return true;
}
@Override
public int hashCode() {
- int result = statusId != null ? statusId.hashCode() : 0;
- result = 31 * result + (taskId != null ? taskId.hashCode() : 0);
+ int result = getStatusId() != null ? getStatusId().hashCode() : 0;
+ result = 31 * result + (getTaskId() != null ? getTaskId().hashCode() : 0);
return result;
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/User.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/User.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/User.java
deleted file mode 100644
index 010a198..0000000
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/User.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.experiment.catalog.model;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.persistence.*;
-import java.util.Collection;
-
-@Entity
-@Table(name = "USER")
-public class User {
- private final static Logger logger = LoggerFactory.getLogger(User.class);
- private String userName;
- private String password;
- private Collection<Experiment> experiments;
- private Collection<GatewayWorker> gatewayWorkers;
- private Collection<Project> projects;
- private Collection<ProjectUser> projectUsers;
-
- @Id
- @Column(name = "USER_NAME")
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- @Basic
- @Column(name = "PASSWORD")
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- User user = (User) o;
-
- if (password != null ? !password.equals(user.password) : user.password != null) return false;
- if (userName != null ? !userName.equals(user.userName) : user.userName != null) return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = userName != null ? userName.hashCode() : 0;
- result = 31 * result + (password != null ? password.hashCode() : 0);
- return result;
- }
-
- @OneToMany(mappedBy = "usersByUserName")
- public Collection<Experiment> getExperiments() {
- return experiments;
- }
-
- public void setExperiments(Collection<Experiment> experimentByUserName) {
- this.experiments = experimentByUserName;
- }
-
- @OneToMany(mappedBy = "users")
- public Collection<GatewayWorker> getGatewayWorkers() {
- return gatewayWorkers;
- }
-
- public void setGatewayWorkers(Collection<GatewayWorker> gatewayWorkerByUserName) {
- this.gatewayWorkers = gatewayWorkerByUserName;
- }
-
- @OneToMany(mappedBy = "user")
- public Collection<Project> getProjects() {
- return projects;
- }
-
- public void setProjects(Collection<Project> projectByUserName) {
- this.projects = projectByUserName;
- }
-
- @OneToMany(mappedBy = "user")
- public Collection<ProjectUser> getProjectUsers() {
- return projectUsers;
- }
-
- public void setProjectUsers(Collection<ProjectUser> projectUserByUserName) {
- this.projectUsers = projectUserByUserName;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
index 18c7335..fc7144e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/UserConfigurationData.java
@@ -185,58 +185,58 @@ public class UserConfigurationData {
this.totalPhysicalMemory = totalPhysicalMemory;
}
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- UserConfigurationData that = (UserConfigurationData) o;
-
- if (airavataAutoSchedule != null ? !airavataAutoSchedule.equals(that.airavataAutoSchedule) : that.airavataAutoSchedule != null)
- return false;
- if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
- if (generateCert != null ? !generateCert.equals(that.generateCert) : that.generateCert != null) return false;
- if (nodeCount != null ? !nodeCount.equals(that.nodeCount) : that.nodeCount != null) return false;
- if (numberOfThreads != null ? !numberOfThreads.equals(that.numberOfThreads) : that.numberOfThreads != null)
- return false;
- if (overrideManualScheduledParams != null ? !overrideManualScheduledParams.equals(that.overrideManualScheduledParams) : that.overrideManualScheduledParams != null)
- return false;
- if (queueName != null ? !queueName.equals(that.queueName) : that.queueName != null) return false;
- if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
- return false;
- if (shareExperimentPublically != null ? !shareExperimentPublically.equals(that.shareExperimentPublically) : that.shareExperimentPublically != null)
- return false;
- if (throttleResources != null ? !throttleResources.equals(that.throttleResources) : that.throttleResources != null)
- return false;
- if (totalCpuCount != null ? !totalCpuCount.equals(that.totalCpuCount) : that.totalCpuCount != null)
- return false;
- if (totalPhysicalMemory != null ? !totalPhysicalMemory.equals(that.totalPhysicalMemory) : that.totalPhysicalMemory != null)
- return false;
- if (userDn != null ? !userDn.equals(that.userDn) : that.userDn != null) return false;
- if (wallTimeLimit != null ? !wallTimeLimit.equals(that.wallTimeLimit) : that.wallTimeLimit != null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- int result = experimentId != null ? experimentId.hashCode() : 0;
- result = 31 * result + (airavataAutoSchedule != null ? airavataAutoSchedule.hashCode() : 0);
- result = 31 * result + (overrideManualScheduledParams != null ? overrideManualScheduledParams.hashCode() : 0);
- result = 31 * result + (shareExperimentPublically != null ? shareExperimentPublically.hashCode() : 0);
- result = 31 * result + (throttleResources != null ? throttleResources.hashCode() : 0);
- result = 31 * result + (userDn != null ? userDn.hashCode() : 0);
- result = 31 * result + (generateCert != null ? generateCert.hashCode() : 0);
- result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
- result = 31 * result + (totalCpuCount != null ? totalCpuCount.hashCode() : 0);
- result = 31 * result + (nodeCount != null ? nodeCount.hashCode() : 0);
- result = 31 * result + (numberOfThreads != null ? numberOfThreads.hashCode() : 0);
- result = 31 * result + (queueName != null ? queueName.hashCode() : 0);
- result = 31 * result + (wallTimeLimit != null ? wallTimeLimit.hashCode() : 0);
- result = 31 * result + (totalPhysicalMemory != null ? totalPhysicalMemory.hashCode() : 0);
- return result;
- }
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// UserConfigurationData that = (UserConfigurationData) o;
+//
+// if (airavataAutoSchedule != null ? !airavataAutoSchedule.equals(that.airavataAutoSchedule) : that.airavataAutoSchedule != null)
+// return false;
+// if (experimentId != null ? !experimentId.equals(that.experimentId) : that.experimentId != null) return false;
+// if (generateCert != null ? !generateCert.equals(that.generateCert) : that.generateCert != null) return false;
+// if (nodeCount != null ? !nodeCount.equals(that.nodeCount) : that.nodeCount != null) return false;
+// if (numberOfThreads != null ? !numberOfThreads.equals(that.numberOfThreads) : that.numberOfThreads != null)
+// return false;
+// if (overrideManualScheduledParams != null ? !overrideManualScheduledParams.equals(that.overrideManualScheduledParams) : that.overrideManualScheduledParams != null)
+// return false;
+// if (queueName != null ? !queueName.equals(that.queueName) : that.queueName != null) return false;
+// if (resourceHostId != null ? !resourceHostId.equals(that.resourceHostId) : that.resourceHostId != null)
+// return false;
+// if (shareExperimentPublically != null ? !shareExperimentPublically.equals(that.shareExperimentPublically) : that.shareExperimentPublically != null)
+// return false;
+// if (throttleResources != null ? !throttleResources.equals(that.throttleResources) : that.throttleResources != null)
+// return false;
+// if (totalCpuCount != null ? !totalCpuCount.equals(that.totalCpuCount) : that.totalCpuCount != null)
+// return false;
+// if (totalPhysicalMemory != null ? !totalPhysicalMemory.equals(that.totalPhysicalMemory) : that.totalPhysicalMemory != null)
+// return false;
+// if (userDn != null ? !userDn.equals(that.userDn) : that.userDn != null) return false;
+// if (wallTimeLimit != null ? !wallTimeLimit.equals(that.wallTimeLimit) : that.wallTimeLimit != null)
+// return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = experimentId != null ? experimentId.hashCode() : 0;
+// result = 31 * result + (airavataAutoSchedule != null ? airavataAutoSchedule.hashCode() : 0);
+// result = 31 * result + (overrideManualScheduledParams != null ? overrideManualScheduledParams.hashCode() : 0);
+// result = 31 * result + (shareExperimentPublically != null ? shareExperimentPublically.hashCode() : 0);
+// result = 31 * result + (throttleResources != null ? throttleResources.hashCode() : 0);
+// result = 31 * result + (userDn != null ? userDn.hashCode() : 0);
+// result = 31 * result + (generateCert != null ? generateCert.hashCode() : 0);
+// result = 31 * result + (resourceHostId != null ? resourceHostId.hashCode() : 0);
+// result = 31 * result + (totalCpuCount != null ? totalCpuCount.hashCode() : 0);
+// result = 31 * result + (nodeCount != null ? nodeCount.hashCode() : 0);
+// result = 31 * result + (numberOfThreads != null ? numberOfThreads.hashCode() : 0);
+// result = 31 * result + (queueName != null ? queueName.hashCode() : 0);
+// result = 31 * result + (wallTimeLimit != null ? wallTimeLimit.hashCode() : 0);
+// result = 31 * result + (totalPhysicalMemory != null ? totalPhysicalMemory.hashCode() : 0);
+// return result;
+// }
@OneToOne
@JoinColumn(name = "EXPERIMENT_ID", referencedColumnName = "EXPERIMENT_ID", nullable = false)
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Users.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Users.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Users.java
new file mode 100644
index 0000000..f0f1fbb
--- /dev/null
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/model/Users.java
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.experiment.catalog.model;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+import java.util.Collection;
+
+@Entity
+@Table(name = "USERS")
+public class Users {
+ private final static Logger logger = LoggerFactory.getLogger(Users.class);
+ private String userName;
+ private String password;
+ private Collection<Experiment> experiments;
+ private Collection<GatewayWorker> gatewayWorkers;
+ private Collection<Project> projects;
+ private Collection<ProjectUser> projectUsers;
+
+ @Id
+ @Column(name = "USER_NAME")
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ @Basic
+ @Column(name = "PASSWORD")
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+// @Override
+// public boolean equals(Object o) {
+// if (this == o) return true;
+// if (o == null || getClass() != o.getClass()) return false;
+//
+// User user = (User) o;
+//
+// if (password != null ? !password.equals(user.password) : user.password != null) return false;
+// if (userName != null ? !userName.equals(user.userName) : user.userName != null) return false;
+//
+// return true;
+// }
+//
+// @Override
+// public int hashCode() {
+// int result = userName != null ? userName.hashCode() : 0;
+// result = 31 * result + (password != null ? password.hashCode() : 0);
+// return result;
+// }
+
+ @OneToMany(mappedBy = "user")
+ public Collection<Experiment> getExperiments() {
+ return experiments;
+ }
+
+ public void setExperiments(Collection<Experiment> experimentByUserName) {
+ this.experiments = experimentByUserName;
+ }
+
+ @OneToMany(mappedBy = "user")
+ public Collection<GatewayWorker> getGatewayWorkers() {
+ return gatewayWorkers;
+ }
+
+ public void setGatewayWorkers(Collection<GatewayWorker> gatewayWorkerByUserName) {
+ this.gatewayWorkers = gatewayWorkerByUserName;
+ }
+
+ @OneToMany(mappedBy = "user")
+ public Collection<Project> getProjects() {
+ return projects;
+ }
+
+ public void setProjects(Collection<Project> projectByUserName) {
+ this.projects = projectByUserName;
+ }
+
+ @OneToMany(mappedBy = "user")
+ public Collection<ProjectUser> getProjectUsers() {
+ return projectUsers;
+ }
+
+ public void setProjectUsers(Collection<ProjectUser> projectUserByUserName) {
+ this.projectUsers = projectUserByUserName;
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
index 8faf1aa..5fc5e48 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/AbstractExpCatResource.java
@@ -31,12 +31,12 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// table names
public static final String GATEWAY = "Gateway";
public static final String USERS = "Users";
- public static final String GATEWAY_WORKER = "Gateway_Worker";
+ public static final String GATEWAY_WORKER = "GatewayWorker";
public static final String PROJECT = "Project";
- public static final String PROJECT_USER = "Project_User";
+ public static final String PROJECT_USER = "ProjectUser";
public static final String EXPERIMENT = "Experiment";
- public static final String EXPERIMENT_INPUT = "Experiment_Input";
- public static final String EXPERIMENT_OUTPUT = "Experiment_Output";
+ public static final String EXPERIMENT_INPUT = "ExperimentInput";
+ public static final String EXPERIMENT_OUTPUT = "ExperimentOutput";
public static final String EXPERIMENT_ERROR = "ExperimentError";
public static final String EXPERIMENT_STATUS = "ExperimentStatus";
public static final String USER_CONFIGURATION_DATA = "UserConfigurationData";
@@ -53,30 +53,30 @@ public abstract class AbstractExpCatResource implements ExperimentCatResource {
// Gateway Table
public final class GatewayConstants {
- public static final String GATEWAY_ID = "gateway_id";
- public static final String GATEWAY_NAME = "gateway_name";
+ public static final String GATEWAY_ID = "gatewayId";
+ public static final String GATEWAY_NAME = "gatewayName";
public static final String DOMAIN = "domain";
public static final String EMAIL_ADDRESS = "emailAddress";
}
// Users table
public final class UserConstants {
- public static final String USERNAME = "user_name";
+ public static final String USERNAME = "userName";
public static final String PASSWORD = "password";
}
// Gateway_Worker table
public final class GatewayWorkerConstants {
- public static final String USERNAME = "user_name";
- public static final String GATEWAY_ID = "gateway_id";
+ public static final String USERNAME = "userName";
+ public static final String GATEWAY_ID = "gatewayId";
}
// Project table
public final class ProjectConstants {
- public static final String GATEWAY_ID = "gateway_id";
- public static final String USERNAME = "user_name";
- public static final String PROJECT_NAME = "project_name";
- public static final String PROJECT_ID = "project_id";
+ public static final String GATEWAY_ID = "gatewayId";
+ public static final String USERNAME = "userName";
+ public static final String PROJECT_NAME = "projectName";
+ public static final String PROJECT_ID = "projectId";
public static final String DESCRIPTION = "description";
public static final String CREATION_TIME = "creationTime";
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
index 26a1ea1..1702f4a 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
@@ -442,11 +442,8 @@ public class ExperimentResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
-
- Experiment experiment = em.find(Experiment.class, experimentId);
- em.close();
- em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
+ Experiment experiment = em.find(Experiment.class, experimentId);
if (experiment == null) {
experiment = new Experiment();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
index fae7552..3c1c93e 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/GatewayResource.java
@@ -206,7 +206,7 @@ public class GatewayResource extends AbstractExpCatResource {
generator = new QueryGenerator(USERS);
generator.setParameter(UserConstants.USERNAME, name);
q = generator.selectQuery(em);
- User user = (User) q.getSingleResult();
+ Users user = (Users) q.getSingleResult();
UserResource userResource =
(UserResource) Utils.getResource(ResourceType.USER, user);
em.getTransaction().commit();
@@ -285,25 +285,11 @@ public class GatewayResource extends AbstractExpCatResource {
}
}
break;
- case EXPERIMENT:
- generator = new QueryGenerator(EXPERIMENT);
- generator.setParameter(ExperimentConstants.GATEWAY_ID, gatewayId);
- q = generator.selectQuery(em);
- results = q.getResultList();
- if (results.size() != 0) {
- for (Object result : results) {
- Experiment experiment = (Experiment) result;
- ExperimentResource experimentResource =
- (ExperimentResource) Utils.getResource(ResourceType.EXPERIMENT, experiment);
- resourceList.add(experimentResource);
- }
- }
- break;
case USER:
generator = new QueryGenerator(USERS);
q = generator.selectQuery(em);
for (Object o : q.getResultList()) {
- User user = (User) o;
+ Users user = (Users) o;
UserResource userResource =
(UserResource) Utils.getResource(ResourceType.USER, user);
resourceList.add(userResource);
@@ -392,7 +378,7 @@ public class GatewayResource extends AbstractExpCatResource {
return existingWorker != null;
case USER:
em = ExpCatResourceUtils.getEntityManager();
- User existingUser = em.find(User.class, name);
+ Users existingUser = em.find(Users.class, name);
em.close();
return existingUser != null;
case EXPERIMENT:
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index e162d45..86933c4 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -399,10 +399,8 @@ public class ProcessResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
- Process process = em.find(Process.class, processId);
- em.close();
- em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
+ Process process = em.find(Process.class, processId);
if (process == null) {
process = new Process();
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectResource.java
index c46256c..f77c2b9 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectResource.java
@@ -26,7 +26,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.Experiment;
import org.apache.airavata.registry.core.experiment.catalog.model.Project;
import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUser;
-import org.apache.airavata.registry.core.experiment.catalog.model.User;
+import org.apache.airavata.registry.core.experiment.catalog.model.Users;
import org.apache.airavata.registry.core.experiment.catalog.utils.QueryGenerator;
import org.apache.airavata.registry.cpi.RegistryException;
import org.apache.airavata.registry.cpi.ResultOrderType;
@@ -340,9 +340,9 @@ public class ProjectResource extends AbstractExpCatResource {
project.setProjectId(id);
project.setProjectName(name);
project.setGatewayId(gatewayId);
- User user = em.find(User.class, worker.getUser());
+ Users user = em.find(Users.class, worker.getUser());
project.setUser(user);
- project.setOwnerName(user.getUserName());
+ project.setUserName(user.getUserName());
project.setDescription(description);
project.setCreationTime(creationTime);
@@ -350,10 +350,10 @@ public class ProjectResource extends AbstractExpCatResource {
existingProject.setProjectName(name);
existingProject.setGatewayId(gatewayId);
existingProject.setUser(user);
- existingProject.setOwnerName(user.getUserName());
+ existingProject.setUserName(user.getUserName());
existingProject.setDescription(description);
existingProject.setCreationTime(creationTime);
- project = em.merge(existingProject);
+ em.merge(existingProject);
} else {
em.persist(project);
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
index 433b62e..3686204 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProjectUserResource.java
@@ -27,7 +27,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUser;
import org.apache.airavata.registry.core.experiment.catalog.model.ProjectUserPK;
import org.apache.airavata.registry.core.experiment.catalog.model.Project;
-import org.apache.airavata.registry.core.experiment.catalog.model.User;
+import org.apache.airavata.registry.core.experiment.catalog.model.Users;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -97,7 +97,7 @@ public class ProjectUserResource extends AbstractExpCatResource {
ProjectUser prUser = new ProjectUser();
prUser.setProjectId(projectId);
prUser.setUserName(userName);
- User user = em.find(User.class, userName);
+ Users user = em.find(Users.class, userName);
prUser.setUser(user);
Project project = em.find(Project.class, projectId);
prUser.setProject(project);
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserResource.java
index a11c268..b2da6ca 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/UserResource.java
@@ -26,7 +26,7 @@ import org.apache.airavata.common.utils.ServerSettings;
import org.apache.airavata.registry.core.experiment.catalog.ExpCatResourceUtils;
import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResource;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
-import org.apache.airavata.registry.core.experiment.catalog.model.User;
+import org.apache.airavata.registry.core.experiment.catalog.model.Users;
import org.apache.airavata.registry.cpi.RegistryException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -110,12 +110,12 @@ public class UserResource extends AbstractExpCatResource {
EntityManager em = null;
try {
em = ExpCatResourceUtils.getEntityManager();
- User existingUser = em.find(User.class, userName);
+ Users existingUser = em.find(Users.class, userName);
em.close();
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
- User user = new User();
+ Users user = new Users();
user.setUserName(userName);
if (password != null && !password.equals("")) {
try {
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index d171685..c7d2873 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -26,6 +26,7 @@ import org.apache.airavata.registry.core.experiment.catalog.ExperimentCatResourc
import org.apache.airavata.registry.core.experiment.catalog.JPAConstants;
import org.apache.airavata.registry.core.experiment.catalog.ResourceType;
import org.apache.airavata.registry.core.experiment.catalog.model.*;
+import org.apache.airavata.registry.core.experiment.catalog.model.Process;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -181,14 +182,14 @@ public class Utils {
}
case PROJECT_USER:
if (o instanceof ProjectUser){
- return createProjectUser((ProjectUser)o);
+ return createProjectUser((ProjectUser) o);
}else {
logger.error("Object should be a ProjectUser.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a ProjectUser.");
}
case USER:
- if(o instanceof User) {
- return createUser((User) o);
+ if(o instanceof Users) {
+ return createUser((Users) o);
}else {
logger.error("Object should be a User.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a User.");
@@ -202,28 +203,28 @@ public class Utils {
}
case EXPERIMENT_SUMMARY:
if (o instanceof ExperimentSummary){
- return createExperimentSummary((ExperimentSummary)o);
+ return createExperimentSummary((ExperimentSummary) o);
}else {
logger.error("Object should be a ExperimentSummary.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a ExperimentSummary.");
}
case EXPERIMENT:
if (o instanceof Experiment){
- return createExperiment((Experiment)o);
+ return createExperiment((Experiment) o);
}else {
logger.error("Object should be a Experiment.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a Experiment.");
}
case EXPERIMENT_INPUT:
if (o instanceof ExperimentInput){
- return createExperimentInput((ExperimentInput)o);
+ return createExperimentInput((ExperimentInput) o);
}else {
logger.error("Object should be a Experiment input data.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a Experiment input data.");
}
case EXPERIMENT_OUTPUT:
if (o instanceof ExperimentOutput){
- return createExperimentOutput((ExperimentOutput)o);
+ return createExperimentOutput((ExperimentOutput) o);
}else {
logger.error("Object should be a Experiment output data.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a Experiment output data.");
@@ -242,6 +243,20 @@ public class Utils {
logger.error("Object should be a experiment error data.", new IllegalArgumentException());
throw new IllegalArgumentException("Object should be a experiment error data.");
}
+ case USER_CONFIGURATION_DATA:
+ if (o instanceof UserConfigurationData){
+ return createUserConfigData((UserConfigurationData) o);
+ }else {
+ logger.error("Object should be a user config data.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Object should be a user config data.");
+ }
+ case PROCESS:
+ if (o instanceof Process){
+ return createProcess((Process) o);
+ }else {
+ logger.error("Object should be a process error data.", new IllegalArgumentException());
+ throw new IllegalArgumentException("Object should be a process error data.");
+ }
case PROCESS_ERROR:
if (o instanceof ProcessError){
return createProcessError((ProcessError) o);
@@ -352,7 +367,7 @@ public class Utils {
return null;
}
- private static ExperimentCatResource createUser(User o) {
+ private static ExperimentCatResource createUser(Users o) {
UserResource userResource = new UserResource();
if (o != null){
userResource.setUserName(o.getUserName());
@@ -402,7 +417,6 @@ public class Utils {
private static ExperimentCatResource createExperimentInput (ExperimentInput o){
ExperimentInputResource inputResource = new ExperimentInputResource();
if (o != null){
- inputResource.setExperimentInputId(o.getExperimentInputId());
inputResource.setExperimentId(o.getExperimentId());
inputResource.setInputName(o.getInputName());
inputResource.setInputValue(o.getInputValue());
@@ -422,8 +436,9 @@ public class Utils {
private static ExperimentCatResource createExperimentOutput (ExperimentOutput o){
ExperimentOutputResource outputResource = new ExperimentOutputResource();
if (o != null){
- outputResource.setExperimentOutputId(o.getExperimentOutputId());
outputResource.setExperimentId(o.getExperimentId());
+ outputResource.setOutputName(o.getOutputName());
+ outputResource.setOutputValue(o.getOutputValue());
outputResource.setDataType(o.getDataType());
outputResource.setApplicationArgument(o.getApplicationArgument());
outputResource.setIsRequired(o.getIsRequired());
@@ -462,6 +477,41 @@ public class Utils {
return experimentErrorResource;
}
+ private static ExperimentCatResource createUserConfigData (UserConfigurationData o){
+ UserConfigurationDataResource configurationDataResource = new UserConfigurationDataResource();
+ if (o != null){
+ configurationDataResource.setExperimentId(o.getExperimentId());
+ configurationDataResource.setAiravataAutoSchedule(o.getAiravataAutoSchedule());
+ configurationDataResource.setOverrideManualScheduledParams(o.getOverrideManualScheduledParams());
+ configurationDataResource.setShareExperimentPublically(o.getShareExperimentPublically());
+ configurationDataResource.setThrottleResources(o.getThrottleResources());
+ configurationDataResource.setUserDn(o.getUserDn());
+ configurationDataResource.setGenerateCert(o.getGenerateCert());
+ configurationDataResource.setResourceHostId(o.getResourceHostId());
+ configurationDataResource.setTotalCpuCount(o.getTotalCpuCount());
+ configurationDataResource.setNodeCount(o.getNodeCount());
+ configurationDataResource.setNumberOfThreads(o.getNumberOfThreads());
+ configurationDataResource.setQueueName(o.getQueueName());
+ configurationDataResource.setWallTimeLimit(o.getWallTimeLimit());
+ configurationDataResource.setTotalPhysicalMemory(o.getTotalPhysicalMemory());
+ }
+ return configurationDataResource;
+ }
+
+ private static ExperimentCatResource createProcess (Process o){
+ ProcessResource processResource = new ProcessResource();
+ if (o != null){
+ processResource.setProcessId(o.getProcessId());
+ processResource.setExperimentId(o.getExperimentId());
+ processResource.setCreationTime(o.getCreationTime());
+ processResource.setLastUpdateTime(o.getLastUpdateTime());
+ processResource.setProcessDetail(o.getProcessDetail());
+ processResource.setApplicationInterfaceId(o.getApplicationInterfaceId());
+ processResource.setTaskDag(o.getTaskDag());
+ }
+ return processResource;
+ }
+
private static ExperimentCatResource createProcessError (ProcessError o){
ProcessErrorResource processErrorResource = new ProcessErrorResource();
if (o != null){
@@ -478,7 +528,6 @@ public class Utils {
private static ExperimentCatResource createProcessInput (ProcessInput o){
ProcessInputResource inputResource = new ProcessInputResource();
if (o != null){
- inputResource.setProcessInputId(o.getProcessInputId());
inputResource.setProcessId(o.getProcessId());
inputResource.setInputName(o.getInputName());
inputResource.setInputValue(o.getInputValue());
@@ -498,8 +547,9 @@ public class Utils {
private static ExperimentCatResource createProcessOutput (ProcessOutput o){
ProcessOutputResource outputResource = new ProcessOutputResource();
if (o != null){
- outputResource.setProcessOutputId(o.getProcessOutputId());
outputResource.setProcessId(o.getProcessId());
+ outputResource.setOutputName(o.getOutputName());
+ outputResource.setOutputValue(o.getOutputValue());
outputResource.setDataType(o.getDataType());
outputResource.setApplicationArgument(o.getApplicationArgument());
outputResource.setIsRequired(o.getIsRequired());
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
index 25bc2e4..3cb47d5 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/WorkerResource.java
@@ -253,7 +253,7 @@ public class WorkerResource extends AbstractExpCatResource {
switch (type) {
case PROJECT:
generator = new QueryGenerator(PROJECT);
- User users = em.find(User.class, getUser());
+ Users users = em.find(Users.class, getUser());
Gateway gatewayModel = em.find(Gateway.class, gatewayId);
generator.setParameter("users", users);
if (gatewayModel != null) {
@@ -340,7 +340,7 @@ public class WorkerResource extends AbstractExpCatResource {
em = ExpCatResourceUtils.getEntityManager();
em.getTransaction().begin();
GatewayWorker gatewayWorker = new GatewayWorker();
- User existingUser = em.find(User.class, this.user);
+ Users existingUser = em.find(Users.class, this.user);
gatewayWorker.setUser(existingUser);
gatewayWorker.setUserName(existingUser.getUserName());
gatewayWorker.setGatewayId(gatewayId);
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
index 29e5050..9e2ddfe 100644
--- a/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
+++ b/modules/registry/registry-core/src/main/resources/META-INF/persistence.xml
@@ -85,7 +85,7 @@
<class>org.apache.airavata.registry.core.experiment.catalog.model.Task</class>
<class>org.apache.airavata.registry.core.experiment.catalog.model.TaskError</class>
<class>org.apache.airavata.registry.core.experiment.catalog.model.TaskStatus</class>
- <class>org.apache.airavata.registry.core.experiment.catalog.model.User</class>
+ <class>org.apache.airavata.registry.core.experiment.catalog.model.Users</class>
<class>org.apache.airavata.registry.core.experiment.catalog.model.UserConfigurationData</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
http://git-wip-us.apache.org/repos/asf/airavata/blob/cb5d3aef/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
index be1a62d..6e1174d 100644
--- a/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
+++ b/modules/registry/registry-core/src/main/resources/expcatalog-derby.sql
@@ -27,7 +27,7 @@ CREATE TABLE GATEWAY
PRIMARY KEY (GATEWAY_ID)
);
-CREATE TABLE USER
+CREATE TABLE USERS
(
USER_NAME VARCHAR(255),
PASSWORD VARCHAR(255),
@@ -40,20 +40,20 @@ CREATE TABLE GATEWAY_WORKER
USER_NAME VARCHAR(255),
PRIMARY KEY (GATEWAY_ID, USER_NAME),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT
(
GATEWAY_ID VARCHAR(255),
USER_NAME VARCHAR(255),
- PROJECT_NAME VARCHAR(255) NOT NULL,
+ PROJECT_NAME VARCHAR(255),
PROJECT_ID VARCHAR(255),
DESCRIPTION VARCHAR(255),
- CREATION_TIME TIMESTAMP DEFAULT NOW(),
+ CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (PROJECT_ID),
FOREIGN KEY (GATEWAY_ID) REFERENCES GATEWAY(GATEWAY_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE PROJECT_USER
@@ -62,7 +62,7 @@ CREATE TABLE PROJECT_USER
USER_NAME VARCHAR(255),
PRIMARY KEY (PROJECT_ID,USER_NAME),
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE,
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
);
CREATE TABLE EXPERIMENT (
@@ -72,14 +72,14 @@ CREATE TABLE EXPERIMENT (
USER_NAME varchar(255),
APPLICATION_ID varchar(255),
EXPERIMENT_NAME varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
DESCRIPTION varchar(255),
EXECUTION_ID varchar(255),
GATEWAY_EXECUTION_ID varchar(255),
ENABLE_EMAIL_NOTIFICATION BOOLEAN,
EMAIL_ADDRESSES CLOB,
PRIMARY KEY (EXPERIMENT_ID),
- FOREIGN KEY (USER_NAME) REFERENCES USER(USER_NAME) ON DELETE CASCADE,
+ FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE,
FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID) ON DELETE CASCADE
);
@@ -94,7 +94,7 @@ CREATE TABLE EXPERIMENT_INPUT
STANDARD_INPUT BOOLEAN,
USER_FRIENDLY_DESCRIPTION varchar(255),
METADATA varchar(255),
- INPUT_ORDER int(11),
+ INPUT_ORDER INT,
IS_REQUIRED BOOLEAN,
REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
DATA_STAGED BOOLEAN,
@@ -123,7 +123,7 @@ CREATE TABLE EXPERIMENT_STATUS (
STATUS_ID varchar(255),
EXPERIMENT_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
REASON varchar(255),
PRIMARY KEY (STATUS_ID, EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
@@ -133,7 +133,7 @@ CREATE TABLE EXPERIMENT_STATUS (
CREATE TABLE EXPERIMENT_ERROR (
ERROR_ID varchar(255),
EXPERIMENT_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
@@ -151,12 +151,12 @@ CREATE TABLE USER_CONFIGURATION_DATA (
USER_DN varchar(255),
GENERATE_CERT BOOLEAN,
RESOURCE_HOST_ID varchar(255),
- TOTAL_CPU_COUNT int(11),
- NODE_COUNT int(11),
- NUMBER_OF_THREADS int(11),
+ TOTAL_CPU_COUNT INT,
+ NODE_COUNT INT,
+ NUMBER_OF_THREADS INT,
QUEUE_NAME varchar(255),
- WALL_TIME_LIMIT int(11),
- TOTAL_PHYSICAL_MEMORY int(11),
+ WALL_TIME_LIMIT INT,
+ TOTAL_PHYSICAL_MEMORY INT,
PRIMARY KEY (EXPERIMENT_ID),
FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
);
@@ -172,13 +172,13 @@ CREATE VIEW EXPERIMENT_SUMMARY AS
E.CREATION_TIME AS CREATION_TIME, E.DESCRIPTION AS DESCRIPTION, ES.STATE AS STATE, UD.RESOURCE_HOST_ID
AS RESOURCE_HOST_ID, ES.TIME_OF_STATE_CHANGE AS TIME_OF_STATE_CHANGE
from ((EXPERIMENT E left join LATEST_EXPERIMENT_STATUS ES on((E.EXPERIMENT_ID = ES.EXPERIMENT_ID)))
- left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where 1;
+ left join USER_CONFIGURATION_DATA UD on((E.EXPERIMENT_ID = UD.EXPERIMENT_ID))) where true;
CREATE TABLE PROCESS (
PROCESS_ID varchar(255),
EXPERIMENT_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
PROCESS_DETAIL CLOB,
APPLICATION_INTERFACE_ID varchar(255),
TASK_DAG varchar(255),
@@ -196,7 +196,7 @@ CREATE TABLE PROCESS_INPUT
STANDARD_INPUT BOOLEAN,
USER_FRIENDLY_DESCRIPTION varchar(255),
METADATA varchar(255),
- INPUT_ORDER int(11),
+ INPUT_ORDER INT,
IS_REQUIRED BOOLEAN,
REQUIRED_TO_ADDED_TO_CMD BOOLEAN,
DATA_STAGED BOOLEAN,
@@ -225,7 +225,7 @@ CREATE TABLE PROCESS_STATUS (
STATUS_ID varchar(255),
PROCESS_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
REASON varchar(255),
PRIMARY KEY (STATUS_ID, PROCESS_ID),
FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
@@ -235,7 +235,7 @@ CREATE TABLE PROCESS_STATUS (
CREATE TABLE PROCESS_ERROR (
ERROR_ID varchar(255),
PROCESS_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
@@ -247,21 +247,22 @@ CREATE TABLE PROCESS_ERROR (
CREATE TABLE PROCESS_RESOURCE_SCHEDULE (
PROCESS_ID varchar(255),
RESOURCE_HOST_ID varchar(255),
- TOTAL_CPU_COUNT int(11),
- NODE_COUNT int(11),
- NUMBER_OF_THREADS int(11),
+ TOTAL_CPU_COUNT INT,
+ NODE_COUNT INT,
+ NUMBER_OF_THREADS INT,
QUEUE_NAME varchar(255),
- WALL_TIME_LIMIT int(11),
- TOTAL_PHYSICAL_MEMORY int(11),
- PRIMARY KEY (PROCESS_ID)
+ WALL_TIME_LIMIT INT,
+ TOTAL_PHYSICAL_MEMORY INT,
+ PRIMARY KEY (PROCESS_ID),
+ FOREIGN KEY (PROCESS_ID) REFERENCES PROCESS(PROCESS_ID) ON DELETE CASCADE
);
CREATE TABLE TASK (
TASK_ID varchar(255),
TASK_TYPE varchar(255),
PARENT_PROCESS_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
- LAST_UPDATE_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+ LAST_UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
TASK_DETAIL CLOB,
TASK_INTERNAL_STORE CHAR,
PRIMARY KEY (TASK_ID),
@@ -272,7 +273,7 @@ CREATE TABLE TASK_STATUS (
STATUS_ID varchar(255),
TASK_ID varchar(255),
STATE varchar(255),
- TIME_OF_STATE_CHANGE timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
+ TIME_OF_STATE_CHANGE timestamp DEFAULT '0000-00-00 00:00:00',
REASON varchar(255),
PRIMARY KEY (STATUS_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
@@ -282,7 +283,7 @@ CREATE TABLE TASK_STATUS (
CREATE TABLE TASK_ERROR (
ERROR_ID varchar(255),
TASK_ID varchar(255),
- CREATION_TIME timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
ACTUAL_ERROR_MESSAGE CLOB,
USER_FRIENDLY_MESSAGE CLOB,
TRANSIENT_OR_PERSISTENT BOOLEAN,
@@ -290,3 +291,14 @@ CREATE TABLE TASK_ERROR (
PRIMARY KEY (ERROR_ID, TASK_ID),
FOREIGN KEY (TASK_ID) REFERENCES TASK(TASK_ID) ON DELETE CASCADE
);
+
+CREATE TABLE CONFIGURATION
+(
+ CONFIG_KEY VARCHAR(255),
+ CONFIG_VAL VARCHAR(255),
+ EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
+ CATEGORY_ID VARCHAR (255),
+ PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
+);
+
+INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.15', CURRENT_TIMESTAMP ,'SYSTEM');
\ No newline at end of file