diff --git a/README.md b/README.md new file mode 100644 index 00000000..f3399fcb --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +See the [wiki associated with this repository](https://github.com/Access4Learning/sif3-framework-java/wiki) for information on: + +* contributing to this framework +* the Java coding style to be used and +* the structure of the SIF 3 Framework repositories diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_SQLite.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_SQLite.sql new file mode 100644 index 00000000..97be8b3d --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_SQLite.sql @@ -0,0 +1,10 @@ +ALTER TABLE SIF3_SESSION ADD FINGERPRINT VARCHAR(255) NULL; + +-- Upgarding 3.0.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.0.1','http://www.sifassociation.org/infrastructure/3.2.1'); + +-- Upgarding 3.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.1','http://www.sifassociation.org/infrastructure/3.2.1'); + diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mssql.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mssql.sql new file mode 100644 index 00000000..97be8b3d --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mssql.sql @@ -0,0 +1,10 @@ +ALTER TABLE SIF3_SESSION ADD FINGERPRINT VARCHAR(255) NULL; + +-- Upgarding 3.0.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.0.1','http://www.sifassociation.org/infrastructure/3.2.1'); + +-- Upgarding 3.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.1','http://www.sifassociation.org/infrastructure/3.2.1'); + diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mysql.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mysql.sql new file mode 100644 index 00000000..32abb116 --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_mysql.sql @@ -0,0 +1,9 @@ +ALTER TABLE SIF3_SESSION ADD FINGERPRINT VARCHAR(255) NULL AFTER ENVIRONMENT_ID; + +-- Upgarding 3.0.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.0.1','http://www.sifassociation.org/infrastructure/3.2.1'); + +-- Upgarding 3.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.1','http://www.sifassociation.org/infrastructure/3.2.1'); diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_oracle.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_oracle.sql new file mode 100644 index 00000000..5301af7a --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_oracle.sql @@ -0,0 +1,10 @@ +ALTER TABLE SIF3_SESSION ADD (FINGERPRINT VARCHAR2(255) NULL); + +-- Upgarding 3.0.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.0.1','http://www.sifassociation.org/infrastructure/3.2.1'); + +-- Upgarding 3.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.1','http://www.sifassociation.org/infrastructure/3.2.1'); + diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_postgres.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_postgres.sql new file mode 100644 index 00000000..606ea16b --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170314_postgres.sql @@ -0,0 +1,11 @@ +ALTER TABLE SIF3_SESSION ADD FINGERPRINT VARCHAR(255) NULL; + +-- Upgarding 3.0.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.0.1','http://www.sifassociation.org/infrastructure/3.2.1'); + +-- Upgarding 3.1 to 3.2.1 +update SIF3_SESSION +set ENVIRONMENT_XML=REPLACE(ENVIRONMENT_XML,'http://www.sifassociation.org/infrastructure/3.1','http://www.sifassociation.org/infrastructure/3.2.1'); + + diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_SQLite.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_SQLite.sql new file mode 100644 index 00000000..ec679e5d --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_SQLite.sql @@ -0,0 +1,31 @@ +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INTEGER NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE INTEGER NOT NULL DEFAULT 0, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INTEGER NOT NULL, + EXT_SECURITY_SERVICE_ID INTEGER NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID), + CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC + FOREIGN KEY (EXT_SECURITY_SERVICE_ID) + REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID) + ON DELETE NO ACTION + ON UPDATE NO ACTION); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mssql.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mssql.sql new file mode 100644 index 00000000..61fa8b24 --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mssql.sql @@ -0,0 +1,31 @@ +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE BIT DEFAULT (0) NOT NULL, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID), + CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC + FOREIGN KEY (EXT_SECURITY_SERVICE_ID) + REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID) + ON DELETE NO ACTION + ON UPDATE NO ACTION); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mysql.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mysql.sql new file mode 100644 index 00000000..74812d42 --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_mysql.sql @@ -0,0 +1,33 @@ +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE TINYINT(1) NOT NULL DEFAULT 0, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)) +ENGINE = InnoDB; + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID), + CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC + FOREIGN KEY (EXT_SECURITY_SERVICE_ID) + REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_oracle.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_oracle.sql new file mode 100644 index 00000000..2b5c138e --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_oracle.sql @@ -0,0 +1,31 @@ +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR2(20) NULL, + ADAPTER_TYPE VARCHAR2(20) NULL, + HTTP_HEADER_VALUE VARCHAR2(20) NULL, + XML_VALUE VARCHAR2(20) NULL, + TWO_PHASE CHAR DEFAULT 'N' NOT NULL, + IMPLEMENTATION_CLASS VARCHAR2(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR2(45) NULL, + PARAM_VALUE VARCHAR2(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID)); + +ALTER TABLE SIF3_SEC_SERVICE_PARAM +ADD CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC +FOREIGN KEY (EXT_SECURITY_SERVICE_ID) +REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_postgres.sql b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_postgres.sql new file mode 100644 index 00000000..9c06bb15 --- /dev/null +++ b/SIF3InfraREST/DB/DDL/Datafix/current/v0.10.0-v0.11.0/Datafix20170330_postgres.sql @@ -0,0 +1,31 @@ +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE BOOLEAN DEFAULT 0 NOT NULL, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID)); + +ALTER TABLE SIF3_SEC_SERVICE_PARAM +ADD CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC +FOREIGN KEY (EXT_SECURITY_SERVICE_ID) +REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_SQLite.sql b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_SQLite.sql index dbf17be6..d179648c 100644 --- a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_SQLite.sql +++ b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_SQLite.sql @@ -11,6 +11,7 @@ CREATE TABLE IF NOT EXISTS SIF3_SESSION ( PASSWORD VARCHAR(100) NULL , SESSION_TOKEN VARCHAR(200) NULL , ENVIRONMENT_ID VARCHAR(36) NULL , + FINGERPRINT VARCHAR(255) NULL , SECURITY_TOKEN VARCHAR(1000) NULL, SECURITY_TOKEN_EXPIRY DATETIME NULL, ADAPTER_TYPE VARCHAR(20) NULL , @@ -123,4 +124,35 @@ CREATE INDEX APPKEY_USERTK_IDX ON SIF3_APP_TEMPLATE (APPLICATION_KEY ASC, USER_T CREATE INDEX IDX_APP_TMPLT_TO_ENV_TMPLT ON SIF3_APP_TEMPLATE (ENV_TEMPLATE_ID ASC) ; +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INTEGER NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE INTEGER NOT NULL DEFAULT 0, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INTEGER NOT NULL, + EXT_SECURITY_SERVICE_ID INTEGER NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID), + CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC + FOREIGN KEY (EXT_SECURITY_SERVICE_ID) + REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID) + ON DELETE NO ACTION + ON UPDATE NO ACTION); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mssql.sql b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mssql.sql index e66b91e8..e5b3b767 100644 --- a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mssql.sql +++ b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mssql.sql @@ -1,11 +1,8 @@ USE SIF3_INFRA ; -- ----------------------------------------------------- - -- Table SIF3_SESSION - -- ----------------------------------------------------- - CREATE TABLE SIF3_SESSION ( SESSION_ID INT NOT NULL IDENTITY , @@ -17,6 +14,7 @@ CREATE TABLE SIF3_SESSION PASSWORD VARCHAR(100) NULL , SESSION_TOKEN VARCHAR(200) NULL , ENVIRONMENT_ID VARCHAR(36) NULL , + FINGERPRINT VARCHAR(255) NULL , SECURITY_TOKEN VARCHAR(1000) NULL, SECURITY_TOKEN_EXPIRY DATETIME NULL, ADAPTER_TYPE VARCHAR(20) NULL, @@ -25,7 +23,7 @@ CREATE TABLE SIF3_SESSION CREATED DATETIME NULL , LAST_ACCESSED DATETIME NULL , PRIMARY KEY (SESSION_ID) -) +); CREATE INDEX SOL_APP_KEY_IDX ON SIF3_SESSION (SOLUTION_ID ASC, APPLICATION_KEY ASC, ADAPTER_TYPE ASC) ; CREATE INDEX SESSION_TK_IDX ON SIF3_SESSION (SESSION_TOKEN ASC) ; @@ -57,7 +55,7 @@ CREATE TABLE SIF3_QUEUE LAST_ACCESSED DATETIME NULL , LAST_MODIFIED DATETIME NULL , PRIMARY KEY (QUEUE_ID) - ) +); CREATE INDEX IDX_QUEUE_ENVID ON SIF3_QUEUE (ENVIRONMENT_ID ASC, ADAPTER_TYPE ASC) ; CREATE INDEX IDX_QUEUE_ZONE ON SIF3_QUEUE (ENVIRONMENT_ID ASC, ADAPTER_TYPE ASC, ZONE_ID ASC) ; @@ -66,8 +64,6 @@ CREATE INDEX IDX_QUEUE_ZONE_CTX_SVC ON SIF3_QUEUE (ENVIRONMENT_ID ASC, ADAPTER_T -- ----------------------------------------------------- -- Table SIF3_SUBSCRIPTION -- ----------------------------------------------------- - - CREATE TABLE SIF3_SUBSCRIPTION ( SUBSCRIPTION_ID VARCHAR(36) NOT NULL , @@ -85,15 +81,11 @@ CREATE TABLE SIF3_SUBSCRIPTION REFERENCES SIF3_QUEUE (QUEUE_ID ) ON DELETE NO ACTION ON UPDATE NO ACTION -) - +); CREATE INDEX IDX_SUBSCR_QUEUEID ON SIF3_SUBSCRIPTION (QUEUE_ID ASC, ADAPTER_TYPE ASC) ; - CREATE INDEX IDX_SUBSCR_SERVICE ON SIF3_SUBSCRIPTION (SERVICE_NAME ASC, SERVICE_TYPE ASC) ; - CREATE INDEX FK_SUBSCR_QUEUE ON SIF3_SUBSCRIPTION (QUEUE_ID ASC) ; - CREATE INDEX IDK_SUBSCR_ZONE_CTX_SVC ON SIF3_SUBSCRIPTION (ZONE_ID ASC, CONTEXT_ID ASC, SERVICE_NAME ASC, SERVICE_TYPE ASC) ; -- ----------------------------------------------------- @@ -105,9 +97,7 @@ CREATE TABLE SIF3_ENV_TEMPLATE ENV_TEMPLATE_ID VARCHAR(50) NOT NULL , TEMPLATE_FILE_NAME VARCHAR(100) NOT NULL , PRIMARY KEY (ENV_TEMPLATE_ID) - ) - - +); -- ----------------------------------------------------- -- Table SIF3_APP_TEMPLATE @@ -128,8 +118,7 @@ CREATE TABLE SIF3_APP_TEMPLATE REFERENCES SIF3_ENV_TEMPLATE (ENV_TEMPLATE_ID ) ON DELETE NO ACTION ON UPDATE NO ACTION -) - +); CREATE INDEX SOL_APPKEY_IDX ON SIF3_APP_TEMPLATE (SOLUTION_ID ASC, APPLICATION_KEY ASC) ; CREATE INDEX APPKEY_IDX ON SIF3_APP_TEMPLATE (APPLICATION_KEY ASC) ; @@ -137,5 +126,36 @@ CREATE INDEX SOL_APPKEY_USERTK_IDX ON SIF3_APP_TEMPLATE (SOLUTION_ID ASC, APPLIC CREATE INDEX APPKEY_USERTK_IDX ON SIF3_APP_TEMPLATE (APPLICATION_KEY ASC, USER_TOKEN ASC) ; CREATE INDEX IDX_APP_TMPLT_TO_ENV_TMPLT ON SIF3_APP_TEMPLATE (ENV_TEMPLATE_ID ASC) ; +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE BIT DEFAULT (0) NOT NULL, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID) +); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID), + CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC + FOREIGN KEY (EXT_SECURITY_SERVICE_ID) + REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID) + ON DELETE NO ACTION + ON UPDATE NO ACTION +); +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); diff --git a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mysql.sql b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mysql.sql index b6137a2f..20cd841a 100644 --- a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mysql.sql +++ b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_mysql.sql @@ -23,6 +23,7 @@ CREATE TABLE IF NOT EXISTS `SIF3_SESSION` ( `PASSWORD` VARCHAR(100) NULL , `SESSION_TOKEN` VARCHAR(200) NULL , `ENVIRONMENT_ID` VARCHAR(36) NULL , + `FINGERPRINT` VARCHAR(255) NULL , `SECURITY_TOKEN` VARCHAR(500) NULL, `SECURITY_TOKEN_EXPIRY` DATETIME NULL, `ADAPTER_TYPE` VARCHAR(20) NULL COMMENT 'CONSUMER, PROVIDER, ENVIRONMENT_PROVIDER' , @@ -154,6 +155,44 @@ CREATE INDEX `APPKEY_USERTK_IDX` ON `SIF3_APP_TEMPLATE` (`APPLICATION_KEY` ASC, CREATE INDEX `IDX_APP_TMPLT_TO_ENV_TMPLT` ON `SIF3_APP_TEMPLATE` (`ENV_TEMPLATE_ID` ASC) ; +-- ----------------------------------------------------- +-- Table `SIF3_EXT_SECURITY_SERVICE` +-- ----------------------------------------------------- +DROP TABLE IF EXISTS `SIF3_EXT_SECURITY_SERVICE` ; + +CREATE TABLE IF NOT EXISTS `SIF3_EXT_SECURITY_SERVICE` ( + `EXT_SECURITY_SERVICE_ID` INT NOT NULL, + `AUTH_METHOD` VARCHAR(20) NULL, + `ADAPTER_TYPE` VARCHAR(20) NULL, + `HTTP_HEADER`_VALUE VARCHAR(20) NULL, + `XML_VALUE` VARCHAR(20) NULL, + `TWO_PHASE` TINYINT(1) NOT NULL DEFAULT 0, + `IMPLEMENTATION_CLASS` VARCHAR(256) NULL, + PRIMARY KEY (`EXT_SECURITY_SERVICE_ID`)) +ENGINE = InnoDB; + +CREATE UNIQUE INDEX `UQ_AUTH_METH_ADAP` ON `SIF3_EXT_SECURITY_SERVICE` (`AUTH_METHOD` ASC, `ADAPTER_TYPE` ASC); + +-- ----------------------------------------------------- +-- Table `SIF3_SEC_SERVICE_PARAM` +-- ----------------------------------------------------- +DROP TABLE IF EXISTS `SIF3_SEC_SERVICE_PARAM` ; + +CREATE TABLE IF NOT EXISTS `SIF3_SEC_SERVICE_PARAM` ( + `SEC_SERVICE_PARAM_ID` INT NOT NULL, + `EXT_SECURITY_SERVICE_ID` INT NOT NULL, + `PARAM_NAME` VARCHAR(45) NULL, + `PARAM_VALUE` VARCHAR(256) NULL, + PRIMARY KEY (`SEC_SERVICE_PARAM_ID`), + CONSTRAINT `FK_SEC_SVC_PARAM_TO_SEC_SVC` + FOREIGN KEY (`EXT_SECURITY_SERVICE_ID`) + REFERENCES `SIF3_EXT_SECURITY_SERVICE` (`EXT_SECURITY_SERVICE_ID`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + +CREATE INDEX `IDX_EXT_SEC_SVC` ON `SIF3_SEC_SERVICE_PARAM` (`EXT_SECURITY_SERVICE_ID` ASC); + SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; diff --git a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_oracle.sql b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_oracle.sql index aa0388cf..8721b643 100644 --- a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_oracle.sql +++ b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_oracle.sql @@ -11,6 +11,7 @@ CREATE TABLE SIF3_SESSION ( PASSWORD VARCHAR2(100) NULL , SESSION_TOKEN VARCHAR2(200) NULL , ENVIRONMENT_ID VARCHAR2(36) NULL , + FINGERPRINT VARCHAR2(255) NULL , SECURITY_TOKEN VARCHAR2(1000) NULL, SECURITY_TOKEN_EXPIRY TIMESTAMP NULL, ADAPTER_TYPE VARCHAR2(20) , @@ -126,6 +127,37 @@ CREATE INDEX APPKEY_USERTK_IDX ON SIF3_APP_TEMPLATE (APPLICATION_KEY ASC, USER_T CREATE INDEX IDX_APP_TMPLT_TO_ENV_TMPLT ON SIF3_APP_TEMPLATE (ENV_TEMPLATE_ID ASC) ; +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR2(20) NULL, + ADAPTER_TYPE VARCHAR2(20) NULL, + HTTP_HEADER_VALUE VARCHAR2(20) NULL, + XML_VALUE VARCHAR2(20) NULL, + TWO_PHASE CHAR DEFAULT 'N' NOT NULL, + IMPLEMENTATION_CLASS VARCHAR2(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR2(45) NULL, + PARAM_VALUE VARCHAR2(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID)); + +ALTER TABLE SIF3_SEC_SERVICE_PARAM +ADD CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC +FOREIGN KEY (EXT_SECURITY_SERVICE_ID) +REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); -- ----------------------------------------------------- -- Sequence for AUTO_INCREMENT diff --git a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_postgres.sql b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_postgres.sql index c92e4c70..9e068663 100644 --- a/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_postgres.sql +++ b/SIF3InfraREST/DB/DDL/SIF3InfrastructureERM_DDL_postgres.sql @@ -11,6 +11,7 @@ CREATE TABLE SIF3_SESSION ( PASSWORD VARCHAR(100) NULL , SESSION_TOKEN VARCHAR(200) NULL , ENVIRONMENT_ID VARCHAR(36) NULL , + FINGERPRINT VARCHAR(255) NULL , SECURITY_TOKEN VARCHAR(1000) NULL, SECURITY_TOKEN_EXPIRY TIMESTAMP NULL, ADAPTER_TYPE VARCHAR(20) , @@ -126,6 +127,37 @@ CREATE INDEX APPKEY_USERTK_IDX ON SIF3_APP_TEMPLATE (APPLICATION_KEY ASC, USER_T CREATE INDEX IDX_APP_TMPLT_TO_ENV_TMPLT ON SIF3_APP_TEMPLATE (ENV_TEMPLATE_ID ASC) ; +-- ----------------------------------------------------- +-- Table SIF3_EXT_SECURITY_SERVICE +-- ----------------------------------------------------- +CREATE TABLE SIF3_EXT_SECURITY_SERVICE ( + EXT_SECURITY_SERVICE_ID INT NOT NULL, + AUTH_METHOD VARCHAR(20) NULL, + ADAPTER_TYPE VARCHAR(20) NULL, + HTTP_HEADER_VALUE VARCHAR(20) NULL, + XML_VALUE VARCHAR(20) NULL, + TWO_PHASE BOOLEAN DEFAULT 0 NOT NULL, + IMPLEMENTATION_CLASS VARCHAR(256) NULL, + PRIMARY KEY (EXT_SECURITY_SERVICE_ID)); + +CREATE UNIQUE INDEX UQ_AUTH_METH_ADAP ON SIF3_EXT_SECURITY_SERVICE (AUTH_METHOD ASC, ADAPTER_TYPE ASC); + +-- ----------------------------------------------------- +-- Table SIF3_SEC_SERVICE_PARAM +-- ----------------------------------------------------- +CREATE TABLE SIF3_SEC_SERVICE_PARAM ( + SEC_SERVICE_PARAM_ID INT NOT NULL, + EXT_SECURITY_SERVICE_ID INT NOT NULL, + PARAM_NAME VARCHAR(45) NULL, + PARAM_VALUE VARCHAR(256) NULL, + PRIMARY KEY (SEC_SERVICE_PARAM_ID)); + +ALTER TABLE SIF3_SEC_SERVICE_PARAM +ADD CONSTRAINT FK_SEC_SVC_PARAM_TO_SEC_SVC +FOREIGN KEY (EXT_SECURITY_SERVICE_ID) +REFERENCES SIF3_EXT_SECURITY_SERVICE (EXT_SECURITY_SERVICE_ID); + +CREATE INDEX IDX_EXT_SEC_SVC ON SIF3_SEC_SERVICE_PARAM (EXT_SECURITY_SERVICE_ID ASC); -- ----------------------------------------------------- -- Sequence for AUTO_INCREMENT diff --git a/SIF3InfraREST/DB/Data/SIF3Infra.sqliteDB b/SIF3InfraREST/DB/Data/SIF3Infra.sqliteDB index c921b901..eebd0df0 100644 Binary files a/SIF3InfraREST/DB/Data/SIF3Infra.sqliteDB and b/SIF3InfraREST/DB/Data/SIF3Infra.sqliteDB differ diff --git a/SIF3InfraREST/README.md b/SIF3InfraREST/README.md index a274f1b9..59ac6b0e 100644 --- a/SIF3InfraREST/README.md +++ b/SIF3InfraREST/README.md @@ -25,7 +25,7 @@ Project (note that the version number will change over time): sif3.framework sif3-infra-rest - 0.10.0 + 0.11.0 ``` @@ -147,6 +147,16 @@ Additional changes to the framework include: Please refer to the release notes in the directory "release/v0.10.0" for additional details and upgrade instructions. +## Version from May 04, 2017: v0.11.0 - Various changes +- The SIF3 Framework uses the sfl4j as its logging framework. This has changed from the fixed log4j. +- Framework infrastructure is now SIF 3.2.1. Fingerprint functionality has been added. While the framework is now SIF 3.2.1 there + is no support for functional services, yet. +- Refactor'ed approach to external security services (i.e. OAuth) to open up the framework to other security services. For details + on how to use external security please refer to section 5.10 of the Developer's Guide. + +**NOTE: There are database changes! You must read the detailed release notes in "release/v0.11.0" carefully to ensure that your +project is upgraded properly to the new framework version.** + # Download Instructions How to download this project: diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/pom.xml b/SIF3InfraREST/SIF3Demo/sif3-demo-web/pom.xml index f6737d6d..da3ddbac 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/pom.xml +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/pom.xml @@ -8,7 +8,7 @@ sif3.framework sif3-demo-web war - 0.10.0-Demo + 0.11.0-Demo SIF3 Demo Provider @@ -41,7 +41,7 @@ sif3.framework sif3-infra-rest - 0.10.0-beta + 0.11.0-beta @@ -51,7 +51,7 @@ sifau sif3-au-datamodel - 3.4 + 3.4.1 @@ -67,17 +67,28 @@ - org.slf4j - slf4j-log4j12 - 1.5.8 + org.slf4j + slf4j-api + 1.7.22 - + + + - log4j - log4j - 1.2.14 + org.slf4j + slf4j-log4j12 + 1.7.22 - + + + + diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelConsumer.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelConsumer.java index b9356266..2771cea6 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelConsumer.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelConsumer.java @@ -18,7 +18,8 @@ package systemic.sif3.demo.rest.consumer; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif.dd.au30.conversion.DataModelMarshalFactory; import sif.dd.au30.conversion.DataModelUnmarshalFactory; @@ -40,7 +41,7 @@ */ public abstract class AUDataModelConsumer extends AbstractConsumer { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static DataModelUnmarshalFactory unmarshaller = new DataModelUnmarshalFactory(); private static DataModelMarshalFactory marshaller = new DataModelMarshalFactory(); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelEventConsumer.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelEventConsumer.java index cdc6eb99..f9b370e5 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelEventConsumer.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/consumer/AUDataModelEventConsumer.java @@ -25,8 +25,10 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.DateUtils; import sif.dd.au30.conversion.DataModelMarshalFactory; import sif.dd.au30.conversion.DataModelUnmarshalFactory; import sif3.common.conversion.MarshalFactory; @@ -44,7 +46,6 @@ import sif3.common.ws.OperationStatus; import sif3.common.ws.model.MultiOperationStatusList; import sif3.infra.rest.consumer.AbstractEventConsumer; -import au.com.systemic.framework.utils.DateUtils; /** * @author Joerg Huber @@ -52,7 +53,7 @@ */ public abstract class AUDataModelEventConsumer extends AbstractEventConsumer { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static Integer busyInSec = null; private static Boolean writePayload = null; diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVMarshaller.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVMarshaller.java index 2aaff42a..18b2f703 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVMarshaller.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVMarshaller.java @@ -25,7 +25,8 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.conversion.MarshalFactory; import sif3.common.exception.MarshalException; @@ -39,7 +40,7 @@ */ public class CSVMarshaller implements MarshalFactory { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); //List of supported media types. private static final HashSet supportedMediaTypes = new HashSet(Arrays.asList(MediaType.TEXT_PLAIN_TYPE)); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVUnmarshaller.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVUnmarshaller.java index 31f9a67d..52b4c096 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVUnmarshaller.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/conversion/CSVUnmarshaller.java @@ -25,7 +25,8 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.conversion.UnmarshalFactory; import sif3.common.exception.UnmarshalException; @@ -39,7 +40,7 @@ */ public class CSVUnmarshaller implements UnmarshalFactory { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); //List of supported media types. private static final HashSet supportedMediaTypes = new HashSet(Arrays.asList(MediaType.TEXT_PLAIN_TYPE)); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProvider.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProvider.java index d7c55b97..df3b78a7 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProvider.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProvider.java @@ -18,7 +18,8 @@ package systemic.sif3.demo.rest.provider; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif.dd.au30.conversion.DataModelMarshalFactory; import sif.dd.au30.conversion.DataModelUnmarshalFactory; @@ -41,7 +42,7 @@ */ public abstract class AUDataModelProvider extends BaseProvider { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static DataModelUnmarshalFactory unmarshaller = new DataModelUnmarshalFactory(); private static DataModelMarshalFactory marshaller = new DataModelMarshalFactory(); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProviderWithEvents.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProviderWithEvents.java index b67f12d6..44179eec 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProviderWithEvents.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/rest/provider/AUDataModelProviderWithEvents.java @@ -18,7 +18,8 @@ package systemic.sif3.demo.rest.provider; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif.dd.au30.conversion.DataModelMarshalFactory; import sif.dd.au30.conversion.DataModelUnmarshalFactory; @@ -41,7 +42,7 @@ */ public abstract class AUDataModelProviderWithEvents extends BaseEventProvider { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static DataModelUnmarshalFactory unmarshaller = new DataModelUnmarshalFactory(); private static DataModelMarshalFactory marshaller = new DataModelMarshalFactory(); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/.gitignore b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/.gitignore new file mode 100644 index 00000000..f51f71a9 --- /dev/null +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/.gitignore @@ -0,0 +1 @@ +/RICOneSecurityService.java diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/BaseSecurityOperations.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/BaseSecurityOperations.java similarity index 95% rename from SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/BaseSecurityOperations.java rename to SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/BaseSecurityOperations.java index e824d13e..89d4fe4a 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/BaseSecurityOperations.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/BaseSecurityOperations.java @@ -15,7 +15,7 @@ * the License. */ -package sif3.common.test.security; +package systemic.sif3.demo.security; import java.nio.charset.Charset; import java.text.ParseException; @@ -41,7 +41,7 @@ public class BaseSecurityOperations @SuppressWarnings("unused") public static TokenInfo createToken(TokenCoreInfo coreInfo, String password) { - String iso8601Str = "2016-05-26T14:01:00Z"; + String iso8601Str = "2017-04-20T14:00:00Z"; String token = coreInfo.getAppUserInfo().getApplicationKey()+":"+iso8601Str; token = new String(Base64.encodeBase64(token.getBytes()), Charset.forName("ASCII")); TokenInfo newToken = null; diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/DummySecurityService.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/DummySecurityService.java similarity index 85% rename from SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/DummySecurityService.java rename to SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/DummySecurityService.java index 90d45825..9732005c 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/DummySecurityService.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/main/java/systemic/sif3/demo/security/DummySecurityService.java @@ -15,22 +15,25 @@ * or implied. * See the License for the specific language governing permissions and limitations under the License. */ -package sif3.common.test.security; +package systemic.sif3.demo.security; +import java.util.Map; + +import au.com.systemic.framework.utils.AdvancedProperties; import sif3.common.model.RequestMetadata; import sif3.common.model.security.TokenCoreInfo; import sif3.common.model.security.TokenInfo; import sif3.common.security.AbstractSecurityService; -import au.com.systemic.framework.utils.AdvancedProperties; public class DummySecurityService extends AbstractSecurityService { // private static final long MINUTE = 1000*60; - public DummySecurityService(AdvancedProperties properties) + public DummySecurityService(AdvancedProperties properties, Map securityServiceParameters) { - super(properties); + super(properties, securityServiceParameters); System.out.println("DummySecurityService Constructor called with property: " + getServiceProperties()); + System.out.println("DummySecurityService Constructor called with securityServiceParameters: " + getSecurityServiceParameters()); } @Override @@ -38,7 +41,7 @@ public TokenInfo getTokenInfo(String securityToken, RequestMetadata requestMetad { System.out.println("DummySecurityService.getTokenInfo() called for securityToken = "+securityToken+" and request metadata = "+requestMetadata); TokenInfo tokenInfo = BaseSecurityOperations.getTokenInfo(securityToken); - + // long expireTime = MINUTE*5; // expire every x minute. // TokenInfo tokenInfo = new TokenInfo(securityToken); // tokenInfo.setTokenExpiryDate(new Date(((new Date()).getTime()) + expireTime)); diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestConsumerLoader.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestConsumerLoader.java index 5013f824..5240ebd1 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestConsumerLoader.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestConsumerLoader.java @@ -18,6 +18,7 @@ package sif3.test.infra.rest.consumer; +import sif3.infra.common.env.mgr.ConsumerEnvironmentManager; import sif3.infra.rest.consumer.ConsumerLoader; /** @@ -28,6 +29,7 @@ public class TestConsumerLoader { // Local private static final String CONSUMER_ID = "StudentConsumer"; +// private static final String CONSUMER_ID = "RicOneConsumer"; // Broker // private static final String CONSUMER_ID = "BrokeredAttTrackerConsumer"; @@ -68,7 +70,7 @@ public static void main(String[] args) if (ConsumerLoader.initialise(CONSUMER_ID)) { - System.out.println("Consumer loaded successfully."); + System.out.println("Consumer loaded successfully. Environment Data:\n"+ConsumerEnvironmentManager.getInstance().getEnvironmentInfo()); } // Put this agent to a blocking wait..... diff --git a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestStudentPersonalConsumer.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestStudentPersonalConsumer.java index b2e9a2a3..ff182cbc 100644 --- a/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestStudentPersonalConsumer.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/consumer/TestStudentPersonalConsumer.java @@ -40,6 +40,7 @@ import sif3.common.ws.CreateOperationStatus; import sif3.common.ws.OperationStatus; import sif3.common.ws.Response; +import sif3.infra.common.env.mgr.ConsumerEnvironmentManager; import sif3.infra.rest.consumer.ConsumerLoader; import systemic.sif3.demo.rest.consumer.StudentPersonalConsumer; import au.com.systemic.framework.utils.FileReaderWriter; @@ -319,8 +320,8 @@ private void getStudents(StudentPersonalConsumer consumer, boolean printRepsonse // envZoneCtxList.add(new ZoneContextInfo((SIFZone)null, new SIFContext("secure"))); // envZoneCtxList.add(new ZoneContextInfo((SIFZone)null, CommonConstants.DEFAULT_CONTEXT)); -// List responses = consumer.retrieve(new PagingInfo(10), envZoneCtxList, RequestType.DELAYED, QueryIntention.NO_CACHE, params); - List responses = consumer.retrieve(new PagingInfo(10, 1), envZoneCtxList, RequestType.IMMEDIATE, QueryIntention.NO_CACHE, params); +// List responses = consumer.retrieve(new PagingInfo(100), envZoneCtxList, RequestType.DELAYED, QueryIntention.NO_CACHE, params); + List responses = consumer.retrieve(new PagingInfo(5, 1), envZoneCtxList, RequestType.IMMEDIATE, QueryIntention.NO_CACHE, params); // List responses = consumer.retrieve(new PagingInfo(10, 0), envZoneCtxList, REQUEST_TYPE, QueryIntention.NO_CACHE, params); // List responses = consumer.retrieve(new PagingInfo(5, 17), envZoneCtxList, REQUEST_TYPE); // List responses = consumer.retrieve(null, envZoneCtxList, REQUEST_TYPE); @@ -508,6 +509,7 @@ public static void main(String[] args) if (ConsumerLoader.initialise(CONSUMER_ID)) { + System.out.println("Consumer loaded successfully. Environment Data:\n"+ConsumerEnvironmentManager.getInstance().getEnvironmentInfo()); StudentPersonalConsumer consumer = tester.getConsumer(); diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/TestSecurityServiceFactory.java b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/security/TestSecurityServiceFactory.java similarity index 55% rename from SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/TestSecurityServiceFactory.java rename to SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/security/TestSecurityServiceFactory.java index fadbf26d..5ce41a7a 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/security/TestSecurityServiceFactory.java +++ b/SIF3InfraREST/SIF3Demo/sif3-demo-web/src/test/java/sif3/test/infra/rest/security/TestSecurityServiceFactory.java @@ -13,15 +13,18 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. */ -package sif3.common.test.security; +package sif3.test.infra.rest.security; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.PropertyManager; +import sif3.common.CommonConstants.AdapterType; import sif3.common.model.EnvironmentKey; import sif3.common.model.security.TokenCoreInfo; import sif3.common.model.security.TokenInfo; +import sif3.common.persist.common.HibernateUtil; +import sif3.common.persist.model.ExternalSecurityService; import sif3.common.security.AbstractSecurityService; -import sif3.common.security.BearerSecurityFactory; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.PropertyManager; +import sif3.common.security.SecurityServiceFactory; public class TestSecurityServiceFactory { @@ -34,6 +37,7 @@ public class TestSecurityServiceFactory public TestSecurityServiceFactory() { + HibernateUtil.initialise(null); PropertyManager propMgr = PropertyManager.getInstance(); String propFileName = IS_PROVDER ? PROV_PROP_FILE_NAME : CONS_PROP_FILE_NAME; propMgr.loadPropertyFile(propFileName); @@ -43,26 +47,34 @@ public TestSecurityServiceFactory() public void testGetInstance() { - AbstractSecurityService service = BearerSecurityFactory.getSecurityService(properties); - if (service != null) + ExternalSecurityService extService = SecurityServiceFactory.getSecurityService("BeareR", AdapterType.CONSUMER); + if (extService != null) { - if (IS_PROVDER) + AbstractSecurityService abstractService = extService.getSecurityService(properties); + if (abstractService != null) { - TokenInfo tokenInfo = service.getInfo("VGVzdFNJUzoyMDE1LTA3LTE0VDE1OjE5OjAxWg==", null); - System.out.println(tokenInfo); + if (IS_PROVDER) + { + TokenInfo tokenInfo = abstractService.getInfo("VGVzdFNJUzoyMDE1LTA3LTE0VDE1OjE5OjAxWg==", null); + System.out.println(tokenInfo); + } + else + { + TokenCoreInfo coreInfo = new TokenCoreInfo(); + coreInfo.setAppUserInfo(new EnvironmentKey(null, properties.getPropertyAsString("env.application.key", null))); + // TokenInfo tokenInfo = service.generateToken(coreInfo, properties.getPropertyAsString("env.pwd", null)); + TokenInfo tokenInfo = abstractService.createToken(coreInfo, properties.getPropertyAsString("env.pwd", null)); + System.out.println(tokenInfo); + } } else { - TokenCoreInfo coreInfo = new TokenCoreInfo(); - coreInfo.setAppUserInfo(new EnvironmentKey(null, properties.getPropertyAsString("env.application.key", null))); -// TokenInfo tokenInfo = service.generateToken(coreInfo, properties.getPropertyAsString("env.pwd", null)); - TokenInfo tokenInfo = service.createToken(coreInfo, properties.getPropertyAsString("env.pwd", null)); - System.out.println(tokenInfo); + System.out.println("Returned Security Service Implementation is null."); } } else { - System.out.println("Returned Security Service is null."); + System.out.println("Returned Security Service from Factory is null."); } } diff --git a/SIF3InfraREST/SIF3REST/pom.xml b/SIF3InfraREST/SIF3REST/pom.xml index 5e68d3a5..8c9f3757 100644 --- a/SIF3InfraREST/SIF3REST/pom.xml +++ b/SIF3InfraREST/SIF3REST/pom.xml @@ -7,7 +7,7 @@ sif3.framework sif3-framework - 0.10.0-beta + 0.11.0-beta @@ -55,11 +55,16 @@ - + - log4j - log4j + org.slf4j + slf4j-api + + + + org.slf4j + slf4j-log4j12 diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/BaseClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/BaseClient.java index a89617c6..c732afbd 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/BaseClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/BaseClient.java @@ -28,8 +28,18 @@ import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriBuilder; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.WebResource.Builder; +import com.sun.jersey.api.client.config.ClientConfig; + +import au.com.systemic.framework.utils.DateUtils; +import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.conversion.MarshalFactory; import sif3.common.conversion.UnmarshalFactory; import sif3.common.exception.UnmarshalException; @@ -41,16 +51,16 @@ import sif3.common.header.RequestHeaderConstants; import sif3.common.header.ResponseHeaderConstants; import sif3.common.model.AuthenticationInfo; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.model.SIFContext; import sif3.common.model.SIFZone; import sif3.common.model.URLQueryParameter; import sif3.common.model.delayed.DelayedRequestReceipt; import sif3.common.model.security.TokenCoreInfo; import sif3.common.model.security.TokenInfo; +import sif3.common.persist.model.ExternalSecurityService; import sif3.common.persist.model.SIF3Session; import sif3.common.security.AbstractSecurityService; -import sif3.common.security.BearerSecurityFactory; +import sif3.common.security.SecurityServiceFactory; import sif3.common.utils.UUIDGenerator; import sif3.common.ws.BaseResponse; import sif3.common.ws.ErrorDetails; @@ -62,14 +72,6 @@ import sif3.infra.common.model.ErrorType; import sif3.infra.common.model.ObjectFactory; import sif3.infra.rest.mapper.InfraDataModelMapper; -import au.com.systemic.framework.utils.DateUtils; -import au.com.systemic.framework.utils.StringUtils; - -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.WebResource.Builder; -import com.sun.jersey.api.client.config.ClientConfig; /** * This class is a core client class to deal with REST clients for SIF3. It takes care of all the little things that define the @@ -87,7 +89,7 @@ */ public abstract class BaseClient { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private URI baseURI = null; private ClientConfig config = null; @@ -361,12 +363,16 @@ protected WebResource buildURI(WebResource svc, String relURI) * @param hdrProperties A set of defined header properties. Should really hold the authentication related properties! * @param requestType The request type to be set in the HTTP headers. * @param includeRequestID TRUE: Add a generated request ID header property + * @param includeFingerprint TRUE: Fingerprint will be retrieved from current session. Note for a provider this will be + * the provider's fingerprint! This is generally not desired for events. In this case + * this parameter should be set to FALSE. + * FALSE: Fingerprint from the current session will not be added to the HTTP headers. * @hasPayload TRUE: The request will contain a payload. Required for compression header settings * FALSE: The request is payload free. * * @return A builder class on which a HTTP operation can be invoked on. */ - protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderProperties hdrProperties, RequestType requestType, boolean includeRequestID, boolean hasPayload) + protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderProperties hdrProperties, RequestType requestType, boolean includeRequestID, boolean includeFingerprint, boolean hasPayload) { String charEncoding = getClientEnvMgr().getEnvironmentInfo().getCharsetEncoding(); Builder builder = service.type(addEncoding(getRequestMediaType(), charEncoding)).accept(addEncoding(getResponseMediaType(), charEncoding)); @@ -384,6 +390,19 @@ protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderPrope // Set the request type. hdrProperties.setHeaderProperty(RequestHeaderConstants.HDR_REQUEST_TYPE, ((requestType == null) ? RequestType.IMMEDIATE.name() : requestType.name())); + // Add fingerprint to HTTP Header if it is known and not yet set. Note for events this value might already be set, so we + // should not override it! This should be indicated with the includeFingerprint parameter that would be set to false! + if (includeFingerprint) + { + if (hdrProperties.getHeaderProperty(RequestHeaderConstants.HDR_FINGERPRINT) == null) + { + if ((getClientEnvMgr().getSIF3Session() != null) && (getClientEnvMgr().getSIF3Session().getFingerprint() != null)) + { + hdrProperties.setHeaderProperty(RequestHeaderConstants.HDR_FINGERPRINT, getClientEnvMgr().getSIF3Session().getFingerprint()); + } + } + } + // Sometimes the request ID is not required (i.e. events) if (includeRequestID) { @@ -439,14 +458,18 @@ protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderPrope * @param service The service to which media type and header properties shall be added. * @param hdrProperties A set of defined header properties. Should really hold the authentication related properties! * @param includeRequestID TRUE: Add a generated request ID header property + * @param includeFingerprint TRUE: Fingerprint will be retrieved from current session. Note for a provider this will be + * the provider's fingerprint! This is generally not desired for events. In this case + * this parameter should be set to FALSE. + * FALSE: Fingerprint from the current session will not be added to the HTTP headers. * @hasPayload TRUE: The request will contain a payload. Required for compression header settings * FALSE: The request is payload free. * * @return A builder class on which a HTTP operation can be invoked on. */ - protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderProperties hdrProperties, boolean includeRequestID, boolean hasPayload) + protected Builder setRequestHeaderAndMediaTypes(WebResource service, HeaderProperties hdrProperties, boolean includeRequestID, boolean includeFingerprint, boolean hasPayload) { - return setRequestHeaderAndMediaTypes(service, hdrProperties, RequestType.IMMEDIATE, includeRequestID, hasPayload); + return setRequestHeaderAndMediaTypes(service, hdrProperties, RequestType.IMMEDIATE, includeRequestID, includeFingerprint, hasPayload); } protected HeaderProperties createAuthenticationHdr(boolean isEnvCreate, SIF3Session pseudoSIF3Session) @@ -456,7 +479,7 @@ protected HeaderProperties createAuthenticationHdr(boolean isEnvCreate, SIF3Sess if (authInfo != null) // all good { // First create the properties for the authentication header. - ClientUtils.setAuthenticationHeader(hdrProps, authInfo.getAuthMethod(), authInfo.getUserToken(), authInfo.getPassword()); + ClientUtils.setAuthenticationHeader(hdrProps, authInfo.getSecurityServiceInfo(), authInfo.getUserToken(), authInfo.getPassword()); } return hdrProps; @@ -751,7 +774,6 @@ private MediaType addEncoding(MediaType mediaType, String charEncoding) * If anything fails then null is returned. An error will already be logged. */ private AuthenticationInfo getAuthenicationInfo(boolean isEnvCreateRequest, SIF3Session pseudoSIF3Session) -// private AuthenticationInfo getAuthenicationInfo(boolean isEnvCreateRequest, TokenInfo tokenInfo) { EnvironmentInfo envInfo = getClientEnvMgr().getEnvironmentInfo(); String pwd = envInfo.getPassword(); @@ -763,7 +785,7 @@ private AuthenticationInfo getAuthenicationInfo(boolean isEnvCreateRequest, SIF3 } else { - // it is not a createEnv request but if we may have a pseudoSIF3Session then it should have a sessionToken populated + // it is not a createEnv request but if we may have a pseudoSIF3Session then it should have a sessionToken populated if (pseudoSIF3Session == null) // we must have a session { user = getSIF3Session().getSessionToken(); @@ -775,20 +797,28 @@ private AuthenticationInfo getAuthenicationInfo(boolean isEnvCreateRequest, SIF3 } AuthenticationInfo authInfo = null; - if (envInfo.getAuthMethod() != AuthenticationMethod.Bearer) - { - authInfo = new AuthenticationInfo(envInfo.getAuthMethod(), user, pwd); - } - else // Use Bearer Authentication => potentially requires external security service. - { - TokenInfo tokenInfo = null; - if (pseudoSIF3Session != null) // we don't have a real session. Use pseudoSIF3Session and extract token info from there. - { - tokenInfo = new TokenInfo(pseudoSIF3Session.getSecurityToken(), pseudoSIF3Session.getSecurityTokenExpiry()); - } - authInfo = getBearerAuthorisationInfo(isEnvCreateRequest, tokenInfo); - } - + ExternalSecurityService securityService = SecurityServiceFactory.getSecurityService(envInfo.getAuthMethod(), envInfo.getAdapterType()); + if (securityService != null) + { + if (securityService.getAuthenticationType() != AuthenticationType.Other) + { + authInfo = new AuthenticationInfo(securityService, user, pwd); + } + else // Use Bearer Authentication => potentially requires external security service. + { + TokenInfo tokenInfo = null; + if (pseudoSIF3Session != null) // we don't have a real session. Use pseudoSIF3Session and extract token info from there. + { + tokenInfo = new TokenInfo(pseudoSIF3Session.getSecurityToken(), pseudoSIF3Session.getSecurityTokenExpiry()); + } + authInfo = getExternalAuthorisationInfo(isEnvCreateRequest, tokenInfo, securityService); + } + } + else + { + logger.error("Cannot determine Authentication Serice to use. See previous error log entries."); + } + return authInfo; } @@ -806,7 +836,7 @@ private AuthenticationInfo getAuthenicationInfo(boolean isEnvCreateRequest, SIF3 * * If anything fails then null is returned and an error is logged. */ - private AuthenticationInfo getBearerAuthorisationInfo(boolean isEnvCreateRequest, TokenInfo tokenInfo) + private AuthenticationInfo getExternalAuthorisationInfo(boolean isEnvCreateRequest, TokenInfo tokenInfo, ExternalSecurityService securityService) { boolean retrieveToken = false; if (!isEnvCreateRequest) // we should have a SIF3 Session @@ -844,8 +874,8 @@ private AuthenticationInfo getBearerAuthorisationInfo(boolean isEnvCreateRequest EnvironmentInfo envInfo = getClientEnvMgr().getEnvironmentInfo(); if (retrieveToken) // We must get a token from that service { - AbstractSecurityService securityService = BearerSecurityFactory.getSecurityService(getClientEnvMgr().getServiceProperties()); - if (securityService != null) + AbstractSecurityService abstractSecurityService = securityService.getSecurityService(getClientEnvMgr().getServiceProperties()); + if (abstractSecurityService != null) { TokenCoreInfo coreInfo = new TokenCoreInfo(); if (isEnvCreateRequest) @@ -862,10 +892,10 @@ private AuthenticationInfo getBearerAuthorisationInfo(boolean isEnvCreateRequest } // Now call the security service and if successful update appropriate data - TokenInfo newTokenInfo = securityService.createToken(coreInfo, envInfo.getPassword()); + TokenInfo newTokenInfo = abstractSecurityService.createToken(coreInfo, envInfo.getPassword()); if ((newTokenInfo != null) && StringUtils.notEmpty(newTokenInfo.getToken())) // we just got a valid token => save it in the sif3Session { - AuthenticationInfo authInfo = new AuthenticationInfo(envInfo.getAuthMethod(), newTokenInfo.getToken(), envInfo.getPassword(), newTokenInfo.getTokenExpiryDate()); + AuthenticationInfo authInfo = new AuthenticationInfo(securityService, newTokenInfo.getToken(), envInfo.getPassword(), newTokenInfo.getTokenExpiryDate()); if (!isEnvCreateRequest) // not initial request => Update session! { getSIF3Session().setSecurityToken(newTokenInfo.getToken()); @@ -896,11 +926,11 @@ private AuthenticationInfo getBearerAuthorisationInfo(boolean isEnvCreateRequest { if (tokenInfo != null) { - return new AuthenticationInfo(envInfo.getAuthMethod(), tokenInfo.getToken(), envInfo.getPassword(), tokenInfo.getTokenExpiryDate()); + return new AuthenticationInfo(securityService, tokenInfo.getToken(), envInfo.getPassword(), tokenInfo.getTokenExpiryDate()); } else // we get it from the session. { - return new AuthenticationInfo(envInfo.getAuthMethod(), getSIF3Session().getSecurityToken(), envInfo.getPassword(), getSIF3Session().getSecurityTokenExpiry()); + return new AuthenticationInfo(securityService, getSIF3Session().getSecurityToken(), envInfo.getPassword(), getSIF3Session().getSecurityTokenExpiry()); } } } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientConfigMgr.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientConfigMgr.java index 2c3ff20e..d8b3d13a 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientConfigMgr.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientConfigMgr.java @@ -24,16 +24,8 @@ import javax.net.ssl.SSLSession; import javax.net.ssl.TrustManager; -import org.apache.log4j.Logger; - -import sif3.common.CommonConstants; -import sif3.common.security.X509KeystoreManager; -import sif3.common.security.X509TrustedStoreManager; -import sif3.common.security.X509TrustedStoreManagerNoCheck; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.PropertyManager; -import au.com.systemic.framework.utils.StringUtils; -import au.com.systemic.framework.utils.Timer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; //TODO: JH - Here we do have some jersey specific classes => Investigate how to replace them with generic classes! //Note: These are "client" classes only and the only jar that might be required could be jersey-client-1.17.1.jar which @@ -42,6 +34,15 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.client.urlconnection.HTTPSProperties; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.PropertyManager; +import au.com.systemic.framework.utils.StringUtils; +import au.com.systemic.framework.utils.Timer; +import sif3.common.CommonConstants; +import sif3.common.security.X509KeystoreManager; +import sif3.common.security.X509TrustedStoreManager; +import sif3.common.security.X509TrustedStoreManagerNoCheck; + /** * There are many places where client contexts are required for REST service invocation. The client context can either be a secure * connection (HTTPS/SSL) or unsecured (HTTP) and in future may even include client certificate exchanges etc. This class is a helper @@ -54,7 +55,7 @@ */ public class ClientConfigMgr { - private final Logger logger = Logger.getLogger(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); private static AdvancedProperties props = null; private static String keystoreName = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientUtils.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientUtils.java index a8959ea0..778e4a95 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientUtils.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ClientUtils.java @@ -18,11 +18,11 @@ package sif3.infra.rest.client; +import au.com.systemic.framework.utils.DateUtils; import sif3.common.header.HeaderProperties; import sif3.common.header.RequestHeaderConstants; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; +import sif3.common.model.security.SecurityServiceInfo; import sif3.common.utils.AuthenticationUtils; -import au.com.systemic.framework.utils.DateUtils; /** * @author Joerg Huber @@ -35,13 +35,13 @@ public class ClientUtils * * @param hdrProps A not null TransportHeaderProperties object where authentication properties will be added to. If some authentication * related properties should already exist then they will be over overwritten. - * @param authenticationMethod The authentication method to set in the header properties. + * @param serviceInfo The security service to use to create the correct HTTP Header notation. * @param username Username to use to generate the authentication token for the header properties. * @param password Password to use to generate the authentication token for the header properties. */ - public static synchronized void setAuthenticationHeader(HeaderProperties hdrProps, AuthenticationMethod authenticationMethod, String username, String password) + public static synchronized void setAuthenticationHeader(HeaderProperties hdrProps, SecurityServiceInfo serviceInfo, String username, String password) { - switch (authenticationMethod) + switch (serviceInfo.getAuthenticationType()) { case Basic: { @@ -55,23 +55,11 @@ public static synchronized void setAuthenticationHeader(HeaderProperties hdrProp hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_DATE_TIME, iso8601Date); break; } - case Bearer: + case Other: { - hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_AUTH_TOKEN, AuthenticationUtils.getBearerAuthToken(username, password)); + hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_AUTH_TOKEN, AuthenticationUtils.getOtherAuthToken(serviceInfo, username, password)); break; } } - -// if (authenticationMethod == AuthenticationMethod.Basic) -// { -// hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_AUTH_TOKEN, AuthenticationUtils.getBasicAuthToken(username, password)); -// } -// else if (authenticationMethod == AuthenticationMethod.SIF_HMACSHA256) -// { -// String iso8601Date = DateUtils.nowAsISO8601withSecFraction(); -// hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_AUTH_TOKEN, AuthenticationUtils.getSIFHMACSHA256Token(username, password, iso8601Date)); -// hdrProps.setHeaderProperty(RequestHeaderConstants.HDR_DATE_TIME, iso8601Date); -// } - } } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EnvironmentClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EnvironmentClient.java index 104d6342..1862d59e 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EnvironmentClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EnvironmentClient.java @@ -96,7 +96,7 @@ public Response createEnvironment(EnvironmentType template, TokenInfo tokenInfo) pseudoSIF3Session.setSecurityTokenExpiry(tokenInfo.getTokenExpiryDate()); } HeaderProperties requestHdrProps = createAuthenticationHdr(true, pseudoSIF3Session); - ClientResponse response = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, true).post(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, true, true).post(ClientResponse.class, payloadStr); if (envInfo.getEnvCreateConflictIsError()) { @@ -137,7 +137,7 @@ public Response getEnvironment(SIF3Session pseudoSIF3Session) throws ServiceInvo // Since we have a pseudo session we must check if there is a need to pass along a TokenInfo. Only needed if // Authentication method is 'Bearer' which also means that the security token should be set in the pseudo session! HeaderProperties requestHdrProps = createAuthenticationHdr(false, pseudoSIF3Session); - ClientResponse response = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, false).get(ClientResponse.class); + ClientResponse response = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, true, false).get(ClientResponse.class); return setResponse(service, response, EnvironmentType.class, requestHdrProps, null, null, false, Status.OK, Status.NOT_MODIFIED); } @@ -164,7 +164,7 @@ public boolean removeEnvironment() { service = buildURI(service, null); HeaderProperties requestHdrProps = createAuthenticationHdr(false, null); - ClientResponse remoteResponse = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, false).delete(ClientResponse.class); + ClientResponse remoteResponse = setRequestHeaderAndMediaTypes(service, requestHdrProps, true, true, false).delete(ClientResponse.class); Response response = setResponse(service, remoteResponse, null, requestHdrProps, null, null, false, Status.NO_CONTENT); if (response.hasError()) diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EventClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EventClient.java index 8689bcb2..24c4540a 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EventClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/EventClient.java @@ -148,9 +148,9 @@ public BaseResponse sendEvents(SIFEvent event, SIFZone zone, SIFContext conte // { // logger.debug("sendEvents: Payload to send:\n"+payloadStr); // } - HeaderProperties headerProps = getEventHeaders(event.getEventAction(), event.getUpdateType(), zone, context, customHdrFields); + HeaderProperties headerProps = getEventHeaders(event.getEventAction(), event.getUpdateType(), event.getFingerprint(), zone, context, customHdrFields); - Builder builder = setRequestHeaderAndMediaTypes(service, headerProps, false, true); + Builder builder = setRequestHeaderAndMediaTypes(service, headerProps, false, false, true); logger.debug("Send Event with payload size: "+payloadStr.length()); ClientResponse response = builder.post(ClientResponse.class, payloadStr); logger.debug("Receive Event Response Status: "+response.getStatus()); @@ -186,7 +186,7 @@ private ProviderEnvironment getProviderEnvironment() * @param context The context for this event. Can be null. * @return */ - private HeaderProperties getEventHeaders(EventAction eventAction, UpdateType updateType, SIFZone zone, SIFContext context, HeaderProperties overrideHdrFields) + private HeaderProperties getEventHeaders(EventAction eventAction, UpdateType updateType, String fingerprint, SIFZone zone, SIFContext context, HeaderProperties overrideHdrFields) { // Set the override header fields HeaderProperties hdrProperties = (overrideHdrFields != null) ? new HeaderProperties(overrideHdrFields.getHeaderProperties()) : new HeaderProperties(); @@ -212,6 +212,11 @@ private HeaderProperties getEventHeaders(EventAction eventAction, UpdateType upd } } + if (StringUtils.notEmpty(fingerprint)) + { + hdrProperties.setHeaderProperty(RequestHeaderConstants.HDR_FINGERPRINT, fingerprint); + } + if ((zone == null) || (zone.getIsDefault()) || StringUtils.isEmpty(zone.getId())) // Assume default zone! { hdrProperties.setHeaderProperty(RequestHeaderConstants.HDR_ZONE_ID, getSIF3Session().getDefaultZone().getId()); diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/MessageClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/MessageClient.java index e10e9160..fa70363b 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/MessageClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/MessageClient.java @@ -60,7 +60,7 @@ public Response getMessage(String removeMsgID, int consumerInstanceID) throws Se service = buildMessageURI(service, removeMsgID, true); HeaderProperties hdrProperties = getHeaderProperties(consumerInstanceID); logger.debug("HTTP GET Next Message..."); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); logger.debug("HTTP GET Next Message received."); //OK: Message Returned, NO_CONTENT: No message on queue: Both are valid returns @@ -85,7 +85,7 @@ public Response removeMessage(String removeMsgID, int consumerInstanceID) throws { service = buildMessageURI(service, removeMsgID, false); HeaderProperties hdrProperties = getHeaderProperties(consumerInstanceID); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).delete(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).delete(ClientResponse.class); return setResponse(service, clientResponse, null, hdrProperties, null, null, false, Status.NO_CONTENT); } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ObjectServiceClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ObjectServiceClient.java index ec95e024..e34e0197 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ObjectServiceClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/ObjectServiceClient.java @@ -129,7 +129,7 @@ public Response getSingle(String relURI, String resourceID, HeaderProperties hdr { service = buildURI(service, relURI, resourceID, zone, context, urlQueryParams); hdrProperties = addAuthenticationHdrProps(hdrProperties); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); return setResponse(service, response, returnObjectClass, hdrProperties, zone, context, true, Status.OK, Status.NOT_MODIFIED); } @@ -177,7 +177,7 @@ public Response createSingle(String relURI, Object payload, HeaderProperties hdr } hdrProperties = addAuthenticationHdrProps(hdrProperties); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true).post(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, true).post(ClientResponse.class, payloadStr); return setResponse(service, response, returnObjectClass, hdrProperties, zone, context, true, Status.CREATED, Status.CONFLICT); } @@ -225,7 +225,7 @@ public Response updateSingle(String relURI, String resourceID, Object payload, H } hdrProperties = addAuthenticationHdrProps(hdrProperties); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true).put(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, true).put(ClientResponse.class, payloadStr); return setResponse(service, response, null, hdrProperties, zone, context, true, Status.NO_CONTENT); } @@ -264,7 +264,7 @@ public Response removeSingle(String relURI, String resourceID, HeaderProperties service = buildURI(service, relURI, resourceID, zone, context, urlQueryParams); hdrProperties = addAuthenticationHdrProps(hdrProperties); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).delete(ClientResponse.class); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).delete(ClientResponse.class); return setResponse(service, response, null, hdrProperties, zone, context, true, Status.NO_CONTENT); } @@ -310,7 +310,7 @@ public Response getMany(String relURI, String serviceName, ServiceType serviceTy addPagingInfoToHeaders(pagingInfo, hdrProperties); addDelayedInfo(hdrProperties, zone, context, serviceName, serviceType, requestType); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, false).get(ClientResponse.class); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true, false).get(ClientResponse.class); return setResponse(service, response, returnObjectClass, hdrProperties, zone, context, requestType, true, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT, Status.ACCEPTED); } @@ -365,7 +365,7 @@ public Response getByQBE(String relURI, String serviceName, Object exampleObject logger.debug("getByQBE: Payload to send:\n"+payloadStr); } - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true).post(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true, true).post(ClientResponse.class, payloadStr); return setResponse(service, response, returnObjectClass, hdrProperties, zone, context, requestType, true, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT, Status.ACCEPTED); } @@ -414,7 +414,7 @@ public BulkOperationResponse createMany(String relURI, St hdrProperties = addAuthenticationHdrProps(hdrProperties); addDelayedInfo(hdrProperties, zone, context, serviceName, ServiceType.OBJECT, requestType); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true).post(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true, true).post(ClientResponse.class, payloadStr); return setCreateBulkResponse(service, response, zone, context, requestType, hdrProperties); } @@ -467,7 +467,7 @@ public BulkOperationResponse updateMany(String relURI, String s // Set specific header so that PUT method knows that an UPDATE and not a DELETE is required! hdrProperties.setHeaderProperty(RequestHeaderConstants.HDR_METHOD_OVERRIDE, HeaderValues.MethodType.UPDATE.name()); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true).put(ClientResponse.class, payloadStr); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true, true).put(ClientResponse.class, payloadStr); return setUpdateBulkResponse(service, response, zone, context, requestType, hdrProperties); } @@ -536,7 +536,7 @@ public BulkOperationResponse removeMany(String relURI, String s { logger.debug("removeMany: Payload to send:\n"+payloadStr); } - ClientResponse cltResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true).put(ClientResponse.class, payloadStr); + ClientResponse cltResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, requestType, true, true, true).put(ClientResponse.class, payloadStr); return setDeleteBulkResponse(service, cltResponse, zone, context, requestType, hdrProperties); } @@ -579,7 +579,7 @@ public Response getServiceInfo(String relURI, String serviceName, PagingInfo pag hdrProperties = addAuthenticationHdrProps(hdrProperties); addPagingInfoToHeaders(pagingInfo, hdrProperties); - ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, RequestType.IMMEDIATE, true, false).head(); + ClientResponse response = setRequestHeaderAndMediaTypes(service, hdrProperties, RequestType.IMMEDIATE, true, true, false).head(); return setResponse(service, response, null, hdrProperties, zone, context, RequestType.IMMEDIATE, true, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT, Status.ACCEPTED); } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/QueueClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/QueueClient.java index d678e272..cef7935a 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/QueueClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/QueueClient.java @@ -54,7 +54,7 @@ public Response getQueues() throws ServiceInvokationException { service = buildURI(service, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); return setResponse(service, clientResponse, QueueCollectionType.class, hdrProperties, null, null, false, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT); } @@ -73,7 +73,7 @@ public Response getQueue(String queueID) throws ServiceInvokationException { service = buildURI(service, null, queueID, null, null, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); return setResponse(service, clientResponse, QueueType.class, hdrProperties, null, null, false, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT); } @@ -148,7 +148,7 @@ public Response removeQueue(String queueID) throws ServiceInvokationException { service = buildURI(service, null, queueID, null, null, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).delete(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).delete(ClientResponse.class); return setResponse(service, clientResponse, null, hdrProperties, null, null, false, Status.NO_CONTENT); } @@ -201,7 +201,7 @@ private Response createQueue(String queueName, QueuePollingType pollingType, int { logger.debug("createQueue: Payload to send:\n"+payloadStr); } - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true).post(ClientResponse.class, payloadStr); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, true).post(ClientResponse.class, payloadStr); return setResponse(service, clientResponse, QueueType.class, hdrProperties, null, null, false, Status.CREATED, Status.CONFLICT); } catch (Exception ex) diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/SubscriptionClient.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/SubscriptionClient.java index 8b028854..7a0ab012 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/SubscriptionClient.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/client/SubscriptionClient.java @@ -55,7 +55,7 @@ public Response getSubscriptions() throws ServiceInvokationException { service = buildURI(service, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); return setResponse(service, clientResponse, SubscriptionCollectionType.class, hdrProperties, null, null, false, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT); } @@ -74,7 +74,7 @@ public Response getSubscription(String subscriptionID) throws ServiceInvokationE { service = buildURI(service, null, subscriptionID, null, null, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).get(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).get(ClientResponse.class); return setResponse(service, clientResponse, SubscriptionType.class, hdrProperties, null, null, false, Status.OK, Status.NOT_MODIFIED, Status.NO_CONTENT); } @@ -135,7 +135,7 @@ public Response subscribe(SubscriptionType subscriptionInfo) throws ServiceInvok { logger.debug("subscribe: Payload to send:\n"+payloadStr); } - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true).post(ClientResponse.class, payloadStr); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, true).post(ClientResponse.class, payloadStr); return setResponse(service, clientResponse, SubscriptionType.class, hdrProperties, null, null, false, Status.CREATED, Status.CONFLICT); } catch (Exception ex) @@ -164,7 +164,7 @@ public Response unsubscribe(String subscriptionID) throws ServiceInvokationExcep { service = buildURI(service, null, subscriptionID, null, null, null); HeaderProperties hdrProperties = getHeaderProperties(); - ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, false).delete(ClientResponse.class); + ClientResponse clientResponse = setRequestHeaderAndMediaTypes(service, hdrProperties, true, true, false).delete(ClientResponse.class); return setResponse(service, clientResponse, null, hdrProperties, null, null, false, Status.NO_CONTENT); } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/AbstractConsumer.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/AbstractConsumer.java index d4c70831..dcc1c6fb 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/AbstractConsumer.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/AbstractConsumer.java @@ -24,8 +24,12 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response.Status; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; +import au.com.systemic.framework.utils.Timer; import sif3.common.exception.PersistenceException; import sif3.common.exception.ServiceInvokationException; import sif3.common.exception.UnsupportedQueryException; @@ -65,9 +69,6 @@ import sif3.infra.rest.client.ObjectServiceClient; import sif3.infra.rest.queue.LocalConsumerQueue; import sif3.infra.rest.queue.LocalMessageConsumer; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; -import au.com.systemic.framework.utils.Timer; /** * This is the core class that a developer will use to implement their consumers. Each consumer for each object type MUST extend this @@ -84,7 +85,7 @@ */ public abstract class AbstractConsumer implements Consumer, DelayedConsumer, QueryConsumer { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* Below variables are for testing purposes only */ private static Boolean testMode = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/ConsumerLoader.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/ConsumerLoader.java index 8449cde3..9297eafe 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/ConsumerLoader.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/consumer/ConsumerLoader.java @@ -22,8 +22,11 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.interfaces.HibernateProperties; import sif3.common.model.ServiceInfo; @@ -39,8 +42,6 @@ import sif3.infra.rest.queue.connectors.ConsumerSubscriptionConnector; import sif3.infra.rest.queue.types.LocalQueueServiceInfo; import sif3.infra.rest.queue.types.QueueInfo; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; /** * This is the initialise/finalise class that must be called at startup or shutdown of any consumer adapter/service. The methods in here @@ -59,7 +60,7 @@ */ public class ConsumerLoader { - protected static final Logger logger = Logger.getLogger(ConsumerLoader.class); + protected final static Logger logger = LoggerFactory.getLogger(ConsumerLoader.class); private static ConsumerLoader instance = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/BrokeredProviderEnvironmentConnector.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/BrokeredProviderEnvironmentConnector.java index 979e7d8d..e2f0d668 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/BrokeredProviderEnvironmentConnector.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/BrokeredProviderEnvironmentConnector.java @@ -18,7 +18,8 @@ package sif3.infra.rest.env.connectors; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.infra.common.env.mgr.BrokeredProviderEnvironmentManager; import sif3.infra.common.env.types.ProviderEnvironment; @@ -33,7 +34,7 @@ */ public class BrokeredProviderEnvironmentConnector extends EnvironmentClientConnector implements EnvironmentConnector { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); public BrokeredProviderEnvironmentConnector(BrokeredProviderEnvironmentManager environmentManager) { diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/DirectProviderEnvironmentConnector.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/DirectProviderEnvironmentConnector.java index b6b052b7..20ad3078 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/DirectProviderEnvironmentConnector.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/DirectProviderEnvironmentConnector.java @@ -19,7 +19,8 @@ package sif3.infra.rest.env.connectors; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.infra.common.env.mgr.DirectProviderEnvironmentManager; import sif3.infra.common.interfaces.EnvironmentConnector; @@ -30,7 +31,7 @@ */ public class DirectProviderEnvironmentConnector implements EnvironmentConnector { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); public DirectProviderEnvironmentConnector(DirectProviderEnvironmentManager environmentManager) { diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentClientConnector.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentClientConnector.java index 8605d470..4cdec321 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentClientConnector.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentClientConnector.java @@ -17,22 +17,24 @@ */ package sif3.infra.rest.env.connectors; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.exception.ServiceInvokationException; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.model.security.TokenCoreInfo; import sif3.common.model.security.TokenInfo; +import sif3.common.persist.model.ExternalSecurityService; import sif3.common.persist.model.SIF3Session; import sif3.common.security.AbstractSecurityService; -import sif3.common.security.BearerSecurityFactory; +import sif3.common.security.SecurityServiceFactory; import sif3.common.ws.Response; import sif3.infra.common.env.types.ConsumerEnvironment.ConnectorName; import sif3.infra.common.env.types.EnvironmentInfo; import sif3.infra.common.interfaces.ClientEnvironmentManager; import sif3.infra.common.model.EnvironmentType; import sif3.infra.rest.client.EnvironmentClient; -import au.com.systemic.framework.utils.StringUtils; /** * This class provides a set of methods that are required by a "client connector" style service. This includes a consumer but also a @@ -44,7 +46,7 @@ */ public class EnvironmentClientConnector { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private ClientEnvironmentManager envMgr = null; @@ -151,26 +153,36 @@ protected boolean connect(EnvironmentInfo envInfo) // Also since we connect to exiting or may need to create a new environment we may need to use an // external security service. There is no existing session at the moment so we cannot retrieve the info from there. TokenInfo tokenInfo = null; - if (envInfo.getAuthMethod() == AuthenticationMethod.Bearer) + ExternalSecurityService securityService = SecurityServiceFactory.getSecurityService(envInfo.getAuthMethod(), envInfo.getAdapterType()); + if (securityService != null) { - AbstractSecurityService securityService = BearerSecurityFactory.getSecurityService(getEnvironmentManager().getServiceProperties()); - if (securityService != null) + if (securityService.getAuthenticationType() == AuthenticationType.Other) { - TokenCoreInfo coreInfo = new TokenCoreInfo(); - coreInfo.setAppUserInfo(envInfo.getEnvironmentKey()); - coreInfo.setConsumerName(envInfo.getAdapterName()); - coreInfo.setSessionToken(envInfo.getUseExistingEnv() ? envInfo.getExistingSessionToken() : null); - - // Now call the security service - tokenInfo = securityService.createToken(coreInfo, envInfo.getPassword()); - if ((tokenInfo == null) || StringUtils.isEmpty(tokenInfo.getToken())) // we failed to get a token! + AbstractSecurityService abstractService = securityService.getSecurityService(getEnvironmentManager().getServiceProperties()); + if (abstractService != null) { - logger.error("Failed to retrieve a security token. See previous error log entries."); - return false; - } - } + TokenCoreInfo coreInfo = new TokenCoreInfo(); + coreInfo.setAppUserInfo(envInfo.getEnvironmentKey()); + coreInfo.setConsumerName(envInfo.getAdapterName()); + coreInfo.setSessionToken(envInfo.getUseExistingEnv() ? envInfo.getExistingSessionToken() : null); + + // Now call the security service + tokenInfo = abstractService.createToken(coreInfo, envInfo.getPassword()); + if ((tokenInfo == null) || StringUtils.isEmpty(tokenInfo.getToken())) // we failed to get a token! + { + logger.error("Failed to retrieve a security token. See previous error log entries."); + return false; + } + } + } + } + else + { + // Error already logged. + disconnect(); + return false; } - + if (envInfo.getUseExistingEnv()) { logger.debug("No Environment for " + envInfo.getEnvironmentName() + " exists. Attempt to connect to existing environment without creating it (use pre-existing) ..."); @@ -211,7 +223,7 @@ protected boolean connect(EnvironmentInfo envInfo) { logger.debug("No Environment for " + envInfo.getEnvironmentName() + " exists. Attempt to create and connect ..."); - EnvironmentType remoteEnv = createRemoteEnvironment(envInfo, template, tokenInfo); + EnvironmentType remoteEnv = createRemoteEnvironment(envInfo, template, tokenInfo, securityService); if (remoteEnv != null) // successfully created { localEnvironment = getEnvironmentManager().createOrUpdateEnvironment(remoteEnv, tokenInfo); @@ -294,13 +306,13 @@ private EnvironmentType retrieveRemoteEnvironment(EnvironmentInfo envInfo, SIF3S } } - private EnvironmentType createRemoteEnvironment(EnvironmentInfo envInfo, EnvironmentType template, TokenInfo tokenInfo) + private EnvironmentType createRemoteEnvironment(EnvironmentInfo envInfo, EnvironmentType template, TokenInfo tokenInfo, ExternalSecurityService securityService) { if (template != null) { // Set a few fields in the template before it is sent to environment provider template.setConsumerName(envInfo.getAdapterName()); - template.setAuthenticationMethod(envInfo.getAuthMethod().name()); + template.setAuthenticationMethod(securityService.getXmlValue()); template.setSolutionId(envInfo.getEnvironmentKey().getSolutionID()); template.getApplicationInfo().setApplicationKey(envInfo.getEnvironmentKey().getApplicationKey()); template.setUserToken(envInfo.getEnvironmentKey().getUserToken()); diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentConnectorFactory.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentConnectorFactory.java index cf522cc9..3d139c30 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentConnectorFactory.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/env/connectors/EnvironmentConnectorFactory.java @@ -18,7 +18,8 @@ package sif3.infra.rest.env.connectors; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.infra.common.env.mgr.BrokeredProviderEnvironmentManager; import sif3.infra.common.env.mgr.ConsumerEnvironmentManager; @@ -36,7 +37,7 @@ */ public class EnvironmentConnectorFactory { - protected static final Logger logger = Logger.getLogger(EnvironmentConnectorFactory.class); + protected final static Logger logger = LoggerFactory.getLogger(EnvironmentConnectorFactory.class); public static EnvironmentConnector getEnvironmentConnector(EnvironmentManager envMgr) { diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/BaseProvider.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/BaseProvider.java index ffb0b5fe..a7d2eb73 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/BaseProvider.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/BaseProvider.java @@ -21,8 +21,10 @@ import java.util.Timer; import java.util.TimerTask; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; import sif3.common.CommonConstants; import sif3.common.exception.DataTooLargeException; import sif3.common.exception.PersistenceException; @@ -37,7 +39,6 @@ import sif3.infra.common.env.mgr.ProviderManagerFactory; import sif3.infra.common.env.types.EnvironmentInfo.EnvironmentType; import sif3.infra.common.env.types.ProviderEnvironment; -import au.com.systemic.framework.utils.AdvancedProperties; /** * This is the main class each specific provider of a given SIF Object type must extends to implement the CRUD operation as defined @@ -49,7 +50,7 @@ */ public abstract class BaseProvider implements Provider, Runnable { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private Timer eventTimer = null; private TimerTask eventTimerTask = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/ProviderFactory.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/ProviderFactory.java index ad6be36c..66b2d13a 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/ProviderFactory.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/provider/ProviderFactory.java @@ -24,12 +24,13 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import sif3.common.conversion.ModelObjectInfo; -import sif3.common.interfaces.Provider; import au.com.systemic.framework.utils.AdvancedProperties; import au.com.systemic.framework.utils.StringUtils; +import sif3.common.conversion.ModelObjectInfo; +import sif3.common.interfaces.Provider; /** * This is the provider factory. Each provider deals with a number of objects (i.e. StudentPersonal, SchoolInfo etc). @@ -44,7 +45,7 @@ public class ProviderFactory private static final int DEFAULT_DELAY = 10; private static final String DELAY_PROPERTY = "provider.startup.delay"; - private static final Logger logger = Logger.getLogger(ProviderFactory.class); + private final static Logger logger = LoggerFactory.getLogger(ProviderFactory.class); private static ProviderFactory factory = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalConsumerQueue.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalConsumerQueue.java index e950ade1..c8329a7b 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalConsumerQueue.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalConsumerQueue.java @@ -20,10 +20,11 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import sif3.infra.rest.queue.types.QueueMessage; import au.com.systemic.framework.utils.StringUtils; +import sif3.infra.rest.queue.types.QueueMessage; /** @@ -45,7 +46,7 @@ */ public class LocalConsumerQueue { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private BlockingQueue queue = null; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalMessageConsumer.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalMessageConsumer.java index a699df97..ee356a74 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalMessageConsumer.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/LocalMessageConsumer.java @@ -19,7 +19,10 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.sun.jersey.api.client.ClientResponse.Status; import sif3.common.exception.UnmarshalException; import sif3.common.exception.UnsupportedMediaTypeExcpetion; @@ -38,8 +41,6 @@ import sif3.infra.rest.queue.types.QueueMessage; import sif3.infra.rest.queue.types.ResponseInfo; -import com.sun.jersey.api.client.ClientResponse.Status; - /** * This class allows the subscriber to consume messages in a multi-threaded manner according to the @@ -50,7 +51,8 @@ */ public class LocalMessageConsumer implements Runnable { - protected final Logger logger = Logger.getLogger(getClass()); + + protected final Logger logger = LoggerFactory.getLogger(getClass()); private LocalConsumerQueue localQueue; private String consumerID; @@ -143,6 +145,7 @@ private void processEvent(EventInfo eventInfo) // Create actual event Object SIFEvent event = eventConsumer.createEventObject(eventPayload, eventInfo.getEventAction(), eventInfo.getUpdateType()); event.setMetadata(eventInfo.getMetadata()); + event.setFingerprint(eventInfo.getFingerprint()); // Send event to actual event consumer. eventConsumer.onEvent(event, eventInfo.getZone(), eventInfo.getContext(), eventInfo.getEventMetadata(), eventInfo.getMessageQueueReaderID(), consumerID); @@ -154,7 +157,7 @@ private void processResponse(ResponseInfo responseInfo) if (logger.isDebugEnabled()) { logger.debug(consumerID + " has receive a DELAYED RESPONSE from its local consumer queue ID: " + responseInfo.getMessageQueueReaderID()); - logger.debug(responseInfo); + logger.debug(responseInfo.toString()); } DelayedConsumer delayedConsumer = (DelayedConsumer)consumer; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/RemoteMessageQueueReader.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/RemoteMessageQueueReader.java index 076811d0..154ab5e4 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/RemoteMessageQueueReader.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/RemoteMessageQueueReader.java @@ -21,8 +21,10 @@ import javax.ws.rs.core.Response.Status; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; import sif3.common.exception.ServiceInvokationException; import sif3.common.header.HeaderValues.EventAction; @@ -43,7 +45,6 @@ import sif3.infra.rest.queue.types.EventInfo; import sif3.infra.rest.queue.types.QueueInfo; import sif3.infra.rest.queue.types.ResponseInfo; -import au.com.systemic.framework.utils.StringUtils; /** * This class is the actual reader on the remote SIF Queue. It deals with all the logic that applies to SIF Message Queues and how @@ -60,7 +61,7 @@ */ public class RemoteMessageQueueReader implements Runnable { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private QueueInfo queueInfo = null; private ConsumerEnvironmentManager consumerEvnMgr = null; @@ -397,6 +398,8 @@ private void processEvent(Response response) //TODO: JH - Do we need applicationKey and authenticatedUser HTTP header here? EventInfo eventInfo = new EventInfo(eventPayload, response.getMediaType(), eventAction, updateType, zone, context, metadata, getQueueReaderID()); + eventInfo.setFingerprint(getHeaderValue(response, ResponseHeaderConstants.HDR_FINGERPRINT)); + logger.debug(getQueueReaderID()+": Attempts to push Event to local queue..."); localQueue.blockingPush(eventInfo); logger.debug(getQueueReaderID()+": Event successfully pushed to local queue"); diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerQueueConnector.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerQueueConnector.java index 8f2e9e41..ec4f9774 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerQueueConnector.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerQueueConnector.java @@ -24,7 +24,8 @@ import java.util.HashMap; import java.util.List; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.CommonConstants.AdapterType; import sif3.common.CommonConstants.QueuePollingType; @@ -53,7 +54,7 @@ */ public class ConsumerQueueConnector { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static final AdapterType CONSUMER = AdapterType.CONSUMER; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerSubscriptionConnector.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerSubscriptionConnector.java index 62697c51..38df223c 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerSubscriptionConnector.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/connectors/ConsumerSubscriptionConnector.java @@ -22,15 +22,16 @@ import java.util.HashMap; import java.util.List; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.exception.ServiceInvokationException; import sif3.common.model.ServiceInfo; -import sif3.common.model.SubscriptionKey; import sif3.common.model.ServiceRights.AccessRight; import sif3.common.model.ServiceRights.AccessType; +import sif3.common.model.SubscriptionKey; import sif3.common.persist.model.SIF3Queue; import sif3.common.persist.model.SIF3Session; import sif3.common.persist.model.SIF3Subscription; @@ -57,7 +58,7 @@ */ public class ConsumerSubscriptionConnector { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static final AdapterType CONSUMER = AdapterType.CONSUMER; diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/types/QueueMessage.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/types/QueueMessage.java index a7a8c9ad..7f274e8a 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/types/QueueMessage.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/queue/types/QueueMessage.java @@ -49,6 +49,7 @@ public class QueueMessage implements Serializable private MediaType mediaType; // indicates what format the payload string is in. private SIFZone zone; private SIFContext context; + private String fingerprint = null; private String messageQueueReaderID; public QueueMessage() @@ -195,6 +196,16 @@ public void setContext(SIFContext context) this.context = context; } + public String getFingerprint() + { + return fingerprint; + } + + public void setFingerprint(String fingerprint) + { + this.fingerprint = fingerprint; + } + /** * @return the messageQueueReaderID */ @@ -211,16 +222,13 @@ public void setMessageQueueReaderID(String messageQueueReaderID) this.messageQueueReaderID = messageQueueReaderID; } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ @Override public String toString() { return "QueueMessage [messageType=" + messageType + ", serviceType=" + serviceType + ", payload=" + payload + ", metadata=" + metadata + ", mediaType=" + mediaType - + ", zone=" + zone + ", context=" + context + ", messageQueueReaderID=" - + messageQueueReaderID + "]"; + + ", zone=" + zone + ", context=" + context + ", fingerprint=" + fingerprint + + ", messageQueueReaderID=" + messageQueueReaderID + "]"; } } diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/BaseResource.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/BaseResource.java index 6aa61a72..9ead9f4e 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/BaseResource.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/BaseResource.java @@ -33,9 +33,15 @@ import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.DateUtils; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; +import sif3.common.CommonConstants.AdapterType; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.conversion.MarshalFactory; import sif3.common.conversion.MediaTypeOperations; import sif3.common.conversion.UnmarshalFactory; @@ -50,7 +56,6 @@ import sif3.common.header.RequestHeaderConstants; import sif3.common.header.ResponseHeaderConstants; import sif3.common.model.AuthenticationInfo; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.model.PagingInfo; import sif3.common.model.RequestMetadata; import sif3.common.model.ResponseParameters; @@ -59,10 +64,12 @@ import sif3.common.model.ServiceRights.AccessRight; import sif3.common.model.ServiceRights.AccessType; import sif3.common.model.URLQueryParameter; +import sif3.common.model.security.InternalSecurityServiceConstants; +import sif3.common.model.security.SecurityServiceInfo; import sif3.common.model.security.TokenInfo; +import sif3.common.persist.model.ExternalSecurityService; import sif3.common.persist.model.SIF3Session; import sif3.common.security.AbstractSecurityService; -import sif3.common.security.BearerSecurityFactory; import sif3.common.utils.AuthenticationUtils; import sif3.common.utils.UUIDGenerator; import sif3.common.ws.CreateOperationStatus; @@ -90,9 +97,6 @@ import sif3.infra.common.model.UpdateType; import sif3.infra.common.model.UpdatesType; import sif3.infra.rest.resource.audit.AuditableResource; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.DateUtils; -import au.com.systemic.framework.utils.StringUtils; /** * This is a utility class. All REST resource style class should extend this class. It provides many common functions that are @@ -105,7 +109,7 @@ */ public abstract class BaseResource { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* Below variables are for testing purposes only */ private static Boolean testMode = null; @@ -114,7 +118,7 @@ public abstract class BaseResource private enum PostFixMimeType {XML, JSON}; /* Name of query parameters for payload free environment creation */ - private enum EnvironmentQueryParams {solutionId, applicationKey, userToken, instanceId, authenticationMethod, consumerName, supportedInfrastructureVersion, dataModelNamespace, transport, productName}; + private enum EnvironmentQueryParams {solutionId, applicationKey, userToken, instanceId, authenticationMethod, consumerName, supportedInfrastructureVersion, dataModelNamespace, transport, productName, fingerprint}; private static final String HTTPS_SCHEMA = "https"; private static final String NOT_AUTHORIZED = "Not Authorized."; @@ -178,7 +182,7 @@ public BaseResource(UriInfo uriInfo, HttpHeaders requestHeaders, Request request extractQueryParameters(); setSecure(HTTPS_SCHEMA.equalsIgnoreCase(getUriInfo().getBaseUri().getScheme())); setRelativeServicePath(getUriInfo().getRequestUri().toString(), getUriInfo().getBaseUri().toString(), servicePrefixPath); - extractAuthTokenInfo(); + extractAuthTokenInfo(isDirectEnvironment() ? AdapterType.ENVIRONMENT_PROVIDER : AdapterType.PROVIDER); if (StringUtils.notEmpty(zoneID)) { @@ -196,9 +200,9 @@ public BaseResource(UriInfo uriInfo, HttpHeaders requestHeaders, Request request } else { - if ((authInfo.getAuthMethod() == AuthenticationInfo.AuthenticationMethod.Bearer)) + if ((authInfo.getSecurityServiceInfo().getAuthenticationType() == AuthenticationType.Other)) { - setSecurityService(BearerSecurityFactory.getSecurityService(getServiceProperties())); + setSecurityService(((ExternalSecurityService)authInfo.getSecurityServiceInfo()).getSecurityService(getServiceProperties())); } } @@ -345,7 +349,7 @@ public void setQueryParameters(URLQueryParameter queryParameters) /*--------------------------------*/ /** * This method returns the userToken form the given Authorisation token. This can either be a sessionToken (Basic, - * SIF_HMACSH256) or a securityToken (Bearer). If no authorisation information is available then null is returned. + * SIF_HMACSH256) or a securityToken (External Security Service). If no authorisation information is available then null is returned. * * @return the token held in the userToken property or null if no Authentication information is available. */ @@ -370,7 +374,7 @@ public String getProviderID() /*---------------------------------*/ /** - * This method combines the validSession() and validateBearerSession() method into a higher level, so that the caller doesn't have to know + * This method combines the validSession() and validateExternalSession() method into a higher level, so that the caller doesn't have to know * which one to invoke, rather have the code here to determine it automatically as it is possible in most cases. * * @param autoCreateAllowed There are times where a environment must not be created automatically even if the @@ -386,13 +390,13 @@ protected ErrorDetails validateSession(boolean autoCreateAllowed) { return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "No or invalid Authorization Token provided"); } - if (authInfo.getAuthMethod() != AuthenticationMethod.Bearer) // Basic or SIF_HMACSHA256 + if (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) // Basic or SIF_HMACSHA256 { return validSession(authInfo, false, null); } else { - return validateBearerSession(authInfo, autoCreateAllowed); + return validateExternalSession(authInfo, autoCreateAllowed); } } @@ -408,7 +412,7 @@ public SIF3Session getSIF3SessionForRequest() if (token != null) { - if (getAuthInfo().getAuthMethod() == AuthenticationMethod.Bearer) + if (getAuthInfo().getSecurityServiceInfo().getAuthenticationType() == AuthenticationType.Other) { return getEnvironmentManager().getSessionBySecurityToken(token); } @@ -701,14 +705,14 @@ protected ErrorDetails validClient(String serviceName, AccessRight right, Access * authorised/authenticated token. If all tests succeed then null is returned, otherwise and ErrorDetails object is returned * that holds all the required error information and status. * - * @param validateBearerToken TRUE: Bearer Token will be validated against security service. - * FALSE: Bearer Token is assumed to already be validated. - * @param tokenInfo The token Info if authentication method is Bearer. In all other cases this parameter + * @param validateExternalToken TRUE: External Security Service Token will be validated against security service. + * FALSE: External Security Service Token is assumed to already be validated. + * @param tokenInfo The token Info if authentication method is "other". In all other cases this parameter * is null and session token info should be used from the AuthInfo object. * * @return See desc */ - protected ErrorDetails validSession(AuthenticationInfo authInfo, boolean validateBearerToken, TokenInfo tokenInfo) + protected ErrorDetails validSession(AuthenticationInfo authInfo, boolean validateExternalToken, TokenInfo tokenInfo) { // we must have a authentication token and there must be an environment with that authentication token if ((authInfo != null) && (authInfo.getUserToken() != null)) @@ -732,18 +736,19 @@ protected ErrorDetails validSession(AuthenticationInfo authInfo, boolean validat try { EnvironmentType environment = null; - if (authInfo.getAuthMethod() != AuthenticationMethod.Bearer) // Basic or SIF_HMACSHA256 + if (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) // Basic or SIF_HMACSHA256 { environment = ((DirectProviderEnvironmentManager)getEnvironmentManager()).reloadEnvironmentBySessionToken(authInfo.getUserToken(), tokenInfo, isSecure()); } - else // Bearer Token + else // External Token { environment = ((DirectProviderEnvironmentManager)getEnvironmentManager()).reloadEnvironmentForSecurityToken(tokenInfo, isSecure()); } // If we have no environment then there is no environment for that session token if (environment == null) { - String errorStr = "No environment exits for the given security token = "+authInfo.getUserToken()+". Ensure that environment is created first."; + String tokenType = (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) ? "session" : "security"; + String errorStr = "No environment exits for the given "+tokenType+" token = "+authInfo.getUserToken()+". Ensure that environment is created first."; logger.error(errorStr); return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, errorStr); } @@ -760,7 +765,7 @@ protected ErrorDetails validSession(AuthenticationInfo authInfo, boolean validat } // Do the full validation of Auth Token. - return validateAuthTokenWithSession(sif3Session, validateBearerToken); + return validateAuthTokenWithSession(sif3Session, validateExternalToken); } else // we have no or an invalid authorisation token { @@ -770,22 +775,22 @@ protected ErrorDetails validSession(AuthenticationInfo authInfo, boolean validat /* * This method validates the user token and password against the two valid SIF authentication methods of - * Basic or SIF_HMACSHA256. If the authentication method should be set to bearer and this method is + * Basic or SIF_HMACSHA256. If the authentication method should be set to "other" and this method is * called then null is returned meaning that no validation is performed and it is assumed all is good. - * This means that the bearer token must already be validated external to this method. Practically this - * method should not be called if the authentication method is bearer. Future changes to this method may + * This means that the "other" token must already be validated external to this method. Practically this + * method should not be called if the authentication method is "other". Future changes to this method may * return an error in such a case. */ - protected ErrorDetails validateNoneBearerAuthToken(String userToken, String password) + protected ErrorDetails validateInternalAuthToken(String userToken, String password) { - if (getAuthInfo().getAuthMethod() == null) + if ((getAuthInfo().getSecurityServiceInfo() == null) || StringUtils.isEmpty(getAuthInfo().getSecurityServiceInfo().getAuthenticationMethod())) { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "No Authentication Method set.", "Choose between Basic, SIF_HMACSHA256 or Bearer as Authentication Method. Refer to SIF3 Specification for details."); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "No Authentication Method set.", "Choose between Basic, SIF_HMACSHA256 or External Security as Authentication Method. Refer to SIF3 Specification for details."); } - if ((getAuthInfo().getAuthMethod() == AuthenticationInfo.AuthenticationMethod.Bearer)) + if (getAuthInfo().getSecurityServiceInfo().getAuthenticationType() == AuthenticationType.Other) { - // It is bearer token and it is already validated. Nothing else to do here. + // It is "other" token and it is already validated. Nothing else to do here. return null; } @@ -797,7 +802,7 @@ protected ErrorDetails validateNoneBearerAuthToken(String userToken, String pass String authToken = AuthenticationUtils.getFullBase64Token(getAuthInfo()); String newAuthToken = null; - if (getAuthInfo().getAuthMethod() == AuthenticationInfo.AuthenticationMethod.Basic) + if (getAuthInfo().getSecurityServiceInfo().getAuthenticationType() == AuthenticationType.Basic) { // Create authentication token and compare if it matches newAuthToken = AuthenticationUtils.getBasicAuthToken(userToken, password); @@ -829,9 +834,9 @@ protected ErrorDetails validateNoneBearerAuthToken(String userToken, String pass /* * This method will attempt to validate the given securityToken against an external security service. This method is only called - * if the Authorisation HTTP header is of type 'Bearer'. VerifyError is thrown if there are any issues accessing the security service. + * if the Authorisation HTTP header is of type 'other'. VerifyError is thrown if there are any issues accessing the security service. */ - protected boolean validateBearerWithSecurityService(String securityToken) throws VerifyError + protected boolean validateTokenWithSecurityService(String securityToken) throws VerifyError { if (getSecurityService() != null) { @@ -839,7 +844,7 @@ protected boolean validateBearerWithSecurityService(String securityToken) throws } else // No security service known => report error { - throw new VerifyError("No security service known to validate Bearer Token."); + throw new VerifyError("No security service known to validate Security Token."); } } @@ -865,11 +870,10 @@ protected RequestMetadata getRequestMetadata(SIF3Session sif3Session, boolean is // Get values from HTTP Header. metadata.setGeneratorID(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_GENERATOR_ID)); -// metadata.setNavigationID(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_NAVIGATION_ID)); metadata.setApplicationKey(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_APPLICATION_KEY)); metadata.setAuthentictedUser(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_AUTHENTICATED_USER)); - // Source Name is a HTTP header if DBROKERED. Defaulted to applicationKey if DIRECT + // Brokered: SourceName and Fingerprint are in HTTP Headers and are set by the Broker if (isBrokeredEnvironment()) { metadata.setSourceName(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_SOURCE_NAME)); @@ -879,12 +883,25 @@ protected RequestMetadata getRequestMetadata(SIF3Session sif3Session, boolean is { metadata.setSourceName(getQueryParameters().getQueryParam(RequestHeaderConstants.HDR_SOURCE_NAME)); } + + metadata.setFingerprint(getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_FINGERPRINT)); + + //Or is it a URL query parameter + if (metadata.getFingerprint() == null) + { + metadata.setFingerprint(getQueryParameters().getQueryParam(RequestHeaderConstants.HDR_FINGERPRINT)); + } + } - else // In a direct environment we set the SourceName to the consumer's application key if available. + // Direct: We set the SourceName to the consumer's application key if available and the fingerprint to the appropriate + // value as in the session of this consumer. These values cannot be set by consumers, so that they cannot + // pretend to be someone else. + else { if (sif3Session != null) { metadata.setSourceName(sif3Session.getApplicationKey()); + metadata.setFingerprint(sif3Session.getFingerprint()); } } @@ -917,10 +934,6 @@ protected RequestMetadata getRequestMetadata(SIF3Session sif3Session, boolean is { metadata.setGeneratorID(getQueryParameters().getQueryParam(RequestHeaderConstants.HDR_GENERATOR_ID)); } -// if (metadata.getNavigationID() == null) -// { -// metadata.setNavigationID(getQueryParameters().getQueryParam(RequestHeaderConstants.HDR_NAVIGATION_ID)); -// } if (metadata.getApplicationKey() == null) { @@ -948,32 +961,32 @@ protected RequestMetadata getRequestMetadata(SIF3Session sif3Session, boolean is /* * VerifyError is thrown if anything is not valid or not working. The exception message holds the details. - * If everything is ok and the authentication method is Bearer then the TokenInfo is returned, + * If everything is ok and the authentication method is "other" then the TokenInfo is returned, */ - protected TokenInfo getBearerTokenInfo(AuthenticationInfo authInfo) throws VerifyError + protected TokenInfo getExternalTokenInfo(AuthenticationInfo authInfo) throws VerifyError { if (authInfo == null) { throw new VerifyError("No authentication info found. Cannot authorize consumer."); } - if ((authInfo.getAuthMethod() == AuthenticationMethod.Bearer)) + if (authInfo.getSecurityServiceInfo().getAuthenticationType() == AuthenticationType.Other) { - if (validateBearerWithSecurityService(authInfo.getUserToken())) + if (validateTokenWithSecurityService(authInfo.getUserToken())) { // Now, what info can we get about the token TokenInfo tokenInfo = getSecurityService().getInfo(authInfo.getUserToken(), getRequestMetadata(null, false)); if (tokenInfo == null) { - throw new VerifyError("No information about Bearer Token can be retrieved."); + throw new VerifyError("No information about Security Token can be retrieved."); } else { return tokenInfo; } } - else // invalid bearer token + else // invalid token { - throw new VerifyError("Bearer Token validation with security service returned \"Not Authorized\"."); + throw new VerifyError("External Token validation with security service returned \"Not Authorized\"."); } } else // It is a standard Basic or SIF_HMACSHA256 authentication and therefore no further action is required. @@ -1046,10 +1059,10 @@ private void setURLMediaTypeFromPath(String urlPostfixMimeTypeStr) * in the tokenInfo then it will take precedence of query parameters because the tokenInfo is based on security * service information and is more trust worthy. */ - protected EnvironmentType makeEnvironmentForBearerToken(URLQueryParameter urlParams, TokenInfo tokenInfo) + protected EnvironmentType makeEnvironmentForExternalToken(SecurityServiceInfo securityService, URLQueryParameter urlParams, TokenInfo tokenInfo) { // Use what is available from the Query Params. - EnvironmentType env = makeEnvironmentFromQueryParams(urlParams, null, false); + EnvironmentType env = makeEnvironmentFromQueryParams(securityService, urlParams, null, false); // Now get TokenInfo and overwrite possible query parameter values. if (StringUtils.notEmpty(tokenInfo.getAppUserInfo().getApplicationKey())) @@ -1084,7 +1097,7 @@ protected EnvironmentType makeEnvironmentForBearerToken(URLQueryParameter urlPar * ApplicationKey can be part of the url query parameters or it could be in the authorisation header or access token. If it is in either * in the authorisation header or as an access token then it must be passed to this method in the "applicationKey' parameter. */ - protected EnvironmentType makeEnvironmentFromQueryParams(URLQueryParameter urlParams, String applicationKey, boolean appKeyRequired) + protected EnvironmentType makeEnvironmentFromQueryParams(SecurityServiceInfo securityService, URLQueryParameter urlParams, String applicationKey, boolean appKeyRequired) { ObjectFactory infraObjectFactory = new ObjectFactory(); EnvironmentType env = infraObjectFactory.createEnvironmentType(); @@ -1123,11 +1136,21 @@ protected EnvironmentType makeEnvironmentFromQueryParams(URLQueryParameter urlPa env.setInstanceId(value); break; case authenticationMethod: - env.setAuthenticationMethod(value); + if (securityService == null) // not found so set to Basic + { + env.setAuthenticationMethod(InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getXmlValue()); + } + else + { + env.setAuthenticationMethod(securityService.getXmlValue()); + } break; case consumerName: env.setConsumerName(value); break; + case fingerprint: + env.setFingerprint(value); + break; case supportedInfrastructureVersion: env.getApplicationInfo().setSupportedInfrastructureVersion(value); break; @@ -1460,6 +1483,10 @@ private Response makeFullResponse(Object data, int status, PagingInfo pagingInfo String baseURIStr = isSecure() ? envInfo.getSecureConnectorBaseURI().toString() : envInfo.getConnectorBaseURI().toString(); StringBuilder envURLStr = new StringBuilder(baseURIStr).append("/environments/").append(sif3Session.getEnvironmentID()); allHeaders.setHeaderProperty(ResponseHeaderConstants.HDR_ENVIRONMENT_URI, envURLStr.toString()); +// if (sif3Session.getFingerprint() != null) +// { + allHeaders.setHeaderProperty(ResponseHeaderConstants.HDR_FINGERPRINT, sif3Session.getFingerprint()); +// } } } else // ensure that environmentURI header is not set by customHeaders and fakes some back door. @@ -1502,16 +1529,16 @@ private void setAuthInfo(AuthenticationInfo authInfo) this.authInfo = authInfo; } - private void extractAuthTokenInfo() + private void extractAuthTokenInfo(AdapterType adapterType) { String authToken = getSIFHeaderProperties().getHeaderProperty(RequestHeaderConstants.HDR_AUTH_TOKEN); if (StringUtils.notEmpty(authToken)) { - setAuthInfo(AuthenticationUtils.getPartsFromAuthToken(authToken)); + setAuthInfo(AuthenticationUtils.getPartsFromAuthToken(authToken, adapterType)); } else if (getProviderEnvironment().getAllowAuthOnURL()) // Ok no header info. Do we have something on the query parameters and is it allowed to be on query parameter { - setAuthInfo(getAccessToken()); + setAuthInfo(getAccessToken(adapterType)); } } @@ -1523,37 +1550,37 @@ else if (getProviderEnvironment().getAllowAuthOnURL()) // Ok no header info. Do * be sent back to the client. * * @param sif3Session The SIF3 Session against which the given authentication token shall be validated. - * @param validateBearer TRUE: Bearer Token must be validated against security service. FALSE validation required. This assumes that the - * caller of this method has already validated the bearer token. + * @param validateExternalToken TRUE: External Security Service Token must be validated against security service. + * FALSE validation required. This assumes that the caller of this method has already validated the token. * * @return See desc. */ - private ErrorDetails validateAuthTokenWithSession(SIF3Session sif3Session, boolean validateBearerToken) + private ErrorDetails validateAuthTokenWithSession(SIF3Session sif3Session, boolean validateExternalToken) { - if (getAuthInfo().getAuthMethod() == null) + if ((getAuthInfo().getSecurityServiceInfo() == null) || StringUtils.isEmpty(getAuthInfo().getSecurityServiceInfo().getAuthenticationMethod())) { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Choose between Basic, SIF_HMACSHA256 or Bearer as Authentication Method. Refer to SIF3 Specification for details."); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Choose between Basic, SIF_HMACSHA256 or External Security as Authentication Method. Refer to SIF3 Specification for details."); } // Check if the Authentication Method matches the session's mandated authentication method. - if (getAuthInfo().getAuthMethod() != sif3Session.getAuthenticationMethod()) + if (!getAuthInfo().getSecurityServiceInfo().getAuthenticationMethod().equalsIgnoreCase(sif3Session.getAuthenticationMethod())) { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Invalid authentication method. Authentication method must be "+sif3Session.getAuthenticationMethod().name()); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Invalid authentication method. Authentication method must be "+sif3Session.getAuthenticationMethod()); } - if (getAuthInfo().getAuthMethod() != AuthenticationInfo.AuthenticationMethod.Bearer) // It is Basic or SIF_HMACSHA256 + if (getAuthInfo().getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) // It is Basic or SIF_HMACSHA256 { - return validateNoneBearerAuthToken(getAuthInfo().getUserToken(), sif3Session.getPassword()); + return validateInternalAuthToken(getAuthInfo().getUserToken(), sif3Session.getPassword()); } - else // we must validate session against bearer token. + else // we must validate session against External Authentication token. { - if (validateBearerToken) + if (validateExternalToken) { try { - if (!validateBearerWithSecurityService(getAuthInfo().getUserToken())) + if (!validateTokenWithSecurityService(getAuthInfo().getUserToken())) { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Bearer Token validation with security service returned \"Not Authorized\"."); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Security Token validation with security service returned \"Not Authorized\"."); } } catch (VerifyError ex) @@ -1562,14 +1589,13 @@ private ErrorDetails validateAuthTokenWithSession(SIF3Session sif3Session, boole } } - // If we get here we assume that the bearer token is all valid. now we can validate the session - // against it. - return validateBearerTokenAgainstSession(getAuthInfo().getUserToken(), sif3Session); + // If we get here we assume that the token is all valid. now we can validate the session against it. + return validateExternalTokenAgainstSession(getAuthInfo().getUserToken(), sif3Session); } } /* - * This method deals specifically with the case where the authentication method is 'Bearer'. + * This method deals specifically with the case where the authentication method is 'Other' (External Service). * The algorithm in this case is reasonably complex and roughly follows the algorithm below: * * First we check if there is a sif3 session in the session cache that matches the security token. @@ -1604,7 +1630,7 @@ private ErrorDetails validateAuthTokenWithSession(SIF3Session sif3Session, boole * provider's property would allow this. A typical case is where we attempt to retrieve * an environment by its ID. In such case we do not create it if it doesn't exist. */ - private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean autoCreateAllowed) + private ErrorDetails validateExternalSession(AuthenticationInfo authInfo, boolean autoCreateAllowed) { String errorStr = null; SIF3Session sif3Session = getSIF3SessionForRequest(); @@ -1631,14 +1657,14 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean // If there is no environment then there are two potential reasons: // 1) It really does not exist - // 2) There is an environment but for a different bearer token because a previous one has expired or was + // 2) There is an environment but for a different external token because a previous one has expired or was // re-generated! To cover this case we must get the info for the token and then attempt to reload it that - // way. Only if it still doesn't exist we can say for sure that there is no environment for the bearer token. + // way. Only if it still doesn't exist we can say for sure that there is no environment for the external token. if (environment == null) { - logger.debug("No envionment found yet => Attempt get bearer token info and reload environment from there..."); - tokenInfo = getBearerTokenInfo(authInfo); - ErrorDetails errors = createOrLoadEnvByTokenInfo(tokenInfo, envMgr, (autoCreateAllowed && getProviderEnvironment().getAutoCreateEnvironment())); + logger.debug("No envionment found yet => Attempt get external token info and reload environment from there..."); + tokenInfo = getExternalTokenInfo(authInfo); + ErrorDetails errors = createOrLoadEnvByTokenInfo(tokenInfo, envMgr, authInfo, (autoCreateAllowed && getProviderEnvironment().getAutoCreateEnvironment())); if (errors != null) { return errors; @@ -1647,7 +1673,7 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean } catch (VerifyError ex) { - logger.error("Bearer Token security issue: "+ ex.getMessage(), ex); + logger.error("External Security Token issue: "+ ex.getMessage(), ex); return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, ex.getMessage()); } catch (Exception ex) @@ -1675,11 +1701,11 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean // expired since it was last accessed. if (isDirectEnvironment()) { - if (isSessionBearerExpired(sif3Session)) //is token expired + if (isExternalSessionExpired(sif3Session)) //is token expired { try { - TokenInfo tokenInfo = getBearerTokenInfo(authInfo); + TokenInfo tokenInfo = getExternalTokenInfo(authInfo); // Now this should have potential expire date if (tokenInfo.getTokenExpiryDate() != null) @@ -1697,7 +1723,7 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean envMgr.removeEnvironmentBySessionToken(sif3Session.getSessionToken(), false); // Report error. - errorStr = "Bearer Token = "+authInfo.getUserToken()+" is expired."; + errorStr = "External Token = "+authInfo.getUserToken()+" is expired."; logger.error(errorStr); return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, errorStr); } @@ -1705,24 +1731,24 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean } catch (VerifyError ex) { - logger.error("Bearer Token security issue: "+ ex.getMessage(), ex); + logger.error("External Token security issue: "+ ex.getMessage(), ex); return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, ex.getMessage()); } } } - else // Brokered environment => Bearer Authentication not yet supported. + else // Brokered environment => External Authentication not yet supported. { //TODO: JH - Add code once External Security is enabled for brokered providers. - errorStr = "Bearer Token security not yet supported for Brokered Environment Provider."; + errorStr = "External Security Token not yet supported for Brokered Environment Provider."; logger.error(errorStr); return new ErrorDetails(Status.INTERNAL_SERVER_ERROR.getStatusCode(), errorStr); } // At this point we should have a SIF3Session which we can check to see if Authentication Method matches the Authorisation header // Check if the Authentication Method matches the session's mandated authentication method. - if (getAuthInfo().getAuthMethod() != sif3Session.getAuthenticationMethod()) + if (!getAuthInfo().getSecurityServiceInfo().getAuthenticationMethod().equalsIgnoreCase(sif3Session.getAuthenticationMethod())) { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Invalid authentication method. Authentication method must be "+sif3Session.getAuthenticationMethod().name()); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "Invalid authentication method. Authentication method must be "+sif3Session.getAuthenticationMethod()); } // If we get to this point then all validations have succeeded. @@ -1730,7 +1756,7 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean } /* - * This method validates a security token (Bearer) against a SIF3 session. While doing so it will + * This method validates a security token (external) against a SIF3 session. While doing so it will * NOT attempt to load a session from the session store. It is assumed that the sif3 session given to * this method is retrieved from the session cache and therefore exists. It will only validate against * the given sif3 session. It follows the steps below: @@ -1739,7 +1765,7 @@ private ErrorDetails validateBearerSession(AuthenticationInfo authInfo, boolean * - If it does and it is not expired in session => All fine * - If it does but expired => return error */ - private ErrorDetails validateBearerTokenAgainstSession(String securityToken, SIF3Session sif3Session) + private ErrorDetails validateExternalTokenAgainstSession(String securityToken, SIF3Session sif3Session) { String errorStr = null; if (sif3Session != null) @@ -1785,7 +1811,7 @@ private ErrorDetails validateBearerTokenAgainstSession(String securityToken, SIF } } - protected boolean isSessionBearerExpired(SIF3Session sif3Session) + protected boolean isExternalSessionExpired(SIF3Session sif3Session) { if (StringUtils.notEmpty(sif3Session.getSecurityToken())) { @@ -1810,9 +1836,8 @@ protected boolean isSessionBearerExpired(SIF3Session sif3Session) * This method attempts to retrieve the URL Query Parameter called 'accessToken' which may be used for SIF Simple. It will then * attempt to also get the authentication method from the URL Query Parameters. If it is provided it will be used, assuming it has a valid * value, otherwise a lookup to the provider's config file will be performed to determine the default accessToken authentication method. - * If this is set then this will be used otherwise it is defaulted to 'Bearer'. */ - private AuthenticationInfo getAccessToken() + private AuthenticationInfo getAccessToken(AdapterType adapterType) { String accessTokenStr = getQueryParameters().getQueryParam(CommonConstants.ACCESS_TOKEN); @@ -1820,27 +1845,17 @@ private AuthenticationInfo getAccessToken() { // Check if we have an Authentication Method as well String authMethodStr = getQueryParameters().getQueryParam(CommonConstants.AUTH_METHOD); - AuthenticationMethod authMethod = null; +// String authMethod = null; - if (StringUtils.notEmpty(authMethodStr)) - { - try - { - authMethod = AuthenticationMethod.valueOf(authMethodStr.trim()); - } - catch (Exception ex) // invalid value is provided. Ignore it! - { - authMethod = null; // this will ensure that we use what is in the provider's config file - } - } + authMethodStr = (StringUtils.notEmpty(authMethodStr)) ? authMethodStr.trim() : null; - if (authMethod == null) // check what is in the provider's config file + if (authMethodStr == null) // check what is in the provider's config file { - authMethod = getProviderEnvironment().getAccessTokenAuthMethod(); + authMethodStr = getProviderEnvironment().getAccessTokenAuthMethod(); } // Create a string that looks like if it is in the Authorization HTTP Header - return AuthenticationUtils.getPartsFromAuthToken(authMethod.name()+" "+accessTokenStr.trim()); + return AuthenticationUtils.getPartsFromAuthToken(authMethodStr+" "+accessTokenStr.trim(), adapterType); } return null; } @@ -1885,10 +1900,10 @@ private String getTimestampFromRequest() } /* - * This method will either create a environment or load an exiting environment based on the information + * This method will either create an environment or load an exiting environment based on the information * provided in the 'tokenInfo' parameter. It will do this through the EnvironmentManger to ensure that * the loaded environment is also added properly to the session cache. - * This method must only be used if the authentication type is 'Bearer'. It must be checked before calling + * This method must only be used if the authentication type is 'Other'. It must be checked before calling * this method. * * The algorithm used to determine if an existing environment shall be loaded or a new one be created is as @@ -1901,11 +1916,11 @@ private String getTimestampFromRequest() * - If one is found all is good and we don't need to create one and return null * - appUserInfo is not available => log error and return ErrorDetails */ - private ErrorDetails createOrLoadEnvByTokenInfo(TokenInfo tokenInfo, DirectProviderEnvironmentManager envMgr, boolean allowCreate) + private ErrorDetails createOrLoadEnvByTokenInfo(TokenInfo tokenInfo, DirectProviderEnvironmentManager envMgr, AuthenticationInfo authInfo, boolean allowCreate) { if (tokenInfo == null) // should not be the case but for robustness... { - return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "No Bearer Security Token available (token info is null)"); + return new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), NOT_AUTHORIZED, "No External Security Token available (token info is null)"); } try { @@ -1941,7 +1956,7 @@ else if (StringUtils.notEmpty(tokenInfo.getEnvironmentID())) if (allowCreate) { logger.debug("Attempt to automatically create environment for security token: "+authInfo.getUserToken()); - EnvironmentType inputEnvironment = makeEnvironmentForBearerToken(null, tokenInfo); + EnvironmentType inputEnvironment = makeEnvironmentForExternalToken(authInfo.getSecurityServiceInfo(), null, tokenInfo); environment = envMgr.createOrUpdateEnvironment(inputEnvironment, tokenInfo, isSecure()); if (environment == null) // failed to create environment { diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/EnvironmentResource.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/EnvironmentResource.java index a5d7315e..d3a52fea 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/EnvironmentResource.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/resource/EnvironmentResource.java @@ -33,11 +33,12 @@ import javax.ws.rs.core.Response.Status; import javax.ws.rs.core.UriInfo; +import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.exception.UnmarshalException; import sif3.common.exception.UnsupportedMediaTypeExcpetion; import sif3.common.header.HeaderValues.ResponseAction; import sif3.common.model.AuthenticationInfo; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.model.EnvironmentKey; import sif3.common.model.security.TokenInfo; import sif3.common.persist.model.AppEnvironmentTemplate; @@ -48,7 +49,6 @@ import sif3.infra.common.env.types.ProviderEnvironment; import sif3.infra.common.interfaces.EnvironmentManager; import sif3.infra.common.model.EnvironmentType; -import au.com.systemic.framework.utils.StringUtils; /* * http://localhost:9080/SIF3InfraREST/sif3/environments/69df9d79-8e01-43e8-825f-d0dc1775761b @@ -121,7 +121,7 @@ public Response createEnvironment(String payload, @PathParam("mimeType") String // The method below will set the bearer token info if the authentication method is 'Bearer' // Any failures with the method below will throw a VerifyError exception - TokenInfo tokenInfo = getBearerTokenInfo(authInfo); + TokenInfo tokenInfo = getExternalTokenInfo(authInfo); if (StringUtils.notEmpty(payload)) { @@ -129,14 +129,14 @@ public Response createEnvironment(String payload, @PathParam("mimeType") String } else // check if we have the environment information as URL query parameters { - if (authInfo.getAuthMethod() != AuthenticationInfo.AuthenticationMethod.Bearer) + if (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) { // authInfo should have an application key here at this stage if Basic or SIF_HMACSHA256 - inputEnv = makeEnvironmentFromQueryParams(getQueryParameters(), authInfo.getUserToken(), true); + inputEnv = makeEnvironmentFromQueryParams(authInfo.getSecurityServiceInfo(), getQueryParameters(), authInfo.getUserToken(), true); } else // Bearer Token => We must get info about environment from TokenInfo or Query Parameters { - inputEnv = makeEnvironmentForBearerToken(getQueryParameters(), tokenInfo); + inputEnv = makeEnvironmentForExternalToken(authInfo.getSecurityServiceInfo(), getQueryParameters(), tokenInfo); } } @@ -158,18 +158,18 @@ public Response createEnvironment(String payload, @PathParam("mimeType") String } // check if initial Authentication Token is valid for this environment template. - // Check if the Authentication Method matches the session's mandated authentication method. - if (!getAuthInfo().getAuthMethod().toString().equals(appEnvTemplate.getAuthMethod())) + // Check if the Authentication Method matches the session's mandated authentication method. + if (!authInfo.getSecurityServiceInfo().getAuthenticationMethod().equalsIgnoreCase(appEnvTemplate.getAuthMethod())) { ErrorDetails error = new ErrorDetails(Status.UNAUTHORIZED.getStatusCode(), "Not Authorized.", "Invalid authentication method. Authentication method must be "+appEnvTemplate.getAuthMethod()); return makeErrorResponse(error, ResponseAction.CREATE, getInitialCustomResponseParameters()); } - // No validation of token required if it is bearer token because it was validated in getBearerTokenInfo() + // No validation of token required if it is external service token because it was validated in getExternalTokenInfo() // at the top of this method. - if (authInfo.getAuthMethod() != AuthenticationMethod.Bearer) + if (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) { - ErrorDetails errors = validateNoneBearerAuthToken(appEnvTemplate.getApplicationKey(), appEnvTemplate.getPassword()); + ErrorDetails errors = validateInternalAuthToken(appEnvTemplate.getApplicationKey(), appEnvTemplate.getPassword()); if (errors != null) // we had an issue with the authentication => return error. { return makeErrorResponse(errors, ResponseAction.CREATE, getInitialCustomResponseParameters()); @@ -257,7 +257,7 @@ public Response getEnvironment(@PathParam("id") String id, TokenInfo tokenInfo = null; try { - tokenInfo = getBearerTokenInfo(getAuthInfo()); + tokenInfo = getExternalTokenInfo(getAuthInfo()); } catch (VerifyError ex) { @@ -316,7 +316,7 @@ public Response deleteEnvironment(@PathParam("id") String id, TokenInfo tokenInfo = null; try { - tokenInfo = getBearerTokenInfo(getAuthInfo()); + tokenInfo = getExternalTokenInfo(getAuthInfo()); } catch (VerifyError ex) { diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/AuditFilter.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/AuditFilter.java index 4d146666..31787a08 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/AuditFilter.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/AuditFilter.java @@ -28,9 +28,10 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.log4j.Logger; -import sif3.common.interfaces.Auditor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import sif3.common.interfaces.Auditor; import sif3.common.model.audit.AuditRecord; import sif3.infra.rest.resource.audit.AuditableResource; import sif3.infra.rest.web.audit.AuditRequestWrapper; @@ -46,8 +47,9 @@ public class AuditFilter implements Filter { public static final String AUDIT_SERVICE_CLASS = "AUDIT_SERVICE_CLASS"; - protected final Logger logger = Logger.getLogger(getClass()); - private Auditor auditor = null; + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + private Auditor auditor = null; @Override public void destroy() diff --git a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/ProviderServletContext.java b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/ProviderServletContext.java index 75c73820..953f949f 100644 --- a/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/ProviderServletContext.java +++ b/SIF3InfraREST/SIF3REST/src/main/java/sif3/infra/rest/web/ProviderServletContext.java @@ -25,8 +25,11 @@ import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.interfaces.HibernateProperties; import sif3.common.persist.common.HibernateHelper; @@ -36,8 +39,6 @@ import sif3.infra.common.interfaces.EnvironmentManager; import sif3.infra.rest.env.connectors.EnvironmentConnectorFactory; import sif3.infra.rest.provider.ProviderFactory; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; /** * This class is to initialise the provider at startup and clean up resources at shutdown. @@ -47,7 +48,7 @@ */ public class ProviderServletContext implements ServletContextListener { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* Context Property name: ... Node in web.xml */ private static final String SERVICE_PROPERTY_FILE_TAG = "SERVICE_PROPERTY_FILE"; diff --git a/SIF3InfraREST/TestData/xml/input/SchoolInfos.xml b/SIF3InfraREST/TestData/xml/input/SchoolInfos.xml index 734131c5..d1f05da3 100644 --- a/SIF3InfraREST/TestData/xml/input/SchoolInfos.xml +++ b/SIF3InfraREST/TestData/xml/input/SchoolInfos.xml @@ -1,4 +1,4 @@ - + E1013 01011234 diff --git a/SIF3InfraREST/TestData/xml/input/StudentPersonals.xml b/SIF3InfraREST/TestData/xml/input/StudentPersonals.xml index dbb1e474..0e8c1855 100644 --- a/SIF3InfraREST/TestData/xml/input/StudentPersonals.xml +++ b/SIF3InfraREST/TestData/xml/input/StudentPersonals.xml @@ -1,4 +1,4 @@ - + 98765 diff --git a/SIF3InfraREST/TestData/xml/input/TeachingGroups.xml b/SIF3InfraREST/TestData/xml/input/TeachingGroups.xml index 7c567d5a..4bcf1df1 100644 --- a/SIF3InfraREST/TestData/xml/input/TeachingGroups.xml +++ b/SIF3InfraREST/TestData/xml/input/TeachingGroups.xml @@ -1,4 +1,4 @@ - + 2008 20087ASPN diff --git a/SIF3InfraREST/TestData/xml/input/environment_large.xml b/SIF3InfraREST/TestData/xml/input/environment_large.xml index c69b3241..d99a2fff 100644 --- a/SIF3InfraREST/TestData/xml/input/environment_large.xml +++ b/SIF3InfraREST/TestData/xml/input/environment_large.xml @@ -1,4 +1,4 @@ - + 2e5dd3ca282fc8ddb3d08dcacc407e8a auTestSolution diff --git a/SIF3InfraREST/TestData/xml/input/testEvents.log b/SIF3InfraREST/TestData/xml/input/testEvents.log index ada0b777..ae76d019 100644 --- a/SIF3InfraREST/TestData/xml/input/testEvents.log +++ b/SIF3InfraREST/TestData/xml/input/testEvents.log @@ -1,9 +1,9 @@ ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 879 @@ -17,7 +17,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> @@ -34,9 +34,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -50,7 +50,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -109,9 +109,9 @@ StudentDailyAttendances ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -128,8 +128,8 @@ StudentPersonals ### SchoolInfos ### - - + + E1013 01011234 Pri/Sec diff --git a/SIF3InfraREST/TestData/xml/input/testEventsSPOnly.log b/SIF3InfraREST/TestData/xml/input/testEventsSPOnly.log index 33ec3699..07a84dc5 100644 --- a/SIF3InfraREST/TestData/xml/input/testEventsSPOnly.log +++ b/SIF3InfraREST/TestData/xml/input/testEventsSPOnly.log @@ -1,9 +1,9 @@ ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 879 @@ -17,7 +17,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> @@ -34,9 +34,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -50,7 +50,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -67,9 +67,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -86,9 +86,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 879 @@ -102,7 +102,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> @@ -119,9 +119,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -135,7 +135,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -152,9 +152,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -171,9 +171,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 879 @@ -187,7 +187,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> @@ -204,9 +204,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -220,7 +220,7 @@ StudentPersonals + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 @@ -237,9 +237,9 @@ StudentPersonals ### StudentPersonals ### - + + xmlns="http://www.sifassociation.org/datamodel/au/3.4.1"> 98765 diff --git a/SIF3InfraREST/TestData/xml/output/environment_large.xml b/SIF3InfraREST/TestData/xml/output/environment_large.xml index 6124510c..8c5be3f1 100644 --- a/SIF3InfraREST/TestData/xml/output/environment_large.xml +++ b/SIF3InfraREST/TestData/xml/output/environment_large.xml @@ -1,4 +1,4 @@ - + 2e5dd3ca282fc8ddb3d08dcacc407e8a auTestSolution diff --git a/SIF3InfraREST/documentation/.gitignore b/SIF3InfraREST/documentation/.gitignore new file mode 100644 index 00000000..1910f62b --- /dev/null +++ b/SIF3InfraREST/documentation/.gitignore @@ -0,0 +1 @@ +/javadoc/ diff --git a/SIF3InfraREST/documentation/UseCases/HITS/SIF3 Framework Consumer and HITS.docx b/SIF3InfraREST/documentation/UseCases/HITS/SIF3 Framework Consumer and HITS.docx index 841bfb38..7acdf1f2 100644 Binary files a/SIF3InfraREST/documentation/UseCases/HITS/SIF3 Framework Consumer and HITS.docx and b/SIF3InfraREST/documentation/UseCases/HITS/SIF3 Framework Consumer and HITS.docx differ diff --git a/SIF3InfraREST/documentation/UseCases/RICOne/RICOne.xml b/SIF3InfraREST/documentation/UseCases/RICOne/RICOne.xml index 3012f5fa..34e842bc 100644 --- a/SIF3InfraREST/documentation/UseCases/RICOne/RICOne.xml +++ b/SIF3InfraREST/documentation/UseCases/RICOne/RICOne.xml @@ -7,7 +7,7 @@ - 3.1 + 3.2.1 http://www.sifassociation.org/datamodel/na/3.3 REST diff --git a/SIF3InfraREST/documentation/UseCases/RICOne/RICOneSecurityService.java b/SIF3InfraREST/documentation/UseCases/RICOne/RICOneSecurityService.java index dc1b89f6..7874c352 100644 --- a/SIF3InfraREST/documentation/UseCases/RICOne/RICOneSecurityService.java +++ b/SIF3InfraREST/documentation/UseCases/RICOne/RICOneSecurityService.java @@ -17,7 +17,10 @@ package systemic.sif3.demo.security; -import org.apache.log4j.Logger; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import au.com.systemic.framework.utils.AdvancedProperties; import riconeapi.common.Authenticator; @@ -34,15 +37,15 @@ */ public class RICOneSecurityService extends AbstractSecurityService { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private final static String AOUTH_URL_PROP_NAME = "ricOne.authUrl"; /** * @param properties */ - public RICOneSecurityService(AdvancedProperties properties) + public RICOneSecurityService(AdvancedProperties properties, Map securityServiceParameters) { - super(properties); + super(properties, securityServiceParameters); if (logger.isDebugEnabled()) { logger.debug("RICOneSecurityService Constructor called with property: " + getServiceProperties()); diff --git a/SIF3InfraREST/documentation/UseCases/RICOne/RicOneConsumer.properties b/SIF3InfraREST/documentation/UseCases/RICOne/RicOneConsumer.properties index 575df8ba..2e3d0842 100644 --- a/SIF3InfraREST/documentation/UseCases/RICOne/RicOneConsumer.properties +++ b/SIF3InfraREST/documentation/UseCases/RICOne/RicOneConsumer.properties @@ -19,10 +19,8 @@ adapter.checkACL=true #--------------------------------------# # RIC One Authentication Server Details #--------------------------------------# -# External security service shall be used if Bearer Token is used. -adapter.security.service=systemic.sif3.demo.security.RICOneSecurityService -# Values to be used in the generation of accessToken in external security service. All values with the property +# Values to be used in the generation of access token in external security service. All values with the property # name starting in 'security.service.property.<...> will be passed to the 'otherInfo' property of the # TokenCoreInfo object. See Developer's Guide for more details. security.service.property.ricOne.authUrl=https://auth.test.ricone.org/login diff --git a/SIF3InfraREST/documentation/UseCases/RICOne/SIF3 Framework Consumer and RICOne.docx b/SIF3InfraREST/documentation/UseCases/RICOne/SIF3 Framework Consumer and RICOne.docx index b41df72a..f0ad2fa0 100644 Binary files a/SIF3InfraREST/documentation/UseCases/RICOne/SIF3 Framework Consumer and RICOne.docx and b/SIF3InfraREST/documentation/UseCases/RICOne/SIF3 Framework Consumer and RICOne.docx differ diff --git a/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.0.docx b/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.0.docx deleted file mode 100644 index 23e1f6a1..00000000 Binary files a/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.0.docx and /dev/null differ diff --git a/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.1.docx b/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.1.docx new file mode 100644 index 00000000..08c40ed4 Binary files /dev/null and b/SIF3InfraREST/documentation/UserGuide/SIF3Framework_DevelopersGuide_v0.7.1.docx differ diff --git a/SIF3InfraREST/documentation/javadoc.zip b/SIF3InfraREST/documentation/javadoc.zip index b890e117..4ae7d4b0 100644 Binary files a/SIF3InfraREST/documentation/javadoc.zip and b/SIF3InfraREST/documentation/javadoc.zip differ diff --git a/SIF3InfraREST/lib/.gitignore b/SIF3InfraREST/lib/.gitignore new file mode 100644 index 00000000..3d3ae6f6 --- /dev/null +++ b/SIF3InfraREST/lib/.gitignore @@ -0,0 +1 @@ +/RicOneAPI/ diff --git a/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.1.jar b/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.1.jar new file mode 100644 index 00000000..54cff140 Binary files /dev/null and b/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.1.jar differ diff --git a/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.jar b/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.jar deleted file mode 100644 index d58a369b..00000000 Binary files a/SIF3InfraREST/lib/datamodel/sifDataModel_au3.4.jar and /dev/null differ diff --git a/SIF3InfraREST/pom.xml b/SIF3InfraREST/pom.xml index d1863d63..adb7cf2a 100644 --- a/SIF3InfraREST/pom.xml +++ b/SIF3InfraREST/pom.xml @@ -17,7 +17,7 @@ sif3.framework sif3-framework - 0.10.0-beta + 0.11.0-beta pom @@ -38,7 +38,7 @@ ${project.lib.dir}/datamodel - 3.1 + 3.2.1 sif${sifInfraVersion} @@ -61,7 +61,7 @@ sifau sif3-au-datamodel - 3.4 + 3.4.1 test @@ -88,12 +88,20 @@ - + - log4j - log4j - 1.2.14 + org.slf4j + slf4j-api + 1.7.22 + + + + + org.slf4j + slf4j-log4j12 + 1.7.22 + test @@ -147,11 +155,11 @@ install-external-au-datamodel clean - ${project.lib.dir}/datamodel/sifDataModel_au3.4.jar + ${project.lib.dir}/datamodel/sifDataModel_au3.4.1.jar default sifau sif3-au-datamodel - 3.4 + 3.4.1 jar true diff --git a/SIF3InfraREST/release/sif3.1Infra-common-0.10.0-beta.jar b/SIF3InfraREST/release/sif3.1Infra-common-0.10.0-beta.jar deleted file mode 100644 index 83c26a60..00000000 Binary files a/SIF3InfraREST/release/sif3.1Infra-common-0.10.0-beta.jar and /dev/null differ diff --git a/SIF3InfraREST/release/sif3.1Infra-model-0.10.0-beta.jar b/SIF3InfraREST/release/sif3.1Infra-model-0.10.0-beta.jar deleted file mode 100644 index a3a7a504..00000000 Binary files a/SIF3InfraREST/release/sif3.1Infra-model-0.10.0-beta.jar and /dev/null differ diff --git a/SIF3InfraREST/release/sif3.1Infra-rest-0.10.0-beta.jar b/SIF3InfraREST/release/sif3.1Infra-rest-0.10.0-beta.jar deleted file mode 100644 index c12c4b34..00000000 Binary files a/SIF3InfraREST/release/sif3.1Infra-rest-0.10.0-beta.jar and /dev/null differ diff --git a/SIF3InfraREST/release/sif3.1Common-0.10.0-beta.jar b/SIF3InfraREST/release/sif3.2.1Common-0.11.0-beta.jar similarity index 52% rename from SIF3InfraREST/release/sif3.1Common-0.10.0-beta.jar rename to SIF3InfraREST/release/sif3.2.1Common-0.11.0-beta.jar index 8eb91bdc..0d508d6c 100644 Binary files a/SIF3InfraREST/release/sif3.1Common-0.10.0-beta.jar and b/SIF3InfraREST/release/sif3.2.1Common-0.11.0-beta.jar differ diff --git a/SIF3InfraREST/release/sif3.2.1Infra-common-0.11.0-beta.jar b/SIF3InfraREST/release/sif3.2.1Infra-common-0.11.0-beta.jar new file mode 100644 index 00000000..f2a69ae0 Binary files /dev/null and b/SIF3InfraREST/release/sif3.2.1Infra-common-0.11.0-beta.jar differ diff --git a/SIF3InfraREST/release/sif3.2.1Infra-model-0.11.0-beta.jar b/SIF3InfraREST/release/sif3.2.1Infra-model-0.11.0-beta.jar new file mode 100644 index 00000000..d86fdbc7 Binary files /dev/null and b/SIF3InfraREST/release/sif3.2.1Infra-model-0.11.0-beta.jar differ diff --git a/SIF3InfraREST/release/sif3.2.1Infra-rest-0.11.0-beta.jar b/SIF3InfraREST/release/sif3.2.1Infra-rest-0.11.0-beta.jar new file mode 100644 index 00000000..037aaad8 Binary files /dev/null and b/SIF3InfraREST/release/sif3.2.1Infra-rest-0.11.0-beta.jar differ diff --git a/SIF3InfraREST/release/v0.11.0/Release_Notes_v0.11.0.txt b/SIF3InfraREST/release/v0.11.0/Release_Notes_v0.11.0.txt new file mode 100644 index 00000000..a0decfcf --- /dev/null +++ b/SIF3InfraREST/release/v0.11.0/Release_Notes_v0.11.0.txt @@ -0,0 +1,116 @@ +============================================================== +Release Notes for v0.11.0 of SIF3 Framework (MMM DD, 2017) +============================================================== + +Bug Fixes +--------- +- Fix pom.xml for sif3-common to ensure the latest jettison library is used rather than an old one + that is included through jersey. Old one has a bug with JSON deserialising. Latest version fixes + that issue. + +New Functionality +----------------- +- Updated framework to use SIF 3.2.1 Infrastructure namespace and data model. +- Support for "Fingerprint" as per SIF 3.2.1 Infrastructure. Please refer to notes in "Infrastructure Upgrade" + section further down. + +Changed Functionality +--------------------- +- Dependency on slf4j rather than hard-wired log4j. Please refer to notes in "3rd Party Library Update" section + further down. +- Approach to link externals security services (i.e. OAuth) to the framework has changed slightly). + THIS WILL BREAK YOUR CODE if you use this functionality. See Infrastructure Upgrade section below for more details. + +Removed Artifacts/Functionality +------------------------------- +- None + +-------------------------- +-- Upgrade Instructions -- +-------------------------- + +---------------------------- +-- Infrastructure Upgrade -- +---------------------------- +DB Upgrade Step 1 +----------------- +Due to the support of the "Fingerprint" in SIF 3.2.1 there was the need to update the database structure of the +SIF3_SESSION table. There is a SQL script THAT MUST BE RUN first to upgrade the database. It will add a new +column to the SIF3_SESSION table and it will also upgrade the namespace of all existing environment XML in that +table to SIF 3.2.1. +The script can be found in the directory /DB/DDL/Datafix/current/v0.10.0-v0.11.0. Run the script +with the name Datafix20170314_.sql. If you use a database other than the ones that have an update script +provided you should be able to derive your script based on one of the provided one's. + +DB Upgrade Step 2 +----------------- +Some new tables have been added to allow more flexible configuration when external security services need to be +enabled (i.e. OAuth). For this run the database SQL script named Datafix20170330_.sql in the +/DB/DDL/Datafix/current/v0.10.0-v0.11.0. If you use a database other than the ones that have an +update script provided you should be able to derive your script based on one of the provided one's. + +Environment Template Upgrade +---------------------------- +The environment template XMLs need a fix as well. They should be in a directory called "environments/consumer/template" +and "environments/provider/template". Ensure that the namespace http://www.sifassociation.org/infrastructure/3.1 or +http://www.sifassociation.org/infrastructure/3.0.1 is changed to http://www.sifassociation.org/infrastructure/3.2.1. + +Upgrade your Project +-------------------- +Once the above steps are done you can upgrade your project with the latest libraries of the framework as stated below: + +Ant: +Drop the latest framework library into your project's lib directory/directories + +Maven: +Use the latest maven dependency + + sif3.framework + sif3-infra-rest + 0.11.0 + + + +========================================================================================================================== +External Security Services ONLY: Compilation Error due to new parameter in Constructor of AbstractSecurityService Class. +-------------------------------------------------------------------------------------------------------------------------- +Due to an additional parameters in the constructor of the AbstractSecurityService class all classes that extend that class will +report a compilation error. Please note only the additional parameter must be added to rectify the compile error. You wont't +need to change any other code. + +Name & Type of Parameter: Map securityServiceParameters + +Add the above parameter to the constructor of your class that extends the AbstractSecurityService class. Your constructor +signature will change from: + + public YourSecurityClassName(AdvancedProperties properties) + { + ... + } + +to: + + public YourSecurityClassName(AdvancedProperties properties, + Map securityServiceParameters) // <== NOTE NEW PARAMETER + { + ... + } + +Due to the change how external Security Services are configured you will need to configure the SIF3_EXT_SECURITY_SERVICE +table as listed in the developer's guide in section 5.10. Basically the property value called adapter.security.service in +your adapter's property file will now be in the SIF3_EXT_SECURITY_SERVICE table in the column IMPLEMENTATION_CLASS. + +------------------------ +-- Data Model Upgrade -- +------------------------ +None. + +------------------------------ +-- 3rd Party Library Update -- +------------------------------ +The SIF3 Framework uses the sfl4j as its logging framework. This has changed from the hard-wired log4j. This change allows that the +implementation can easily choose between logging implementations. To allow proper and full logging a slf4j binding implementation +must be provided with your implementation. The example in the SIF3Demo project uses the slf4j-log4j12 as a binding implementation. + - Maven: Simply add the appropriate bridge dependency to your project (see SIF3Demo for an example). + - Ant: You need to add the slf4j-api-.jar and an appropriate slf4j bridging jar (i.e. self4j-log4j-) to your + project. diff --git a/SIF3InfraREST/sif3Common/pom.xml b/SIF3InfraREST/sif3Common/pom.xml index 6bc97e5e..f73d1ebc 100644 --- a/SIF3InfraREST/sif3Common/pom.xml +++ b/SIF3InfraREST/sif3Common/pom.xml @@ -6,7 +6,7 @@ sif3.framework sif3-framework - 0.10.0-beta + 0.11.0-beta @@ -52,13 +52,18 @@ - + - log4j - log4j + org.slf4j + slf4j-api - + + + org.slf4j + slf4j-log4j12 + + @@ -76,6 +81,15 @@ jsr311-api + + + + + org.codehaus.jettison + jettison + 1.3.8 + + diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/AdvancedProperties.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/AdvancedProperties.java index 23e5e546..4333f517 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/AdvancedProperties.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/AdvancedProperties.java @@ -20,7 +20,9 @@ import java.util.List; import java.util.Properties; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * @author Joerg Huber @@ -28,7 +30,7 @@ */ public class AdvancedProperties { - protected Logger logger = Logger.getLogger(getClass()); + protected Logger logger = LoggerFactory.getLogger(getClass()); private String propFileNameFull = null; private Properties props = null; diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GUIDGenerator.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GUIDGenerator.java index 2274a59c..bd51eaae 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GUIDGenerator.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GUIDGenerator.java @@ -16,15 +16,15 @@ */ package au.com.systemic.framework.utils; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Joerg Huber */ public class GUIDGenerator { - protected static final Logger logger = Logger.getLogger(GUIDGenerator.class); - + protected static Logger logger = LoggerFactory.getLogger(GUIDGenerator.class); /** * Method to generate the random GUID that is 32 characters long made of HEX code and in upper case. It will follow the RFC4122 with * the exception that the returned GUIDs have upper case only and the '-' removed. diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GZIPUtil.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GZIPUtil.java index 253e51ac..6a0699fa 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GZIPUtil.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/GZIPUtil.java @@ -24,7 +24,8 @@ import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import au.com.systemic.framework.types.ByteArray; @@ -36,7 +37,7 @@ */ public class GZIPUtil { - protected static final Logger logger = Logger.getLogger(GZIPUtil.class); + protected static final Logger logger = LoggerFactory.getLogger(GZIPUtil.class); /** * This method gzip the given string and returns the gzip as a byte array. If anything fails during the process then diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyFileReader.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyFileReader.java index 8eba4cdd..2c4bdccb 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyFileReader.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyFileReader.java @@ -19,14 +19,15 @@ import java.io.IOException; import java.util.Properties; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @author Joerg Huber */ public class PropertyFileReader { - protected final static Logger logger = Logger.getLogger(PropertyFileReader.class); + protected final static Logger logger = LoggerFactory.getLogger(PropertyFileReader.class); private String propFileNameFull = null; diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyManager.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyManager.java index 13561480..b9bae390 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyManager.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/PropertyManager.java @@ -20,7 +20,9 @@ import java.util.HashMap; import java.util.List; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + /** * This class allows to load any number of property files and keep their content in a singleton to avoid poroperty files to be read over @@ -32,7 +34,7 @@ */ public class PropertyManager { - protected Logger logger = Logger.getLogger(getClass()); + protected Logger logger = LoggerFactory.getLogger(getClass()); private HashMap properties = new HashMap(); diff --git a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/XMLUtils.java b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/XMLUtils.java index b5b869bd..fea9b282 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/XMLUtils.java +++ b/SIF3InfraREST/sif3Common/src/main/java/au/com/systemic/framework/utils/XMLUtils.java @@ -29,7 +29,6 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import org.apache.log4j.Logger; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; @@ -39,6 +38,8 @@ import org.jdom.output.Format; import org.jdom.output.XMLOutputter; import org.jdom.xpath.XPath; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.xml.sax.InputSource; /** @@ -50,7 +51,7 @@ public class XMLUtils protected static org.w3c.dom.DocumentFragment tmpFragment = null; protected static int tmpNameCounter = 0; - protected final static Logger logger = Logger.getLogger(XMLUtils.class); + protected final static Logger logger = LoggerFactory.getLogger(XMLUtils.class); private static final XMLOutputter prettyXML = new XMLOutputter(Format.getPrettyFormat()); private static final XMLOutputter compactXML = new XMLOutputter(Format.getCompactFormat()); diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/CommonConstants.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/CommonConstants.java index 18307ad8..d77571a3 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/CommonConstants.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/CommonConstants.java @@ -121,6 +121,8 @@ public enum QueuePollingType {IMMEDIATE, LONG}; /*------------------------------------------------------------------------------------*/ /* URL Query Parameter names in relation to security (special case for SIF Express) --*/ /*------------------------------------------------------------------------------------*/ + public enum AuthenticationType {Basic, SIF_HMACSHA256, Other}; + public static final String ACCESS_TOKEN = "access_token"; public static final String AUTH_METHOD = "authenticationMethod"; // Indicates the authentication method to use with access token public static final String ISO8601_TIMESTAMP = "timestamp"; // If SIF_HMACHSHA256 is used a timestamp in ISO8601 has to be provided. diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/RequestHeaderConstants.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/RequestHeaderConstants.java index fc36e0cb..18c8822f 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/RequestHeaderConstants.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/RequestHeaderConstants.java @@ -39,6 +39,7 @@ public class RequestHeaderConstants public static final String HDR_SERVICE_TYPE = "serviceType"; // OBJECT, FUNCTION, UTILITY, SERVICEPATH, XQUERYTEMPLATE public static final String HDR_DATE_TIME = "timestamp"; public static final String HDR_SOURCE_NAME = "sourceName"; + public static final String HDR_FINGERPRINT = "fingerprint"; /*------------------------------- Early SIF 3.1.0 proposed header fields -------------------------------*/ /*-- Experimental as of January 2015: Use with care because it is not officially part of SIF 3.x, yet --*/ @@ -83,6 +84,7 @@ public class RequestHeaderConstants HDR_SERVICE_TYPE, HDR_DATE_TIME, HDR_SOURCE_NAME, + HDR_FINGERPRINT, // Early adopted field (not yet officially supported) HDR_APPLICATION_KEY, diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/ResponseHeaderConstants.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/ResponseHeaderConstants.java index 3ffe204e..d1173012 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/ResponseHeaderConstants.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/header/ResponseHeaderConstants.java @@ -65,7 +65,9 @@ public class ResponseHeaderConstants public static final String HDR_CONTEXT_ID = "contextId"; public static final String HDR_ZONE_ID = "zoneId"; public static final String HDR_EVENT_ACTION = "eventAction"; // CREATE, UPDATE, DELETE (see HeaderValues.EventAction) - public static final String HDR_CONSUMER_ID = "connectionId"; // Used by getMessage() on queue to identify the thread that queries + public static final String HDR_CONSUMER_ID = "connectionId"; // Used by getMessage() on queue to identify the thread that queries + public static final String HDR_FINGERPRINT = "fingerprint"; + // NON SIF specific but of interest public static final String HDR_CONNECTION = "Connection"; @@ -107,6 +109,7 @@ public class ResponseHeaderConstants HDR_UPDATE_TYPE, HDR_SERVICE_NAME, HDR_CONSUMER_ID, + HDR_FINGERPRINT, }; } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AttributeValue.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AttributeValue.java new file mode 100644 index 00000000..6b3420d1 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AttributeValue.java @@ -0,0 +1,73 @@ +/* + * AttributeValue.java + * Created: 4 Apr 2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.model; + +import java.io.Serializable; + +/** + * This is a simple POJO to represent a string based attribute/value object. + * + * @author Joerg Huber + */ +public class AttributeValue implements Serializable +{ + private static final long serialVersionUID = 8905008772095616682L; + + private String attribute = null; + private String value = null; + + public AttributeValue() + { + this(null, null); + } + + public AttributeValue(String attribute, String value) + { + super(); + setAttribute(attribute); + setValue(value); + } + + public String getAttribute() + { + return attribute; + } + + public void setAttribute(String attribute) + { + this.attribute = attribute; + } + + public String getValue() + { + return value; + } + + public void setValue(String value) + { + this.value = value; + } + + @Override + public String toString() + { + return "AttributeValue [attribute=" + attribute + ", value=" + value + "]"; + } + + +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AuthenticationInfo.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AuthenticationInfo.java index c3b9a58b..e2a30b19 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AuthenticationInfo.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/AuthenticationInfo.java @@ -21,6 +21,9 @@ import java.io.Serializable; import java.util.Date; +import sif3.common.model.security.InternalSecurityServiceConstants; +import sif3.common.model.security.SecurityServiceInfo; + /** * This is a simple utility class to deal with components that make up the authentication token in SIF3. If the authentication method * is 'Basic' or 'SIF_HMACSHA256' then the authentication token has the structure as defined in the SIF specification, meaning it is @@ -36,62 +39,41 @@ public class AuthenticationInfo implements Serializable { private static final long serialVersionUID = -8736784141972585133L; - /* Defines valid authentication methods for SIF 3.0 */ - public enum AuthenticationMethod {Basic, SIF_HMACSHA256, Bearer}; + private SecurityServiceInfo securityServiceInfo = null; - private AuthenticationMethod authMethod = AuthenticationMethod.Basic; - private String userToken = null; - private String password = null; - private Date expireDate = null; // date when token expires. + // private String authMethod = AuthenticationType.Basic.name(); + private String userToken = null; + private String password = null; + private Date expireDate = null; // date when token expires. public AuthenticationInfo() { - this(AuthenticationMethod.Basic, null, null, null); + this(InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY, null, null, null); } - - public AuthenticationInfo(AuthenticationMethod authMethod, String userToken, String password, Date expireDate) + public AuthenticationInfo(SecurityServiceInfo securityServiceInfo, String userToken, String password, Date expireDate) { super(); - setAuthMethod(authMethod); + setSecurityServiceInfo(securityServiceInfo); setUserToken(userToken); setPassword(password); setExpireDate(expireDate); } - - public AuthenticationInfo(AuthenticationMethod authMethod, String userToken, String password) - { - this(authMethod, userToken, password, null); - } - - public AuthenticationInfo(String authMethod, String userToken, String password) - { - this(null, userToken, password, null); - setAuthMethod(authMethod); - } - - public AuthenticationMethod getAuthMethod() + public AuthenticationInfo(SecurityServiceInfo securityServiceInfo, String userToken, String password) { - return authMethod; + this(securityServiceInfo, userToken, password, null); } - public void setAuthMethod(AuthenticationMethod authMethod) - { - this.authMethod = authMethod; - } + public SecurityServiceInfo getSecurityServiceInfo() + { + return securityServiceInfo; + } - public void setAuthMethod(String authMethod) - { - try - { - this.authMethod = AuthenticationMethod.valueOf(authMethod); - } - catch (Exception ex) - { - this.authMethod = AuthenticationMethod.Basic; - } - } + public void setSecurityServiceInfo(SecurityServiceInfo securityServiceInfo) + { + this.securityServiceInfo = securityServiceInfo; + } public String getUserToken() { @@ -126,9 +108,8 @@ public void setExpireDate(Date expireDate) @Override public String toString() { - return "AuthenticationInfo [authMethod=" + authMethod + ", userToken=" - + userToken + ", password=" + password + ", expireDate=" - + expireDate + "]"; + return "AuthenticationInfo [securityServiceInfo=" + securityServiceInfo + ", userToken=" + + userToken + ", password=" + password + ", expireDate=" + expireDate + "]"; } } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/RequestMetadata.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/RequestMetadata.java index 9c84c886..49377e15 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/RequestMetadata.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/RequestMetadata.java @@ -31,15 +31,20 @@ public class RequestMetadata extends BaseMetadata private static final long serialVersionUID = 1477907327110025038L; private QueryIntention queryIntention = null; // May only be used in HTTP GET requests -// private String navigationID = null; // May only be used in HTTP GET requests - + // Refer to javadoc for the getSourceName() method. private String sourceName = null; // Refer to javadoc for the getEnvironmentID() method. private String environmentID = null; // Only useful in DIRECT environments - public RequestMetadata(URLQueryParameter queryParams, HeaderProperties httpHeaderParams) + // Introduced in SIF 3.2.1. Uniquely identifies the consumer. + // In a brokered environment this value will be set by the broker. + // In a direct environment this framework will assign the value according to the environment of the consumer regardless of + // what the consumer has set this header for. This will ensure that a consumer cannot pretend to be someone else. + private String fingerprint = null; + + public RequestMetadata(URLQueryParameter queryParams, HeaderProperties httpHeaderParams) { super(queryParams, httpHeaderParams); } @@ -54,16 +59,6 @@ public void setQueryIntention(QueryIntention queryIntention) this.queryIntention = queryIntention; } -// public String getNavigationID() -// { -// return this.navigationID; -// } -// -// public void setNavigationID(String navigationID) -// { -// this.navigationID = navigationID; -// } - /** * IMPORTANT:
* This value is assigned by the broker in a brokered environment. It is something that identifies the source @@ -111,10 +106,21 @@ public void setEnvironmentID(String environmentID) this.environmentID = environmentID; } - @Override + public String getFingerprint() + { + return fingerprint; + } + + public void setFingerprint(String fingerprint) + { + this.fingerprint = fingerprint; + } + + @Override public String toString() { - return "RequestMetadata [queryIntention=" + this.queryIntention + ", sourceName=" + this.sourceName + ", environmentID=" - + this.environmentID + ", toString()=" + super.toString() + "]"; + return "RequestMetadata [queryIntention=" + queryIntention + ", sourceName=" + sourceName + + ", environmentID=" + environmentID + ", fingerprint=" + fingerprint + + ", toString()=" + super.toString() + "]"; } } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/SIFEvent.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/SIFEvent.java index 97f32420..48e682e1 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/SIFEvent.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/SIFEvent.java @@ -41,7 +41,8 @@ public class SIFEvent implements Serializable private EventAction eventAction; private int listSize; private UpdateType updateType; - private HashMap metadata = new HashMap(); + private String fingerprint; + private HashMap metadata = new HashMap(); public SIFEvent() { @@ -124,6 +125,16 @@ public HashMap getMetadata() return this.metadata; } + public String getFingerprint() + { + return fingerprint; + } + + public void setFingerprint(String fingerprint) + { + this.fingerprint = fingerprint; + } + /** * This method stores a simple name/value hashmap with this event. Note that this data is not forming part of the actual event that * is being sent in a provider. It is also not received by a consumer from the event queue. It is the developer that can add additional @@ -150,9 +161,9 @@ public void addMetadataValue(String name, String value) @Override public String toString() { - return "SIFEvent [sifObjectList=" + this.sifObjectList + ", eventAction=" - + this.eventAction + ", listSize=" + this.listSize + ", updateType=" - + this.updateType + ", metadata=" + this.metadata + "]"; + return "SIFEvent [sifObjectList=" + sifObjectList + ", eventAction=" + eventAction + + ", listSize=" + listSize + ", updateType=" + updateType + ", fingerprint=" + + fingerprint + ", metadata=" + metadata + "]"; } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/InternalSecurityServiceConstants.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/InternalSecurityServiceConstants.java new file mode 100644 index 00000000..2b475177 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/InternalSecurityServiceConstants.java @@ -0,0 +1,72 @@ +/* + * InternalSecurityServiceConstants.java + * Created: 13 Apr 2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.model.security; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import sif3.common.CommonConstants.AdapterType; +import sif3.common.CommonConstants.AuthenticationType; + +/** + * @author Joerg Huber + * + */ +public class InternalSecurityServiceConstants implements Serializable +{ + private static final long serialVersionUID = -4316613712710000226L; + + // + // Basic + // + public static final SecurityServiceInfo BASIC_CONSUMER_SECURITY = + new SecurityServiceInfo(AuthenticationType.Basic.name(), AdapterType.CONSUMER.name(), AuthenticationType.Basic.name(), AuthenticationType.Basic.name(), Boolean.TRUE, AuthenticationType.Basic); + + public static final SecurityServiceInfo BASIC_PROVIDER_SECURITY = + new SecurityServiceInfo(AuthenticationType.Basic.name(), AdapterType.PROVIDER.name(), AuthenticationType.Basic.name(), AuthenticationType.Basic.name(), Boolean.TRUE, AuthenticationType.Basic); + + public static final SecurityServiceInfo BASIC_ENV_PROVIDER_SECURITY = + new SecurityServiceInfo(AuthenticationType.Basic.name(), AdapterType.ENVIRONMENT_PROVIDER.name(), AuthenticationType.Basic.name(), AuthenticationType.Basic.name(), Boolean.TRUE, AuthenticationType.Basic); + + // SIF_HMACSHA256 + public static final SecurityServiceInfo SIF_HMACSHA256_CONSUMER_SECURITY = + new SecurityServiceInfo(AuthenticationType.SIF_HMACSHA256.name(), AdapterType.CONSUMER.name(), AuthenticationType.SIF_HMACSHA256.name(), AuthenticationType.SIF_HMACSHA256.name(), Boolean.TRUE, AuthenticationType.SIF_HMACSHA256); + + public static final SecurityServiceInfo SIF_HMACSHA256_PROVIDER_SECURITY = + new SecurityServiceInfo(AuthenticationType.SIF_HMACSHA256.name(), AdapterType.PROVIDER.name(), AuthenticationType.SIF_HMACSHA256.name(), AuthenticationType.SIF_HMACSHA256.name(), Boolean.TRUE, AuthenticationType.SIF_HMACSHA256); + + public static final SecurityServiceInfo SIF_HMACSHA256_ENV_PROVIDER_SECURITY = + new SecurityServiceInfo(AuthenticationType.SIF_HMACSHA256.name(), AdapterType.ENVIRONMENT_PROVIDER.name(), AuthenticationType.SIF_HMACSHA256.name(), AuthenticationType.SIF_HMACSHA256.name(), Boolean.TRUE, AuthenticationType.SIF_HMACSHA256); + + + public static final List ALL_INTERNAL_SERVICES = + new ArrayList(Arrays.asList(BASIC_CONSUMER_SECURITY, + BASIC_PROVIDER_SECURITY, + BASIC_ENV_PROVIDER_SECURITY, + SIF_HMACSHA256_CONSUMER_SECURITY, + SIF_HMACSHA256_PROVIDER_SECURITY, + SIF_HMACSHA256_ENV_PROVIDER_SECURITY)); + + // Generic Values not tied to a adapter type. + public static final SecurityServiceInfo BASIC_GENERIC_SECURITY = + new SecurityServiceInfo(AuthenticationType.Basic.name(), null, AuthenticationType.Basic.name(), AuthenticationType.Basic.name(), Boolean.TRUE, AuthenticationType.Basic); + public static final SecurityServiceInfo SIF_HMACSHA256_GENERIC_SECURITY = + new SecurityServiceInfo(AuthenticationType.SIF_HMACSHA256.name(), AdapterType.CONSUMER.name(), AuthenticationType.SIF_HMACSHA256.name(), AuthenticationType.SIF_HMACSHA256.name(), Boolean.TRUE, AuthenticationType.SIF_HMACSHA256); +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceInfo.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceInfo.java new file mode 100644 index 00000000..97f16415 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceInfo.java @@ -0,0 +1,93 @@ +/* + * SecuirtyServiceInfo.java + * Created: 13 Apr 2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.model.security; + +import java.io.Serializable; + +import sif3.common.CommonConstants.AuthenticationType; + +/** + * @author Joerg Huber + * + */ +public class SecurityServiceInfo extends SecurityServiceKey implements Serializable +{ + private static final long serialVersionUID = -2826196563878296341L; + + private String httpHeaderValue = null; + private String xmlValue = null; + private boolean twoPhase = Boolean.FALSE; + private transient AuthenticationType authenticationType = AuthenticationType.Other; + + public SecurityServiceInfo() + { + this(null, null, null, null, Boolean.FALSE, AuthenticationType.Other); + } + + public SecurityServiceInfo(String authenticationMethod, String adapterType, String httpHeaderValue, String xmlValue, boolean twoPhase, AuthenticationType authenticationType) + { + super(authenticationMethod, adapterType); + setHttpHeaderValue(httpHeaderValue); + setXmlValue(xmlValue); + setTwoPhase(twoPhase); + this.authenticationType = authenticationType; + } + + public String getHttpHeaderValue() + { + return httpHeaderValue; + } + + public void setHttpHeaderValue(String httpHeaderValue) + { + this.httpHeaderValue = httpHeaderValue; + } + + public String getXmlValue() + { + return xmlValue; + } + + public void setXmlValue(String xmlValue) + { + this.xmlValue = xmlValue; + } + + public boolean getTwoPhase() + { + return twoPhase; + } + + public void setTwoPhase(boolean twoPhase) + { + this.twoPhase = twoPhase; + } + + public AuthenticationType getAuthenticationType() + { + return authenticationType; + } + + @Override + public String toString() + { + return "SecurityServiceInfo [httpHeaderValue=" + httpHeaderValue + ", xmlValue=" + xmlValue + + ", twoPhase=" + twoPhase + ", authenticationType=" + authenticationType + "]"; + } + +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceKey.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceKey.java new file mode 100644 index 00000000..e4c505e6 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/model/security/SecurityServiceKey.java @@ -0,0 +1,125 @@ +/* + * SecurityServiceKey.java + * Created: 4 Apr 2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.model.security; + +import java.io.Serializable; + +/** + * This class is a simple POJO that has the "key" information that identifies a external security service. It can be used to build + * hash related data structures. + * + * @author Joerg Huber + * + */ +public class SecurityServiceKey implements Serializable +{ + private static final long serialVersionUID = 7603992349542893735L; + + private String authenticationMethod = null; + private String adapterType = null; + + public SecurityServiceKey() + { + this(null, null); + } + + public SecurityServiceKey(String authenticationMethod, String adapterType) + { + super(); + setAuthenticationMethod(authenticationMethod); + setAdapterType(adapterType); + } + + public String getAuthenticationMethod() + { + return authenticationMethod; + } + + public void setAuthenticationMethod(String authenticationMethod) + { + this.authenticationMethod = authenticationMethod != null ? authenticationMethod.toLowerCase() : null; + } + + public String getAdapterType() + { + return adapterType; + } + + public void setAdapterType(String adapterType) + { + this.adapterType = adapterType != null ? adapterType.toLowerCase() : null; + } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ((adapterType == null) ? 0 : adapterType.hashCode()); + result = prime * result + ((authenticationMethod == null) ? 0 : authenticationMethod.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) + { + if (this == obj) + { + return true; + } + if (obj == null) + { + return false; + } + if (getClass() != obj.getClass()) + { + return false; + } + SecurityServiceKey other = (SecurityServiceKey) obj; + if (adapterType == null) + { + if (other.adapterType != null) + { + return false; + } + } + else if (!adapterType.equals(other.adapterType)) + { + return false; + } + if (authenticationMethod == null) + { + if (other.authenticationMethod != null) + { + return false; + } + } + else if (!authenticationMethod.equals(other.authenticationMethod)) + { + return false; + } + return true; + } + + @Override + public String toString() + { + return "SecurityServiceKey [authenticationMethod=" + authenticationMethod + ", adapterType=" + + adapterType + "]"; + } +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/common/HibernateUtil.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/common/HibernateUtil.java index 2d505a29..9478a6c9 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/common/HibernateUtil.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/common/HibernateUtil.java @@ -2,7 +2,6 @@ import java.util.Properties; -import org.apache.log4j.Logger; import org.hibernate.Hibernate; import org.hibernate.Session; import org.hibernate.SessionFactory; @@ -10,10 +9,12 @@ import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class HibernateUtil { - protected static final Logger logger = Logger.getLogger(HibernateUtil.class); + protected final static Logger logger = LoggerFactory.getLogger(HibernateUtil.class); private static SessionFactory sessionFactory = null; diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/AppEnvTemplateDAO.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/AppEnvTemplateDAO.java index 0e268432..e93f6a53 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/AppEnvTemplateDAO.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/AppEnvTemplateDAO.java @@ -19,16 +19,17 @@ import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.criterion.Restrictions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; import sif3.common.persist.common.BasicTransaction; import sif3.common.persist.model.AppEnvironmentTemplate; -import au.com.systemic.framework.utils.StringUtils; /** * Implements some low level DB operations relating to the environment templates and their application relationship. @@ -38,7 +39,7 @@ */ public class AppEnvTemplateDAO extends BaseDAO { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /** * This method attempts to retrive the application environment template. This works in a hierarchical manner. The lowest level of the hierarchy diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/ExternalSecurityServiceDAO.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/ExternalSecurityServiceDAO.java new file mode 100644 index 00000000..e32627a1 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/ExternalSecurityServiceDAO.java @@ -0,0 +1,74 @@ +/* + * ExternalSecurityServiceDAO.java + * Created: 31/03/2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.persist.dao; + +import java.util.List; + +import org.hibernate.Criteria; +import org.hibernate.HibernateException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import sif3.common.exception.PersistenceException; +import sif3.common.persist.common.BasicTransaction; +import sif3.common.persist.model.ExternalSecurityService; + +/** + * Implements some low level DB operations relating to the external security service configuration. + * + * @author Joerg Huber + * + */ +public class ExternalSecurityServiceDAO extends BaseDAO +{ + protected final Logger logger = LoggerFactory.getLogger(getClass()); + + /** + * This method attempts to retrieve all defined security services as listed in the SIF3_EXT_ECURITY_SERVICE table. + * If no services are defined then an empty list is returned. With each returned service all the related parameters + * from the SIF3_SEC_SERVICE_PARAM that relate to a specific service are also returned (i.e. lazy loading is disabled). + * + * @param tx The current transaction. Cannot be null. + * + * @return See desc. + * + * @throws IllegalArgumentException tx is null. + * @throws PersistenceException Could not access underlying data store. + */ + @SuppressWarnings("unchecked") + public List getSecurityServices(BasicTransaction tx) throws IllegalArgumentException, PersistenceException + { + if (tx == null) + { + throw new IllegalArgumentException("Current transaction is null."); + + } + + try + { + Criteria criteria = tx.getSession().createCriteria(ExternalSecurityService.class); + + return criteria.list(); + } + catch (HibernateException e) + { + throw new PersistenceException("Unable to retrieve External Security Service configuration from underlaying data store.", e); + } + } + +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3QueueDAO.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3QueueDAO.java index 3a78650a..1223e733 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3QueueDAO.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3QueueDAO.java @@ -21,17 +21,18 @@ import java.util.Date; import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.criterion.Restrictions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.persist.common.BasicTransaction; import sif3.common.persist.model.SIF3Queue; -import au.com.systemic.framework.utils.StringUtils; /** * Implements some low level DB operations relating to the SIF Queue Information that must be stored locally. @@ -41,7 +42,7 @@ */ public class SIF3QueueDAO extends BaseDAO { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); @SuppressWarnings("unchecked") public SIF3Queue getQueue(BasicTransaction tx, String queueID, AdapterType adapterType) throws IllegalArgumentException, PersistenceException diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SessionDAO.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SessionDAO.java index 5231f0f5..9bdd8ed4 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SessionDAO.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SessionDAO.java @@ -21,17 +21,18 @@ import java.util.Date; import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.criterion.Restrictions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; import sif3.common.persist.common.BasicTransaction; import sif3.common.persist.model.SIF3Session; -import au.com.systemic.framework.utils.StringUtils; /** * This class provides some low level DB access to SIF3 session information. @@ -41,7 +42,7 @@ */ public class SIF3SessionDAO extends BaseDAO { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); @SuppressWarnings("unchecked") public SIF3Session getSessionBySolutionAppkeyUserInst(BasicTransaction tx, EnvironmentKey environmentKey, AdapterType adapterType) throws IllegalArgumentException, PersistenceException diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SubscriptionDAO.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SubscriptionDAO.java index 6b733c6e..7c307261 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SubscriptionDAO.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/dao/SIF3SubscriptionDAO.java @@ -22,18 +22,19 @@ import java.util.Date; import java.util.List; -import org.apache.log4j.Logger; import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.criterion.Restrictions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.persist.common.BasicTransaction; import sif3.common.persist.model.SIF3Queue; import sif3.common.persist.model.SIF3Subscription; -import au.com.systemic.framework.utils.StringUtils; /** * This class provides a low level DB interface to SIF3 subscription information. This information is required locally for retrieveing events on @@ -44,7 +45,7 @@ */ public class SIF3SubscriptionDAO extends BaseDAO { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); @SuppressWarnings("unchecked") public SIF3Subscription getSubscription(BasicTransaction tx, String subscriptionID, AdapterType adapterType) throws IllegalArgumentException, PersistenceException diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/ExternalSecurityService.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/ExternalSecurityService.java new file mode 100644 index 00000000..18f17762 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/ExternalSecurityService.java @@ -0,0 +1,154 @@ +/* + * ExternalSecurityService.java + * Created: 31/03/2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.persist.model; + +import java.io.Serializable; +import java.lang.reflect.Constructor; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AuthenticationType; +import sif3.common.model.security.SecurityServiceInfo; +import sif3.common.security.AbstractSecurityService; + +public class ExternalSecurityService extends SecurityServiceInfo implements Serializable +{ + private final Logger logger = LoggerFactory.getLogger(getClass()); + private static final long serialVersionUID = -5309104809529450455L; + + private long externalSecurityServiceID; + private String implementationClass = null; + private Collection parameters = new ArrayList(); + + // The properties below are runtime properties. They are not read or maintained in the DB! + private transient Constructor constructor = null; + + public ExternalSecurityService() + { + this(null, null, null, null, Boolean.FALSE, AuthenticationType.Other); + } + + public ExternalSecurityService(String authenticationMethod, String adapterType, String httpHeaderValue, String xmlValue, boolean twoPhase, AuthenticationType authenticationType) + { + super(authenticationMethod, adapterType, httpHeaderValue, xmlValue, twoPhase, authenticationType); + } + + public ExternalSecurityService(SecurityServiceInfo securityServiceInfo) + { + this(securityServiceInfo.getAuthenticationMethod(), securityServiceInfo.getAdapterType(), securityServiceInfo.getHttpHeaderValue(), securityServiceInfo.getXmlValue(), securityServiceInfo.getTwoPhase(), securityServiceInfo.getAuthenticationType()); + } + + public long getExternalSecurityServiceID() + { + return externalSecurityServiceID; + } + + public void setExternalSecurityServiceID(long externalSecurityServiceID) + { + this.externalSecurityServiceID = externalSecurityServiceID; + } + + public String getImplementationClass() + { + return implementationClass; + } + + public void setImplementationClass(String implementationClass) + { + if (StringUtils.notEmpty(implementationClass)) // we found a security class. => gather info about it. + { + this.implementationClass = implementationClass; + Class clazz; + try + { + clazz = Class.forName(implementationClass); + this.constructor = clazz.getConstructor(new Class[] { AdvancedProperties.class, Map.class }); + } + catch (Exception ex) + { + logger.error("Failed to find or Configure Class "+implementationClass+" as listed in the SIF3_EXT_SECURITY_SERVICE: "+ex.getMessage(), ex); + } + } + else + { + this.implementationClass = null; + } + } + + public Collection getParameters() + { + return parameters; + } + + public void setParameters(Collection parameters) + { + this.parameters = parameters; + } + + public Constructor getConstructor() + { + return constructor; + } + + public AbstractSecurityService getSecurityService(AdvancedProperties properties) + { + try + { + Map serviceParams = new HashMap(); + if (getParameters()!= null) + { + for (SecurityServiceParameter param : getParameters()) + { + serviceParams.put(param.getParameterName(), param.getParameterValue()); + } + } + + Object classObj = getConstructor().newInstance(new Object[] { properties, serviceParams }); + + if (classObj instanceof AbstractSecurityService) + { + return (AbstractSecurityService) classObj; + } + else + { + logger.error("The class " + classObj.getClass().getSimpleName() + " does not extend AbstractSecurityService. This adapter cannot use this security service implementation."); + return null; + } + } + catch (Exception ex) + { + logger.error("Failed to create an instance of the Class "+getImplementationClass()+": " + ex.getMessage(), ex); + return null; + } + } + + @Override + public String toString() + { + return "ExternalSecurityService [externalSecurityServiceID=" + externalSecurityServiceID + + ", implementationClass=" + implementationClass + ", parameters=" + parameters + + ", constructor=" + constructor + ", toString()=" + super.toString() + "]"; + } +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Infra.hbm.xml b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Infra.hbm.xml index d0c6846d..6861a3a5 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Infra.hbm.xml +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Infra.hbm.xml @@ -20,6 +20,7 @@ + @@ -98,4 +99,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Session.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Session.java index edbbcc35..16077aa5 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Session.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SIF3Session.java @@ -23,16 +23,16 @@ import java.util.Date; import java.util.List; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.header.HeaderValues.ServiceType; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.model.EnvironmentKey; import sif3.common.model.SIFContext; import sif3.common.model.SIFZone; import sif3.common.model.ServiceInfo; import sif3.common.model.ServiceRights.AccessRight; import sif3.common.model.ServiceRights.AccessType; -import au.com.systemic.framework.utils.StringUtils; /** * POJO to encapsulate SIF3 Session Information and configuration. @@ -49,7 +49,8 @@ public class SIF3Session extends EnvironmentKey implements Serializable private String password; private String sessionToken; private String environmentID; - private String adapterType; //CONSUMER, PROVIDER, ENVIRONMENT_PROVIDER + private String fingerprint; + private String adapterType; //CONSUMER, PROVIDER, ENVIRONMENT_PROVIDER private String securityToken; private Date securityTokenExpiry; private String environmentXML; @@ -59,7 +60,7 @@ public class SIF3Session extends EnvironmentKey implements Serializable // The properties below are runtime properties. They are not read or maintained in the DB! private transient SIFZone defaultZone = null; - private transient AuthenticationMethod authenticationMethod = AuthenticationMethod.Basic; + private transient String authenticationMethod = AuthenticationType.Basic.name(); // List of all services according to the ACL of this session. private transient ArrayList services = new ArrayList(); @@ -121,6 +122,16 @@ public void setEnvironmentID(String environmentID) this.environmentID = environmentID; } + public String getFingerprint() + { + return fingerprint; + } + + public void setFingerprint(String fingerprint) + { + this.fingerprint = fingerprint; + } + public String getSecurityToken() { return securityToken; @@ -196,24 +207,14 @@ public void setLastAccessed(Date lastAccessed) this.lastAccessed = lastAccessed; } - public AuthenticationMethod getAuthenticationMethod() + public String getAuthenticationMethod() { return authenticationMethod; } - /** - * Will default to BASIC if set to null. - * - * @param authenticationMethod the authenticationMethod to set. - */ - public void setAuthenticationMethod(AuthenticationMethod authenticationMethod) - { - this.authenticationMethod = (authenticationMethod == null) ? AuthenticationMethod.Basic : authenticationMethod; - } - public void setAuthenticationMethod(String authenticationMethod) { - this.authenticationMethod = StringUtils.isEmpty(authenticationMethod) ? AuthenticationMethod.Basic : AuthenticationMethod.valueOf(authenticationMethod); + this.authenticationMethod = StringUtils.isEmpty(authenticationMethod) ? AuthenticationType.Basic.name() : authenticationMethod; } /*---------------------------------------------------------------------------------------------------------------------------------------*/ @@ -405,20 +406,17 @@ public SIFContext getContext(SIFContext context) } - /* (non-Javadoc) - * @see java.lang.Object#toString() - */ - @Override + @Override public String toString() { return "SIF3Session [sessionID=" + sessionID + ", adapterName=" + adapterName + ", password=" + password + ", sessionToken=" + sessionToken + ", environmentID=" - + environmentID + ", adapterType=" + adapterType + ", securityToken=" - + securityToken + ", securityTokenExpiry=" + securityTokenExpiry - + ", environmentXML=" + environmentXML + ", queueStrategy=" + queueStrategy - + ", created=" + created + ", lastAccessed=" + lastAccessed + ", defaultZone=" - + defaultZone + ", authenticationMethod=" + authenticationMethod + ", services=" - + services + ", toString()=" + super.toString() + "]"; + + environmentID + ", fingerprint=" + fingerprint + ", adapterType=" + adapterType + + ", securityToken=" + securityToken + ", securityTokenExpiry=" + + securityTokenExpiry + ", environmentXML=" + environmentXML + ", queueStrategy=" + + queueStrategy + ", created=" + created + ", lastAccessed=" + lastAccessed + + ", defaultZone=" + defaultZone + ", authenticationMethod=" + authenticationMethod + + ", services=" + services + ", toString()=" + super.toString() + "]"; } /*---------------------*/ diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SecurityServiceParameter.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SecurityServiceParameter.java new file mode 100644 index 00000000..e7b29b41 --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/model/SecurityServiceParameter.java @@ -0,0 +1,71 @@ +/* + * SecurityServiceParameter.java + * Created: 31/03/2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.persist.model; + +import java.io.Serializable; + +public class SecurityServiceParameter implements Serializable //, Comparable +{ + private static final long serialVersionUID = -7587054623306008525L; + + private long parameterID; + private String parameterName; + private String parameterValue; + + public SecurityServiceParameter() + { + super(); + } + + public long getParameterID() + { + return parameterID; + } + + public void setParameterID(long parameterID) + { + this.parameterID = parameterID; + } + + public String getParameterName() + { + return parameterName; + } + + public void setParameterName(String parameterName) + { + this.parameterName = parameterName; + } + + public String getParameterValue() + { + return parameterValue; + } + + public void setParameterValue(String parameterValue) + { + this.parameterValue = parameterValue; + } + + @Override + public String toString() + { + return "SecurityServiceParameter [parameterID=" + parameterID + ", parameterName=" + parameterName + + ", parameterValue=" + parameterValue + "]"; + } +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/DBService.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/DBService.java index 79484741..cf2f65fc 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/DBService.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/DBService.java @@ -19,7 +19,8 @@ package sif3.common.persist.service; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.exception.PersistenceException; import sif3.common.persist.common.BasicTransaction; @@ -33,7 +34,7 @@ */ public abstract class DBService { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); public abstract BaseDAO getDAO(); diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/ExternalSecurityService.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/ExternalSecurityService.java new file mode 100644 index 00000000..d9cb33cc --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/ExternalSecurityService.java @@ -0,0 +1,68 @@ +/* + * ExternalSecurityService.java + * Created: 31/03/2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.persist.service; + +import java.util.List; + +import sif3.common.exception.PersistenceException; +import sif3.common.persist.common.BasicTransaction; +import sif3.common.persist.dao.BaseDAO; +import sif3.common.persist.dao.ExternalSecurityServiceDAO; + +/** + * @author Joerg Huber + * + */ +public class ExternalSecurityService extends DBService +{ + private ExternalSecurityServiceDAO externalSecurityServiceDAO = new ExternalSecurityServiceDAO(); + + @Override + public BaseDAO getDAO() + { + return externalSecurityServiceDAO; + } + + /** + * This method attempts to retrieve all defined security services as listed in the SIF3_EXT_ECURITY_SERVICE table. If no + * services are defined then an empty list is returned. With each returned service all the related parameters from the + * SIF3_SEC_SERVICE_PARAM that relate to a specific service are also returned (i.e. lazy loading is disabled). + * + * @return See desc. + * + * @throws PersistenceException Could not access underlying data store. + */ + public List getSecurityServices() throws IllegalArgumentException, PersistenceException + { + List rows = null; + BasicTransaction tx = null; + + try + { + tx = startTransaction(); + rows = externalSecurityServiceDAO.getSecurityServices(tx); + tx.commit(); + } + catch (Exception ex) + { + rollback(tx); + exceptionMapper(ex, "Failed to retrieve list of external security service configurations.", true, false); + } + return rows; + } +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/SIF3SessionService.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/SIF3SessionService.java index b94b7e3e..615e0b9a 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/SIF3SessionService.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/persist/service/SIF3SessionService.java @@ -102,21 +102,21 @@ public SIF3Session getSessionBySessionToken(String sessionToken, AdapterType ada public SIF3Session getSessionBySecurityToken(String securityToken, AdapterType adapterType) throws IllegalArgumentException, PersistenceException { - SIF3Session row = null; - BasicTransaction tx = null; + SIF3Session row = null; + BasicTransaction tx = null; - try - { - tx = startTransaction(); - row = sif3SessionDAO.getSessionBySecurityToken(tx, securityToken, adapterType); - tx.commit(); - } - catch (Exception ex) - { - rollback(tx); - exceptionMapper(ex, "Failed to retrieve session for securityToken = '"+ securityToken + "'.", true, false); - } - return row; + try + { + tx = startTransaction(); + row = sif3SessionDAO.getSessionBySecurityToken(tx, securityToken, adapterType); + tx.commit(); + } + catch (Exception ex) + { + rollback(tx); + exceptionMapper(ex, "Failed to retrieve session for securityToken = '" + securityToken + "'.", true, false); + } + return row; } public void save(SIF3Session sif3Session) throws IllegalArgumentException, PersistenceException @@ -265,6 +265,7 @@ private SIF3Session createNewSession(BasicTransaction tx, EnvironmentKey environ session.setCreated(new Date()); session.setEnvironmentID(UUIDGenerator.getUUID()); session.setSessionToken(UUIDGenerator.getUUID()); + session.setFingerprint(UUIDGenerator.getUUID()); sif3SessionDAO.save(tx, session); } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/AbstractSecurityService.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/AbstractSecurityService.java index 436c94bd..09ff8ce1 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/AbstractSecurityService.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/AbstractSecurityService.java @@ -18,12 +18,13 @@ package sif3.common.security; import java.util.HashMap; +import java.util.Map; +import au.com.systemic.framework.utils.AdvancedProperties; import sif3.common.interfaces.SecurityService; import sif3.common.model.RequestMetadata; import sif3.common.model.security.TokenCoreInfo; import sif3.common.model.security.TokenInfo; -import au.com.systemic.framework.utils.AdvancedProperties; /** * All custom security services that shall be used for 'Bearer' security must extend this abstract Security Service. This will enforce the @@ -46,8 +47,9 @@ public abstract class AbstractSecurityService implements SecurityService /* The consumer's properties. Used to access the property file within the security service implementation. */ private AdvancedProperties properties = null; + private Map securityServiceParameters = null; - /** + /** * Only a provider needs to implement this method. If the security service is used by a consumer it might 'null out' this method (i.e. return * false).

* @@ -106,13 +108,17 @@ public abstract class AbstractSecurityService implements SecurityService /** - * Ensure constructor exists and has no arguments. This is the constructor called by the - * framework to instantiate a concrete security service implementation. + * This is the constructor called by the framework to instantiate a concrete security service implementation. + * + * @param properties Properties file for the given adapter. + * @param securityServiceParameters Name/Value (name=key) map of parameters that are listed in the SIF3_SEC_SERVICE_PARAM table for + * the given security service. */ - public AbstractSecurityService(AdvancedProperties properties) + public AbstractSecurityService(AdvancedProperties properties, Map securityServiceParameters) { super(); this.properties = properties; + this.securityServiceParameters = securityServiceParameters; } @@ -121,6 +127,11 @@ public AdvancedProperties getServiceProperties() return properties; } + public Map getSecurityServiceParameters() + { + return securityServiceParameters; + } + /*-----------------------*/ /*-- Interface Methods --*/ /*-----------------------*/ diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/BearerSecurityFactory.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/BearerSecurityFactory.java deleted file mode 100644 index 840c5b01..00000000 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/BearerSecurityFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * BearerSecurityFactory.java - * Created: 15/12/2014 - * - * Copyright 2014 Systemic Pty Ltd - * - * Licensed 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 sif3.common.security; - -import java.lang.reflect.Constructor; - -import org.apache.log4j.Logger; - -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; - -/** - * This class is the factory for the security service. The SIF3 Framework supports Basic and SIF_HMACSHA256 as security and authentication - * mechanism. These are defined as the known security concepts for SIF 3.0.1. If any other more generic security shall be used, such - * as OAuth, Active Directory etc instead of the SIF 3.0.1 specified options then this framework allows this by means of implementing a - * custom security interface. This factory class gives access to this custom security interface.

- * - * DIRECT Providers within the SIF3 Framework will always use a custom security implementation returned by this factory if the HTTP Authorisation - * header carries a 'Bearer' token rather than a 'Basic' or 'SIF_HMACSHA256' token.

- * - * Consumers will use a custom security implementation if 'Bearer' is stated in the consumer's property file. In such a case the SIF3 Framework - * will use a custom security service returned by this factory to generate a security token to be used in the HTTP Header of all SIF3 requests.

- * - * To enable to 'Bearer' token security implementation the lower level of the SIF3 Framework will use this BearerSecurityFactory to get a - * specific implementation to such a custom security service. If a SIF3 implementation using this framework chooses to use a custom security - * service such as OAuth and therefore implements such a service it must ensure that the consumer's or provider's property file sets the - * 'env.authentication.method' property to 'Bearer' and that the 'adapter.security.service' property holds the fully qualified path of a specific - * security service implementation.

- * - * Note
- * As of July 2015 SIF 3.1 does support other security mechanism besides the SIF internal methods of 'Basic' and 'SIF_HMACSH256'. There is no - * support by any SIF3 broker for that functionality, yet, and therefore the custom security services can only be used in a DIRECT environment. - * - * @author Joerg Huber - * - */ -public class BearerSecurityFactory -{ - private static final Logger logger = Logger.getLogger(BearerSecurityFactory.class); - - private static final String SECURITY_SERVICE_PROP_NAME = "adapter.security.service"; - - private static BearerSecurityFactory factory = null; - - private AdvancedProperties properties = null; - - /* Constructor of the actual security service as per properties file */ - private Constructor constructor = null; - - /** - * Returns the concrete implementation of a security service as defined in the consumer's or provider's property file. If no such - * service is defined to the instantiation of the security service failed then an error is logged and null is returned. - * - * @param properties The consumer's or provider's property file content. - * - * @return See desc. - */ - public static AbstractSecurityService getSecurityService(AdvancedProperties properties) - { - try - { - if (factory == null) // not yet initialised. First time access. - { - factory = new BearerSecurityFactory(properties); - } - - // If we get here then we do have a factory initialised and we should be able to instantiate the security service. - // Instantiate the class. Constructor must exist otherwise an exception would have been called before. - if (factory.getConstructor() != null) - { - Object classObj = factory.getConstructor().newInstance(new Object[] { properties }); - - if (classObj instanceof AbstractSecurityService) - { - return (AbstractSecurityService)classObj; - } - else - { - logger.error("The class "+classObj.getClass().getSimpleName()+" does not extend AbstractSecurityService. This adapter cannot use this security service implementation."); - return null; - } - } - else - { - logger.error("No valid constructor can be found for a custom security service. See previous log entries for details."); - return null; - } - } - catch (Exception ex) - { - logger.error("Failed to initialise BearerSecurityFactory factory: " + ex.getMessage(), ex); - factory = null; - - // Indicate to the caller that call failed. - return null; - } - } - - - /*---------------------*/ - /*-- Private methods --*/ - /*---------------------*/ - private BearerSecurityFactory(AdvancedProperties properties) throws Exception - { - if (properties == null) - { - throw new IllegalArgumentException("Properties given to BearerSecurityFactory is null."); - } - setProperties(properties); - String securityClassName = getProperties().getPropertyAsString(SECURITY_SERVICE_PROP_NAME, null); - if (StringUtils.notEmpty(securityClassName)) // we found a security class. => gather info about it. - { - Class clazz = Class.forName(securityClassName); - setConstructor(clazz.getConstructor(new Class[] { AdvancedProperties.class })); - } - else - { - logger.info("The property '"+SECURITY_SERVICE_PROP_NAME+"' is not set in the service property file. No Security Service will be available."); - } - } - - private AdvancedProperties getProperties() - { - return properties; - } - - private void setProperties(AdvancedProperties properties) - { - this.properties = properties; - } - - private Constructor getConstructor() - { - return constructor; - } - - private void setConstructor(Constructor constructor) - { - this.constructor = constructor; - } -} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/SecurityServiceFactory.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/SecurityServiceFactory.java new file mode 100644 index 00000000..ab145c8d --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/SecurityServiceFactory.java @@ -0,0 +1,169 @@ +/* + * SecurityServiceFactory.java + * Created: 11 Apr 2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.security; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AdapterType; +import sif3.common.model.security.InternalSecurityServiceConstants; +import sif3.common.model.security.SecurityServiceInfo; +import sif3.common.model.security.SecurityServiceKey; +import sif3.common.persist.model.ExternalSecurityService; + +/** + * This class is the factory for the security service. The SIF3 Framework supports Basic and SIF_HMACSHA256 as security and authentication + * mechanism. These are defined as the known security concepts for SIF 3. If any other more generic security shall be used, such + * as OAuth, Active Directory etc instead of the SIF 3 specified options then this framework allows this by means of implementing a + * custom security interface. This factory class gives access to this custom security interface as well as the default BASIC and + * SIF_HMACSHA256.

+ * + * To enable any security service including the default SIF3 ones a implementation of the AbstractSecurity Service for a given + * authentication method will be required. Access to security implementations within the SIF3 Framework will use this SecurityServiceFactory. + * If a SIF3 Adapter using this framework must set the 'env.authentication.method' which will be used in this factory to return the appropriate + * implementation. The tables SIF3_EXT_SECURITY_SERVICE must have an entry for that adapter property to ensure that the correct configuration + * can be loaded and returned by this factory.

+ * + * @author Joerg Huber + * + */ +public class SecurityServiceFactory implements Serializable +{ + private static final long serialVersionUID = -4266212183461454328L; + private static final Logger logger = LoggerFactory.getLogger(SecurityServiceFactory.class); + + private static SecurityServiceFactory factory = null; + + private HashMap securityServices = new HashMap(); + + /** + * This method returns a ExternalSecurityService POJO that holds information about a Security Service. The POJO returned depends + * on the two input parameters. SIF3 Security Service Information is also returned. These are for 'Basic' and 'SIF_HMACSHA256'. If + * any other authentication method is used it must be configured in the SIF3_EXT_SECURITY_SERVICE table. The 'authenticationMethod' + * parameter must match a value in the AUTH_METHOD column of that table (case insensitive!). If no such service can be found then null + * is returned. Please refer to the developer's guide section TBD for more details on how to configure external security services. + * + * @param authenticationMethod The name of the authentication method for which a security service POJO shall be returned. + * There are two internal ones available called 'Basic' and 'SIF_HMACSHA256'. To get an other security + * service it is expected that the caller to this method passes the 'name' of the authentication method + * to this method. This would generally be the first token of the "Authorization" HTTP header. + * For example if OAuth is used the Authorization HTTP Header would be of the form 'Bearer dfuy64kjadfuijh'. + * The first token in this case would be 'Bearer'. + * @param adapterType The adapter type as defined by the enumeration. This enables that a consumer and a provider can have different + * implementation classes. + * + * @return See description. + */ + public static ExternalSecurityService getSecurityService(String authenticationMethod, AdapterType adapterType) + { + try + { + if (factory == null) // not yet initialised. First time access. + { + factory = new SecurityServiceFactory(); + } + + // If we get here then we do have a factory initialised and we should be able to instantiate the security service. + // Check if there is a implementation for the given method and adapter type. + ExternalSecurityService service = factory.getSecurityServices().get(new SecurityServiceKey(authenticationMethod, adapterType.name())); + if (service != null) + { + return service; + } + else + { + logger.error("No implementation can be found for a security service with the Authentication Method = "+authenticationMethod+" and Adapeter Type = "+adapterType+" in the table SIF3_EXT_SECURITY_SERVICE."); + return null; + } + } + catch (Exception ex) + { + logger.error("Failed to initialise Security Service factory: " + ex.getMessage(), ex); + factory = null; + + // Indicate to the caller that call failed. + return null; + } + } + + /*---------------------*/ + /*-- Private methods --*/ + /*---------------------*/ + /* + * MUST throw an exception if anything fails! + */ + private SecurityServiceFactory() throws Exception + { + try + { + sif3.common.persist.service.ExternalSecurityService service = new sif3.common.persist.service.ExternalSecurityService(); + List dbSecurityServices = service.getSecurityServices(); + if ((dbSecurityServices != null) && (dbSecurityServices.size() > 0)) + { + for (ExternalSecurityService extService : dbSecurityServices) + { + // Only put services into the cache that have an implementation class defined. + if (StringUtils.notEmpty(extService.getImplementationClass())) + { + getSecurityServices().put(new SecurityServiceKey(extService.getAuthenticationMethod(), extService.getAdapterType()), extService); + } + } + } + + // Now we put the SIF3 Internal Security configuration into the factory. These will be special cases!! + for (SecurityServiceInfo internalService : InternalSecurityServiceConstants.ALL_INTERNAL_SERVICES) + { + getSecurityServices().put(new SecurityServiceKey(internalService.getAuthenticationMethod(), internalService.getAdapterType()), + new ExternalSecurityService(internalService)); + } + +// for (AdapterType adapterType : AdapterType.values()) +// { +// addInternalService(AuthenticationType.Basic, adapterType); +// addInternalService(AuthenticationType.SIF_HMACSHA256, adapterType); +// } + logger.debug("List of Security Services:\n"+getSecurityServices()); + } + catch (Exception ex) + { + logger.error("Failed to load external service configuration form the data store (SIF3_EXT_SECURITY_SERVICE): " + ex.getMessage(), ex); + throw new Exception(ex); + } + } + + private HashMap getSecurityServices() + { + return securityServices; + } + +// private void setSecurityServices(HashMap securityServices) +// { +// this.securityServices = securityServices; +// } + +// private void addInternalService(AuthenticationType authenticationType, AdapterType adapterType) +// { +// getSecurityServices().put(new SecurityServiceKey(authenticationType.name(), adapterType.name()), +// new ExternalSecurityService(authenticationType.name(), adapterType.name(), authenticationType.name(), authenticationType.name(), Boolean.TRUE, authenticationType)); +// } +} diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509KeystoreManager.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509KeystoreManager.java index e106309c..e33de04e 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509KeystoreManager.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509KeystoreManager.java @@ -27,7 +27,8 @@ import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.X509KeyManager; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is an utility class to load the Keystore from a specific location. The code is inspired from the following @@ -38,7 +39,7 @@ */ public class X509KeystoreManager implements X509KeyManager { - private final Logger logger = Logger.getLogger(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); //The default PKIX X509KeyManager. We'll delegate decisions to it, and fall back to the logic in this class if //the default X509KeyManager doesn't trust it. diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManager.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManager.java index 0bd19376..d47b6afb 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManager.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManager.java @@ -26,7 +26,8 @@ import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509TrustManager; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This class is an utility class to load the Trusted Keystore from a specific location. The code is inspired from the following @@ -37,7 +38,7 @@ */ public class X509TrustedStoreManager implements X509TrustManager { - private final Logger logger = Logger.getLogger(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); /* * The default PKIX X509TrustManager. We'll delegate decisions to it, and fall back to the logic in this diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManagerNoCheck.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManagerNoCheck.java index 3a6c1f50..656d3c6f 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManagerNoCheck.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/security/X509TrustedStoreManagerNoCheck.java @@ -22,7 +22,8 @@ import javax.net.ssl.X509TrustManager; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * This is a "dummy" trusted store implementation that accepts all certificates. There are situations during development @@ -36,7 +37,7 @@ */ public class X509TrustedStoreManagerNoCheck implements X509TrustManager { - private final Logger logger = Logger.getLogger(getClass()); + private final Logger logger = LoggerFactory.getLogger(getClass()); public X509TrustedStoreManagerNoCheck() throws Exception { diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/AuthenticationUtils.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/AuthenticationUtils.java index 8df95215..40dc7d44 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/AuthenticationUtils.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/AuthenticationUtils.java @@ -24,11 +24,17 @@ import javax.crypto.spec.SecretKeySpec; import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; -import sif3.common.model.AuthenticationInfo; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import au.com.systemic.framework.utils.StringUtils; +import sif3.common.CommonConstants.AdapterType; +import sif3.common.CommonConstants.AuthenticationType; +import sif3.common.model.AuthenticationInfo; +import sif3.common.model.security.InternalSecurityServiceConstants; +import sif3.common.model.security.SecurityServiceInfo; +import sif3.common.persist.model.ExternalSecurityService; +import sif3.common.security.SecurityServiceFactory; /** * This class provides a few useful methods for SIF3 specific authentication functions. If the authentication method is 'Basic' or @@ -43,7 +49,7 @@ */ public class AuthenticationUtils { - protected static final Logger logger = Logger.getLogger(AuthenticationUtils.class); + protected final static Logger logger = LoggerFactory.getLogger(AuthenticationUtils.class); /*----------------------*/ /*-- Encoding Methods --*/ @@ -60,7 +66,7 @@ public class AuthenticationUtils */ public static String getBasicAuthToken(String username, String password) { - return AuthenticationMethod.Basic.name()+" "+base64Encode(username, password); + return InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getHttpHeaderValue()+" "+base64Encode(username, password); } /** @@ -78,7 +84,7 @@ public static String getBasicAuthToken(String username, String password) public static String getSIFHMACSHA256AuthToken(String username, String password, String dateAsISO8601) { String token = username+":"+hmacsha256Base64(username+":"+dateAsISO8601, password); - return AuthenticationMethod.SIF_HMACSHA256.name()+" "+new String(Base64.encodeBase64(token.getBytes()), Charset.forName("ASCII")); + return InternalSecurityServiceConstants.SIF_HMACSHA256_GENERIC_SECURITY.getHttpHeaderValue()+" "+new String(Base64.encodeBase64(token.getBytes()), Charset.forName("ASCII")); } /** @@ -87,18 +93,18 @@ public static String getSIFHMACSHA256AuthToken(String username, String password, * @param token The token to be used got the final authentication token. * @param password Optional. Not currently used. * - * @return The Bearer Authentication Token of the form "Bearer ". + * @return The Authentication Token of the form "XXX ", where XXX is the value of the security service HTTP Value. */ - public static String getBearerAuthToken(String token, String password) + public static String getOtherAuthToken(SecurityServiceInfo serviceInfo, String token, String password) { - return AuthenticationMethod.Bearer.name()+" "+ token; + return serviceInfo.getHttpHeaderValue()+" "+ token; } /** * This method create the full authentication token of the format:
* If authentication method is Basic or SIF_HMACSHA256: " "base64Encode(:)
- * If authentication method is Bearer: Bearer . Meaning that the userToken is untouched, i.e. not base64 encoded.
+ * If authentication method is Other: ABX . Meaning that the userToken is untouched, i.e. not base64 encoded.
*
* If the authInfo is null then null is returned. * @@ -113,13 +119,13 @@ public static String getFullBase64Token(AuthenticationInfo authInfo) { return null; } - if (authInfo.getAuthMethod() != AuthenticationInfo.AuthenticationMethod.Bearer) + if (authInfo.getSecurityServiceInfo().getAuthenticationType() != AuthenticationType.Other) { - return authInfo.getAuthMethod().name() + " " + base64Encode(authInfo.getUserToken(), authInfo.getPassword()); + return authInfo.getSecurityServiceInfo().getHttpHeaderValue() + " " + base64Encode(authInfo.getUserToken(), authInfo.getPassword()); } - else // It is Bearer so leave token untouched! + else // It is other so leave token untouched! { - return getBearerAuthToken(authInfo.getUserToken(), null); + return getOtherAuthToken(authInfo.getSecurityServiceInfo(), authInfo.getUserToken(), null); } } @@ -225,22 +231,13 @@ public static String extractAuthToken(String fullToken) * @return The prefix of the fullToken. Will be one of the values of the AuthenticationMethod enum. If an invalid auth method * is used then null is returned. */ - public static AuthenticationMethod extractAuthenticationMethod(String fullToken) + public static String extractAuthenticationMethod(String fullToken) { if (StringUtils.notEmpty(fullToken)) { fullToken = fullToken.trim(); int splitPos = fullToken.indexOf(" "); - String authMethodStr = (splitPos>0) ? fullToken.substring(0, splitPos) : null; - try - { - return (authMethodStr != null) ? AuthenticationMethod.valueOf(authMethodStr) : null; - } - catch (Exception ex) - { - logger.error(authMethodStr+" is an invalid authentication method. Valid values are Basic, SIF_HMACSHA256 and Bearer."); - return null; - } + return (splitPos>0) ? fullToken.substring(0, splitPos) : null; } return null; } @@ -272,19 +269,21 @@ public static String[] splitValuesFromBase64(String token) /** * This method takes the full authentication token. This is the token that has one of the two forms:
* ("Basic"|"SIF_HMACSHA256")" " where the must be of the format: - * :.
- * "Bearer "

+ * :.
+ * "XXX "

*
* If the token does not follow one of these structures, i.e. cannot be split into these components then it is invalid and null - * is returned. If the token can be split successfully then the returned AuthenticationInfo has the following Structure:

+ * is returned. Null is also returned if no authentication method can be determined based on the authentication method in the + * fullBaseToken. This will be logged. If the token can be split successfully then the returned AuthenticationInfo has the following + * Structure:

* * For "Basic"|"SIF_HMACSHA256":
* AuthenticationInfo.authMethod="Basic"|"SIF_HMACSHA256"
* AuthenticationInfo.userToken=
* AuthenticationInfo.password=

* - * For "Bearer":
- * AuthenticationInfo.authMethod="Bearer"
+ * For "XXX":
+ * AuthenticationInfo.authMethod="XXX"
* AuthenticationInfo.userToken=
* AuthenticationInfo.password=null

* @@ -292,34 +291,43 @@ public static String[] splitValuesFromBase64(String token) * according to the SIF3 spec. * * @param fullBaseToken See desc. + * @param adapterType indicates if this is authentication for Consumer or Provider. This is required for external authentication + * where it is necessary to lookup the implementation from the Security Factory. * * @return See Desc */ - public static AuthenticationInfo getPartsFromAuthToken(String fullBaseToken) +// public static AuthenticationInfo getPartsFromAuthToken(SecurityServiceInfo serviceInfo, String fullBaseToken) + public static AuthenticationInfo getPartsFromAuthToken(String fullBaseToken, AdapterType adapterType) { fullBaseToken = fullBaseToken.trim(); int splitPos = fullBaseToken.indexOf(" "); String authMethodStr = (splitPos>0) ? fullBaseToken.substring(0, splitPos) : null; String securityToken = (splitPos>0) ? fullBaseToken.substring(splitPos+1) : fullBaseToken; + + ExternalSecurityService securityServiceInfo = SecurityServiceFactory.getSecurityService(authMethodStr, adapterType); + if (securityServiceInfo == null) + { + return null; // error already logged. + } - // Check if we have a Bearer authentication method. - if (AuthenticationInfo.AuthenticationMethod.Bearer.name().equals(authMethodStr)) + // Check if we have a SIF Internal authentication method. + if (securityServiceInfo.getAuthenticationType() == AuthenticationType.Other) { - return new AuthenticationInfo(AuthenticationInfo.AuthenticationMethod.Bearer, securityToken, null); + return new AuthenticationInfo(securityServiceInfo, securityToken, null); } - else // it should be Basic or SIF_HMACSHA256 + else { - String[] splitValues = splitValuesFromBase64(securityToken); - - if (splitValues.length == 2) // all good - { - return new AuthenticationInfo(authMethodStr, splitValues[0], splitValues[1]); - } - else // we could not split the token into userToken and password - { - logger.error("The token of the authenticathen method "+authMethodStr+" is not a base64 encoded string with a ':' separating two components as expected by the SIF sepcification."); - return null; - } + String[] splitValues = splitValuesFromBase64(securityToken); + + if (splitValues.length == 2) // all good + { + return new AuthenticationInfo(securityServiceInfo, splitValues[0], splitValues[1]); + } + else // we could not split the token into userToken and password + { + logger.error("The token of the authenticathen method "+authMethodStr+" is not a base64 encoded string with a ':' separating two components as expected by the SIF sepcification."); + return null; + } } } } diff --git a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/JAXBUtils.java b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/JAXBUtils.java index b54d8bfd..c0436b40 100644 --- a/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/JAXBUtils.java +++ b/SIF3InfraREST/sif3Common/src/main/java/sif3/common/utils/JAXBUtils.java @@ -35,7 +35,6 @@ import javax.xml.stream.XMLStreamWriter; import javax.xml.transform.stream.StreamSource; -import org.apache.log4j.Logger; import org.codehaus.jettison.json.JSONException; import org.codehaus.jettison.json.JSONObject; import org.codehaus.jettison.mapped.Configuration; @@ -43,10 +42,12 @@ import org.codehaus.jettison.mapped.MappedXMLStreamReader; import org.codehaus.jettison.mapped.MappedXMLStreamWriter; import org.codehaus.jettison.mapped.SimpleConverter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.Timer; import sif3.common.exception.MarshalException; import sif3.common.exception.UnmarshalException; -import au.com.systemic.framework.utils.Timer; /** * @author Joerg Huber @@ -54,7 +55,7 @@ */ public class JAXBUtils { - protected static final Logger logger = Logger.getLogger(JAXBUtils.class); + protected final static Logger logger = LoggerFactory.getLogger(JAXBUtils.class); /* Make JAXBContext a singleton. Otherwise creating the JAXBContext every time is very slow! */ private static HashMap jaxbCtx = new HashMap(); diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestExternalSecurityService.java b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestExternalSecurityService.java new file mode 100644 index 00000000..c6c30c0c --- /dev/null +++ b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestExternalSecurityService.java @@ -0,0 +1,56 @@ +/* + * TestExternalSecurityService.java + * Created: 31/03/2017 + * + * Copyright 2017 Systemic Pty Ltd + * + * Licensed 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 sif3.common.test.persist.service; + +import java.util.List; + +import sif3.common.persist.service.ExternalSecurityService; + +/** + * @author Joerg Huber + * + */ +public class TestExternalSecurityService extends ServiceBaseTest +{ + + private ExternalSecurityService service = new ExternalSecurityService(); + + public void testGetAllServices() throws Exception + { + List secServices = service.getSecurityServices(); + System.out.println("Exetrnal Security Services:\n"+secServices); + } + + public static void main(String[] args) + { + System.out.println("================================== Start TestExternalSecurityService ==============================="); + try + { + TestExternalSecurityService tester = new TestExternalSecurityService(); + tester.testGetAllServices(); + + tester.shutdown(); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + System.out.println("================================== End TestExternalSecurityService ==============================="); + } +} diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestSIF3SessionService.java b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestSIF3SessionService.java index a1f1024d..52a2586e 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestSIF3SessionService.java +++ b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/persist/service/TestSIF3SessionService.java @@ -37,7 +37,7 @@ public class TestSIF3SessionService extends ServiceBaseTest // private static final String INSTANCE_ID = "1234567890-0987654321"; private static final String SESSION_TOKEN = "fa224931-9425-45e1-a7a1-432eb178e76e"; - private static final String ENVIRONMENT_ID = "22d7a78a-cde3-4757-8ce3-db471ecd807a"; + private static final String ENVIRONMENT_ID = "431889c2-97dc-48bd-9acb-72b9c30b044c"; private static final String SECURITY_TOKEN = "OAUTH-TOKEN:1234"; // private static final String ENVIRONMENT_ID = "1f8d7a78-74f1-4757-8ce3-db471ecdf1eb"; private static final AdapterType ADAPTER_TYPE = AdapterType.CONSUMER; @@ -114,9 +114,9 @@ public static void main(String[] args) // tester.testGetSessionBySolutionAppkeyUserInst(); // tester.testCreateNewSession(); //tester.testCreateNewSessionWithXML(); -// tester.testGetSessionByEnvID(); + tester.testGetSessionByEnvID(); // tester.testGetSessionBySessionToken(); - tester.testGetSessionBySecurityToken(); +// tester.testGetSessionBySecurityToken(); // tester.testRemoveSessionByEnvironmentID(); //tester.testSave(); diff --git a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/utils/TestAuthUtils.java b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/utils/TestAuthUtils.java index b1b9240f..efa7376c 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/utils/TestAuthUtils.java +++ b/SIF3InfraREST/sif3Common/src/test/java/sif3/common/test/utils/TestAuthUtils.java @@ -20,9 +20,13 @@ import java.util.Date; +import au.com.systemic.framework.utils.DateUtils; +import sif3.common.CommonConstants.AdapterType; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.model.AuthenticationInfo; +import sif3.common.model.security.SecurityServiceInfo; +import sif3.common.persist.common.HibernateUtil; import sif3.common.utils.AuthenticationUtils; -import au.com.systemic.framework.utils.DateUtils; /** * @author Joerg Huber @@ -30,10 +34,18 @@ */ public class TestAuthUtils { + //Test Value + private static final SecurityServiceInfo securityInfo = new SecurityServiceInfo("Bearer", "CONSUMER", "Bearer", "BEARER", false, AuthenticationType.Other); + + public TestAuthUtils() + { + HibernateUtil.initialise(null); + } + private void testGetBasicAuthToken() { // System.out.println("Basic Auth String: "+AuthenticationUtils.getBasicAuthToken("new", "guest")); - System.out.println("Basic Auth String: "+AuthenticationUtils.getBasicAuthToken("2f47fd0c-fbc5-4a6e-a779-de7633624a67", "Password1")); + System.out.println("Basic Auth String: "+AuthenticationUtils.getBasicAuthToken("2f47fd0c-fbc5-4a6e-a779-de7633624a67", "Password1")); } // private void testGetBearerAuthToken() @@ -55,7 +67,7 @@ private void testHMACSHA256() String hash = AuthenticationUtils.hmacsha256Base64(message, key); long endTime = (new Date()).getTime(); - System.out.println("HMACSHA256 String: " + hash + " Time taken to compute: "+(endTime-startTime)+" millis."); + System.out.println("HMACSHA256 String: " + hash + " Time taken to compute: "+(endTime-startTime)+" millis."); } private void testHMACSHA256Stress() @@ -78,8 +90,8 @@ private void testHMACSHA256Stress() private void testHMACSHA256Token() { // String username = "TestSIS"; - String username = "c92bf270-2ef5-41a0-bd68-d5d29c5a8214"; - String password = "Password1"; + String username = "d394e915-ebb0-4c22-b4ec-8a0abed239df"; + String password = "password"; // String username = "new"; // String password = "guest"; /// String now = "2013-06-22T23:52-07"; @@ -142,13 +154,13 @@ private void testExtractMethods() splitValues = AuthenticationUtils.splitValuesFromBase64(token); System.out.println("Left Side: '"+splitValues[0]+"' Right Side: '"+splitValues[1]+"'"); - System.out.println(""); - AuthenticationInfo authInfo = new AuthenticationInfo(AuthenticationInfo.AuthenticationMethod.Bearer, "xyz-abc-123", null); - authToken = AuthenticationUtils.getFullBase64Token(authInfo); - System.out.println("Bearer Auth Token: " + authToken); - token = AuthenticationUtils.extractAuthToken(authToken); - System.out.println("Auth Method: '"+AuthenticationUtils.extractAuthenticationMethod(authToken)+"' Token: '"+token+"'"); - System.out.println("All parts of Auth Token: "+AuthenticationUtils.getPartsFromAuthToken(authToken)); + System.out.println(""); + AuthenticationInfo authInfo = new AuthenticationInfo(securityInfo, "xyz-abc-123", null); + authToken = AuthenticationUtils.getFullBase64Token(authInfo); + System.out.println("Bearer Auth Token: " + authToken); + token = AuthenticationUtils.extractAuthToken(authToken); + System.out.println("Auth Method: '"+AuthenticationUtils.extractAuthenticationMethod(authToken)+"' Token: '"+token+"'"); + System.out.println("All parts of Auth Token: "+AuthenticationUtils.getPartsFromAuthToken(authToken, AdapterType.CONSUMER)); } private void testGetPartsFromAuthToken() @@ -159,7 +171,7 @@ private void testGetPartsFromAuthToken() String authToken = AuthenticationUtils.getSIFHMACSHA256AuthToken(username, password, now); System.out.println("HMACSHA256 Auth Token for username/password/date="+username+"/"+password+"/"+now+": " + authToken + "."); - AuthenticationInfo authInfo = AuthenticationUtils.getPartsFromAuthToken(authToken); + AuthenticationInfo authInfo = AuthenticationUtils.getPartsFromAuthToken(authToken, AdapterType.PROVIDER); System.out.println("Parts of Auth Token: "+authInfo); } @@ -171,13 +183,12 @@ public static void main(String[] args) try { // tester.testGetBasicAuthToken(); -// tester.testGetBearerAuthToken(); // tester.testHMACSHA256(); //tester.testHMACSHA256Stress(); - tester.testHMACSHA256Token(); - //tester.testHMACSHA256TokenStress(); - tester.testExtractMethods(); - //tester.testGetPartsFromAuthToken(); +// tester.testHMACSHA256Token(); +// tester.testHMACSHA256TokenStress(); +// tester.testExtractMethods(); + tester.testGetPartsFromAuthToken(); } catch (Exception ex) { diff --git a/SIF3InfraREST/sif3Common/src/test/java/systemic/framework/utils/test/TestPropertyManager.java b/SIF3InfraREST/sif3Common/src/test/java/systemic/framework/utils/test/TestPropertyManager.java index d4cef5db..34cb4623 100644 --- a/SIF3InfraREST/sif3Common/src/test/java/systemic/framework/utils/test/TestPropertyManager.java +++ b/SIF3InfraREST/sif3Common/src/test/java/systemic/framework/utils/test/TestPropertyManager.java @@ -20,8 +20,8 @@ public static void main(String[] args) PropertyManager manager = tester.getManager(); manager.loadPropertyFile("c3p0"); manager.loadPropertyFile("env"); - manager.loadPropertyFile("c3p0"); - //manager.loadPropertyFile("dummy"); +// manager.loadPropertyFile("c3p0"); +// manager.loadPropertyFile("dummy"); System.out.println("c3p0.autoCommitOnClose from c3p0: "+manager.getPropertyAsBool("c3p0", "c3p0.autoCommitOnClose", true)); System.out.println("c3p0.autoCommitOnClose from env : "+manager.getPropertyAsBool("env", "c3p0.autoCommitOnClose", true)); diff --git a/SIF3InfraREST/sif3InfraCommon/pom.xml b/SIF3InfraREST/sif3InfraCommon/pom.xml index 9b7bdbeb..7d6a8c18 100644 --- a/SIF3InfraREST/sif3InfraCommon/pom.xml +++ b/SIF3InfraREST/sif3InfraCommon/pom.xml @@ -7,7 +7,7 @@ sif3.framework sif3-framework - 0.10.0-beta + 0.11.0-beta @@ -71,13 +71,17 @@ - + - log4j - log4j + org.slf4j + slf4j-api + + org.slf4j + slf4j-log4j12 + diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/BrokeredProviderEnvironmentManager.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/BrokeredProviderEnvironmentManager.java index ac4d7a79..0c618a0f 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/BrokeredProviderEnvironmentManager.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/BrokeredProviderEnvironmentManager.java @@ -22,8 +22,11 @@ import java.util.Date; import java.util.List; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; import sif3.common.model.security.TokenInfo; @@ -37,8 +40,6 @@ import sif3.infra.common.model.InfrastructureServiceType; import sif3.infra.common.model.InfrastructureServicesType; import sif3.infra.common.utils.SIFSessionUtils; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; /** * This class deals with the main functions relating to the environments that need to be managed on a pure provider (i.e. provider in @@ -51,7 +52,7 @@ */ public class BrokeredProviderEnvironmentManager implements ClientEnvironmentManager { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* The property file name of this consumer */ private String adapterFileNameWithoutExt = null; diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ConsumerEnvironmentManager.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ConsumerEnvironmentManager.java index 6bae3f81..1d03edbe 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ConsumerEnvironmentManager.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ConsumerEnvironmentManager.java @@ -22,8 +22,11 @@ import java.util.Date; import java.util.List; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; import sif3.common.model.security.TokenInfo; @@ -36,8 +39,6 @@ import sif3.infra.common.model.InfrastructureServiceType; import sif3.infra.common.model.InfrastructureServicesType; import sif3.infra.common.utils.SIFSessionUtils; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; /** * This class deals with the main functions relating to the environments that need to be managed on a consumer. A consumer connects, @@ -49,7 +50,7 @@ */ public class ConsumerEnvironmentManager implements ClientEnvironmentManager { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* The property file name of this consumer */ private String adapterFileNameWithoutExt = null; diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/DirectProviderEnvironmentManager.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/DirectProviderEnvironmentManager.java index 3b2be1d3..dda05ec9 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/DirectProviderEnvironmentManager.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/DirectProviderEnvironmentManager.java @@ -19,8 +19,11 @@ import java.util.Date; import java.util.HashMap; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; import sif3.common.model.security.TokenInfo; @@ -31,8 +34,6 @@ import sif3.infra.common.interfaces.EnvironmentManager; import sif3.infra.common.model.EnvironmentType; import sif3.infra.common.utils.SIFSessionUtils; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.StringUtils; /** * This class deals with the main functions relating to the environments that need to be managed by the environment provider. @@ -44,7 +45,7 @@ */ public class DirectProviderEnvironmentManager implements EnvironmentManager { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); /* The property file name of this consumer */ private String adapterFileNameWithoutExt = null; @@ -421,7 +422,9 @@ public boolean removeEnvironmentBySessionToken(String sessionToken, boolean perm @Override public String toString() { - return "DirectProviderEnvironmentManager [sessions=" + this.sessions + "]"; + return "DirectProviderEnvironmentManager [adapterFileNameWithoutExt=" + + adapterFileNameWithoutExt + ", sessions=" + sessions + + ", secTokenSession=" + secTokenSession + "]"; } /*---------------------*/ diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ProviderManagerFactory.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ProviderManagerFactory.java index 78ecf5b0..860c06e8 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ProviderManagerFactory.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/mgr/ProviderManagerFactory.java @@ -18,7 +18,8 @@ package sif3.infra.common.env.mgr; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.infra.common.env.types.AdapterEnvironmentStore; import sif3.infra.common.env.types.EnvironmentInfo.EnvironmentType; @@ -34,7 +35,7 @@ */ public class ProviderManagerFactory { - protected static final Logger logger = Logger.getLogger(ProviderManagerFactory.class); + protected static final Logger logger = LoggerFactory.getLogger(ProviderManagerFactory.class); private static EnvironmentManager envMgr = null; diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/AdapterBaseEnvStoreOperations.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/AdapterBaseEnvStoreOperations.java index 3db510e0..11b64ac5 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/AdapterBaseEnvStoreOperations.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/AdapterBaseEnvStoreOperations.java @@ -20,8 +20,12 @@ import java.util.Date; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.FileReaderWriter; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; @@ -35,9 +39,6 @@ import sif3.infra.common.env.types.ConsumerEnvironment; import sif3.infra.common.env.types.EnvironmentInfo; import sif3.infra.common.model.EnvironmentType; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.FileReaderWriter; -import au.com.systemic.framework.utils.StringUtils; /** * Helper class for some operations required by the Environment Store (Consumer or Provider). Only used internal to the framework. @@ -50,7 +51,7 @@ */ public class AdapterBaseEnvStoreOperations { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private AdapterEnvironmentStore environmentStore = null; @@ -215,6 +216,9 @@ public SIF3Session createOrUpdateSession(EnvironmentType inputEnv, TokenInfo tok sif3Session.setSecurityToken(tokenInfo.getToken()); sif3Session.setSecurityTokenExpiry(tokenInfo.getTokenExpiryDate()); } + + // Fingerprint is now available or may have changed. Need to update + sif3Session.setFingerprint(inputEnv.getFingerprint()); } else { @@ -225,6 +229,7 @@ public SIF3Session createOrUpdateSession(EnvironmentType inputEnv, TokenInfo tok sif3Session.setAdapterType(adapterType.name()); sif3Session.setSessionToken(inputEnv.getSessionToken()); sif3Session.setEnvironmentID(inputEnv.getId()); + sif3Session.setFingerprint(inputEnv.getFingerprint()); // Also add the security token info if it is available if (tokenInfo != null) diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/DirectProviderEnvStoreOps.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/DirectProviderEnvStoreOps.java index 8651ce8c..afd00ab8 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/DirectProviderEnvStoreOps.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/ops/DirectProviderEnvStoreOps.java @@ -21,23 +21,26 @@ import java.util.Date; import java.util.List; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.PersistenceException; import sif3.common.model.EnvironmentKey; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; +import sif3.common.model.security.InternalSecurityServiceConstants; import sif3.common.model.security.TokenInfo; import sif3.common.persist.model.AppEnvironmentTemplate; +import sif3.common.persist.model.ExternalSecurityService; import sif3.common.persist.model.SIF3Session; import sif3.common.persist.service.AppEnvironmentService; import sif3.common.persist.service.SIF3SessionService; +import sif3.common.security.SecurityServiceFactory; +import sif3.common.utils.UUIDGenerator; import sif3.infra.common.env.types.ConsumerEnvironment; import sif3.infra.common.env.types.ProviderEnvironment; import sif3.infra.common.model.EnvironmentType; import sif3.infra.common.model.EnvironmentTypeType; import sif3.infra.common.model.InfrastructureServiceType; import sif3.infra.common.model.InfrastructureServicesType; -import au.com.systemic.framework.utils.StringUtils; /** * This class implements operations required by a direct environment provider. They are quite distinct and therefore warrant having its own @@ -372,6 +375,7 @@ public SIF3Session createSession(EnvironmentType inputEnv, TokenInfo tokenInfo, // Now we have a session token and a environmentID. Store them in the environment. environment.setSessionToken(sif3Session.getSessionToken()); environment.setId(sif3Session.getEnvironmentID()); + environment.setFingerprint(sif3Session.getFingerprint()); // Other important values can be taken from the input environment or if not provided (payload free creation) // some of the values should remain as in the template others can be taken from the template lookup tabble @@ -418,11 +422,11 @@ public SIF3Session createSession(EnvironmentType inputEnv, TokenInfo tokenInfo, // Maybe the authentication method has changed, too. if (StringUtils.notEmpty(appEnvTemplate.getAuthMethod())) { - environment.setAuthenticationMethod(appEnvTemplate.getAuthMethod()); + environment.setAuthenticationMethod(getAuthXMLValue(appEnvTemplate.getAuthMethod())); } else if (StringUtils.isEmpty(environment.getAuthenticationMethod())) // if empty in env.xml set to Basic { - environment.setAuthenticationMethod(AuthenticationMethod.Basic.name()); + environment.setAuthenticationMethod(InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getXmlValue()); } // Set Authentication Method is sif3 Session. @@ -523,11 +527,11 @@ private void updateSessionInfo(SIF3Session sif3Session, ProviderEnvironment envI // Maybe the authentication method has changed, too. if (StringUtils.notEmpty(appEnvTemplate.getAuthMethod())) { - environment.setAuthenticationMethod(appEnvTemplate.getAuthMethod()); + environment.setAuthenticationMethod(getAuthXMLValue(appEnvTemplate.getAuthMethod())); } else // assume Basic { - environment.setAuthenticationMethod(AuthenticationMethod.Basic.name()); + environment.setAuthenticationMethod(InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getXmlValue()); } // Set authentication method it in the session. @@ -567,6 +571,13 @@ private void updateSessionInfo(SIF3Session sif3Session, ProviderEnvironment envI sif3Session.setAdapterName(templateEnv.getConsumerName()); } + // Since SIF 3.2.1 we need a fingerprint. This bit is providing a automatic upgrade to this SIF version. + if (StringUtils.isEmpty(environment.getFingerprint())) + { + sif3Session.setFingerprint(UUIDGenerator.getUUID()); + environment.setFingerprint(sif3Session.getFingerprint()); + } + //Note some values may have been changed in the applciationInfo node but we don't really know how to deal with them //right now so we ignore them as they are of no importance for operational purposes. @@ -627,4 +638,24 @@ private void reloadServiceInfo(EnvironmentType environment, EnvironmentType temp { environment.setProvisionedZones(templEnv.getProvisionedZones()); } + + private String getAuthXMLValue(String authMethod) + { + if (StringUtils.notEmpty(authMethod)) + { + ExternalSecurityService securityService = SecurityServiceFactory.getSecurityService(authMethod, CommonConstants.AdapterType.ENVIRONMENT_PROVIDER); + if (securityService != null) + { + return securityService.getXmlValue(); + } + else // default to Basic + { + return InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getXmlValue(); + } + } + else // assume Basic + { + return InternalSecurityServiceConstants.BASIC_GENERIC_SECURITY.getXmlValue(); + } + } } diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/AdapterEnvironmentStore.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/AdapterEnvironmentStore.java index b013bf5c..9df692b6 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/AdapterEnvironmentStore.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/AdapterEnvironmentStore.java @@ -23,20 +23,21 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import au.com.systemic.framework.utils.AdvancedProperties; +import au.com.systemic.framework.utils.PropertyManager; +import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; import sif3.common.CommonConstants.AdapterType; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.CommonConstants.QueuePollingType; import sif3.common.CommonConstants.QueueStrategy; import sif3.common.header.HeaderProperties; import sif3.common.header.HeaderValues.UpdateType; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; import sif3.common.utils.FileAndFolderUtils; import sif3.infra.common.env.types.EnvironmentInfo.EnvironmentType; -import au.com.systemic.framework.utils.AdvancedProperties; -import au.com.systemic.framework.utils.PropertyManager; -import au.com.systemic.framework.utils.StringUtils; /** * This class abstract the reading and processing of the consumer and provider property file of this framework. @@ -49,7 +50,7 @@ public class AdapterEnvironmentStore implements Serializable private static final long serialVersionUID = 34177453457564336L; - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static final String TEMPLATE_DIR_NAME = "template"; private static final String PROVIDER_DIR_NAME = "provider"; @@ -422,7 +423,7 @@ private boolean loadConsumerInfo(AdvancedProperties props, ConsumerEnvironment e } // Authentication Method - envInfo.setAuthMethod(adapterProperties.getPropertyAsString("env.authentication.method", AuthenticationMethod.Basic.name())); + envInfo.setAuthMethod(adapterProperties.getPropertyAsString("env.authentication.method", AuthenticationType.Basic.name())); envInfo.getEnvironmentKey().setUserToken(props.getPropertyAsString("env.userToken", null)); envInfo.getEnvironmentKey().setInstanceID(props.getPropertyAsString("env.instanceID", null)); @@ -485,7 +486,7 @@ private boolean loadProviderInfo(AdvancedProperties props, ProviderEnvironment e } // Authentication Method - envInfo.setAuthMethod(adapterProperties.getPropertyAsString("env.authentication.method", AuthenticationMethod.Basic.name())); + envInfo.setAuthMethod(adapterProperties.getPropertyAsString("env.authentication.method", AuthenticationType.Basic.name())); envInfo.setTemplateXMLFileName(props.getPropertyAsString("env.xml.file.name", null)); if (StringUtils.isEmpty(envInfo.getTemplateXMLFileName())) @@ -543,7 +544,7 @@ private boolean loadProviderInfo(AdvancedProperties props, ProviderEnvironment e envInfo.setAutoCreateEnvironment(props.getPropertyAsBool("env.allow.autoCreate", false)); // Authentication Method - envInfo.setAccessTokenAuthMethod(adapterProperties.getPropertyAsString("adapter.default.accessToken.authentication.method", AuthenticationMethod.Bearer.name())); + envInfo.setAccessTokenAuthMethod(adapterProperties.getPropertyAsString("adapter.default.accessToken.authentication.method", AuthenticationType.Basic.name())); // Allow access_token or URL envInfo.setAllowAuthOnURL(adapterProperties.getPropertyAsBool("adapter.authTokenOnURL.allowed", false)); diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ConsumerEnvironment.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ConsumerEnvironment.java index 9dee649d..25999d9d 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ConsumerEnvironment.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ConsumerEnvironment.java @@ -24,7 +24,7 @@ */ public class ConsumerEnvironment extends EnvironmentInfo { - public static enum ConnectorName {environment, requestsConnector, provisionRequests, eventsConnector, queues, subscriptions}; + public static enum ConnectorName {environment, requestsConnector, servicesConnector, provisionRequests, eventsConnector, queues, subscriptions}; private static final long serialVersionUID = -2685814104916173550L; diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/EnvironmentInfo.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/EnvironmentInfo.java index f8772ef4..4ea2abd0 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/EnvironmentInfo.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/EnvironmentInfo.java @@ -25,7 +25,7 @@ import javax.ws.rs.core.MediaType; import sif3.common.CommonConstants.AdapterType; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.model.EnvironmentKey; import sif3.infra.common.env.types.ConsumerEnvironment.ConnectorName; @@ -53,14 +53,14 @@ public enum EnvironmentType {DIRECT, BROKERED}; private AdapterType adapterType = null; private boolean checkACL = true; private EnvironmentType environmentType = null; - private AuthenticationMethod authMethod = AuthenticationMethod.Basic; + private String authMethod = AuthenticationType.Basic.name(); private boolean removeEnvOnShutdown = false; private String adapterName = null; ; // consumerName private EnvironmentKey environmentKey = new EnvironmentKey(); private String password = null; private String generatorID = null; // Value to be used for the generatorId HTTP Header field. private boolean compressionEnabled = false; - private boolean noCertificateCheck = false; // by default we want certififcates checked. + private boolean noCertificateCheck = false; // by default we want certificates checked. // Properties for using an existing environment. private boolean useExistingEnv = false; @@ -197,28 +197,28 @@ public void setCheckACL(boolean checkACL) this.checkACL = checkACL; } - public AuthenticationMethod getAuthMethod() + public String getAuthMethod() { return this.authMethod; } - public void setAuthMethod(AuthenticationMethod authMethod) + public void setAuthMethod(String authMethod) { this.authMethod = authMethod; } - // authMethod: Valid values are what is listed in AuthenticationUtils.AuthenticationMethod (case sensitive!!!) - public void setAuthMethod(String authMethod) - { - try - { - this.authMethod = AuthenticationMethod.valueOf(authMethod); - } - catch (Exception ex) - { - this.authMethod = AuthenticationMethod.Basic; - } - } +// // authMethod: Valid values are what is listed in AuthenticationUtils.AuthenticationMethod (case sensitive!!!) +// public void setAuthMethod(String authMethod) +// { +// try +// { +// this.authMethod = AuthenticationMethod.valueOf(authMethod); +// } +// catch (Exception ex) +// { +// this.authMethod = AuthenticationMethod.Basic; +// } +// } public MediaType getMediaType() { diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ProviderEnvironment.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ProviderEnvironment.java index dedea91e..38d40cec 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ProviderEnvironment.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/env/types/ProviderEnvironment.java @@ -20,9 +20,9 @@ import java.net.URI; +import sif3.common.CommonConstants.AuthenticationType; import sif3.common.header.HeaderProperties; import sif3.common.header.HeaderValues.UpdateType; -import sif3.common.model.AuthenticationInfo.AuthenticationMethod; /** * This class represents a provider environment. This is a more complex class than a consumer environment as it has to validate a @@ -42,7 +42,7 @@ public class ProviderEnvironment extends EnvironmentInfo private boolean eventsSupported = false; private UpdateType defaultUpdateType = UpdateType.FULL; // Default value for update events. private boolean autoCreateEnvironment = false; - private AuthenticationMethod accessTokenAuthMethod = AuthenticationMethod.Bearer; // Default Auth Method if accessToken is used. + private String accessTokenAuthMethod = AuthenticationType.Basic.name(); // Default Auth Method if accessToken is used. private boolean allowAuthOnURL = false; private HeaderProperties customResponseHeaders = new HeaderProperties(); @@ -158,28 +158,28 @@ public void setAutoCreateEnvironment(boolean autoCreateEnvironment) this.autoCreateEnvironment = autoCreateEnvironment; } - public AuthenticationMethod getAccessTokenAuthMethod() + public String getAccessTokenAuthMethod() { return accessTokenAuthMethod; } - public void setAccessTokenAuthMethod(AuthenticationMethod accessTokenAuthMethod) + public void setAccessTokenAuthMethod(String accessTokenAuthMethod) { this.accessTokenAuthMethod = accessTokenAuthMethod; } - // authMethod for accessToken: Valid values are what is listed in AuthenticationUtils.AuthenticationMethod (case sensitive!!!) - public void setAccessTokenAuthMethod(String accessTokenAuthMethod) - { - try - { - this.accessTokenAuthMethod = AuthenticationMethod.valueOf(accessTokenAuthMethod); - } - catch (Exception ex) - { - this.accessTokenAuthMethod = AuthenticationMethod.Bearer; - } - } +// // authMethod for accessToken: Valid values are what is listed in AuthenticationUtils.AuthenticationMethod (case sensitive!!!) +// public void setAccessTokenAuthMethod(String accessTokenAuthMethod) +// { +// try +// { +// this.accessTokenAuthMethod = AuthenticationMethod.valueOf(accessTokenAuthMethod); +// } +// catch (Exception ex) +// { +// this.accessTokenAuthMethod = AuthenticationMethod.Bearer; +// } +// } public boolean getAllowAuthOnURL() { diff --git a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/utils/SIFSessionUtils.java b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/utils/SIFSessionUtils.java index 99229355..9fb08559 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/utils/SIFSessionUtils.java +++ b/SIF3InfraREST/sif3InfraCommon/src/main/java/sif3/infra/common/utils/SIFSessionUtils.java @@ -20,7 +20,8 @@ import java.util.ArrayList; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import au.com.systemic.framework.utils.StringUtils; import sif3.common.CommonConstants; @@ -42,7 +43,7 @@ */ public class SIFSessionUtils { - protected static final Logger logger = Logger.getLogger(SIFSessionUtils.class); + protected static final Logger logger = LoggerFactory.getLogger(SIFSessionUtils.class); /** * This method populates the SIF3Session.services property with the values of the given environment. If there are no services diff --git a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestAdapterEnvStore.java b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestAdapterEnvStore.java index 5910b7a0..14d6d6ca 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestAdapterEnvStore.java +++ b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestAdapterEnvStore.java @@ -27,9 +27,9 @@ */ public class TestAdapterEnvStore { -// private static final String PROP_FILE_NAME = "StudentProvider"; + private static final String PROP_FILE_NAME = "StudentProvider"; // private static final String PROP_FILE_NAME = "BrokeredSISProvider"; - private static final String PROP_FILE_NAME = "StudentConsumer"; +// private static final String PROP_FILE_NAME = "StudentConsumer"; // private static final String PROP_FILE_NAME = "BrokeredAttTrackerConsumer"; private AdapterEnvironmentStore testGetEnvironmentStore(String propFileName) diff --git a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestConsumerEnvStoreOps.java b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestConsumerEnvStoreOps.java index 1b3bade9..d7db7e81 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestConsumerEnvStoreOps.java +++ b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestConsumerEnvStoreOps.java @@ -21,6 +21,7 @@ import sif3.common.CommonConstants.AdapterType; import sif3.common.exception.MarshalException; import sif3.common.exception.UnsupportedMediaTypeExcpetion; +import sif3.common.persist.common.HibernateUtil; import sif3.infra.common.conversion.InfraMarshalFactory; import sif3.infra.common.env.ops.ConsumerEnvironmentStoreOperations; import sif3.infra.common.model.EnvironmentType; @@ -50,6 +51,7 @@ public class TestConsumerEnvStoreOps public TestConsumerEnvStoreOps() { + HibernateUtil.initialise(null); envOps = new ConsumerEnvironmentStoreOperations(SERVICE_NAME); } @@ -87,11 +89,6 @@ private void testExistTemplateEnvironment() // System.out.println("Workstore XML for Session Token "+SESSION_TOKEN+" exists: "+envOps.existEnvInWorkstoreBySessionToken(SESSION_TOKEN)); // } -// private void testExistWorkstoreEnvByEnvID() throws IllegalArgumentException, PersistenceException -// { -// System.out.println("Workstore XML for Env ID "+ENV_ID+" exists: "+envOps.existEnvInWorkstoreByEnvID(ENV_ID)); -// } - private void testLoadTemplateEnvironment() { printEnvironment(envOps.loadTemplateEnvironmentData(TEMPLATE_FILE_NAME, CONSUMER, DIRECT)); @@ -102,10 +99,6 @@ private void testLoadTemplateEnvironment() // printEnvironment(envOps.loadWorkstoreEnvBySessionToken(SESSION_TOKEN)); // } -// private void testLoadWorkstoreEnvByEnvID() -// { -// printEnvironment(envOps.loadWorkstoreEnvByEnvID(ENV_ID)); -// } private void testStoreEnvironmentToWorkstore() { @@ -113,7 +106,7 @@ private void testStoreEnvironmentToWorkstore() env.setConsumerName("TestConsumer"); env.setSolutionId("test"); env.getApplicationInfo().setApplicationKey("MY_APP"); - env.setAuthenticationMethod("Basic"); + env.setAuthenticationMethod("SAML"); env.setId(ENV_ID); env.setSessionToken(SESSION_TOKEN); // SIF3Session session = new SIF3Session(new EnvironmentKey("test", "MY_APP")); @@ -129,11 +122,6 @@ private void testRemoveEnvFromWorkstoreBySessionTK() System.out.println("Environment Removed: "+envOps.removeEnvFromWorkstoreBySessionToken(SESSION_TOKEN)); } -// private void testRemoveEnvFromWorkstoreByEnvID() -// { -// System.out.println("Environment Removed: "+envOps.removeEnvFromWorkstoreByEnvID(ENV_ID)); -// } - public static void main(String[] args) { TestConsumerEnvStoreOps tester = new TestConsumerEnvStoreOps(); @@ -143,13 +131,10 @@ public static void main(String[] args) System.out.println("Start Testing ConsumerEnvironmentStoreOperations..."); // tester.testExistTemplateEnvironment(); -// tester.testExistWorkstoreEnvByEnvID(); // tester.testExistWorkstoreEnvBySessionTK(); -// tester.testLoadTemplateEnvironment(); -// tester.testLoadWorkstoreEnvByEnvID(); + tester.testLoadTemplateEnvironment(); // tester.testLoadWorkstoreEnvBySessionTK(); - tester.testStoreEnvironmentToWorkstore(); -// tester.testRemoveEnvFromWorkstoreByEnvID(); +// tester.testStoreEnvironmentToWorkstore(); // tester.testRemoveEnvFromWorkstoreBySessionTK(); } catch (Exception ex) diff --git a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestDirectProviderEnvStoreOps.java b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestDirectProviderEnvStoreOps.java index e8a94dc2..426ce92a 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestDirectProviderEnvStoreOps.java +++ b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/env/TestDirectProviderEnvStoreOps.java @@ -24,6 +24,7 @@ import sif3.common.exception.MarshalException; import sif3.common.exception.UnsupportedMediaTypeExcpetion; import sif3.common.model.EnvironmentKey; +import sif3.common.persist.common.HibernateUtil; import sif3.common.persist.service.SIF3SessionService; import sif3.infra.common.conversion.InfraMarshalFactory; import sif3.infra.common.env.ops.DirectProviderEnvStoreOps; @@ -45,7 +46,8 @@ public class TestDirectProviderEnvStoreOps private DirectProviderEnvStoreOps envOps = null; private SIF3SessionService service = new SIF3SessionService(); - private static final String TEMPLATE_FILE_NAME="systemicDemoBrokerResponse.xml"; +// private static final String TEMPLATE_FILE_NAME="systemicDemoBrokerResponse.xml"; + private static final String TEMPLATE_FILE_NAME="devLocal.xml"; private static final String SERVICE_NAME="StudentProvider"; private static ObjectFactory objFactory = new ObjectFactory(); @@ -61,6 +63,7 @@ public class TestDirectProviderEnvStoreOps public TestDirectProviderEnvStoreOps() { + HibernateUtil.initialise(null); envOps = new DirectProviderEnvStoreOps(SERVICE_NAME); } @@ -159,15 +162,15 @@ private void testRemoveEnvFromWorkstoreBySessionToken() private void testCreateEnvironment() { - EnvironmentType inputEnv = envOps.loadEnvironmentFromTemplate(TEMPLATE_FILE_NAME); // use this if BROKERED -// EnvironmentType inputEnv = getInputEnvironment(); // use this for DIRECT +// EnvironmentType inputEnv = envOps.loadEnvironmentFromTemplate(TEMPLATE_FILE_NAME); // use this if BROKERED + EnvironmentType inputEnv = getInputEnvironment(); // use this for DIRECT printEnvironment(envOps.createEnvironmentAndSession(inputEnv, null, USE_HTTPS)); } private void testCreateSession() { - EnvironmentType inputEnv = envOps.loadEnvironmentFromTemplate(TEMPLATE_FILE_NAME); // use this if BROKERED -// EnvironmentType inputEnv = getInputEnvironment(); // use this for DIRECT +// EnvironmentType inputEnv = envOps.loadEnvironmentFromTemplate(TEMPLATE_FILE_NAME); // use this if BROKERED + EnvironmentType inputEnv = getInputEnvironment(); // use this for DIRECT System.out.println("Session:\n" + envOps.createSession(inputEnv, null, USE_HTTPS)); } @@ -206,10 +209,10 @@ public static void main(String[] args) // tester.testExistEnvInWorkstore(); // tester.testLoadEnvironmentFromWorkstore(); // tester.testCreateEnvironment(); -// tester.testCreateSession(); + tester.testCreateSession(); // tester.testRemoveEnvFromWorkstoreByEnvID(); // tester.testRemoveEnvFromWorkstoreBySessionToken(); - tester.testUpdateSessionSecurityInfo(); +// tester.testUpdateSessionSecurityInfo(); System.out.println("End Testing ProviderEnvironmentStoreOperations."); } diff --git a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/utils/TestJAXBUtils.java b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/utils/TestJAXBUtils.java index 413a4071..a8c7ed0f 100644 --- a/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/utils/TestJAXBUtils.java +++ b/SIF3InfraREST/sif3InfraCommon/src/test/java/sif3/infra/common/test/utils/TestJAXBUtils.java @@ -294,12 +294,12 @@ public static void main(String[] args) // System.out.println("Environment JSON:\n" + envStrJSON); -// tester.testXMLToObjectToXML(); + tester.testXMLToObjectToXML(); // tester.testXMLToObjectToJSON(); // tester.testJSONToObjectToJSON(); // tester.testJSONToObjectToXML(); // tester.testStudentUnicodeString(); - tester.testStudentUnicodeFile(); +// tester.testStudentUnicodeFile(); } catch (Exception ex) { diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/Collections.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/Collections.xsd new file mode 100644 index 00000000..70ce6a4d --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/Collections.xsd @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/alert.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/alert.xsd new file mode 100644 index 00000000..a00cb3bf --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/alert.xsd @@ -0,0 +1,149 @@ + + + + + + + + + Alert + yes + yes + + + + Alerts form a system wide log that can be protected, as it may contain sensitive data. Ideally an Alert should contain as much identifying information about the problem being reported as possible. + + + + + + Reporter + M + + External identification of the Application (Consumer or Provider) reporting this Alert. + + + + + + Cause + O + + External identification of the cause of the Alert. + + + + + + Exchange + M + + The exchange (or lack of exchange) responsible for generating the Alert. + + + + + + + + + + + + + + + Level + M + + The level of the Alert. + + + + + + + + + + + + + + Description + O + + A description of the reason for the Alert. + + + + + + Message ID + C + + If available, the ID of the Message causing the problem. + + + + + + Body + O + + The internals of the offending message or a more complete description of the information or state change. Usage of the CDATA designation is recommended in order to make the XML contents more readable to humans. + + + + + + Error + O + + Detailed error results such as a stack trace. + + + + + + Xpath + O + + An indicator of the specific element that was in error (or contributed to the problem. [NEEDS TO BE CHANGED TO the SIF XPATH TYPE] + + + + + + Category + MC + + If the Alert Level is an error, this value must be the SIF 3.0.1 Error Category corresponding to the type of Error being reported + + + + + + Code + MC + + If the Alert Level is an error, this value must be the SIF 3.0.1 Error Code corresponding to the type of Error being reported. + + + + + + Internal + O + + Code internal to the reporter. + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/codeset.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/codeset.xsd new file mode 100644 index 00000000..17a81422 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/codeset.xsd @@ -0,0 +1,249 @@ + + + + + + + + + + Code Set + yes + yes + + + + The Code Set Registry Service provides a way for all legal codes to be defined outside of the SIF Specification while allowing changes (additions and replacements) of external code set values to be easily verified by the recipient so as not to break existing Consumer / Provider interoperability. + + + + + + Zone + M + + If this is tied to a specific zone it is specified here, otherwise “environment-global†indicates applicability to all zones in the Environment. + + + + + + Version + M + + The official major, minor, and revision version of the code set. + + + + + + Timestamp + M + + The date and time of the last change to this code set. So that only updates can be queried efficiently (where applicable). + + + + + + + Source + CN + + URL to an external code set whose values are not (yet) present in the system. + + + + + + + + + + + + + + + + + + + + + + + + + Code + MI + + Official abbreviation for the given value. + + + + + + + + + + + + Source + QN + + URL where the related abbreviation comes from. + + + + + + Namespace + QN + + Namespace where the related abbreviation comes from. + + + + + + Value + QN + + What the code represent. + + + + + + + + + + + + Description + ON + + Human readable explanation of what the code represents. + + + + + + + + + + + + Definition + ON + + Human readable explanation provided by the source! + + + + + + + + + + + + + Action + M + + The last action to be taken for this code item. + + + + + + + + + + + + + + Timestamp + M + + The date and time of the last action taken on this code item. So that only updates can be queried efficiently (where applicable). + + + + + + + + + + + + + + + + Source + QN + + URL where the related abbreviation comes from. + + + + + + Namespace + QN + + Namespace where the related abbreviation comes from. + + + + + + + + + + Old + M + + Indicates the alias code has been deprecated or deleted, even if it no longer appears in the register. + + + + + + Official + M + + Indicates the alias code is an official one; however the locale uses this one to represent that concept, at least in part. + + + + + + Value + M + + Alternate abbreviation that might need to be more specific or correct. + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/createresponse.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/createresponse.xsd new file mode 100644 index 00000000..f411b757 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/createresponse.xsd @@ -0,0 +1,43 @@ + + + + + + + + Create Response + no + no + + + + An HTTP Response with a status of 200 and a payload consisting of a single “createResponse†element. This includes, for each requested object successfully created, an internal status of 201 and the service-assigned refId. Any requested object that failed to be created is indicated by an error statusCode and a corresponding error payload. + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleterequest.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleterequest.xsd new file mode 100644 index 00000000..29d34e06 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleterequest.xsd @@ -0,0 +1,32 @@ + + + + + + + + Alert + no + no + + + + A “deleteRequest†element, which consists of multiple, “delete†object ids. Since REST conventions do not support payloads on HTTP DELETE messages, all multi-object Delete Requests are conveyed via an HTTP PUT message containing an additional HTTP Header Field value of methodOverride set to DELETE. + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleteresponse.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleteresponse.xsd new file mode 100644 index 00000000..1e8f55b9 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/deleteresponse.xsd @@ -0,0 +1,42 @@ + + + + + + + + Delete Response + no + no + + + + An HTTP Response with a status of 200 (success). It contains a payload consisting of a single “deleteResponse†element. + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/environment.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/environment.xsd new file mode 100644 index 00000000..125d4d76 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/environment.xsd @@ -0,0 +1,159 @@ + + + + + + + + Environment + no + yes + + + + The Consumer Environment Service is the gateway to all other services. It scopes the Consumer’s possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully. + + + + + + fingerprint + O + + Unique environment identifier that can be safely shared with others. In order to not compromise security it MUST NOT match the environment’s refId, sessionToken, userToken, or applicationKey. + + + + + + Session Key + O + + + + + + + + Solution + O + + The solution the Application would like to participate in. This is optional only, is advisory, and may be ignored by the Administrator. If processed it may be reflected in the URLs of the infrastructure services which are provided in the consumerEnvironment. + + + + + + + Authentication Method + M + + Defines the way in which the applicationKey can be used to enforce security. + + + + + + Instance ID + O + + + + + + + + User Token + O + + + + + + + + Consumer Name + M + + A descriptive name for the application that will be readily identifiable to Zone Administrators if it becomes a Registered Consumer + + + + + + + + + + + + + + + + Application Key + M + + An opaque (to the SIF standard) element which contains any required Consumer authentication information. The content of this element is site-specific. For a Direct Environment which accepts Consumer Registration Requests from a mobile application, this element might contain a combination of the User ID and Password. + + + + + + Infrastructure Version + M + + The version of the SIF infrastructure which the Consumer supports. + + + + + + Data Model Namespace + M + + The namespace of the data payloads conveyed by this environment. Returns may be of a diffrent minor version. Utility payloads will be of the infrastructure namespace. + + + + + + Transport + O + + The transport which the Consumer expects the infrastructure to use to interoperate with it. The default is whichever transport the create request was issued on + + + + + + + + + + + + There must be an InfrastructureService element present for each defined Infrastructure Service. The value of each InfrastructureService Property value subelement defines the URL location of that Infrastructure Service. + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/infrastructurecommontypes.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/infrastructurecommontypes.xsd new file mode 100644 index 00000000..fbb217fe --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/infrastructurecommontypes.xsd @@ -0,0 +1,424 @@ + + + + + + + + Error + no + no + + + + The Service Provider returns a SIF Error Message to a Consumer issuing an erroneous Request. + + + + + + Code + M + + Corresponds to the value contained in the HTTPS Header Status-Code†field in which the Error Object is the payload. + + + + + + Scope + M + + Attempted operation. Ex: “Modify Student†+ + + + + + + + + + + Message + M + + A simple, easy to understand, compact description of the error. The primary consumer of this message is the application user. Example: "Unable to open database." + + + + + + + + + + + Description + M + + An optional error description that is more complete and technical in nature. It is to be used as a diagnostic message in trouble-shooting procedures. Example: "The 'Students' table is opened in exclusive mode by user 'ADM1' (dbm.cpp, line 300)." + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Path + M + + The namespace qualified XPath being expressed. + + + + + + Namespaces + M + + The grouping tag for the namespace entries used in the path. + + + + + + + + + + + + Name + M + + Name/Value pair. + + + + + + + + + + + + + + + + + Location + M + + The URL to use when sending Requests to a Provider + + + + + + Properties + O + + May contain zero or more property elements containing name/value pairs describing any protocol settings required to ensure proper communication + + + + + + + + + + + Vendor + O + + The name of the company supplying this Product. + + + + + + + + + + + Product + M + + The name of the Product + + + + + + + + + + + Product Version + O + + The format of this field is undefined, but it should match the format used in the agent's conformance statement, if the agent is SIF Certified. + + + + + + + + + + + Icon URI + O + + HTTP URL referencing an icon for graphical representation of the application/agent. Should range from 16x16 pixels to 128x128 pixels and be of an image MIME type commonly supported by Web browsers (e.g. PNG, JPEG, GIF). + + + + + + + + + + + + + + + + + + + + A specific Zone defined for this environment. + + + + + + + + + Zone + yes + yes + + + + Zone identifiers are chosen by the administrator and can follow any convention that best meets the needs of the deploying organization. The Zone in which the Service is to be found always qualifies every Consumer request for any Provider Service. Each Service Consumer is assigned a “default†Zone at Registration time, which is used whenever a specific Zone is not explicitly included in one of its Provider Service Requests. + + + + + + Description + O + + A short (possibly multi-sentence) description of the Zone + + + + + + + + + + + + + Property + MR + + Individual setting + + + + + + + + + + Prefix + M + + The short prefix used to signify this namespace in the path. nil = default + + + + + + + Static + C + + Use this tag when communicating the exact namespace. ex: http://www.sifinfo.org/infrastructure/2.x + + + + + + Starts With + C + + Use this tag when the namespace should be looked up (from the related XML) by how it starts. ex: http://www.sifassociation.org/datamodel/US/3. + + + + + + Regular Expression + C + + Use this tag when the namespace should be looked up (from the related XML) by matching a regular expression. see: http://www.w3.org/TR/xmlschema-2/#regexs ex: http://sifassociation.org/datamodel/US/3\.[0-9]+\.?[0-9]* + + + + + + + + + + + Namespace + MR + + The tag that holds a single namespace entry together. + + + + + + + + + + + + + + + + + + + + Right Type + M + + The type of the requested Access Right + + + + + + + + + + + + + + + + + + + + + + + + + + + + The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model. + + + + + The unique identity of a context element, which is associated with a Provider of this name and type operating in a Zone with this ID. All Services with the same name in the same Zone must have different Context IDs. Only one such Service can have no Context. + + + + + + + + + + + + + + + + + Provisioned Zone ID + M + + The unique id of the Zone, and the key to the Zone element in the Zone Registry. + + + + + + + + + + + + + + + + + + + + Media Type + M + + An Internet Media Type supported by this adaptor (for this service). + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/job.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/job.xsd new file mode 100644 index 00000000..43edda7f --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/job.xsd @@ -0,0 +1,263 @@ + + + + + + + + Job + yes + yes + + + + All functional services must use this object design to track state. While Events may be published back to the objects creator, they must not be published to the Consumer when the event was generated based on its request (since results were included in the response). Each functional service should define the expectations of how management of the job is managed for both the Consumer and Provider. For instance, certain optional fields may need to be included in-order-to successfully cause a job to be created. + + + + + + Name + M + + The name of the job, e.g. "grading" or "sre". + + + + + + Description + O + + A description of the job, e.g. "Bowers Elementary School Final Marks" + + + + + + State + O + + The current enumerable state of the job. + + + + + + State Description + O + + A descriptive message elaborating on the current state, e.g. if the current state is "FAILED" the stateDescription may be "Timeout occured". + + + + + + Created + O + + The datetime this job was created. + + + + + + Last Modified + O + + The datetime this job was last modified. + + + + + + Timeout + O + + The ammount of time after creation before this job is automatically deleted. + + + + + + Phases + O + + The phases that make up this job. + + + + + + + + + + + + + + + + + + + Phase Name + M + + The name of the Phase unique within the context of the owning job. + + + + + + Phase States + M + + A collection of the states the Phase has been through, must initially contain a NOTAPPLICABLE or NOTSTARTED state. + + + + + + Required + M + + Whether or not this phase is required for the job to complete successfully. + + + + + + Rights + M + + Access rights given to the consumer for this phase. + + + + + + States Rights + M + + Access rights given to the consumer for each state. + + + + + + + + + + + + + + + State + no + no + + + + + [services connector]/[job name]+s/[job id]/[phase name]/states/state + Used exclusively by the Consumer to create a new (and therefore current) state. + + + + For states updatable by the Consumer, it creates a new state much like it would a single object. The actual result (state or error) is included in the response. Each functional service should define the expectations for which Adaptor is responsible for updating the phase status. NOTE: The "states" collection represented here is reserved for future capabilities. + + + + + + Type + M + + The type of this State object. + + + + + + Created + O + + The datetime this job was created. + + + + + + Last Modified + O + + The datetime this job was last modified. + + + + + + Description + O + + A descriptive message ellaborating the condition of this state, e.g. if the state is "FAILED" the stateDescription may be "Timeout occured". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Phase Name + O + + Name of initialization phase the payload corresponds to. + + + + + + Payload + M + + Information matching the initialization phase, should result in corresponding phase having an INPROGRESS, COMPLETED, or FAILED state. + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/namespace.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/namespace.xsd new file mode 100644 index 00000000..72ff207b --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/namespace.xsd @@ -0,0 +1,70 @@ + + + + + + + + + Namespace + yes + yes + + + + The Namespaces Registry contains the set of XML namespace URIs and their corresponding schema location URLs that are currently valid within the Environment. + + + + + + Zone + M + + + + + If this namespace is tied to a specific zone it is specified here. + + + + + + URI + MU + + + + + The namespace URI of the retrieved URL. + + + + + + + + + + + URL + MN + + + + + The URL of the specified namespace URI. + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provider.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provider.xsd new file mode 100644 index 00000000..b6d63850 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provider.xsd @@ -0,0 +1,148 @@ + + + + + + + + + Provider + yes + yes + + + + All potentially accessible Services have an entry in the Providers Registry (including the Providers Registry Utility Service itself), although full or even partial Consumer access to that Service is determined by the access rights currently granted in the Consumer’s Environment object, and is not guaranteed. + + + + + + Service Type + M + + The generic type of Service being provided. + + + + + + Service Name + M + + The name of the Service or the Service Path being provided. + + + + + + contextName + M + + The name of the Service Context being provided. + + + + + + Zone ID + M + + The Zone in which the Service Context is being provided. + + + + + + Provider Name + M + + The name of the Service Provider as it would be referred to by the administrator of the Zone (ex: RamseySIS). + + + + + + + + End Point + MC + + In a Brokered Environment, this element contains the URL where all requests for this Service Provider should be re-invoked by the Connector + + + + + + + + + + + Dynamic Query + O + + True if this service is capable of honoring the "where" parameter. + + + + + + Query By Example + O + + True if this service is capable of honoring query by example payloads. + + + + + + Changes Since Marker + O + + True if this service is capable of supporting Changes Since Queries. + + + + + + Paged + O + + True if this service is capable of responding to Paged Query Requests (both Interactive and Batch). + + + + + + Max Page Size + MC + + If Paged Queries are supported, this is the maximum number of Objects that will be returned on a Page of Query results. + + + + + + + Application Product + C + + Application Vendor Identification + + + + + + Adapter Product + O + + Adapter Vendor Identification + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provisionrequest.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provisionrequest.xsd new file mode 100644 index 00000000..678847cf --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/provisionrequest.xsd @@ -0,0 +1,43 @@ + + + + + + + + Provision Request + no + yes + + + + If an Environment supports self-provisioning Consumers than either this section must initially contain all the rights the Consumer has to all Services in all Zones, or the provisionRequests Infrastructure Service must be present in the Consumer’s Environment to allow additional rights to be obtained. + + + + + + Provisioned Zones + M + + Contains the list of per Service provisioning requests. Whether successful or not, the results of any additional Service rights assertions (ACCEPTED or REJECTED) will be merged into the existing set currently found in the environment. + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/queue.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/queue.xsd new file mode 100644 index 00000000..a8a596a8 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/queue.xsd @@ -0,0 +1,143 @@ + + + + + + + + + Queue + no + yes + + + + The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs. + + + + + + Polling + O + + Determines, when no messages are queued, whether the Consumer will have to periodically reissue Polling Requests at timed intervals or can reissue a Polling Request immediately. + + + + + + + + + + + + Ownder ID + C + + The Environment ID of the owning Consumer for which this Queue is buffering messages. It is not specified at Queue create time, but is returned as part of the response to a query operation, and serves to allow an administrative application to identify which application the Queue instance is assigned to. + + + + + + Name + O + + A name which the Consumer assigns to the Queue. It is useful for reporting purposes, but is not guaranteed to be unique. + + + + + + Queue URL + M + + The URI of the Messages Service associated with the Queue instance. This is the endpoint where the 'get next message' requests are issued. + + + + + + + O + + When present, this contains the URL which the Queue instance will use when it determines the owner needs to be asynchronously alerted that a new message has arrived in the Queue. + + + + + + Idle Time + M + + Is the maximum time in seconds the Messages Service will wait for a message to arrive, before returning an HTTPS Response of 'no message seen' to the Consumer. + + + + + + Wait Time + C + + indicates the minimum time in seconds that the Consumer should wait after receiving a 'no message seen' response to a previous query, before posting another. + + + + + + Connections + O + + Number of (properly identified) concurrent connections supported by (the consumer, if suggested, and) the queue. + + + + + + + + + + + Created + M + + Time that Queue Instance was Created + + + + + + Last Accessed + M + + Time that Queue Instance was last Accessed and a message was dequeued. + + + + + + Last Modified + M + + Time that Queue Instance was last Modified by receiving a new incoming message. + + + + + + Message Count + M + + The number of messages currently residing in the Queue. + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/subscription.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/subscription.xsd new file mode 100644 index 00000000..889fb441 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/subscription.xsd @@ -0,0 +1,68 @@ + + + + + + + + Subscription + no + yes + + + + A Consumer uses the Subscriptions Infrastructure Service to subscribe to Events published by one or more Service Providers. + + + + + + Zone ID + M + + + + + + + + Context ID + O + + The unique identity of a context element, which is associated with a Provider of this name and type operating in a Zone with this ID. + + + + + + Service Type + M + + The type of the Service + + + + + + Service Name + M + + The name of the Service. For utilities, this is fixed to one of the defined set of Utility Service Names. For objects and functions, it is defined by the Data Model. + + + + + + Queue ID + M + + Specifies which queues you want data associated with this subscription published to. + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/updateresponse.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/updateresponse.xsd new file mode 100644 index 00000000..a435fa74 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/updateresponse.xsd @@ -0,0 +1,41 @@ + + + + + + + + Update Response + no + no + + + + An HTTP Response with a status of 200 (success) and a location corresponding to the URL of the first successfully modified object. It contains a payload consisting of a single “updateResponse†element. + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/utilities.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/utilities.xsd new file mode 100644 index 00000000..6bda1668 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/utilities.xsd @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/xquery.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/xquery.xsd new file mode 100644 index 00000000..8f6f0cd9 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/xquery.xsd @@ -0,0 +1,268 @@ + + + + + + + + + XQuery + yes + yes + + + + This collection defines the entire set of named queries that Consumers may legally issue for execution by Service Providers. A Consumer specifies the ID of a Named XQuery in a Query Request to a specific Service Provider, along with a set of values for any associated script parameters. + + + + + + Type + M + + Determines if the query may be sent to a data provider or if it requires the extended XQuery mechanism. + + + + + + + + + + + + + Status + M + + Communicates if the query has been inspected for data hiding and the results of that assessment. + + + + + + + + + + + + + Qualifier + O + + If status is DISALLOWED this element optionally contains the reason. + + + + + + + + + + + + Description + ON + + Human readable description of the XQuery's intended behavior. + + + + + + + + + + + + Script + MN + + The text of the XQuery which MAY accept parameters. Usage of the CDATA designation is recommended. + + + + + + + + + + + + + + + + + + Return Type + Q + + The fully qualified name of the root element returned by this service. + Example: http://www.sifassociation.org/datamodel/na/3.3:students + + + + + + + + ID + OC + + The unique ID of the XQuery Template, which is contained in the Query Request URL when this template is being utilized. “Suggested†by the Consumer issuing the create Request, or pre-set in accordance with the binding requirements of a particular SIF release. + This is NOT required to be a UUID, and must be provided as the Service Identifier in every Query URL which invokes this Template. Ex: “StudentSnapshotâ€. + + + + + + + + + + Xpath + MR + + Indicates one of the pieces of data to include in the result. [CHANGE TO SIF XPATH TYPE] + + + + + + + + + + Name + M + + The name of the query parameter to be passed in. Note: Must not conflict with any other query parameter name. + + + + + + Type + O + + A well understood type that MAY be used for parameter validation. Example: xs:unsignedInt + + + + + + Default + O + + Value to be supplied for this parameter if the submitter omits it. + + + + + + Description + O + + An explanation of what this parameter represents. + + + + + + + + + + + + Required + OC + + Indicator as to if this parameter is required. If omitted, the parameter is assumed to be required! + + + + + + + + + + + + + + + Minimum Length + O + + The minimum length for values of this parameter. If omitted, zero. May be functionally different because of other restrictions. + + + + + + Maximum Length + O + + The maximum length for values of this parameter. If omitted, unbounded. May be functionally different because of other restrictions. + + + + + + + + + + Enumeration + M + + An acceptable parameter value for this query. + + + + + + Enumeration Code + OC + + If enumerated value has an equivalent code, this field may be used for conversion. + + + + + + + + + + Start + M + + If a numeric range is used, this holds the inclusive starting value. + + + + + + Range End + M + + If a numeric range is used, this holds the inclusive ending value. + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/zone.xsd b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/zone.xsd new file mode 100644 index 00000000..e79f1ee7 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/Generator/data/input/infra321/zone.xsd @@ -0,0 +1,8 @@ + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/Generator/script/ant.properties b/SIF3InfraREST/sif3InfraModel/Generator/script/ant.properties index 91046c5b..71d676b4 100644 --- a/SIF3InfraREST/sif3InfraModel/Generator/script/ant.properties +++ b/SIF3InfraREST/sif3InfraModel/Generator/script/ant.properties @@ -1,4 +1,4 @@ #The directory name where the infrastructure XSDs are located #xsd.dir=infra301 -xsd.dir=infra31 - +#xsd.dir=infra31 +xsd.dir=infra321 diff --git a/SIF3InfraREST/sif3InfraModel/Generator/script/build.xml b/SIF3InfraREST/sif3InfraModel/Generator/script/build.xml index 7f3229c8..b157b076 100644 --- a/SIF3InfraREST/sif3InfraModel/Generator/script/build.xml +++ b/SIF3InfraREST/sif3InfraModel/Generator/script/build.xml @@ -1,64 +1,84 @@ - + - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + diff --git a/SIF3InfraREST/sif3InfraModel/pom.xml b/SIF3InfraREST/sif3InfraModel/pom.xml index ddb7ae6c..0ec7b716 100644 --- a/SIF3InfraREST/sif3InfraModel/pom.xml +++ b/SIF3InfraREST/sif3InfraModel/pom.xml @@ -7,7 +7,7 @@ sif3.framework sif3-framework - 0.10.0-beta + 0.11.0-beta @@ -39,13 +39,17 @@ - + - log4j - log4j + org.slf4j + slf4j-api + + org.slf4j + slf4j-log4j12 + diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraMarshalFactory.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraMarshalFactory.java index dfd597e6..2edddd0a 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraMarshalFactory.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraMarshalFactory.java @@ -28,7 +28,8 @@ import javax.ws.rs.core.MediaType; import javax.xml.bind.JAXBElement; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.conversion.MarshalFactory; import sif3.common.exception.MarshalException; @@ -46,7 +47,7 @@ */ public class InfraMarshalFactory implements MarshalFactory { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); private static final HashMap, Method> CREATE_METHODS = new HashMap, Method>(); diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraUnmarshalFactory.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraUnmarshalFactory.java index eab0587a..e4ed0947 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraUnmarshalFactory.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/conversion/InfraUnmarshalFactory.java @@ -25,7 +25,8 @@ import javax.ws.rs.core.MediaType; -import org.apache.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import sif3.common.conversion.UnmarshalFactory; import sif3.common.exception.UnmarshalException; @@ -42,7 +43,7 @@ */ public class InfraUnmarshalFactory implements UnmarshalFactory { - protected final Logger logger = Logger.getLogger(getClass()); + protected final Logger logger = LoggerFactory.getLogger(getClass()); //List of supported media types. // private static final HashSet supportedMediaTypes = new HashSet(Arrays.asList(MediaType.APPLICATION_XML_TYPE, MediaType.TEXT_XML_TYPE, MediaType.APPLICATION_JSON_TYPE, MediaType.TEXT_PLAIN_TYPE)); diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertCollectionType.java index b4ebb989..cf21e322 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="alert" type="{http://www.sifassociation.org/infrastructure/3.1}alertType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="alert" type="{http://www.sifassociation.org/infrastructure/3.2.1}alertType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "alertCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "alertCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "alert" }) public class AlertCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List alert; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertType.java index 18e0d10b..6d7d9384 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AlertType.java @@ -13,6 +13,8 @@ /** + * Alerts form a system wide log that can be protected, as it may contain sensitive data. Ideally an Alert should contain as much identifying information about the problem being reported as possible. + * *

Java class for alertType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -54,7 +56,7 @@ * <element name="code" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" minOccurs="0"/> * <element name="internal" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -63,7 +65,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "alertType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "alertType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "reporter", "cause", "exchange", @@ -79,43 +81,43 @@ }) public class AlertType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String reporter; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String cause; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String exchange; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String level; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlSchemaType(name = "normalizedString") protected String description; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String messageID; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String body; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String error; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlSchemaType(name = "normalizedString") protected String xpath; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long category; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long code; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String internal; diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasType.java index db283fe7..5b3a3702 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasType.java @@ -1,9 +1,11 @@ package sif3.infra.common.model; +import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlType; @@ -17,9 +19,9 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="code" type="{http://www.sifassociation.org/infrastructure/3.1}codeType"/> - * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.1}uriType"/> - * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.1}uriType"/> + * <element name="code" type="{http://www.sifassociation.org/infrastructure/3.2.1}codeType"/> + * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.2.1}uriType" minOccurs="0"/> + * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.2.1}uriType" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,7 +31,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "aliasType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "aliasType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "code", "source", "namespace" @@ -38,10 +40,10 @@ public class AliasType { @XmlElement(required = true) protected CodeType code; - @XmlElement(required = true, nillable = true) - protected String source; - @XmlElement(required = true, nillable = true) - protected String namespace; + @XmlElementRef(name = "source", type = JAXBElement.class, required = false) + protected JAXBElement source; + @XmlElementRef(name = "namespace", type = JAXBElement.class, required = false) + protected JAXBElement namespace; /** * Gets the value of the code property. @@ -72,10 +74,10 @@ public void setCode(CodeType value) { * * @return * possible object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public String getSource() { + public JAXBElement getSource() { return source; } @@ -84,10 +86,10 @@ public String getSource() { * * @param value * allowed object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public void setSource(String value) { + public void setSource(JAXBElement value) { this.source = value; } @@ -96,10 +98,10 @@ public void setSource(String value) { * * @return * possible object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public String getNamespace() { + public JAXBElement getNamespace() { return namespace; } @@ -108,10 +110,10 @@ public String getNamespace() { * * @param value * allowed object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public void setNamespace(String value) { + public void setNamespace(JAXBElement value) { this.namespace = value; } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasesType.java index d3bf2e70..ee8d1186 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/AliasesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="alias" type="{http://www.sifassociation.org/infrastructure/3.1}aliasType" maxOccurs="unbounded"/> + * <element name="alias" type="{http://www.sifassociation.org/infrastructure/3.2.1}aliasType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,7 +29,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "aliasesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "aliasesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "alias" }) public class AliasesType { diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ApplicationInfoType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ApplicationInfoType.java index 5108145f..d6edf7d5 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ApplicationInfoType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ApplicationInfoType.java @@ -22,8 +22,8 @@ * <element name="supportedInfrastructureVersion" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * <element name="dataModelNamespace" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> * <element name="transport" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="applicationProduct" type="{http://www.sifassociation.org/infrastructure/3.1}productIdentityType" minOccurs="0"/> - * <element name="adapterProduct" type="{http://www.sifassociation.org/infrastructure/3.1}productIdentityType" minOccurs="0"/> + * <element name="applicationProduct" type="{http://www.sifassociation.org/infrastructure/3.2.1}productIdentityType" minOccurs="0"/> + * <element name="adapterProduct" type="{http://www.sifassociation.org/infrastructure/3.2.1}productIdentityType" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -33,7 +33,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "applicationInfoType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "applicationInfoType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "applicationKey", "supportedInfrastructureVersion", "dataModelNamespace", @@ -43,18 +43,18 @@ }) public class ApplicationInfoType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String applicationKey; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String supportedInfrastructureVersion; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "anyURI") protected String dataModelNamespace; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String transport; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProductIdentityType applicationProduct; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProductIdentityType adapterProduct; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemType.java index fb8c365a..1cbdfd39 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemType.java @@ -2,9 +2,11 @@ package sif3.infra.common.model; import java.util.Calendar; +import javax.xml.bind.JAXBElement; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElementRef; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; @@ -30,8 +32,8 @@ * </restriction> * </simpleType> * </element> - * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.1}uriType"/> - * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.1}uriType"/> + * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.2.1}uriType" minOccurs="0"/> + * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.2.1}uriType" minOccurs="0"/> * <element name="value"> * <simpleType> * <restriction base="{http://www.w3.org/2001/XMLSchema}token"> @@ -56,7 +58,7 @@ * </restriction> * </simpleType> * </element> - * <element name="aliases" type="{http://www.sifassociation.org/infrastructure/3.1}aliasesType" minOccurs="0"/> + * <element name="aliases" type="{http://www.sifassociation.org/infrastructure/3.2.1}aliasesType" minOccurs="0"/> * <element name="action"> * <simpleType> * <restriction base="{http://www.w3.org/2001/XMLSchema}string"> @@ -77,7 +79,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "codeItemType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "codeItemType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "code", "source", "namespace", @@ -93,10 +95,10 @@ public class CodeItemType { @XmlElement(required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String code; - @XmlElement(required = true, nillable = true) - protected String source; - @XmlElement(required = true, nillable = true) - protected String namespace; + @XmlElementRef(name = "source", type = JAXBElement.class, required = false) + protected JAXBElement source; + @XmlElementRef(name = "namespace", type = JAXBElement.class, required = false) + protected JAXBElement namespace; @XmlElement(required = true, nillable = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String value; @@ -141,10 +143,10 @@ public void setCode(String value) { * * @return * possible object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public String getSource() { + public JAXBElement getSource() { return source; } @@ -153,10 +155,10 @@ public String getSource() { * * @param value * allowed object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public void setSource(String value) { + public void setSource(JAXBElement value) { this.source = value; } @@ -165,10 +167,10 @@ public void setSource(String value) { * * @return * possible object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public String getNamespace() { + public JAXBElement getNamespace() { return namespace; } @@ -177,10 +179,10 @@ public String getNamespace() { * * @param value * allowed object is - * {@link String } + * {@link JAXBElement }{@code <}{@link String }{@code >} * */ - public void setNamespace(String value) { + public void setNamespace(JAXBElement value) { this.namespace = value; } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemsType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemsType.java index 103cbebc..c8bb08d1 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemsType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeItemsType.java @@ -1,6 +1,8 @@ package sif3.infra.common.model; +import java.util.ArrayList; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; @@ -17,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="codeItem" type="{http://www.sifassociation.org/infrastructure/3.1}codeItemType"/> + * <element name="codeItem" type="{http://www.sifassociation.org/infrastructure/3.2.1}codeItemType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -27,36 +29,41 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "codeItemsType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "codeItemsType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "codeItem" }) public class CodeItemsType { @XmlElement(required = true) - protected CodeItemType codeItem; + protected List codeItem; /** * Gets the value of the codeItem property. * - * @return - * possible object is - * {@link CodeItemType } - * - */ - public CodeItemType getCodeItem() { - return codeItem; - } - - /** - * Sets the value of the codeItem property. + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the codeItem property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getCodeItem().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link CodeItemType } + * * - * @param value - * allowed object is - * {@link CodeItemType } - * */ - public void setCodeItem(CodeItemType value) { - this.codeItem = value; + public List getCodeItem() { + if (codeItem == null) { + codeItem = new ArrayList(); + } + return this.codeItem; } } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetCollectionType.java index 0a13a27d..a31bf123 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="codeSet" type="{http://www.sifassociation.org/infrastructure/3.1}codeSetType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="codeSet" type="{http://www.sifassociation.org/infrastructure/3.2.1}codeSetType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "codeSetCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "codeSetCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "codeSet" }) public class CodeSetCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List codeSet; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetType.java index 3254a00a..8cbc8a4f 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeSetType.java @@ -13,6 +13,8 @@ /** + * The Code Set Registry Service provides a way for all legal codes to be defined outside of the SIF Specification while allowing changes (additions and replacements) of external code set values to be easily verified by the recipient so as not to break existing Consumer / Provider interoperability. + * *

Java class for codeSetType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -23,12 +25,12 @@ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="zone" type="{http://www.w3.org/2001/XMLSchema}token"/> - * <element name="version" type="{http://www.sifassociation.org/infrastructure/3.1}versionType"/> + * <element name="version" type="{http://www.sifassociation.org/infrastructure/3.2.1}versionType"/> * <element name="timestamp" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> - * <choice> - * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.1}uriType" minOccurs="0"/> - * <element name="codeItems" type="{http://www.sifassociation.org/infrastructure/3.1}codeItemsType" minOccurs="0"/> - * </choice> + * <sequence> + * <element name="source" type="{http://www.sifassociation.org/infrastructure/3.2.1}uriType" minOccurs="0"/> + * <element name="codeItems" type="{http://www.sifassociation.org/infrastructure/3.2.1}codeItemsType" minOccurs="0"/> + * </sequence> * </sequence> * <attribute name="id"> * <simpleType> @@ -46,7 +48,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "codeSetType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "codeSetType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "zone", "version", "timestamp", diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeType.java index e6eccc46..00c34447 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CodeType.java @@ -38,7 +38,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "codeType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "codeType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "old", "official", "value" diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateResponseType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateResponseType.java index 5e0556b9..d2991c24 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateResponseType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateResponseType.java @@ -8,6 +8,8 @@ /** + * An HTTP Response with a status of 200 and a payload consisting of a single “createResponse” element. This includes, for each requested object successfully created, an internal status of 201 and the service-assigned refId. Any requested object that failed to be created is indicated by an error statusCode and a corresponding error payload. + * *

Java class for createResponseType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -17,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="creates" type="{http://www.sifassociation.org/infrastructure/3.1}createsType"/> + * <element name="creates" type="{http://www.sifassociation.org/infrastructure/3.2.1}createsType"/> * </sequence> * </restriction> * </complexContent> @@ -27,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "createResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "creates" }) public class CreateResponseType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected CreatesType creates; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateType.java index 721ed190..764a6df2 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreateType.java @@ -21,7 +21,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.1}errorType" minOccurs="0"/> + * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.2.1}errorType" minOccurs="0"/> * </sequence> * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}token" /> * <attribute name="advisoryId" type="{http://www.w3.org/2001/XMLSchema}token" /> @@ -40,12 +40,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "createType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "error" }) public class CreateType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ErrorType error; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreatesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreatesType.java index 678d97e3..266da042 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreatesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/CreatesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="create" type="{http://www.sifassociation.org/infrastructure/3.1}createType" maxOccurs="unbounded"/> + * <element name="create" type="{http://www.sifassociation.org/infrastructure/3.2.1}createType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "createsType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "createsType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "create" }) public class CreatesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List create; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdCollection.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdCollection.java index 48fd14a0..60f93e37 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdCollection.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdCollection.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="delete" type="{http://www.sifassociation.org/infrastructure/3.1}deleteIdType" maxOccurs="unbounded"/> + * <element name="delete" type="{http://www.sifassociation.org/infrastructure/3.2.1}deleteIdType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteIdCollection", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "deleteIdCollection", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "delete" }) public class DeleteIdCollection { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List delete; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdType.java index 79febea3..793426eb 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteIdType.java @@ -28,7 +28,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteIdType", namespace = "http://www.sifassociation.org/infrastructure/3.1") +@XmlType(name = "deleteIdType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") public class DeleteIdType { @XmlAttribute(name = "id", required = true) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteRequestType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteRequestType.java index b734772e..f837abd9 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteRequestType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteRequestType.java @@ -8,6 +8,8 @@ /** + * A “deleteRequest” element, which consists of multiple, “delete” object ids. Since REST conventions do not support payloads on HTTP DELETE messages, all multi-object Delete Requests are conveyed via an HTTP PUT message containing an additional HTTP Header Field value of methodOverride set to DELETE. + * *

Java class for deleteRequestType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -17,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="deletes" type="{http://www.sifassociation.org/infrastructure/3.1}deleteIdCollection"/> + * <element name="deletes" type="{http://www.sifassociation.org/infrastructure/3.2.1}deleteIdCollection"/> * </sequence> * </restriction> * </complexContent> @@ -27,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteRequestType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "deleteRequestType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "deletes" }) public class DeleteRequestType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected DeleteIdCollection deletes; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteResponseType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteResponseType.java index b03fe034..47d2c216 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteResponseType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteResponseType.java @@ -8,6 +8,8 @@ /** + * An HTTP Response with a status of 200 (success). It contains a payload consisting of a single “deleteResponse” element. + * *

Java class for deleteResponseType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -17,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="deletes" type="{http://www.sifassociation.org/infrastructure/3.1}deleteStatusCollection"/> + * <element name="deletes" type="{http://www.sifassociation.org/infrastructure/3.2.1}deleteStatusCollection"/> * </sequence> * </restriction> * </complexContent> @@ -27,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "deleteResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "deletes" }) public class DeleteResponseType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected DeleteStatusCollection deletes; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatus.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatus.java index 202f94d4..f6762322 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatus.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatus.java @@ -21,7 +21,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.1}errorType" minOccurs="0"/> + * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.2.1}errorType" minOccurs="0"/> * </sequence> * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}token" /> * <attribute name="statusCode"> @@ -39,12 +39,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteStatus", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "deleteStatus", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "error" }) public class DeleteStatus { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ErrorType error; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatusCollection.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatusCollection.java index 2781b54a..abab35f2 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatusCollection.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/DeleteStatusCollection.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="delete" type="{http://www.sifassociation.org/infrastructure/3.1}deleteStatus" maxOccurs="unbounded"/> + * <element name="delete" type="{http://www.sifassociation.org/infrastructure/3.2.1}deleteStatus" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "deleteStatusCollection", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "deleteStatusCollection", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "delete" }) public class DeleteStatusCollection { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List delete; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnumerationType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnumerationType.java new file mode 100644 index 00000000..65a24fef --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnumerationType.java @@ -0,0 +1,97 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for enumerationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="enumerationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="value" type="{http://www.w3.org/2001/XMLSchema}token"/>
+ *         <element name="code" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "enumerationType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "value", + "code" +}) +public class EnumerationType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String value; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String code; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setValue(String value) { + this.value = value; + } + + /** + * Gets the value of the code property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getCode() { + return code; + } + + /** + * Sets the value of the code property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCode(String value) { + this.code = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentCollectionType.java index bb991d4d..859ad978 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="environment" type="{http://www.sifassociation.org/infrastructure/3.1}environmentType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="environment" type="{http://www.sifassociation.org/infrastructure/3.2.1}environmentType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "environmentCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "environmentCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "environment" }) public class EnvironmentCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List environment; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentType.java index ec54bfe6..14764def 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentType.java @@ -12,6 +12,8 @@ /** + * The Consumer Environment Service is the gateway to all other services. It scopes the Consumer’s possible interactions with the infrastructure and any Provider Services accessible from it. The Environment Service provides the set of (possibly customized) information the Application needs to interoperate successfully. + * *

Java class for environmentType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -21,19 +23,20 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> + * <element name="fingerprint" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element name="sessionToken" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element name="solutionId" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> - * <element name="defaultZone" type="{http://www.sifassociation.org/infrastructure/3.1}zoneType" minOccurs="0"/> + * <element name="defaultZone" type="{http://www.sifassociation.org/infrastructure/3.2.1}zoneType" minOccurs="0"/> * <element name="authenticationMethod" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element name="instanceId" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element name="userToken" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * <element name="consumerName" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> - * <element name="applicationInfo" type="{http://www.sifassociation.org/infrastructure/3.1}applicationInfoType" minOccurs="0"/> - * <element name="infrastructureServices" type="{http://www.sifassociation.org/infrastructure/3.1}infrastructureServicesType" minOccurs="0"/> - * <element name="provisionedZones" type="{http://www.sifassociation.org/infrastructure/3.1}provisionedZonesType" minOccurs="0"/> + * <element name="applicationInfo" type="{http://www.sifassociation.org/infrastructure/3.2.1}applicationInfoType" minOccurs="0"/> + * <element name="infrastructureServices" type="{http://www.sifassociation.org/infrastructure/3.2.1}infrastructureServicesType" minOccurs="0"/> + * <element name="provisionedZones" type="{http://www.sifassociation.org/infrastructure/3.2.1}provisionedZonesType" minOccurs="0"/> * </sequence> - * <attribute name="type" type="{http://www.sifassociation.org/infrastructure/3.1}environmentTypeType" /> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="type" type="{http://www.sifassociation.org/infrastructure/3.2.1}environmentTypeType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -42,7 +45,8 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "environmentType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "environmentType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "fingerprint", "sessionToken", "solutionId", "defaultZone", @@ -56,33 +60,37 @@ }) public class EnvironmentType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String fingerprint; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String sessionToken; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String solutionId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ZoneType defaultZone; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String authenticationMethod; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String instanceId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String userToken; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String consumerName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ApplicationInfoType applicationInfo; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected InfrastructureServicesType infrastructureServices; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProvisionedZonesType provisionedZones; @XmlAttribute(name = "type") protected EnvironmentTypeType type; @@ -90,6 +98,30 @@ public class EnvironmentType { @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String id; + /** + * Gets the value of the fingerprint property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getFingerprint() { + return fingerprint; + } + + /** + * Sets the value of the fingerprint property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setFingerprint(String value) { + this.fingerprint = value; + } + /** * Gets the value of the sessionToken property. * diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentTypeType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentTypeType.java index 5e9065b3..40fc0cd0 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentTypeType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/EnvironmentTypeType.java @@ -20,7 +20,7 @@ * * */ -@XmlType(name = "environmentTypeType", namespace = "http://www.sifassociation.org/infrastructure/3.1") +@XmlType(name = "environmentTypeType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlEnum public enum EnvironmentTypeType { diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ErrorType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ErrorType.java index cda3dad2..2bb70fe9 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ErrorType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ErrorType.java @@ -12,6 +12,8 @@ /** + * The Service Provider returns a SIF Error Message to a Consumer issuing an erroneous Request. + * *

Java class for errorType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -47,7 +49,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "errorType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "errorType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "code", "scope", "message", @@ -55,14 +57,14 @@ }) public class ErrorType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected long code; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String scope; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String message; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String description; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/IncludeType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/IncludeType.java index 9cbeb495..0f118f0e 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/IncludeType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/IncludeType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="xpath" type="{http://www.sifassociation.org/infrastructure/3.1}xpathType" maxOccurs="unbounded"/> + * <element name="xpath" type="{http://www.sifassociation.org/infrastructure/3.2.1}xpathType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "includeType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "includeType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "xpath" }) public class IncludeType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List xpath; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceNamesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceNamesType.java index 5bced124..a63e2fa7 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceNamesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceNamesType.java @@ -20,12 +20,13 @@ * <enumeration value="eventsConnector"/> * <enumeration value="queues"/> * <enumeration value="subscriptions"/> + * <enumeration value="servicesConnector"/> * </restriction> * </simpleType> * * */ -@XmlType(name = "infrastructureServiceNamesType", namespace = "http://www.sifassociation.org/infrastructure/3.1") +@XmlType(name = "infrastructureServiceNamesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlEnum public enum InfrastructureServiceNamesType { @@ -40,7 +41,9 @@ public enum InfrastructureServiceNamesType { @XmlEnumValue("queues") QUEUES("queues"), @XmlEnumValue("subscriptions") - SUBSCRIPTIONS("subscriptions"); + SUBSCRIPTIONS("subscriptions"), + @XmlEnumValue("servicesConnector") + SERVICES_CONNECTOR("servicesConnector"); private final String value; InfrastructureServiceNamesType(String v) { diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceType.java index 57a573ae..19e9ece3 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServiceType.java @@ -20,7 +20,7 @@ * <complexType name="infrastructureServiceType"> * <simpleContent> * <extension base="<http://www.w3.org/2001/XMLSchema>token"> - * <attribute name="name" type="{http://www.sifassociation.org/infrastructure/3.1}infrastructureServiceNamesType" /> + * <attribute name="name" type="{http://www.sifassociation.org/infrastructure/3.2.1}infrastructureServiceNamesType" /> * </extension> * </simpleContent> * </complexType> @@ -29,7 +29,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "infrastructureServiceType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "infrastructureServiceType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "value" }) public class InfrastructureServiceType { diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServicesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServicesType.java index 826f72fc..7539ee92 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServicesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InfrastructureServicesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="infrastructureService" type="{http://www.sifassociation.org/infrastructure/3.1}infrastructureServiceType" maxOccurs="unbounded" minOccurs="2"/> + * <element name="infrastructureService" type="{http://www.sifassociation.org/infrastructure/3.2.1}infrastructureServiceType" maxOccurs="unbounded" minOccurs="2"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "infrastructureServicesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "infrastructureServicesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "infrastructureService" }) public class InfrastructureServicesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List infrastructureService; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InitializationType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InitializationType.java new file mode 100644 index 00000000..6389a45a --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/InitializationType.java @@ -0,0 +1,95 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for initializationType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="initializationType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="phaseName" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/>
+ *         <element name="payload" type="{http://www.w3.org/2001/XMLSchema}anyType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "initializationType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "phaseName", + "payload" +}) +public class InitializationType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String phaseName; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected Object payload; + + /** + * Gets the value of the phaseName property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getPhaseName() { + return phaseName; + } + + /** + * Sets the value of the phaseName property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setPhaseName(String value) { + this.phaseName = value; + } + + /** + * Gets the value of the payload property. + * + * @return + * possible object is + * {@link Object } + * + */ + public Object getPayload() { + return payload; + } + + /** + * Sets the value of the payload property. + * + * @param value + * allowed object is + * {@link Object } + * + */ + public void setPayload(Object value) { + this.payload = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobCollectionType.java new file mode 100644 index 00000000..ec522c9a --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobCollectionType.java @@ -0,0 +1,69 @@ + +package sif3.infra.common.model; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for jobCollectionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="jobCollectionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="job" type="{http://www.sifassociation.org/infrastructure/3.2.1}jobType" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "jobCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "job" +}) +public class JobCollectionType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected List job; + + /** + * Gets the value of the job property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the job property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getJob().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JobType } + * + * + */ + public List getJob() { + if (job == null) { + job = new ArrayList(); + } + return this.job; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobStateType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobStateType.java new file mode 100644 index 00000000..d4349985 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobStateType.java @@ -0,0 +1,42 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for jobStateType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="jobStateType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="NOTSTARTED"/>
+ *     <enumeration value="INPROGRESS"/>
+ *     <enumeration value="COMPLETED"/>
+ *     <enumeration value="FAILED"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "jobStateType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") +@XmlEnum +public enum JobStateType { + + NOTSTARTED, + INPROGRESS, + COMPLETED, + FAILED; + + public String value() { + return name(); + } + + public static JobStateType fromValue(String v) { + return valueOf(v); + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobType.java new file mode 100644 index 00000000..f5f91262 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/JobType.java @@ -0,0 +1,328 @@ + +package sif3.infra.common.model; + +import java.util.Calendar; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import javax.xml.datatype.Duration; + + +/** + * All functional services must use this object design to track state. While Events may be published back to the objects creator, they must not be published to the Consumer when the event was generated based on its request (since results were included in the response). Each functional service should define the expectations of how management of the job is managed for both the Consumer and Provider. For instance, certain optional fields may need to be included in-order-to successfully cause a job to be created. + * + *

Java class for jobType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="jobType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}token"/>
+ *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="state" type="{http://www.sifassociation.org/infrastructure/3.2.1}jobStateType" minOccurs="0"/>
+ *         <element name="stateDescription" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *         <element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="lastModified" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="timeout" type="{http://www.w3.org/2001/XMLSchema}duration" minOccurs="0"/>
+ *         <element name="phases" type="{http://www.sifassociation.org/infrastructure/3.2.1}phaseCollectionType" minOccurs="0"/>
+ *         <element name="initialization" type="{http://www.sifassociation.org/infrastructure/3.2.1}initializationType" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "jobType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "name", + "description", + "state", + "stateDescription", + "created", + "lastModified", + "timeout", + "phases", + "initialization" +}) +public class JobType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String name; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected String description; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected JobStateType state; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected String stateDescription; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) + @XmlJavaTypeAdapter(Adapter1 .class) + @XmlSchemaType(name = "dateTime") + protected Calendar created; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) + @XmlJavaTypeAdapter(Adapter1 .class) + @XmlSchemaType(name = "dateTime") + protected Calendar lastModified; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Duration timeout; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected PhaseCollectionType phases; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected InitializationType initialization; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String id; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the description property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the state property. + * + * @return + * possible object is + * {@link JobStateType } + * + */ + public JobStateType getState() { + return state; + } + + /** + * Sets the value of the state property. + * + * @param value + * allowed object is + * {@link JobStateType } + * + */ + public void setState(JobStateType value) { + this.state = value; + } + + /** + * Gets the value of the stateDescription property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getStateDescription() { + return stateDescription; + } + + /** + * Sets the value of the stateDescription property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setStateDescription(String value) { + this.stateDescription = value; + } + + /** + * Gets the value of the created property. + * + * @return + * possible object is + * {@link String } + * + */ + public Calendar getCreated() { + return created; + } + + /** + * Sets the value of the created property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreated(Calendar value) { + this.created = value; + } + + /** + * Gets the value of the lastModified property. + * + * @return + * possible object is + * {@link String } + * + */ + public Calendar getLastModified() { + return lastModified; + } + + /** + * Sets the value of the lastModified property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastModified(Calendar value) { + this.lastModified = value; + } + + /** + * Gets the value of the timeout property. + * + * @return + * possible object is + * {@link Duration } + * + */ + public Duration getTimeout() { + return timeout; + } + + /** + * Sets the value of the timeout property. + * + * @param value + * allowed object is + * {@link Duration } + * + */ + public void setTimeout(Duration value) { + this.timeout = value; + } + + /** + * Gets the value of the phases property. + * + * @return + * possible object is + * {@link PhaseCollectionType } + * + */ + public PhaseCollectionType getPhases() { + return phases; + } + + /** + * Sets the value of the phases property. + * + * @param value + * allowed object is + * {@link PhaseCollectionType } + * + */ + public void setPhases(PhaseCollectionType value) { + this.phases = value; + } + + /** + * Gets the value of the initialization property. + * + * @return + * possible object is + * {@link InitializationType } + * + */ + public InitializationType getInitialization() { + return initialization; + } + + /** + * Sets the value of the initialization property. + * + * @param value + * allowed object is + * {@link InitializationType } + * + */ + public void setInitialization(InitializationType value) { + this.initialization = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/MediaTypesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/MediaTypesType.java index 43f94533..55bf34ba 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/MediaTypesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/MediaTypesType.java @@ -32,12 +32,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "mediaTypesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "mediaTypesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "mediaType" }) public class MediaTypesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected List mediaType; diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceCollectionType.java index 526dcb32..b9c6246c 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.1}namespaceType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.2.1}namespaceType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "namespaceCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "namespaceCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "namespace" }) public class NamespaceCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List namespace; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifierType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifierType.java index cd650a1a..5254117d 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifierType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifierType.java @@ -35,7 +35,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "namespaceQualifierType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "namespaceQualifierType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "prefix", "_static", "startsWith", @@ -43,18 +43,18 @@ }) public class NamespaceQualifierType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true, nillable = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true, nillable = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String prefix; - @XmlElement(name = "static", namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(name = "static", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "anyURI") protected String _static; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String startsWith; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String regularExpression; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifiersType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifiersType.java index feb4014d..d95a1773 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifiersType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceQualifiersType.java @@ -17,7 +17,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.1}namespaceQualifierType"/> + * <element name="namespace" type="{http://www.sifassociation.org/infrastructure/3.2.1}namespaceQualifierType"/> * </sequence> * </restriction> * </complexContent> @@ -27,12 +27,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "namespaceQualifiersType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "namespaceQualifiersType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "namespace" }) public class NamespaceQualifiersType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected NamespaceQualifierType namespace; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceType.java index 48a13426..698620bc 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/NamespaceType.java @@ -12,6 +12,8 @@ /** + * The Namespaces Registry contains the set of XML namespace URIs and their corresponding schema location URLs that are currently valid within the Environment. + * *

Java class for namespaceType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -37,7 +39,7 @@ * </simpleType> * </element> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -46,20 +48,20 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "namespaceType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "namespaceType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "zone", "uri", "url" }) public class NamespaceType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String zone; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String uri; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String url; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ObjectFactory.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ObjectFactory.java index 3a10487d..cfb6c70a 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ObjectFactory.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ObjectFactory.java @@ -24,30 +24,36 @@ @XmlRegistry public class ObjectFactory { - private final static QName _Queues_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "queues"); - private final static QName _CreateResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "createResponse"); - private final static QName _Zone_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "zone"); - private final static QName _Environment_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "environment"); - private final static QName _DeleteResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "deleteResponse"); - private final static QName _Alerts_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "alerts"); - private final static QName _UpdateResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "updateResponse"); - private final static QName _Providers_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "providers"); - private final static QName _Subscription_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "subscription"); - private final static QName _Provider_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "provider"); - private final static QName _Environments_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "environments"); - private final static QName _CodeSet_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "codeSet"); - private final static QName _Namespace_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "namespace"); - private final static QName _Zones_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "zones"); - private final static QName _Namespaces_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "namespaces"); - private final static QName _CodeSets_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "codeSets"); - private final static QName _Xquerys_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "xquerys"); - private final static QName _DeleteRequest_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "deleteRequest"); - private final static QName _Queue_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "queue"); - private final static QName _Xquery_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "xquery"); - private final static QName _Alert_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "alert"); - private final static QName _Error_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "error"); - private final static QName _Subscriptions_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "subscriptions"); - private final static QName _ProvisionRequest_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.1", "provisionRequest"); + private final static QName _Environments_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "environments"); + private final static QName _State_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "state"); + private final static QName _Job_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "job"); + private final static QName _States_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "states"); + private final static QName _CodeSet_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "codeSet"); + private final static QName _Provider_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "provider"); + private final static QName _Zones_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "zones"); + private final static QName _Namespaces_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "namespaces"); + private final static QName _CodeSets_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "codeSets"); + private final static QName _Namespace_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "namespace"); + private final static QName _DeleteRequest_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "deleteRequest"); + private final static QName _Xquery_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "xquery"); + private final static QName _Queue_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "queue"); + private final static QName _Jobs_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "jobs"); + private final static QName _Xquerys_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "xquerys"); + private final static QName _Error_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "error"); + private final static QName _Subscriptions_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "subscriptions"); + private final static QName _ProvisionRequest_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "provisionRequest"); + private final static QName _Alert_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "alert"); + private final static QName _CreateResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "createResponse"); + private final static QName _Queues_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "queues"); + private final static QName _Zone_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "zone"); + private final static QName _DeleteResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "deleteResponse"); + private final static QName _Environment_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "environment"); + private final static QName _Subscription_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "subscription"); + private final static QName _Providers_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "providers"); + private final static QName _UpdateResponse_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "updateResponse"); + private final static QName _Alerts_QNAME = new QName("http://www.sifassociation.org/infrastructure/3.2.1", "alerts"); + private final static QName _AliasTypeSource_QNAME = new QName("", "source"); + private final static QName _AliasTypeNamespace_QNAME = new QName("", "namespace"); /** * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: sif3.infra.common.model @@ -56,6 +62,22 @@ public class ObjectFactory { public ObjectFactory() { } + /** + * Create an instance of {@link ParameterType } + * + */ + public ParameterType createParameterType() { + return new ParameterType(); + } + + /** + * Create an instance of {@link XqueryType } + * + */ + public XqueryType createXqueryType() { + return new XqueryType(); + } + /** * Create an instance of {@link DeleteRequestType } * @@ -73,163 +95,187 @@ public QueueType createQueueType() { } /** - * Create an instance of {@link XqueryType } + * Create an instance of {@link JobCollectionType } * */ - public XqueryType createXqueryType() { - return new XqueryType(); + public JobCollectionType createJobCollectionType() { + return new JobCollectionType(); } /** - * Create an instance of {@link XqueryCollectionType } + * Create an instance of {@link ProvisionRequestType } * */ - public XqueryCollectionType createXqueryCollectionType() { - return new XqueryCollectionType(); + public ProvisionRequestType createProvisionRequestType() { + return new ProvisionRequestType(); } /** - * Create an instance of {@link ErrorType } + * Create an instance of {@link StateType } * */ - public ErrorType createErrorType() { - return new ErrorType(); + public StateType createStateType() { + return new StateType(); } /** - * Create an instance of {@link SubscriptionCollectionType } + * Create an instance of {@link StateCollectionType } * */ - public SubscriptionCollectionType createSubscriptionCollectionType() { - return new SubscriptionCollectionType(); + public StateCollectionType createStateCollectionType() { + return new StateCollectionType(); } /** - * Create an instance of {@link ProvisionRequestType } + * Create an instance of {@link CodeSetType } * */ - public ProvisionRequestType createProvisionRequestType() { - return new ProvisionRequestType(); + public CodeSetType createCodeSetType() { + return new CodeSetType(); } /** - * Create an instance of {@link AlertType } + * Create an instance of {@link NamespaceType } * */ - public AlertType createAlertType() { - return new AlertType(); + public NamespaceType createNamespaceType() { + return new NamespaceType(); } /** - * Create an instance of {@link EnvironmentCollectionType } + * Create an instance of {@link SubscriptionType } * */ - public EnvironmentCollectionType createEnvironmentCollectionType() { - return new EnvironmentCollectionType(); + public SubscriptionType createSubscriptionType() { + return new SubscriptionType(); } /** - * Create an instance of {@link CodeSetType } + * Create an instance of {@link ProviderCollectionType } * */ - public CodeSetType createCodeSetType() { - return new CodeSetType(); + public ProviderCollectionType createProviderCollectionType() { + return new ProviderCollectionType(); } /** - * Create an instance of {@link ProviderType } + * Create an instance of {@link AlertCollectionType } * */ - public ProviderType createProviderType() { - return new ProviderType(); + public AlertCollectionType createAlertCollectionType() { + return new AlertCollectionType(); } /** - * Create an instance of {@link ZoneCollectionType } + * Create an instance of {@link UpdateResponseType } * */ - public ZoneCollectionType createZoneCollectionType() { - return new ZoneCollectionType(); + public UpdateResponseType createUpdateResponseType() { + return new UpdateResponseType(); } /** - * Create an instance of {@link CodeSetCollectionType } + * Create an instance of {@link CreateResponseType } * */ - public CodeSetCollectionType createCodeSetCollectionType() { - return new CodeSetCollectionType(); + public CreateResponseType createCreateResponseType() { + return new CreateResponseType(); } /** - * Create an instance of {@link NamespaceCollectionType } + * Create an instance of {@link XqueryCollectionType } * */ - public NamespaceCollectionType createNamespaceCollectionType() { - return new NamespaceCollectionType(); + public XqueryCollectionType createXqueryCollectionType() { + return new XqueryCollectionType(); } /** - * Create an instance of {@link NamespaceType } + * Create an instance of {@link ErrorType } * */ - public NamespaceType createNamespaceType() { - return new NamespaceType(); + public ErrorType createErrorType() { + return new ErrorType(); } /** - * Create an instance of {@link DeleteResponseType } + * Create an instance of {@link SubscriptionCollectionType } * */ - public DeleteResponseType createDeleteResponseType() { - return new DeleteResponseType(); + public SubscriptionCollectionType createSubscriptionCollectionType() { + return new SubscriptionCollectionType(); } /** - * Create an instance of {@link EnvironmentType } + * Create an instance of {@link AlertType } * */ - public EnvironmentType createEnvironmentType() { - return new EnvironmentType(); + public AlertType createAlertType() { + return new AlertType(); } /** - * Create an instance of {@link SubscriptionType } + * Create an instance of {@link EnvironmentCollectionType } * */ - public SubscriptionType createSubscriptionType() { - return new SubscriptionType(); + public EnvironmentCollectionType createEnvironmentCollectionType() { + return new EnvironmentCollectionType(); } /** - * Create an instance of {@link ProviderCollectionType } + * Create an instance of {@link JobType } * */ - public ProviderCollectionType createProviderCollectionType() { - return new ProviderCollectionType(); + public JobType createJobType() { + return new JobType(); } /** - * Create an instance of {@link UpdateResponseType } + * Create an instance of {@link ProviderType } * */ - public UpdateResponseType createUpdateResponseType() { - return new UpdateResponseType(); + public ProviderType createProviderType() { + return new ProviderType(); } /** - * Create an instance of {@link AlertCollectionType } + * Create an instance of {@link ZoneCollectionType } * */ - public AlertCollectionType createAlertCollectionType() { - return new AlertCollectionType(); + public ZoneCollectionType createZoneCollectionType() { + return new ZoneCollectionType(); } /** - * Create an instance of {@link CreateResponseType } + * Create an instance of {@link CodeSetCollectionType } * */ - public CreateResponseType createCreateResponseType() { - return new CreateResponseType(); + public CodeSetCollectionType createCodeSetCollectionType() { + return new CodeSetCollectionType(); + } + + /** + * Create an instance of {@link NamespaceCollectionType } + * + */ + public NamespaceCollectionType createNamespaceCollectionType() { + return new NamespaceCollectionType(); + } + + /** + * Create an instance of {@link DeleteResponseType } + * + */ + public DeleteResponseType createDeleteResponseType() { + return new DeleteResponseType(); + } + + /** + * Create an instance of {@link EnvironmentType } + * + */ + public EnvironmentType createEnvironmentType() { + return new EnvironmentType(); } /** @@ -304,6 +350,14 @@ public ProductIdentityType createProductIdentityType() { return new ProductIdentityType(); } + /** + * Create an instance of {@link InitializationType } + * + */ + public InitializationType createInitializationType() { + return new InitializationType(); + } + /** * Create an instance of {@link AliasesType } * @@ -368,6 +422,14 @@ public ApplicationInfoType createApplicationInfoType() { return new ApplicationInfoType(); } + /** + * Create an instance of {@link EnumerationType } + * + */ + public EnumerationType createEnumerationType() { + return new EnumerationType(); + } + /** * Create an instance of {@link DeleteIdCollection } * @@ -384,6 +446,14 @@ public RightsType createRightsType() { return new RightsType(); } + /** + * Create an instance of {@link RangeType } + * + */ + public RangeType createRangeType() { + return new RangeType(); + } + /** * Create an instance of {@link InfrastructureServicesType } * @@ -440,6 +510,14 @@ public InfrastructureServiceType createInfrastructureServiceType() { return new InfrastructureServiceType(); } + /** + * Create an instance of {@link PhaseType } + * + */ + public PhaseType createPhaseType() { + return new PhaseType(); + } + /** * Create an instance of {@link ProvisionedZonesType } * @@ -497,227 +575,323 @@ public NamespaceQualifiersType createNamespaceQualifiersType() { } /** - * Create an instance of {@link ProvisionedZoneType } + * Create an instance of {@link PhaseCollectionType } * */ - public ProvisionedZoneType createProvisionedZoneType() { - return new ProvisionedZoneType(); + public PhaseCollectionType createPhaseCollectionType() { + return new PhaseCollectionType(); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link QueueCollectionType }{@code >}} + * Create an instance of {@link ProvisionedZoneType } * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "queues") - public JAXBElement createQueues(QueueCollectionType value) { - return new JAXBElement(_Queues_QNAME, QueueCollectionType.class, null, value); + public ProvisionedZoneType createProvisionedZoneType() { + return new ProvisionedZoneType(); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link CreateResponseType }{@code >}} + * Create an instance of {@link ParameterType.Enumerations } * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "createResponse") - public JAXBElement createCreateResponse(CreateResponseType value) { - return new JAXBElement(_CreateResponse_QNAME, CreateResponseType.class, null, value); + public ParameterType.Enumerations createParameterTypeEnumerations() { + return new ParameterType.Enumerations(); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ZoneType }{@code >}} + * Create an instance of {@link XqueryType.Parameters } * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "zone") - public JAXBElement createZone(ZoneType value) { - return new JAXBElement(_Zone_QNAME, ZoneType.class, null, value); + public XqueryType.Parameters createXqueryTypeParameters() { + return new XqueryType.Parameters(); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "environment") - public JAXBElement createEnvironment(EnvironmentType value) { - return new JAXBElement(_Environment_QNAME, EnvironmentType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "environments") + public JAXBElement createEnvironments(EnvironmentCollectionType value) { + return new JAXBElement(_Environments_QNAME, EnvironmentCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeleteResponseType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link StateType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "deleteResponse") - public JAXBElement createDeleteResponse(DeleteResponseType value) { - return new JAXBElement(_DeleteResponse_QNAME, DeleteResponseType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "state") + public JAXBElement createState(StateType value) { + return new JAXBElement(_State_QNAME, StateType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link AlertCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link JobType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "alerts") - public JAXBElement createAlerts(AlertCollectionType value) { - return new JAXBElement(_Alerts_QNAME, AlertCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "job") + public JAXBElement createJob(JobType value) { + return new JAXBElement(_Job_QNAME, JobType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link UpdateResponseType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link StateCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "updateResponse") - public JAXBElement createUpdateResponse(UpdateResponseType value) { - return new JAXBElement(_UpdateResponse_QNAME, UpdateResponseType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "states") + public JAXBElement createStates(StateCollectionType value) { + return new JAXBElement(_States_QNAME, StateCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ProviderCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link CodeSetType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "providers") - public JAXBElement createProviders(ProviderCollectionType value) { - return new JAXBElement(_Providers_QNAME, ProviderCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "codeSet") + public JAXBElement createCodeSet(CodeSetType value) { + return new JAXBElement(_CodeSet_QNAME, CodeSetType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link SubscriptionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ProviderType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "subscription") - public JAXBElement createSubscription(SubscriptionType value) { - return new JAXBElement(_Subscription_QNAME, SubscriptionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "provider") + public JAXBElement createProvider(ProviderType value) { + return new JAXBElement(_Provider_QNAME, ProviderType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ProviderType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ZoneCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "provider") - public JAXBElement createProvider(ProviderType value) { - return new JAXBElement(_Provider_QNAME, ProviderType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "zones") + public JAXBElement createZones(ZoneCollectionType value) { + return new JAXBElement(_Zones_QNAME, ZoneCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link NamespaceCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "environments") - public JAXBElement createEnvironments(EnvironmentCollectionType value) { - return new JAXBElement(_Environments_QNAME, EnvironmentCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "namespaces") + public JAXBElement createNamespaces(NamespaceCollectionType value) { + return new JAXBElement(_Namespaces_QNAME, NamespaceCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link CodeSetType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link CodeSetCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "codeSet") - public JAXBElement createCodeSet(CodeSetType value) { - return new JAXBElement(_CodeSet_QNAME, CodeSetType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "codeSets") + public JAXBElement createCodeSets(CodeSetCollectionType value) { + return new JAXBElement(_CodeSets_QNAME, CodeSetCollectionType.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link NamespaceType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "namespace") + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "namespace") public JAXBElement createNamespace(NamespaceType value) { return new JAXBElement(_Namespace_QNAME, NamespaceType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ZoneCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteRequestType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "zones") - public JAXBElement createZones(ZoneCollectionType value) { - return new JAXBElement(_Zones_QNAME, ZoneCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "deleteRequest") + public JAXBElement createDeleteRequest(DeleteRequestType value) { + return new JAXBElement(_DeleteRequest_QNAME, DeleteRequestType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link NamespaceCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link XqueryType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "namespaces") - public JAXBElement createNamespaces(NamespaceCollectionType value) { - return new JAXBElement(_Namespaces_QNAME, NamespaceCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "xquery") + public JAXBElement createXquery(XqueryType value) { + return new JAXBElement(_Xquery_QNAME, XqueryType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link CodeSetCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link QueueType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "codeSets") - public JAXBElement createCodeSets(CodeSetCollectionType value) { - return new JAXBElement(_CodeSets_QNAME, CodeSetCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "queue") + public JAXBElement createQueue(QueueType value) { + return new JAXBElement(_Queue_QNAME, QueueType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link JobCollectionType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "jobs") + public JAXBElement createJobs(JobCollectionType value) { + return new JAXBElement(_Jobs_QNAME, JobCollectionType.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link XqueryCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "xquerys") + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "xquerys") public JAXBElement createXquerys(XqueryCollectionType value) { return new JAXBElement(_Xquerys_QNAME, XqueryCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link DeleteRequestType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ErrorType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "deleteRequest") - public JAXBElement createDeleteRequest(DeleteRequestType value) { - return new JAXBElement(_DeleteRequest_QNAME, DeleteRequestType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "error") + public JAXBElement createError(ErrorType value) { + return new JAXBElement(_Error_QNAME, ErrorType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link QueueType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link SubscriptionCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "queue") - public JAXBElement createQueue(QueueType value) { - return new JAXBElement(_Queue_QNAME, QueueType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "subscriptions") + public JAXBElement createSubscriptions(SubscriptionCollectionType value) { + return new JAXBElement(_Subscriptions_QNAME, SubscriptionCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link XqueryType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ProvisionRequestType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "xquery") - public JAXBElement createXquery(XqueryType value) { - return new JAXBElement(_Xquery_QNAME, XqueryType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "provisionRequest") + public JAXBElement createProvisionRequest(ProvisionRequestType value) { + return new JAXBElement(_ProvisionRequest_QNAME, ProvisionRequestType.class, null, value); } /** * Create an instance of {@link JAXBElement }{@code <}{@link AlertType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "alert") + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "alert") public JAXBElement createAlert(AlertType value) { return new JAXBElement(_Alert_QNAME, AlertType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ErrorType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link CreateResponseType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "error") - public JAXBElement createError(ErrorType value) { - return new JAXBElement(_Error_QNAME, ErrorType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "createResponse") + public JAXBElement createCreateResponse(CreateResponseType value) { + return new JAXBElement(_CreateResponse_QNAME, CreateResponseType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link SubscriptionCollectionType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link QueueCollectionType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "subscriptions") - public JAXBElement createSubscriptions(SubscriptionCollectionType value) { - return new JAXBElement(_Subscriptions_QNAME, SubscriptionCollectionType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "queues") + public JAXBElement createQueues(QueueCollectionType value) { + return new JAXBElement(_Queues_QNAME, QueueCollectionType.class, null, value); } /** - * Create an instance of {@link JAXBElement }{@code <}{@link ProvisionRequestType }{@code >}} + * Create an instance of {@link JAXBElement }{@code <}{@link ZoneType }{@code >}} * */ - @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.1", name = "provisionRequest") - public JAXBElement createProvisionRequest(ProvisionRequestType value) { - return new JAXBElement(_ProvisionRequest_QNAME, ProvisionRequestType.class, null, value); + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "zone") + public JAXBElement createZone(ZoneType value) { + return new JAXBElement(_Zone_QNAME, ZoneType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DeleteResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "deleteResponse") + public JAXBElement createDeleteResponse(DeleteResponseType value) { + return new JAXBElement(_DeleteResponse_QNAME, DeleteResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link EnvironmentType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "environment") + public JAXBElement createEnvironment(EnvironmentType value) { + return new JAXBElement(_Environment_QNAME, EnvironmentType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SubscriptionType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "subscription") + public JAXBElement createSubscription(SubscriptionType value) { + return new JAXBElement(_Subscription_QNAME, SubscriptionType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ProviderCollectionType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "providers") + public JAXBElement createProviders(ProviderCollectionType value) { + return new JAXBElement(_Providers_QNAME, ProviderCollectionType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link UpdateResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "updateResponse") + public JAXBElement createUpdateResponse(UpdateResponseType value) { + return new JAXBElement(_UpdateResponse_QNAME, UpdateResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link AlertCollectionType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", name = "alerts") + public JAXBElement createAlerts(AlertCollectionType value) { + return new JAXBElement(_Alerts_QNAME, AlertCollectionType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "", name = "source", scope = AliasType.class) + public JAXBElement createAliasTypeSource(String value) { + return new JAXBElement(_AliasTypeSource_QNAME, String.class, AliasType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "", name = "namespace", scope = AliasType.class) + public JAXBElement createAliasTypeNamespace(String value) { + return new JAXBElement(_AliasTypeNamespace_QNAME, String.class, AliasType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "", name = "source", scope = CodeItemType.class) + public JAXBElement createCodeItemTypeSource(String value) { + return new JAXBElement(_AliasTypeSource_QNAME, String.class, CodeItemType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "", name = "namespace", scope = CodeItemType.class) + public JAXBElement createCodeItemTypeNamespace(String value) { + return new JAXBElement(_AliasTypeNamespace_QNAME, String.class, CodeItemType.class, value); } } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ParameterType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ParameterType.java new file mode 100644 index 00000000..a2f4fd36 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ParameterType.java @@ -0,0 +1,378 @@ + +package sif3.infra.common.model; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.NormalizedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for parameterType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="parameterType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}token"/>
+ *         <element name="type" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/>
+ *         <element name="default" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/>
+ *         <element name="description" minOccurs="0">
+ *           <simpleType>
+ *             <restriction base="{http://www.w3.org/2001/XMLSchema}normalizedString">
+ *               <maxLength value="1024"/>
+ *               <minLength value="0"/>
+ *             </restriction>
+ *           </simpleType>
+ *         </element>
+ *         <element name="required" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
+ *         <element name="enumerations" minOccurs="0">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <sequence>
+ *                   <element name="enumeration" type="{http://www.sifassociation.org/infrastructure/3.2.1}enumerationType" maxOccurs="unbounded"/>
+ *                 </sequence>
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *         <element name="range" type="{http://www.sifassociation.org/infrastructure/3.2.1}rangeType" minOccurs="0"/>
+ *         <element name="minLength" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" minOccurs="0"/>
+ *         <element name="maxLength" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "parameterType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "name", + "type", + "_default", + "description", + "required", + "enumerations", + "range", + "minLength", + "maxLength" +}) +public class ParameterType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String name; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String type; + @XmlElement(name = "default", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String _default; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlJavaTypeAdapter(NormalizedStringAdapter.class) + protected String description; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Boolean required; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected ParameterType.Enumerations enumerations; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected RangeType range; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlSchemaType(name = "unsignedInt") + protected Long minLength; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + @XmlSchemaType(name = "unsignedInt") + protected Long maxLength; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the default property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDefault() { + return _default; + } + + /** + * Sets the value of the default property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDefault(String value) { + this._default = value; + } + + /** + * Gets the value of the description property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the required property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isRequired() { + return required; + } + + /** + * Sets the value of the required property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setRequired(Boolean value) { + this.required = value; + } + + /** + * Gets the value of the enumerations property. + * + * @return + * possible object is + * {@link ParameterType.Enumerations } + * + */ + public ParameterType.Enumerations getEnumerations() { + return enumerations; + } + + /** + * Sets the value of the enumerations property. + * + * @param value + * allowed object is + * {@link ParameterType.Enumerations } + * + */ + public void setEnumerations(ParameterType.Enumerations value) { + this.enumerations = value; + } + + /** + * Gets the value of the range property. + * + * @return + * possible object is + * {@link RangeType } + * + */ + public RangeType getRange() { + return range; + } + + /** + * Sets the value of the range property. + * + * @param value + * allowed object is + * {@link RangeType } + * + */ + public void setRange(RangeType value) { + this.range = value; + } + + /** + * Gets the value of the minLength property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getMinLength() { + return minLength; + } + + /** + * Sets the value of the minLength property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setMinLength(Long value) { + this.minLength = value; + } + + /** + * Gets the value of the maxLength property. + * + * @return + * possible object is + * {@link Long } + * + */ + public Long getMaxLength() { + return maxLength; + } + + /** + * Sets the value of the maxLength property. + * + * @param value + * allowed object is + * {@link Long } + * + */ + public void setMaxLength(Long value) { + this.maxLength = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="enumeration" type="{http://www.sifassociation.org/infrastructure/3.2.1}enumerationType" maxOccurs="unbounded"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "enumeration" + }) + public static class Enumerations { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected List enumeration; + + /** + * Gets the value of the enumeration property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the enumeration property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getEnumeration().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link EnumerationType } + * + * + */ + public List getEnumeration() { + if (enumeration == null) { + enumeration = new ArrayList(); + } + return this.enumeration; + } + + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseCollectionType.java new file mode 100644 index 00000000..13190b1d --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseCollectionType.java @@ -0,0 +1,69 @@ + +package sif3.infra.common.model; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for phaseCollectionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="phaseCollectionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="phase" type="{http://www.sifassociation.org/infrastructure/3.2.1}phaseType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "phaseCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "phase" +}) +public class PhaseCollectionType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected List phase; + + /** + * Gets the value of the phase property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the phase property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getPhase().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link PhaseType } + * + * + */ + public List getPhase() { + if (phase == null) { + phase = new ArrayList(); + } + return this.phase; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseStateType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseStateType.java new file mode 100644 index 00000000..8d45b30f --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseStateType.java @@ -0,0 +1,48 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for phaseStateType. + * + *

The following schema fragment specifies the expected content contained within this class. + *

+ *

+ * <simpleType name="phaseStateType">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}token">
+ *     <enumeration value="NOTAPPLICABLE"/>
+ *     <enumeration value="NOTSTARTED"/>
+ *     <enumeration value="PENDING"/>
+ *     <enumeration value="SKIPPED"/>
+ *     <enumeration value="INPROGRESS"/>
+ *     <enumeration value="COMPLETED"/>
+ *     <enumeration value="FAILED"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "phaseStateType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1") +@XmlEnum +public enum PhaseStateType { + + NOTAPPLICABLE, + NOTSTARTED, + PENDING, + SKIPPED, + INPROGRESS, + COMPLETED, + FAILED; + + public String value() { + return name(); + } + + public static PhaseStateType fromValue(String v) { + return valueOf(v); + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseType.java new file mode 100644 index 00000000..759cb99f --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PhaseType.java @@ -0,0 +1,171 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + *

Java class for phaseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="phaseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="name" type="{http://www.w3.org/2001/XMLSchema}token"/>
+ *         <element name="states" type="{http://www.sifassociation.org/infrastructure/3.2.1}stateCollectionType"/>
+ *         <element name="required" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
+ *         <element name="rights" type="{http://www.sifassociation.org/infrastructure/3.2.1}rightsType"/>
+ *         <element name="statesRights" type="{http://www.sifassociation.org/infrastructure/3.2.1}rightsType"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "phaseType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "name", + "states", + "required", + "rights", + "statesRights" +}) +public class PhaseType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "token") + protected String name; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected StateCollectionType states; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected boolean required; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected RightsType rights; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected RightsType statesRights; + + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the states property. + * + * @return + * possible object is + * {@link StateCollectionType } + * + */ + public StateCollectionType getStates() { + return states; + } + + /** + * Sets the value of the states property. + * + * @param value + * allowed object is + * {@link StateCollectionType } + * + */ + public void setStates(StateCollectionType value) { + this.states = value; + } + + /** + * Gets the value of the required property. + * + */ + public boolean isRequired() { + return required; + } + + /** + * Sets the value of the required property. + * + */ + public void setRequired(boolean value) { + this.required = value; + } + + /** + * Gets the value of the rights property. + * + * @return + * possible object is + * {@link RightsType } + * + */ + public RightsType getRights() { + return rights; + } + + /** + * Sets the value of the rights property. + * + * @param value + * allowed object is + * {@link RightsType } + * + */ + public void setRights(RightsType value) { + this.rights = value; + } + + /** + * Gets the value of the statesRights property. + * + * @return + * possible object is + * {@link RightsType } + * + */ + public RightsType getStatesRights() { + return statesRights; + } + + /** + * Sets the value of the statesRights property. + * + * @param value + * allowed object is + * {@link RightsType } + * + */ + public void setStatesRights(RightsType value) { + this.statesRights = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProductIdentityType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProductIdentityType.java index 13588062..416e5648 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProductIdentityType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProductIdentityType.java @@ -27,7 +27,7 @@ * </restriction> * </simpleType> * </element> - * <element name="productName" minOccurs="0"> + * <element name="productName"> * <simpleType> * <restriction base="{http://www.w3.org/2001/XMLSchema}token"> * <maxLength value="256"/> @@ -51,7 +51,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "productIdentityType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "productIdentityType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "vendorName", "productName", "productVersion", @@ -59,16 +59,16 @@ }) public class ProductIdentityType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String vendorName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String productName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String productVersion; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "anyURI") protected String iconURI; diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertiesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertiesType.java index aaf35ff7..5b985aee 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertiesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertiesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="property" type="{http://www.sifassociation.org/infrastructure/3.1}propertyType" maxOccurs="unbounded"/> + * <element name="property" type="{http://www.sifassociation.org/infrastructure/3.2.1}propertyType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "propertiesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "propertiesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "property" }) public class PropertiesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List property; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertyType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertyType.java index c49a7999..c5937dee 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertyType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/PropertyType.java @@ -35,7 +35,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "propertyType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "propertyType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "value" }) public class PropertyType { diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProtocolType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProtocolType.java index c63f5546..4b4b86a1 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProtocolType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProtocolType.java @@ -21,7 +21,7 @@ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="location" type="{http://www.w3.org/2001/XMLSchema}anyURI"/> - * <element name="properties" type="{http://www.sifassociation.org/infrastructure/3.1}propertiesType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="properties" type="{http://www.sifassociation.org/infrastructure/3.2.1}propertiesType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -31,16 +31,16 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "protocolType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "protocolType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "location", "properties" }) public class ProtocolType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlSchemaType(name = "anyURI") protected String location; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List properties; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderCollectionType.java index e25ef8ad..7e300cf8 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="provider" type="{http://www.sifassociation.org/infrastructure/3.1}providerType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="provider" type="{http://www.sifassociation.org/infrastructure/3.2.1}providerType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "providerCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "providerCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "provider" }) public class ProviderCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List provider; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderType.java index 72696417..97b3cbf8 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProviderType.java @@ -12,6 +12,8 @@ /** + * All potentially accessible Services have an entry in the Providers Registry (including the Providers Registry Utility Service itself), although full or even partial Consumer access to that Service is determined by the access rights currently granted in the Consumer’s Environment object, and is not guaranteed. + * *

Java class for providerType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -21,16 +23,16 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="serviceType" type="{http://www.sifassociation.org/infrastructure/3.1}serviceTypeType"/> + * <element name="serviceType" type="{http://www.sifassociation.org/infrastructure/3.2.1}serviceTypeType"/> * <element name="serviceName" type="{http://www.w3.org/2001/XMLSchema}token"/> * <element name="contextId" type="{http://www.w3.org/2001/XMLSchema}token"/> * <element name="zoneId" type="{http://www.w3.org/2001/XMLSchema}token"/> * <element name="providerName" type="{http://www.w3.org/2001/XMLSchema}token"/> - * <element name="querySupport" type="{http://www.sifassociation.org/infrastructure/3.1}querySupportType"/> - * <element name="mimeTypes" type="{http://www.sifassociation.org/infrastructure/3.1}mediaTypesType" minOccurs="0"/> - * <element name="endPoint" type="{http://www.sifassociation.org/infrastructure/3.1}protocolType" minOccurs="0"/> + * <element name="querySupport" type="{http://www.sifassociation.org/infrastructure/3.2.1}querySupportType"/> + * <element name="mimeTypes" type="{http://www.sifassociation.org/infrastructure/3.2.1}mediaTypesType" minOccurs="0"/> + * <element name="endPoint" type="{http://www.sifassociation.org/infrastructure/3.2.1}protocolType" minOccurs="0"/> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -39,7 +41,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "providerType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "providerType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "serviceType", "serviceName", "contextId", @@ -51,30 +53,30 @@ }) public class ProviderType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String serviceType; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String serviceName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String contextId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String zoneId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String providerName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected QuerySupportType querySupport; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected MediaTypesType mimeTypes; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProtocolType endPoint; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionRequestType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionRequestType.java index f777d43a..909b5d20 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionRequestType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionRequestType.java @@ -11,6 +11,8 @@ /** + * If an Environment supports self-provisioning Consumers than either this section must initially contain all the rights the Consumer has to all Services in all Zones, or the provisionRequests Infrastructure Service must be present in the Consumer’s Environment to allow additional rights to be obtained. + * *

Java class for provisionRequestType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -20,9 +22,9 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="provisionedZones" type="{http://www.sifassociation.org/infrastructure/3.1}provisionedZonesType"/> + * <element name="provisionedZones" type="{http://www.sifassociation.org/infrastructure/3.2.1}provisionedZonesType"/> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * <attribute name="completionStatus"> * <simpleType> * <restriction base="{http://www.w3.org/2001/XMLSchema}token"> @@ -40,12 +42,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "provisionRequestType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "provisionRequestType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "provisionedZones" }) public class ProvisionRequestType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected ProvisionedZonesType provisionedZones; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZoneType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZoneType.java index cdcf2a0e..8f3494a4 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZoneType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZoneType.java @@ -18,7 +18,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="services" type="{http://www.sifassociation.org/infrastructure/3.1}servicesType" minOccurs="0"/> + * <element name="services" type="{http://www.sifassociation.org/infrastructure/3.2.1}servicesType" minOccurs="0"/> * </sequence> * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "provisionedZoneType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "provisionedZoneType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "services" }) public class ProvisionedZoneType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ServicesType services; @XmlAttribute(name = "id", required = true) protected String id; diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZonesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZonesType.java index 890f7455..c861cdd9 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZonesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ProvisionedZonesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="provisionedZone" type="{http://www.sifassociation.org/infrastructure/3.1}provisionedZoneType" maxOccurs="unbounded"/> + * <element name="provisionedZone" type="{http://www.sifassociation.org/infrastructure/3.2.1}provisionedZoneType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "provisionedZonesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "provisionedZonesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "provisionedZone" }) public class ProvisionedZonesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List provisionedZone; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QuerySupportType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QuerySupportType.java index 39c587ef..74d1a8c8 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QuerySupportType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QuerySupportType.java @@ -18,12 +18,14 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="dynamicQuery" type="{http://www.w3.org/2001/XMLSchema}boolean"/> - * <element name="paged" type="{http://www.w3.org/2001/XMLSchema}boolean"/> + * <element name="dynamicQuery" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> + * <element name="queryByExample" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> + * <element name="changesSinceMarker" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> + * <element name="paged" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> * <element name="maxPageSize" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" minOccurs="0"/> * <element name="totalCount" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/> - * <element name="applicationProduct" type="{http://www.sifassociation.org/infrastructure/3.1}productIdentityType" minOccurs="0"/> - * <element name="adapterProduct" type="{http://www.sifassociation.org/infrastructure/3.1}productIdentityType" minOccurs="0"/> + * <element name="applicationProduct" type="{http://www.sifassociation.org/infrastructure/3.2.1}productIdentityType" minOccurs="0"/> + * <element name="adapterProduct" type="{http://www.sifassociation.org/infrastructure/3.2.1}productIdentityType" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -33,8 +35,10 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "querySupportType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "querySupportType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "dynamicQuery", + "queryByExample", + "changesSinceMarker", "paged", "maxPageSize", "totalCount", @@ -43,49 +47,117 @@ }) public class QuerySupportType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") - protected boolean dynamicQuery; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") - protected boolean paged; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Boolean dynamicQuery; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Boolean queryByExample; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Boolean changesSinceMarker; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected Boolean paged; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long maxPageSize; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected Boolean totalCount; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProductIdentityType applicationProduct; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ProductIdentityType adapterProduct; /** * Gets the value of the dynamicQuery property. * + * @return + * possible object is + * {@link Boolean } + * */ - public boolean isDynamicQuery() { + public Boolean isDynamicQuery() { return dynamicQuery; } /** * Sets the value of the dynamicQuery property. * + * @param value + * allowed object is + * {@link Boolean } + * */ - public void setDynamicQuery(boolean value) { + public void setDynamicQuery(Boolean value) { this.dynamicQuery = value; } + /** + * Gets the value of the queryByExample property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isQueryByExample() { + return queryByExample; + } + + /** + * Sets the value of the queryByExample property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setQueryByExample(Boolean value) { + this.queryByExample = value; + } + + /** + * Gets the value of the changesSinceMarker property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isChangesSinceMarker() { + return changesSinceMarker; + } + + /** + * Sets the value of the changesSinceMarker property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setChangesSinceMarker(Boolean value) { + this.changesSinceMarker = value; + } + /** * Gets the value of the paged property. * + * @return + * possible object is + * {@link Boolean } + * */ - public boolean isPaged() { + public Boolean isPaged() { return paged; } /** * Sets the value of the paged property. * + * @param value + * allowed object is + * {@link Boolean } + * */ - public void setPaged(boolean value) { + public void setPaged(Boolean value) { this.paged = value; } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueCollectionType.java index d9258b3b..cdb54487 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="queue" type="{http://www.sifassociation.org/infrastructure/3.1}queueType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="queue" type="{http://www.sifassociation.org/infrastructure/3.2.1}queueType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "queueCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "queueCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "queue" }) public class QueueCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List queue; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueType.java index 940643c9..e1afca5b 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/QueueType.java @@ -13,6 +13,8 @@ /** + * The Queues Service supports creation, deletion and querying of Queue (Instance) / Queue Messages Service pairs. + * *

Java class for queueType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -30,7 +32,7 @@ * </restriction> * </simpleType> * </element> - * <element name="ownerId" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" minOccurs="0"/> + * <element name="ownerId" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" minOccurs="0"/> * <element name="name" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> * <element name="queueUri" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> * <element name="ownerUri" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/> @@ -48,7 +50,7 @@ * <element name="lastModified" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/> * <element name="messageCount" type="{http://www.w3.org/2001/XMLSchema}unsignedInt" minOccurs="0"/> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -57,7 +59,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "queueType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "queueType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "polling", "ownerId", "name", @@ -73,42 +75,42 @@ }) public class QueueType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected String polling; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String ownerId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String name; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "anyURI") protected String queueUri; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "anyURI") protected String ownerUri; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long idleTimeout; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long minWaitTime; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected Long maxConcurrentConnections; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", type = String.class) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "dateTime") protected Calendar created; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", type = String.class) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "dateTime") protected Calendar lastAccessed; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", type = String.class) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) @XmlJavaTypeAdapter(Adapter1 .class) @XmlSchemaType(name = "dateTime") protected Calendar lastModified; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlSchemaType(name = "unsignedInt") protected Long messageCount; @XmlAttribute(name = "id") diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RangeType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RangeType.java new file mode 100644 index 00000000..43a906b5 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RangeType.java @@ -0,0 +1,74 @@ + +package sif3.infra.common.model; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for rangeType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="rangeType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="start" type="{http://www.w3.org/2001/XMLSchema}long"/>
+ *         <element name="end" type="{http://www.w3.org/2001/XMLSchema}long"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "rangeType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "start", + "end" +}) +public class RangeType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected long start; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected long end; + + /** + * Gets the value of the start property. + * + */ + public long getStart() { + return start; + } + + /** + * Sets the value of the start property. + * + */ + public void setStart(long value) { + this.start = value; + } + + /** + * Gets the value of the end property. + * + */ + public long getEnd() { + return end; + } + + /** + * Sets the value of the end property. + * + */ + public void setEnd(long value) { + this.end = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightType.java index c449262a..cf8ce4c0 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightType.java @@ -18,7 +18,7 @@ *
  * <complexType name="rightType">
  *   <simpleContent>
- *     <extension base="<http://www.sifassociation.org/infrastructure/3.1>rightValueType">
+ *     <extension base="<http://www.sifassociation.org/infrastructure/3.2.1>rightValueType">
  *       <attribute name="type" use="required">
  *         <simpleType>
  *           <restriction base="{http://www.w3.org/2001/XMLSchema}token">
@@ -40,7 +40,7 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "rightType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = {
+@XmlType(name = "rightType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = {
     "value"
 })
 public class RightType {
diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightsType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightsType.java
index 83414913..ffcae170 100644
--- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightsType.java
+++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/RightsType.java
@@ -19,7 +19,7 @@
  *   <complexContent>
  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       <sequence>
- *         <element name="right" type="{http://www.sifassociation.org/infrastructure/3.1}rightType" maxOccurs="unbounded"/>
+ *         <element name="right" type="{http://www.sifassociation.org/infrastructure/3.2.1}rightType" maxOccurs="unbounded"/>
  *       </sequence>
  *     </restriction>
  *   </complexContent>
@@ -29,12 +29,12 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "rightsType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = {
+@XmlType(name = "rightsType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = {
     "right"
 })
 public class RightsType {
 
-    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true)
+    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true)
     protected List right;
 
     /**
diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServiceType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServiceType.java
index 3d47acbd..c9155e55 100644
--- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServiceType.java
+++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServiceType.java
@@ -21,11 +21,11 @@
  *   <complexContent>
  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       <sequence>
- *         <element name="rights" type="{http://www.sifassociation.org/infrastructure/3.1}rightsType"/>
+ *         <element name="rights" type="{http://www.sifassociation.org/infrastructure/3.2.1}rightsType"/>
  *       </sequence>
  *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
  *       <attribute name="contextId" use="required" type="{http://www.w3.org/2001/XMLSchema}anySimpleType" />
- *       <attribute name="type" use="required" type="{http://www.sifassociation.org/infrastructure/3.1}serviceTypeType" />
+ *       <attribute name="type" use="required" type="{http://www.sifassociation.org/infrastructure/3.2.1}serviceTypeType" />
  *     </restriction>
  *   </complexContent>
  * </complexType>
@@ -34,12 +34,12 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "serviceType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = {
+@XmlType(name = "serviceType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = {
     "rights"
 })
 public class ServiceType {
 
-    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true)
+    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true)
     protected RightsType rights;
     @XmlAttribute(name = "name", required = true)
     @XmlSchemaType(name = "anySimpleType")
diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServicesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServicesType.java
index af3f772e..a59dc775 100644
--- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServicesType.java
+++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ServicesType.java
@@ -19,7 +19,7 @@
  *   <complexContent>
  *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
  *       <sequence>
- *         <element name="service" type="{http://www.sifassociation.org/infrastructure/3.1}serviceType" maxOccurs="unbounded"/>
+ *         <element name="service" type="{http://www.sifassociation.org/infrastructure/3.2.1}serviceType" maxOccurs="unbounded"/>
  *       </sequence>
  *     </restriction>
  *   </complexContent>
@@ -29,12 +29,12 @@
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "servicesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = {
+@XmlType(name = "servicesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = {
     "service"
 })
 public class ServicesType {
 
-    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true)
+    @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true)
     protected List service;
 
     /**
diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateCollectionType.java
new file mode 100644
index 00000000..3f668ded
--- /dev/null
+++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateCollectionType.java
@@ -0,0 +1,69 @@
+
+package sif3.infra.common.model;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * 

Java class for stateCollectionType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="stateCollectionType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="state" type="{http://www.sifassociation.org/infrastructure/3.2.1}stateType" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "stateCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "state" +}) +public class StateCollectionType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected List state; + + /** + * Gets the value of the state property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the state property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getState().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link StateType } + * + * + */ + public List getState() { + if (state == null) { + state = new ArrayList(); + } + return this.state; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateType.java new file mode 100644 index 00000000..eb703df8 --- /dev/null +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/StateType.java @@ -0,0 +1,185 @@ + +package sif3.infra.common.model; + +import java.util.Calendar; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + + +/** + * For states updatable by the Consumer, it creates a new state much like it would a single object. The actual result (state or error) is included in the response. Each functional service should define the expectations for which Adaptor is responsible for updating the phase status. NOTE: The "states" collection represented here is reserved for future capabilities. + * + *

Java class for stateType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="stateType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="type" type="{http://www.sifassociation.org/infrastructure/3.2.1}phaseStateType"/>
+ *         <element name="created" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="lastModified" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
+ *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "stateType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { + "type", + "created", + "lastModified", + "description" +}) +public class StateType { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected PhaseStateType type; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) + @XmlJavaTypeAdapter(Adapter1 .class) + @XmlSchemaType(name = "dateTime") + protected Calendar created; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", type = String.class) + @XmlJavaTypeAdapter(Adapter1 .class) + @XmlSchemaType(name = "dateTime") + protected Calendar lastModified; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected String description; + @XmlAttribute(name = "id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + protected String id; + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link PhaseStateType } + * + */ + public PhaseStateType getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link PhaseStateType } + * + */ + public void setType(PhaseStateType value) { + this.type = value; + } + + /** + * Gets the value of the created property. + * + * @return + * possible object is + * {@link String } + * + */ + public Calendar getCreated() { + return created; + } + + /** + * Sets the value of the created property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setCreated(Calendar value) { + this.created = value; + } + + /** + * Gets the value of the lastModified property. + * + * @return + * possible object is + * {@link String } + * + */ + public Calendar getLastModified() { + return lastModified; + } + + /** + * Sets the value of the lastModified property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setLastModified(Calendar value) { + this.lastModified = value; + } + + /** + * Gets the value of the description property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionCollectionType.java index 6ae093b5..4f873419 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="subscription" type="{http://www.sifassociation.org/infrastructure/3.1}subscriptionType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="subscription" type="{http://www.sifassociation.org/infrastructure/3.2.1}subscriptionType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "subscriptionCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "subscriptionCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "subscription" }) public class SubscriptionCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List subscription; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionType.java index 8582ad03..95772a99 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/SubscriptionType.java @@ -12,6 +12,8 @@ /** + * A Consumer uses the Subscriptions Infrastructure Service to subscribe to Events published by one or more Service Providers. + * *

Java class for subscriptionType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -23,11 +25,11 @@ * <sequence> * <element name="zoneId" type="{http://www.w3.org/2001/XMLSchema}token"/> * <element name="contextId" type="{http://www.w3.org/2001/XMLSchema}token" minOccurs="0"/> - * <element name="serviceType" type="{http://www.sifassociation.org/infrastructure/3.1}serviceTypeType"/> + * <element name="serviceType" type="{http://www.sifassociation.org/infrastructure/3.2.1}serviceTypeType"/> * <element name="serviceName" type="{http://www.w3.org/2001/XMLSchema}token"/> * <element name="queueId" type="{http://www.w3.org/2001/XMLSchema}token"/> * </sequence> - * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.1}uuidType" /> + * <attribute name="id" type="{http://www.sifassociation.org/infrastructure/3.2.1}uuidType" /> * </restriction> * </complexContent> * </complexType> @@ -36,7 +38,7 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "subscriptionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "subscriptionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "zoneId", "contextId", "serviceType", @@ -45,22 +47,22 @@ }) public class SubscriptionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String zoneId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String contextId; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String serviceType; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String serviceName; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String queueId; diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateResponseType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateResponseType.java index 361058b3..a328396d 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateResponseType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateResponseType.java @@ -8,6 +8,8 @@ /** + * An HTTP Response with a status of 200 (success) and a location corresponding to the URL of the first successfully modified object. It contains a payload consisting of a single “updateResponse” element. + * *

Java class for updateResponseType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -17,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="updates" type="{http://www.sifassociation.org/infrastructure/3.1}updatesType"/> + * <element name="updates" type="{http://www.sifassociation.org/infrastructure/3.2.1}updatesType"/> * </sequence> * </restriction> * </complexContent> @@ -27,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updateResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "updateResponseType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "updates" }) public class UpdateResponseType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected UpdatesType updates; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateType.java index d3647287..05f8af6a 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdateType.java @@ -21,7 +21,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.1}errorType" minOccurs="0"/> + * <element name="error" type="{http://www.sifassociation.org/infrastructure/3.2.1}errorType" minOccurs="0"/> * </sequence> * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}token" /> * <attribute name="statusCode"> @@ -39,12 +39,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updateType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "updateType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "error" }) public class UpdateType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected ErrorType error; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdatesType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdatesType.java index 3d89df48..83d3a131 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdatesType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/UpdatesType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="update" type="{http://www.sifassociation.org/infrastructure/3.1}updateType" maxOccurs="unbounded"/> + * <element name="update" type="{http://www.sifassociation.org/infrastructure/3.2.1}updateType" maxOccurs="unbounded"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "updatesType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "updatesType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "update" }) public class UpdatesType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected List update; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XpathType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XpathType.java index 01b04b32..1beb1657 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XpathType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XpathType.java @@ -21,7 +21,7 @@ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="path" type="{http://www.w3.org/2001/XMLSchema}token"/> - * <element name="namespaces" type="{http://www.sifassociation.org/infrastructure/3.1}namespaceQualifiersType"/> + * <element name="namespaces" type="{http://www.sifassociation.org/infrastructure/3.2.1}namespaceQualifiersType"/> * </sequence> * </restriction> * </complexContent> @@ -31,17 +31,17 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "xpathType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "xpathType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "path", "namespaces" }) public class XpathType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlSchemaType(name = "token") protected String path; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected NamespaceQualifiersType namespaces; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryCollectionType.java index d704e5d0..fb91cd8a 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="xquery" type="{http://www.sifassociation.org/infrastructure/3.1}xqueryType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="xquery" type="{http://www.sifassociation.org/infrastructure/3.2.1}xqueryType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "xqueryCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "xqueryCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "xquery" }) public class XqueryCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List xquery; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryType.java index e398e9f6..ad1171cc 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/XqueryType.java @@ -1,6 +1,8 @@ package sif3.infra.common.model; +import java.util.ArrayList; +import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; @@ -13,6 +15,8 @@ /** + * This collection defines the entire set of named queries that Consumers may legally issue for execution by Service Providers. A Consumer specifies the ID of a Named XQuery in a Query Request to a specific Service Provider, along with a set of values for any associated script parameters. + * *

Java class for xqueryType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -63,6 +67,17 @@ * </restriction> * </simpleType> * </element> + * <element name="parameters"> + * <complexType> + * <complexContent> + * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> + * <sequence> + * <element name="parameter" type="{http://www.sifassociation.org/infrastructure/3.2.1}parameterType" maxOccurs="unbounded" minOccurs="0"/> + * </sequence> + * </restriction> + * </complexContent> + * </complexType> + * </element> * <element name="returnType" type="{http://www.w3.org/2001/XMLSchema}anyURI"/> * </sequence> * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}token" /> @@ -74,30 +89,33 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "xqueryType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "xqueryType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "type", "status", "qualifier", "description", "script", + "parameters", "returnType" }) public class XqueryType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String type; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String status; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String qualifier; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) protected String description; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) protected String script; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1", required = true, nillable = true) + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true) + protected XqueryType.Parameters parameters; + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1", required = true, nillable = true) @XmlSchemaType(name = "anyURI") protected String returnType; @XmlAttribute(name = "id") @@ -225,6 +243,30 @@ public void setScript(String value) { this.script = value; } + /** + * Gets the value of the parameters property. + * + * @return + * possible object is + * {@link XqueryType.Parameters } + * + */ + public XqueryType.Parameters getParameters() { + return parameters; + } + + /** + * Sets the value of the parameters property. + * + * @param value + * allowed object is + * {@link XqueryType.Parameters } + * + */ + public void setParameters(XqueryType.Parameters value) { + this.parameters = value; + } + /** * Gets the value of the returnType property. * @@ -273,4 +315,64 @@ public void setId(String value) { this.id = value; } + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <sequence>
+     *         <element name="parameter" type="{http://www.sifassociation.org/infrastructure/3.2.1}parameterType" maxOccurs="unbounded" minOccurs="0"/>
+     *       </sequence>
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "parameter" + }) + public static class Parameters { + + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") + protected List parameter; + + /** + * Gets the value of the parameter property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the parameter property. + * + *

+ * For example, to add a new item, do as follows: + *

+         *    getParameter().add(newItem);
+         * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ParameterType } + * + * + */ + public List getParameter() { + if (parameter == null) { + parameter = new ArrayList(); + } + return this.parameter; + } + + } + } diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneCollectionType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneCollectionType.java index 221674d7..33eee6a8 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneCollectionType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneCollectionType.java @@ -19,7 +19,7 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="zone" type="{http://www.sifassociation.org/infrastructure/3.1}zoneType" maxOccurs="unbounded" minOccurs="0"/> + * <element name="zone" type="{http://www.sifassociation.org/infrastructure/3.2.1}zoneType" maxOccurs="unbounded" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> @@ -29,12 +29,12 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "zoneCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "zoneCollectionType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "zone" }) public class ZoneCollectionType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected List zone; /** diff --git a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneType.java b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneType.java index c44ca30a..e12e83d4 100644 --- a/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneType.java +++ b/SIF3InfraREST/sif3InfraModel/src/main/java/sif3/infra/common/model/ZoneType.java @@ -13,6 +13,8 @@ /** + * Zone identifiers are chosen by the administrator and can follow any convention that best meets the needs of the deploying organization. The Zone in which the Service is to be found always qualifies every Consumer request for any Provider Service. Each Service Consumer is assigned a “default” Zone at Registration time, which is used whenever a specific Zone is not explicitly included in one of its Provider Service Requests. + * *

Java class for zoneType complex type. * *

The following schema fragment specifies the expected content contained within this class. @@ -23,7 +25,7 @@ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="description" type="{http://www.w3.org/2001/XMLSchema}normalizedString" minOccurs="0"/> - * <element name="properties" type="{http://www.sifassociation.org/infrastructure/3.1}propertiesType" minOccurs="0"/> + * <element name="properties" type="{http://www.sifassociation.org/infrastructure/3.2.1}propertiesType" minOccurs="0"/> * </sequence> * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}token" /> * </restriction> @@ -34,17 +36,17 @@ * */ @XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "zoneType", namespace = "http://www.sifassociation.org/infrastructure/3.1", propOrder = { +@XmlType(name = "zoneType", namespace = "http://www.sifassociation.org/infrastructure/3.2.1", propOrder = { "description", "properties" }) public class ZoneType { - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") @XmlJavaTypeAdapter(NormalizedStringAdapter.class) @XmlSchemaType(name = "normalizedString") protected String description; - @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.1") + @XmlElement(namespace = "http://www.sifassociation.org/infrastructure/3.2.1") protected PropertiesType properties; @XmlAttribute(name = "id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) diff --git a/SIF3InfraREST/src/test/resources/config/consumers/.gitignore b/SIF3InfraREST/src/test/resources/config/consumers/.gitignore index e11a6f53..7db56a3f 100644 --- a/SIF3InfraREST/src/test/resources/config/consumers/.gitignore +++ b/SIF3InfraREST/src/test/resources/config/consumers/.gitignore @@ -3,3 +3,4 @@ /NSWTestConsumer.properties /QueueTestConsumer.properties /SecureStudentConsumer.properties +/RicOneConsumer.properties diff --git a/SIF3InfraREST/src/test/resources/config/consumers/HITSStudentConsumer.properties b/SIF3InfraREST/src/test/resources/config/consumers/HITSStudentConsumer.properties index ae6c03c4..0805309a 100644 --- a/SIF3InfraREST/src/test/resources/config/consumers/HITSStudentConsumer.properties +++ b/SIF3InfraREST/src/test/resources/config/consumers/HITSStudentConsumer.properties @@ -66,17 +66,17 @@ adapter.noCertificateCheck=false env.events.supported=false env.xml.file.name=HITS.xml -env.application.key=1c194015-9dda-4fa6-ad30-faf82f358b2b +env.application.key=9b19d71b03f84f16aa71f04034c1f714 #env.application.key=BearerTest # This allows to set/override the userToken and/or instanceId element in the environment XML. This can be used if # multiple instances of this adapter shall be run in the same environment configuration. In such case each instance # can have a different userToken to distinguish the instances. If it is empty then this property won't be used and # the value in the environment XML template is used. -env.userToken=a6031d63-b4b1-4ee3-958e-a8456d7a36c1 +env.userToken=9b19d71b03f84f16aa71f04034c1f714 env.instanceID= -env.pwd=d1bbfdb5-3d6e-4bc3-a585-8c9080c0d1de +env.pwd=9b19d71b03f84f16aa71f04034c1f714 # mediaType can be XML or JSON (case in-sensitive). Currently only XML is supported by Framework env.mediaType=XML @@ -91,7 +91,7 @@ env.authentication.method=Basic #env.authentication.method=Bearer # Eclipse built in Tomcat URIs -env.baseURI=http://hits.dev.nsip.edu.au/SIF3InfraREST/hits/environments/environment +env.baseURI=http://hits.nsip.edu.au/SIF3InfraREST/hits/environments/environment #env.baseURI=https://localhost:9443/SIF3InfraREST/sif3/environments/environment # External Tomcat URIs @@ -108,10 +108,10 @@ env.baseURI=http://hits.dev.nsip.edu.au/SIF3InfraREST/hits/environments/environm env.use.existing=false # The session token to use with a pre-existing environment -env.existing.sessionToken=32795355-4eda-4b2e-b0a7-b31ad1663b6f +env.existing.sessionToken=107c2bac-172f-4699-956c-ebfcaff901c2 # The full URI of the pre-existing environment. -env.existing.environmentURI=http://hits.dev.nsip.edu.au/SIF3InfraREST/hits/environments/2a1e87a5-91dd-41cd-b500-62624104ae4d +env.existing.environmentURI=http://hits.nsip.edu.au/SIF3InfraREST/hits/environments/d9b37329-54df-4e2a-8964-b8b282fb08c4 # # This property indicates if a 'conflict' or HTTP Status of 409 for a create environment shall be a treated as an error (true) or if it shall diff --git a/SIF3InfraREST/src/test/resources/config/consumers/SchoolConsumer.properties b/SIF3InfraREST/src/test/resources/config/consumers/SchoolConsumer.properties index 136240fa..2177e4c4 100644 --- a/SIF3InfraREST/src/test/resources/config/consumers/SchoolConsumer.properties +++ b/SIF3InfraREST/src/test/resources/config/consumers/SchoolConsumer.properties @@ -12,9 +12,6 @@ adapter.use.https=false # Turn on (true) or off (false) ACL checks on client. Default = true adapter.checkACL=true -# External security service shall be used if Bearer Token is used. -#adapter.security.service=sif3.infra.test.common.security.DummySecurityService - # Demo of Hibernate Properties through 'injection'. #adapter.hbr.propertyClass=systemic.sif3.demo.hibernate.DemoProperties diff --git a/SIF3InfraREST/src/test/resources/config/consumers/StudentConsumer.properties b/SIF3InfraREST/src/test/resources/config/consumers/StudentConsumer.properties index c2a2f646..a4be22f1 100644 --- a/SIF3InfraREST/src/test/resources/config/consumers/StudentConsumer.properties +++ b/SIF3InfraREST/src/test/resources/config/consumers/StudentConsumer.properties @@ -16,9 +16,6 @@ adapter.use.https=false # Turn on (true) or off (false) ACL checks on client. Default = true adapter.checkACL=true -# External security service shall be used if Bearer Token is used. -#adapter.security.service=sif3.infra.test.common.security.DummySecurityService - # Demo of Hibernate Properties through 'injection'. #adapter.hbr.propertyClass=systemic.sif3.demo.hibernate.DemoProperties @@ -108,10 +105,10 @@ env.baseURI=http://localhost:9080/SIF3InfraREST/sif3/environments/environment env.use.existing=false # The session token to use with a pre-existing environment -env.existing.sessionToken=0426182f-8e15-40ce-946c-85a05622a66e +env.existing.sessionToken=cfd93eb7-f76f-4664-85d2-df172bed5644 # The full URI of the pre-existing environment. -env.existing.environmentURI=http://localhost:9080/SIF3InfraREST/sif3/environments/2bf7069d-d307-444d-b705-2d113943fe1e +env.existing.environmentURI=http://localhost:9080/SIF3InfraREST/sif3/environments/aaacc8d9-c743-49d3-8fbf-d3acfc4eefd7 # # This property indicates if a 'conflict' or HTTP Status of 409 for a create environment shall be a treated as an error (true) or if it shall diff --git a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/.gitignore b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/.gitignore index afa43844..6d6fb174 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/.gitignore +++ b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/.gitignore @@ -2,3 +2,4 @@ /NSWTest.xml /QueueTestEnv.xml /systemicDemo.xml +/RICOne.xml diff --git a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/HITS.xml b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/HITS.xml index 48b66619..568f21ea 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/HITS.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/HITS.xml @@ -1,4 +1,4 @@ - + HITS Basic @@ -6,8 +6,8 @@ - 3.1 - http://www.sifassociation.org/au/datamodel/3.4 + 3.2.1 + http://www.sifassociation.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/auTestSolution.xml b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/auTestSolution.xml index 00c0c0dd..4959732a 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/auTestSolution.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/auTestSolution.xml @@ -1,11 +1,11 @@ - + auTestSolution Basic - 3.1 - http://www.SIFinfo.org/au/datamodel/3.4 + 3.2.1 + http://www.SIFinfo.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/devLocal.xml b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/devLocal.xml index 6a5f68af..1ffb6469 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/devLocal.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/devLocal.xml @@ -1,4 +1,4 @@ - + test Basic @@ -6,8 +6,8 @@ - 3.1 - http://www.sifassociation.org/au/datamodel/3.4 + 3.2.1 + http://www.sifassociation.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/testSolution.xml b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/testSolution.xml index 2621e5aa..59c8a06a 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/consumer/template/testSolution.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/consumer/template/testSolution.xml @@ -1,10 +1,10 @@ - + testSolution Basic - 3.1 + 3.2.1 http://www.SIFinfo.org/au/datamodel/3.4 REST diff --git a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/auBrokeredDemoSIS.xml b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/auBrokeredDemoSIS.xml index a7d0de70..90d92347 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/auBrokeredDemoSIS.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/auBrokeredDemoSIS.xml @@ -1,4 +1,4 @@ - + systemicDemo Basic @@ -6,8 +6,8 @@ - 3.1 - http://www.sifassociation.org/au/datamodel/3.4 + 3.2.1 + http://www.sifassociation.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/brokeredDemoSIS.xml b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/brokeredDemoSIS.xml index a7d0de70..90d92347 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/brokeredDemoSIS.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/brokeredDemoSIS.xml @@ -1,4 +1,4 @@ - + systemicDemo Basic @@ -6,8 +6,8 @@ - 3.1 - http://www.sifassociation.org/au/datamodel/3.4 + 3.2.1 + http://www.sifassociation.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/systemicDemo.xml b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/systemicDemo.xml index 093c8e0a..18f660b8 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/systemicDemo.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/provider/template/brokered/systemicDemo.xml @@ -1,4 +1,4 @@ - + systemicDemo Basic @@ -6,8 +6,8 @@ - 3.1 - http://www.sifassociation.org/au/datamodel/3.4 + 3.2.1 + http://www.sifassociation.org/datamodel/au/3.4.1 REST Systemic Pty Ltd diff --git a/SIF3InfraREST/src/test/resources/config/environments/provider/template/direct/devLocal.xml b/SIF3InfraREST/src/test/resources/config/environments/provider/template/direct/devLocal.xml index 46f0af47..4f1efae6 100644 --- a/SIF3InfraREST/src/test/resources/config/environments/provider/template/direct/devLocal.xml +++ b/SIF3InfraREST/src/test/resources/config/environments/provider/template/direct/devLocal.xml @@ -1,4 +1,4 @@ - + test @@ -13,6 +13,7 @@ eventsConnector /queues /subscriptions/ + services diff --git a/SIF3InfraREST/src/test/resources/config/log4j.properties b/SIF3InfraREST/src/test/resources/config/log4j.properties index e7b7d974..610d6992 100644 --- a/SIF3InfraREST/src/test/resources/config/log4j.properties +++ b/SIF3InfraREST/src/test/resources/config/log4j.properties @@ -27,7 +27,7 @@ log4j.logger.sif3.infra=DEBUG log4j.logger.sif3.infra.rest.client.ClientConfigMgr=DEBUG log4j.logger.sif3.infra.rest.client.MessageClient=DEBUG log4j.logger.sif3.infra.rest.client.EventClient=DEBUG -log4j.logger.sif3.infra.rest.queue.RemoteMessageQueueReader=DEBUG +log4j.logger.sif3.infra.rest.queue.RemoteMessageQueueReader=INFO #log4j.logger.sif3.infra.rest.resource.BaseResource=DEBUG log4j.logger.sif3.infra.rest.resource.DataModelResource=DEBUG diff --git a/SIF3InfraREST/src/test/resources/config/providers/StudentProvider.properties b/SIF3InfraREST/src/test/resources/config/providers/StudentProvider.properties index 2ec55c56..587932d0 100644 --- a/SIF3InfraREST/src/test/resources/config/providers/StudentProvider.properties +++ b/SIF3InfraREST/src/test/resources/config/providers/StudentProvider.properties @@ -13,9 +13,6 @@ adapter.id=StudentProvider # Turn on (true) or off (false) ACL checks on provider. Default = true adapter.checkACL=true -# External security service shall be used if Bearer Token is used. -adapter.security.service=sif3.infra.test.common.security.DummySecurityService - # Fully qualified name of the audit service implementation class to be used by this adapter. The class listed here must implement Auditor interface. If no # class is listed then it is assumed that audit logging is not enabled. #adapter.audit.service=systemic.sif3.demo.audit.LogAuditor @@ -26,10 +23,9 @@ adapter.security.service=sif3.infra.test.common.security.DummySecurityService # # The default authentication method to be used if no 'Authorization' HTTP Header is set but an accessToken is -# provided as an URL Query parameter. Default is 'Bearer' but can be overwritten with this property. If not provided -# 'Bearer' is assumed. +# provided as an URL Query parameter. # -adapter.default.accessToken.authentication.method=Basic +adapter.default.accessToken.authentication.method=SIF_HMACSHA256 # SIF xPress allows the authentication token to be provides on the URL with the access_token URL query parameter. This is not # considered very secure and some implementations want to turn that option off. Setting this property to 'false' will disable