diff options
Diffstat (limited to 'ecomp-sdk/epsdk-workflow')
32 files changed, 978 insertions, 558 deletions
diff --git a/ecomp-sdk/epsdk-workflow/README.md b/ecomp-sdk/epsdk-workflow/README.md index 983d9ba1..262610ba 100644 --- a/ecomp-sdk/epsdk-workflow/README.md +++ b/ecomp-sdk/epsdk-workflow/README.md @@ -1,8 +1,8 @@ -# ECOMP Portal SDK Workflow +# ONAP Portal SDK Workflow ## Overview -This is the Maven project for the ECOMP Portal SDK Workflow library, +This is the Maven project for the ONAP Portal SDK Workflow library, which is distributed as epsdk-workflow-N.N.N.jar. This library requires Hibernate and Spring, and provides features including schedulers, workflows and R Cloud integration. @@ -11,11 +11,17 @@ schedulers, workflows and R Cloud integration. ### ONAP Distributions -Version 1.3.0 -- [Portal-19] Renaming the Group Id in the POM file to org.onap.portal.sdk +Version 1.4.0 +- PORTAL-19 Rename Java package base to org.onap +- PORTAL-42 Use OParent as parent POM +- PORTAL-72 Address Sonar Scan code issues +- PORTAL-90 Use approved ONAP license text + +Version 1.3.0, 28 August 2017 +- Portal-19 Renaming the Group Id in the POM file to org.onap.portal.sdk Version 1.1.0 -- [Portal-7] Improvements added as part of the rebasing process +- Portal-7 Improvements added as part of the rebasing process Version 1.0.0 - Initial release diff --git a/ecomp-sdk/epsdk-workflow/pom.xml b/ecomp-sdk/epsdk-workflow/pom.xml index b43b387b..09b1eb36 100644 --- a/ecomp-sdk/epsdk-workflow/pom.xml +++ b/ecomp-sdk/epsdk-workflow/pom.xml @@ -5,16 +5,18 @@ <parent> <groupId>org.onap.portal.sdk</groupId> <artifactId>epsdk-project</artifactId> - <version>1.3.0-SNAPSHOT</version> + <version>1.4.0-SNAPSHOT</version> </parent> <!-- GroupId is inherited from parent --> <artifactId>epsdk-workflow</artifactId> <!-- Version is inherited from parent --> <packaging>jar</packaging> - <name>ECOMP Portal SDK Workflow</name> + <name>ONAP Portal SDK Workflow</name> <description>Provides workflow features for SDK applications</description> + <!-- properties are inherited from parent --> + <!-- repositories are inherited from parent --> <dependencies> diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookController.java new file mode 100644 index 00000000..d5f4288d --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookController.java @@ -0,0 +1,68 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.rnotebookintegration.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.service.UserProfileService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +@Controller +@RequestMapping("/") +public class NotebookController extends RestrictedBaseController{ + + @RequestMapping(value = {"/notebook" }, method = RequestMethod.GET) + public ModelAndView noteBook(HttpServletRequest request) { + + try { + + } catch (Exception e) { + + + } + return new ModelAndView(getViewName()); + } + + +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookTestController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookTestController.java new file mode 100644 index 00000000..973f8d05 --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/NotebookTestController.java @@ -0,0 +1,60 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ + + +package org.onap.portalsdk.rnotebookintegration.controller; + +import javax.servlet.http.HttpServletRequest; + +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +@Controller +@RequestMapping("/") +public class NotebookTestController extends RestrictedBaseController{ + + @RequestMapping(value = {"/nbooktest" }, method = RequestMethod.GET) + public ModelAndView noteBook(HttpServletRequest request) { + return new ModelAndView(getViewName()); + } + + +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/RNoteBookController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/RNoteBookController.java index 00d97268..9a178450 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/RNoteBookController.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/RNoteBookController.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.rnotebookintegration.controller; +package org.onap.portalsdk.rnotebookintegration.controller; import java.util.HashMap; @@ -25,15 +43,15 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.hibernate.validator.internal.util.privilegedactions.GetMethodFromPropertyName; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.controller.RestrictedRESTfulBaseController; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.openecomp.portalsdk.core.web.support.JsonMessage; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.openecomp.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; -import org.openecomp.portalsdk.rnotebookintegration.service.RNoteBookIntegrationService; +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.onap.portalsdk.core.controller.RestrictedRESTfulBaseController; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.JsonMessage; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.onap.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; +import org.onap.portalsdk.rnotebookintegration.service.RNoteBookIntegrationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/RNoteBookFEController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/RNoteBookFEController.java index 3b0fcc49..0268284c 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/RNoteBookFEController.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/controller/RNoteBookFEController.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.rnotebookintegration.controller; +package org.onap.portalsdk.rnotebookintegration.controller; import java.util.HashMap; import java.util.Iterator; @@ -26,13 +44,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.openecomp.portalsdk.core.util.SystemProperties; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.openecomp.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; -import org.openecomp.portalsdk.rnotebookintegration.service.RNoteBookIntegrationService; +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.core.util.SystemProperties; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.onap.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; +import org.onap.portalsdk.rnotebookintegration.service.RNoteBookIntegrationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/domain/RNoteBookCredentials.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/domain/RNoteBookCredentials.java index d2928495..0744aab3 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/domain/RNoteBookCredentials.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/domain/RNoteBookCredentials.java @@ -1,30 +1,48 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.rnotebookintegration.domain; +package org.onap.portalsdk.rnotebookintegration.domain; import java.util.Date; import java.util.Map; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.core.domain.support.DomainVo; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.support.DomainVo; +import org.onap.portalsdk.core.restful.domain.EcompUser; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java new file mode 100644 index 00000000..ff576725 --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java @@ -0,0 +1,59 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.rnotebookintegration.exception; + +public class RNotebookIntegrationException extends Exception { + public static final String ERROR_CODE_TOKEN_EXPIRED = "ERROR_CODE_TOKEN_EXPIRED"; + public static final String ERROR_CODE_TOKEN_INVALID = "ERROR_CODE_TOKEN_INVALID"; + + String errorCode; + + public RNotebookIntegrationException(String errorCodeStr){ + super(errorCodeStr); + this.errorCode = errorCodeStr; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java new file mode 100644 index 00000000..11de7d25 --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java @@ -0,0 +1,49 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.rnotebookintegration.service; + +import java.util.Map; + +import org.onap.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; + +public interface RNoteBookIntegrationService { + public String getRNotebookCredentials(String token) throws RNotebookIntegrationException, Exception; + + public String saveRNotebookCredentials(String notebookId, EcompUser user, Map<String, String> params) throws RNotebookIntegrationException, Exception; +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/service/RNoteBookIntegrationServiceImpl.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/service/RNoteBookIntegrationServiceImpl.java index fe21cd13..8a21b71a 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/service/RNoteBookIntegrationServiceImpl.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/rnotebookintegration/service/RNoteBookIntegrationServiceImpl.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.rnotebookintegration.service; +package org.onap.portalsdk.rnotebookintegration.service; import java.security.SecureRandom; import java.util.Date; @@ -25,12 +43,12 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.core.web.support.UserUtils; -import org.openecomp.portalsdk.rnotebookintegration.domain.RNoteBookCredentials; -import org.openecomp.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.restful.domain.EcompUser; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.core.web.support.UserUtils; +import org.onap.portalsdk.rnotebookintegration.domain.RNoteBookCredentials; +import org.onap.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,8 +63,7 @@ public class RNoteBookIntegrationServiceImpl implements RNoteBookIntegrationServ private final long tokenTTL = 50000L; - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RNoteBookIntegrationServiceImpl.class); - + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RNoteBookIntegrationServiceImpl.class); @Autowired private DataAccessService dataAccessService; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/controllers/WorkflowController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java index ca2b3885..2566868e 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/controllers/WorkflowController.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/controllers/WorkflowController.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.controllers; +package org.onap.portalsdk.workflow.controllers; import java.io.PrintWriter; import java.text.SimpleDateFormat; @@ -30,12 +48,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONObject; -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule; -import org.openecomp.portalsdk.workflow.models.Workflow; -import org.openecomp.portalsdk.workflow.models.WorkflowLite; -import org.openecomp.portalsdk.workflow.services.WorkflowService; +import org.onap.portalsdk.core.controller.RestrictedBaseController; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.workflow.domain.WorkflowSchedule; +import org.onap.portalsdk.workflow.models.Workflow; +import org.onap.portalsdk.workflow.models.WorkflowLite; +import org.onap.portalsdk.workflow.services.WorkflowService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; @@ -54,6 +73,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; @Controller @RequestMapping("/") public class WorkflowController extends RestrictedBaseController { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkflowController.class); @Autowired private WorkflowService workflowService; @@ -162,7 +183,7 @@ public class WorkflowController extends RestrictedBaseController { request.setCharacterEncoding("UTF-8"); out = response.getWriter(); } catch (Exception e) { - e.printStackTrace(); + logger.error(EELFLoggerDelegate.errorLogger, "removeWorkflow failed", e); } JSONObject j = new JSONObject("{removed: 123}"); diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/dao/WorkflowDAO.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/dao/WorkflowDAO.java new file mode 100644 index 00000000..cb7b27a3 --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/dao/WorkflowDAO.java @@ -0,0 +1,50 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.workflow.dao; + +import java.util.List; + +import org.onap.portalsdk.workflow.models.Workflow; +import org.onap.portalsdk.workflow.models.WorkflowLite; + +public interface WorkflowDAO { + public List<Workflow> getWorkflows(); + public Workflow save(Workflow workflow, String creatorId); + public Workflow edit(WorkflowLite workflow, String creatorId); + public void delete(Long workflow); +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/dao/WorkflowDAOImpl.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/dao/WorkflowDAOImpl.java index a3382dbb..8fdb64fc 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/dao/WorkflowDAOImpl.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/dao/WorkflowDAOImpl.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.dao; +package org.onap.portalsdk.workflow.dao; import java.util.Date; import java.util.List; @@ -26,9 +44,9 @@ import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; -import org.openecomp.portalsdk.core.domain.User; -import org.openecomp.portalsdk.workflow.models.Workflow; -import org.openecomp.portalsdk.workflow.models.WorkflowLite; +import org.onap.portalsdk.core.domain.User; +import org.onap.portalsdk.workflow.models.Workflow; +import org.onap.portalsdk.workflow.models.WorkflowLite; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; @Repository diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/domain/WorkflowSchedule.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/domain/WorkflowSchedule.java index e8c619f5..58f1377a 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/domain/WorkflowSchedule.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/domain/WorkflowSchedule.java @@ -1,26 +1,44 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.domain; +package org.onap.portalsdk.workflow.domain; import java.util.Date; -import org.openecomp.portalsdk.core.domain.support.DomainVo; +import org.onap.portalsdk.core.domain.support.DomainVo; public class WorkflowSchedule extends DomainVo{ /** * diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/models/Workflow.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/models/Workflow.java index 3193f9cd..734b356f 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/models/Workflow.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/models/Workflow.java @@ -1,24 +1,42 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.models; +package org.onap.portalsdk.workflow.models; import java.io.Serializable; import java.util.Date; @@ -32,7 +50,7 @@ import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; -import org.openecomp.portalsdk.core.domain.User; +import org.onap.portalsdk.core.domain.User; @Entity @Table(name = "fn_workflow") diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/models/WorkflowLite.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/models/WorkflowLite.java index c3b727d9..3f689095 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/models/WorkflowLite.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/models/WorkflowLite.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.models; +package org.onap.portalsdk.workflow.models; import java.io.Serializable; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java new file mode 100644 index 00000000..3882865a --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java @@ -0,0 +1,62 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.workflow.scheduler; + +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.workflow.services.WorkflowScheduleExecutor; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.scheduling.quartz.QuartzJobBean; + +public class WorkFlowScheduleJob extends QuartzJobBean{ + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkFlowScheduleJob.class); + + @Override + protected void executeInternal(JobExecutionContext context) + throws JobExecutionException { + + String serverUrl = (String)context.getMergedJobDataMap().get("serverUrl"); + String workflowKey = (String)context.getMergedJobDataMap().get("workflowKey"); + //String arguments = (String)context.getMergedJobDataMap().get("arguments"); + logger.info(EELFLoggerDelegate.debugLogger, ("Executing the job for the workflow " + workflowKey)); + WorkflowScheduleExecutor executor = new WorkflowScheduleExecutor(serverUrl, workflowKey); + executor.execute(); + } + +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/scheduler/WorkFlowScheduleRegistry.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/scheduler/WorkFlowScheduleRegistry.java index bf29f59a..2412b992 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/scheduler/WorkFlowScheduleRegistry.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/scheduler/WorkFlowScheduleRegistry.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.scheduler; +package org.onap.portalsdk.workflow.scheduler; import java.util.Calendar; import java.util.Date; @@ -25,7 +43,7 @@ import java.util.HashMap; import java.util.Map; import java.util.UUID; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.quartz.impl.triggers.CronTriggerImpl; import org.springframework.context.annotation.DependsOn; import org.springframework.scheduling.quartz.CronTriggerFactoryBean; @@ -35,10 +53,8 @@ import org.springframework.stereotype.Component; @Component @DependsOn({"systemProperties"}) public class WorkFlowScheduleRegistry{ - - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkFlowScheduleRegistry.class); + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkFlowScheduleRegistry.class); public WorkFlowScheduleRegistry() { diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleExecutor.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleExecutor.java index ea04e69e..90b9e96a 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleExecutor.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleExecutor.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.services; +package org.onap.portalsdk.workflow.services; import java.io.BufferedReader; import java.io.InputStreamReader; @@ -27,7 +45,12 @@ import java.net.URL; import java.net.URLConnection; import java.nio.charset.Charset; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; + public class WorkflowScheduleExecutor { + + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkflowScheduleExecutor.class); + private String serverURL; private String workflowKey; private String myUrl; @@ -50,7 +73,7 @@ public class WorkflowScheduleExecutor { } public static String get_fromURL(String myURL) { - System.out.println("Requeted URL:" + myURL); + logger.debug(EELFLoggerDelegate.debugLogger, "get_fromURL: Requested URL {}", myURL); StringBuilder sb = new StringBuilder(); URLConnection urlConn = null; InputStreamReader in = null; @@ -63,18 +86,24 @@ public class WorkflowScheduleExecutor { in = new InputStreamReader(urlConn.getInputStream(), Charset.defaultCharset()); BufferedReader bufferedReader = new BufferedReader(in); - if (bufferedReader != null) { - int cp; - while ((cp = bufferedReader.read()) != -1) { - sb.append((char) cp); - } - bufferedReader.close(); - } + int cp; + while ((cp = bufferedReader.read()) != -1) + sb.append((char) cp); + bufferedReader.close(); + in.close(); } - in.close(); } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "get_fromURL failed", e); throw new RuntimeException("Exception while calling URL:"+ myURL, e); } + finally { + try { + if (in != null) + in.close(); + } catch (Exception e) { + logger.error(EELFLoggerDelegate.errorLogger, "get_fromURL close failed", e); + } + } return sb.toString(); } @@ -101,7 +130,8 @@ public class WorkflowScheduleExecutor { br.close(); connection.disconnect(); } catch (Exception e) { - throw new RuntimeException(e.getMessage()); + logger.error(EELFLoggerDelegate.errorLogger, "POST_fromURL failed", e); + throw new RuntimeException(e.getMessage()); } return jsonString.toString(); } diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleService.java new file mode 100644 index 00000000..1a64812d --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleService.java @@ -0,0 +1,52 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.workflow.services; + +import java.util.List; + +import org.onap.portalsdk.workflow.domain.WorkflowSchedule; +import org.quartz.Trigger; +import org.springframework.scheduling.quartz.SchedulerFactoryBean; + +public interface WorkflowScheduleService { + List<WorkflowSchedule> findAll(); + WorkflowSchedule getWorkflowScheduleByKey(Long key); + void saveWorkflowSchedule(WorkflowSchedule ws); + public void triggerWorkflowScheduling(SchedulerFactoryBean schedulerBean, WorkflowSchedule ws); + public List<Trigger> triggerWorkflowScheduling(); +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleServiceImpl.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleServiceImpl.java index 1d0c58a7..73da941c 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleServiceImpl.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowScheduleServiceImpl.java @@ -1,23 +1,41 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.services; +package org.onap.portalsdk.workflow.services; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -25,10 +43,10 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.service.DataAccessService; -import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule; -import org.openecomp.portalsdk.workflow.scheduler.WorkFlowScheduleRegistry; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.service.DataAccessService; +import org.onap.portalsdk.workflow.domain.WorkflowSchedule; +import org.onap.portalsdk.workflow.scheduler.WorkFlowScheduleRegistry; import org.quartz.JobDetail; import org.quartz.Trigger; import org.springframework.beans.factory.annotation.Autowired; @@ -45,8 +63,7 @@ import org.springframework.transaction.annotation.Transactional; public class WorkflowScheduleServiceImpl implements WorkflowScheduleService{ - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkflowScheduleServiceImpl.class); - + private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkflowScheduleServiceImpl.class); @Autowired private DataAccessService dataAccessService; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowService.java new file mode 100644 index 00000000..a246273b --- /dev/null +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowService.java @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software 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. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. + */ +package org.onap.portalsdk.workflow.services; + +import java.util.List; + +import org.onap.portalsdk.workflow.domain.WorkflowSchedule; +import org.onap.portalsdk.workflow.models.Workflow; +import org.onap.portalsdk.workflow.models.WorkflowLite; + +public interface WorkflowService { + public void saveCronJob(WorkflowSchedule domainCronJobData); + + public Workflow addWorkflow(Workflow workflow, String creatorId); + + public Workflow editWorkflow(WorkflowLite worklow, String creatorId); + + public void deleteWorkflow(Long worklow); + + public List<Workflow> getAllWorkflows(); +} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowServiceImpl.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowServiceImpl.java index b27d2e2d..b12aba87 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowServiceImpl.java +++ b/ecomp-sdk/epsdk-workflow/src/main/java/org/onap/portalsdk/workflow/services/WorkflowServiceImpl.java @@ -1,30 +1,48 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. +/* + * ============LICENSE_START========================================== + * ONAP Portal SDK + * =================================================================== + * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the “License”); + * you may not use this software except in compliance with the License. * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * + * 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. - * ================================================================================ + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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. + * + * ============LICENSE_END============================================ + * + * ECOMP is a trademark and service mark of AT&T Intellectual Property. */ -package org.openecomp.portalsdk.workflow.services; +package org.onap.portalsdk.workflow.services; import java.util.List; -import org.openecomp.portalsdk.workflow.dao.WorkflowDAO; -import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule; -import org.openecomp.portalsdk.workflow.models.Workflow; -import org.openecomp.portalsdk.workflow.models.WorkflowLite; +import org.onap.portalsdk.workflow.dao.WorkflowDAO; +import org.onap.portalsdk.workflow.domain.WorkflowSchedule; +import org.onap.portalsdk.workflow.models.Workflow; +import org.onap.portalsdk.workflow.models.WorkflowLite; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookController.java deleted file mode 100644 index 8b8ad5c9..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookController.java +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.rnotebookintegration.controller; - -import javax.servlet.http.HttpServletRequest; - -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.service.UserProfileService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/") -public class NotebookController extends RestrictedBaseController{ - @Autowired - UserProfileService service; - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NotebookController.class); - - @RequestMapping(value = {"/notebook" }, method = RequestMethod.GET) - public ModelAndView noteBook(HttpServletRequest request) { - - try { - - } catch (Exception e) { - - - } - return new ModelAndView(getViewName()); - } - - -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookTestController.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookTestController.java deleted file mode 100644 index ac56b6c6..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/controller/NotebookTestController.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.rnotebookintegration.controller; - -import javax.servlet.http.HttpServletRequest; - -import org.openecomp.portalsdk.core.controller.RestrictedBaseController; -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.core.service.UserProfileService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.servlet.ModelAndView; - -@Controller -@RequestMapping("/") -public class NotebookTestController extends RestrictedBaseController{ - @Autowired - UserProfileService service; - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NotebookTestController.class); - - @RequestMapping(value = {"/nbooktest" }, method = RequestMethod.GET) - public ModelAndView noteBook(HttpServletRequest request) { - - try { - - } catch (Exception e) { - - - } - return new ModelAndView(getViewName()); - } - - -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java deleted file mode 100644 index b2742641..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/exception/RNotebookIntegrationException.java +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.rnotebookintegration.exception; - -public class RNotebookIntegrationException extends Exception { - public static final String ERROR_CODE_TOKEN_EXPIRED = "ERROR_CODE_TOKEN_EXPIRED"; - public static final String ERROR_CODE_TOKEN_INVALID = "ERROR_CODE_TOKEN_INVALID"; - - String errorCode; - - public RNotebookIntegrationException(String errorCodeStr){ - super(errorCodeStr); - this.errorCode = errorCodeStr; - } - - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java deleted file mode 100644 index 2b1e3c9e..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/rnotebookintegration/service/RNoteBookIntegrationService.java +++ /dev/null @@ -1,31 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.rnotebookintegration.service; - -import java.util.Map; - -import org.openecomp.portalsdk.core.restful.domain.EcompUser; -import org.openecomp.portalsdk.rnotebookintegration.exception.RNotebookIntegrationException; - -public interface RNoteBookIntegrationService { - public String getRNotebookCredentials(String token) throws RNotebookIntegrationException, Exception; - - public String saveRNotebookCredentials(String notebookId, EcompUser user, Map<String, String> params) throws RNotebookIntegrationException, Exception; -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/dao/WorkflowDAO.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/dao/WorkflowDAO.java deleted file mode 100644 index 435ac9a6..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/dao/WorkflowDAO.java +++ /dev/null @@ -1,32 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.workflow.dao; - -import java.util.List; - -import org.openecomp.portalsdk.workflow.models.Workflow; -import org.openecomp.portalsdk.workflow.models.WorkflowLite; - -public interface WorkflowDAO { - public List<Workflow> getWorkflows(); - public Workflow save(Workflow workflow, String creatorId); - public Workflow edit(WorkflowLite workflow, String creatorId); - public void delete(Long workflow); -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java deleted file mode 100644 index d90ee05b..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/scheduler/WorkFlowScheduleJob.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.workflow.scheduler; - -import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate; -import org.openecomp.portalsdk.workflow.services.WorkflowScheduleExecutor; -import org.quartz.JobExecutionContext; -import org.quartz.JobExecutionException; -import org.springframework.scheduling.quartz.QuartzJobBean; - -public class WorkFlowScheduleJob extends QuartzJobBean{ - - EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(WorkFlowScheduleJob.class); - - - @Override - protected void executeInternal(JobExecutionContext context) - throws JobExecutionException { - - String serverUrl = (String)context.getMergedJobDataMap().get("serverUrl"); - String workflowKey = (String)context.getMergedJobDataMap().get("workflowKey"); - //String arguments = (String)context.getMergedJobDataMap().get("arguments"); - logger.info(EELFLoggerDelegate.debugLogger, ("Executing the job for the workflow " + workflowKey)); - WorkflowScheduleExecutor executor = new WorkflowScheduleExecutor(serverUrl, workflowKey); - executor.execute(); - } - -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleService.java deleted file mode 100644 index d04b72be..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowScheduleService.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ================================================================================ - * eCOMP Portal SDK - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property - * ================================================================================ - * 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 org.openecomp.portalsdk.workflow.services; - -import java.util.List; - -import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule; -import org.quartz.Trigger; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; - -public interface WorkflowScheduleService { - List<WorkflowSchedule> findAll(); - WorkflowSchedule getWorkflowScheduleByKey(Long key); - void saveWorkflowSchedule(WorkflowSchedule ws); - public void triggerWorkflowScheduling(SchedulerFactoryBean schedulerBean, WorkflowSchedule ws); - public List<Trigger> triggerWorkflowScheduling(); -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowService.java b/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowService.java deleted file mode 100644 index 7bf133a7..00000000 --- a/ecomp-sdk/epsdk-workflow/src/main/java/org/openecomp/portalsdk/workflow/services/WorkflowService.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.openecomp.portalsdk.workflow.services; - -import java.util.List; - -import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule; -import org.openecomp.portalsdk.workflow.models.Workflow; -import org.openecomp.portalsdk.workflow.models.WorkflowLite; - - -public interface WorkflowService { - public void saveCronJob(WorkflowSchedule domainCronJobData); - public Workflow addWorkflow(Workflow workflow, String creatorId); - public Workflow editWorkflow(WorkflowLite worklow, String creatorId); - public void deleteWorkflow(Long worklow); - public List<Workflow> getAllWorkflows(); -} diff --git a/ecomp-sdk/epsdk-workflow/src/main/resources/RNoteBookIntegration.hbm.xml b/ecomp-sdk/epsdk-workflow/src/main/resources/RNoteBookIntegration.hbm.xml index 44b7986f..a93fc863 100644 --- a/ecomp-sdk/epsdk-workflow/src/main/resources/RNoteBookIntegration.hbm.xml +++ b/ecomp-sdk/epsdk-workflow/src/main/resources/RNoteBookIntegration.hbm.xml @@ -1,29 +1,47 @@ <?xml version="1.0"?> <!-- - ================================================================================ - eCOMP Portal SDK - ================================================================================ - Copyright (C) 2017 AT&T Intellectual Property - ================================================================================ - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. + ============LICENSE_START========================================== + ONAP Portal SDK + =================================================================== + Copyright © 2017 AT&T Intellectual Property. All rights reserved. + =================================================================== + + Unless otherwise specified, all software contained herein is licensed + under the Apache License, Version 2.0 (the “License”); + you may not use this software except in compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - + + 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. - ================================================================================ + + Unless otherwise specified, all documentation contained herein is licensed + under the Creative Commons License, Attribution 4.0 Intl. (the “License”); + you may not use this documentation except in compliance with the License. + You may obtain a copy of the License at + + https://creativecommons.org/licenses/by/4.0/ + + Unless required by applicable law or agreed to in writing, documentation + 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. + + ============LICENSE_END============================================ + + ECOMP is a trademark and service mark of AT&T Intellectual Property. --> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> -<hibernate-mapping package="org.openecomp.portalsdk.rnotebookintegration.domain"> +<hibernate-mapping package="org.onap.portalsdk.rnotebookintegration.domain"> <!-- WorkflowSchedule mapping details --> |