From: narendervemula Date: Sun, 5 Aug 2018 15:54:15 +0000 (+0000) Subject: Added Deployment Status X-Git-Tag: 0.0.1~1 X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F199%2F1;p=camunda_workflow.git Added Deployment Status Change-Id: I4386ec0a326754cfd70a7fea7365a1de52fc2956 Signed-off-by: narendervemula --- diff --git a/akraino/.classpath b/akraino/.classpath new file mode 100644 index 0000000..8024414 --- /dev/null +++ b/akraino/.classpath @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/akraino/.metadata/.lock b/akraino/.metadata/.lock new file mode 100644 index 0000000..e69de29 diff --git a/akraino/.metadata/.log b/akraino/.metadata/.log new file mode 100644 index 0000000..70c5d40 --- /dev/null +++ b/akraino/.metadata/.log @@ -0,0 +1,223 @@ +!SESSION 2018-05-31 21:07:40.069 ----------------------------------------------- +eclipse.buildId=3.9.2.201712210947-RELEASE-e47 +java.version=1.8.0_151 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.springsource.sts.ide -product org.springsource.sts.ide +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide -data C:\Users\bbadavenkatappagari.MAJESTY\Downloads\demo -product org.springsource.sts.ide + +!ENTRY org.eclipse.ui 2 0 2018-05-31 21:07:45.642 +!MESSAGE Warnings while parsing the images from the 'org.eclipse.ui.commandImages' extension point. +!SUBENTRY 1 org.eclipse.ui 2 0 2018-05-31 21:07:45.642 +!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.lsp4e', id='org.eclipse.lsp4e.togglehighlight' + +!ENTRY org.eclipse.jface 2 0 2018-05-31 21:07:48.544 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2018-05-31 21:07:48.544 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6b60d99c, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@543a7605, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.ui 2 2 2018-05-31 21:07:50.456 +!MESSAGE org.eclipse.jdt.junit.ResultView: Deprecated relationship "fast" should be converted to "stack". + +!ENTRY org.eclipse.ui 2 2 2018-05-31 21:07:50.456 +!MESSAGE org.springframework.ide.eclipse.aop.ui.navigator.aopReferenceModelNavigator: Deprecated relationship "fast" should be converted to "stack". + +!ENTRY org.eclipse.ui 2 2 2018-05-31 21:07:50.466 +!MESSAGE org.eclipse.contribution.xref.ui.views.XReferenceView: Deprecated relationship "fast" should be converted to "stack". + +!ENTRY org.eclipse.jface.text 2 0 2018-05-31 21:07:51.807 +!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.number' + +!ENTRY org.eclipse.jface.text 2 0 2018-05-31 21:07:51.817 +!MESSAGE Duplicate template id: 'org.eclipse.wst.xslt.templates.xpath.round' + +!ENTRY org.eclipse.egit.ui 2 0 2018-05-31 21:08:00.999 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\bbadavenkatappagari.MAJESTY'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.oomph.setup.core 4 0 2018-05-31 21:08:06.846 +!MESSAGE C:\Users\bbadavenkatappagari.MAJESTY\.eclipse\org.eclipse.oomph.setup\setups\locations.setup (Access is denied) +!STACK 0 +java.io.FileNotFoundException: C:\Users\bbadavenkatappagari.MAJESTY\.eclipse\org.eclipse.oomph.setup\setups\locations.setup (Access is denied) + at java.io.FileOutputStream.open0(Native Method) + at java.io.FileOutputStream.open(FileOutputStream.java:270) + at java.io.FileOutputStream.(FileOutputStream.java:213) + at java.io.FileOutputStream.(FileOutputStream.java:162) + at org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl$1.(FileURIHandlerImpl.java:65) + at org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl.createOutputStream(FileURIHandlerImpl.java:65) + at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349) + at org.eclipse.oomph.setup.internal.core.util.UserURIHandlerImpl.createOutputStream(UserURIHandlerImpl.java:92) + at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349) + at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1234) + at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:985) + at org.eclipse.oomph.setup.internal.core.SetupContext.associate(SetupContext.java:491) + at org.eclipse.oomph.setup.internal.core.SetupContext.access$0(SetupContext.java:408) + at org.eclipse.oomph.setup.internal.core.SetupContext$1.run(SetupContext.java:392) + at org.eclipse.oomph.base.util.BaseUtil.execute(BaseUtil.java:279) + at org.eclipse.oomph.setup.internal.core.SetupContext.associate(SetupContext.java:388) + at org.eclipse.oomph.setup.internal.core.SetupContext.createSelf(SetupContext.java:268) + at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:667) + at org.eclipse.oomph.setup.ui.SetupUIPlugin.access$5(SetupUIPlugin.java:416) + at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.run(SetupUIPlugin.java:253) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) + +!ENTRY org.springsource.ide.eclipse.commons.browser 4 0 2018-05-31 21:08:07.611 +!MESSAGE Could not call browser function extension: addHtml +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4533) + at org.eclipse.swt.SWT.error(SWT.java:4448) + at org.eclipse.swt.SWT.error(SWT.java:4419) + at org.eclipse.swt.widgets.Widget.error(Widget.java:482) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:354) + at org.eclipse.swt.browser.Browser.checkWidget(Browser.java:207) + at org.eclipse.swt.browser.Browser.execute(Browser.java:532) + at org.springsource.ide.eclipse.commons.browser.swt.StsBrowserManager.lambda$0(StsBrowserManager.java:145) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) + at org.eclipse.equinox.launcher.Main.run(Main.java:1499) + +!ENTRY org.springsource.ide.eclipse.commons.browser 4 0 2018-05-31 21:08:07.628 +!MESSAGE Could not call browser function extension: addHtml +!STACK 0 +org.eclipse.swt.SWTException: Widget is disposed + at org.eclipse.swt.SWT.error(SWT.java:4533) + at org.eclipse.swt.SWT.error(SWT.java:4448) + at org.eclipse.swt.SWT.error(SWT.java:4419) + at org.eclipse.swt.widgets.Widget.error(Widget.java:482) + at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:354) + at org.eclipse.swt.browser.Browser.checkWidget(Browser.java:207) + at org.eclipse.swt.browser.Browser.execute(Browser.java:532) + at org.springsource.ide.eclipse.commons.browser.swt.StsBrowserManager.lambda$0(StsBrowserManager.java:145) + at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:37) + at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:182) + at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4213) + at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3820) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) + at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039) + at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) + at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) + at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) + at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) + at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) + at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151) + at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) + at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) + at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) + at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.lang.reflect.Method.invoke(Method.java:498) + at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) + at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) + at org.eclipse.equinox.launcher.Main.run(Main.java:1499) +!SESSION 2018-05-31 21:10:00.864 ----------------------------------------------- +eclipse.buildId=3.9.2.201712210947-RELEASE-e47 +java.version=1.8.0_151 +java.vendor=Oracle Corporation +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US +Framework arguments: -product org.springsource.sts.ide -product org.springsource.sts.ide -product org.springsource.sts.ide +Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.springsource.sts.ide -product org.springsource.sts.ide -data C:\Users\bbadavenkatappagari.MAJESTY\Downloads\demo -product org.springsource.sts.ide + +!ENTRY org.eclipse.ui 2 0 2018-05-31 21:10:07.183 +!MESSAGE Warnings while parsing the images from the 'org.eclipse.ui.commandImages' extension point. +!SUBENTRY 1 org.eclipse.ui 2 0 2018-05-31 21:10:07.183 +!MESSAGE Cannot bind to an undefined command: plug-in='org.eclipse.lsp4e', id='org.eclipse.lsp4e.togglehighlight' + +!ENTRY org.eclipse.jface 2 0 2018-05-31 21:10:11.487 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2018-05-31 21:10:11.487 +!MESSAGE A conflict occurred for CTRL+SHIFT+T: +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.jdt.ui.navigate.open.type,Open Type, + Open a type in a Java editor, + Category(org.eclipse.ui.category.navigate,Navigate,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5cdf61d, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+T, + ParameterizedCommand(Command(org.eclipse.lsp4e.symbolinworkspace,Go to Symbol in Workspace, + , + Category(org.eclipse.lsp4e.category,Language Servers,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@4509414e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) + +!ENTRY org.eclipse.egit.ui 2 0 2018-05-31 21:10:20.579 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\bbadavenkatappagari.MAJESTY'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.oomph.setup.core 4 0 2018-05-31 21:10:28.942 +!MESSAGE C:\Users\bbadavenkatappagari.MAJESTY\.eclipse\org.eclipse.oomph.setup\setups\locations.setup (Access is denied) +!STACK 0 +java.io.FileNotFoundException: C:\Users\bbadavenkatappagari.MAJESTY\.eclipse\org.eclipse.oomph.setup\setups\locations.setup (Access is denied) + at java.io.FileOutputStream.open0(Native Method) + at java.io.FileOutputStream.open(FileOutputStream.java:270) + at java.io.FileOutputStream.(FileOutputStream.java:213) + at java.io.FileOutputStream.(FileOutputStream.java:162) + at org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl$1.(FileURIHandlerImpl.java:65) + at org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl.createOutputStream(FileURIHandlerImpl.java:65) + at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349) + at org.eclipse.oomph.setup.internal.core.util.UserURIHandlerImpl.createOutputStream(UserURIHandlerImpl.java:92) + at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createOutputStream(ExtensibleURIConverterImpl.java:349) + at org.eclipse.emf.ecore.resource.impl.ResourceImpl.saveOnlyIfChangedWithMemoryBuffer(ResourceImpl.java:1234) + at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:985) + at org.eclipse.oomph.setup.internal.core.SetupContext.associate(SetupContext.java:491) + at org.eclipse.oomph.setup.internal.core.SetupContext.access$0(SetupContext.java:408) + at org.eclipse.oomph.setup.internal.core.SetupContext$1.run(SetupContext.java:392) + at org.eclipse.oomph.base.util.BaseUtil.execute(BaseUtil.java:279) + at org.eclipse.oomph.setup.internal.core.SetupContext.associate(SetupContext.java:388) + at org.eclipse.oomph.setup.internal.core.SetupContext.createSelf(SetupContext.java:268) + at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:667) + at org.eclipse.oomph.setup.ui.SetupUIPlugin.access$5(SetupUIPlugin.java:416) + at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.run(SetupUIPlugin.java:253) + at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) diff --git a/akraino/.metadata/.mylyn/repositories.xml.zip b/akraino/.metadata/.mylyn/repositories.xml.zip new file mode 100644 index 0000000..2a9dff4 Binary files /dev/null and b/akraino/.metadata/.mylyn/repositories.xml.zip differ diff --git a/akraino/.metadata/version.ini b/akraino/.metadata/version.ini new file mode 100644 index 0000000..193ce18 --- /dev/null +++ b/akraino/.metadata/version.ini @@ -0,0 +1,3 @@ +#Thu May 31 21:10:05 EDT 2018 +org.eclipse.core.runtime=2 +org.eclipse.platform=4.7.2.v20171130-0510 diff --git a/akraino/.project b/akraino/.project new file mode 100644 index 0000000..5938ee7 --- /dev/null +++ b/akraino/.project @@ -0,0 +1,40 @@ + + + camunda-spring-boot + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.springframework.ide.eclipse.core.springbuilder + + + + + org.springframework.ide.eclipse.boot.validation.springbootbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.springframework.ide.eclipse.core.springnature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/akraino/.springBeans b/akraino/.springBeans index 009ac9b..b09df20 100644 --- a/akraino/.springBeans +++ b/akraino/.springBeans @@ -1,16 +1,16 @@ - - - 1 - - - - - - - java:com.akraino.bpm.AkrainoSpringBootApplication - - - - - - + + + 1 + + + + + + + java:com.akraino.bpm.AkrainoSpringBootApplication + + + + + + diff --git a/akraino/pom.xml b/akraino/pom.xml index 3cb3945..feb8002 100644 --- a/akraino/pom.xml +++ b/akraino/pom.xml @@ -57,7 +57,12 @@ 2.7.0 - + + org.springframework.boot + spring-boot-starter-test + test + 1.5.3.RELEASE + diff --git a/akraino/src/main/java/com/akraino/bpm/config/CamundaCorsFilter.java b/akraino/src/main/java/com/akraino/bpm/config/CamundaCorsFilter.java index 3d0da27..249d90a 100644 --- a/akraino/src/main/java/com/akraino/bpm/config/CamundaCorsFilter.java +++ b/akraino/src/main/java/com/akraino/bpm/config/CamundaCorsFilter.java @@ -1,172 +1,172 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.config; - - -import java.io.IOException; - - -import javax.sql.DataSource; - -import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; -import org.camunda.bpm.engine.impl.jobexecutor.CallerRunsRejectedJobsHandler; -import org.camunda.bpm.engine.impl.jobexecutor.JobExecutor; -import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; -import org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.web.client.RestTemplateBuilder; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.Primary; -import org.springframework.core.io.support.PathMatchingResourcePatternResolver; -import org.springframework.core.task.TaskExecutor; -import org.springframework.jdbc.datasource.DataSourceTransactionManager; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; -import org.springframework.transaction.PlatformTransactionManager; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.cors.CorsConfiguration; -import org.springframework.web.cors.UrlBasedCorsConfigurationSource; -import org.springframework.web.filter.CorsFilter; - - - -@Configuration - - public class CamundaCorsFilter { - - - @Value("${camunda.bpm.buildresponseurl}") - private String buildresponseurl; - - @Value("${camunda.bpm.tokenId}") - private String tokenId; - - @Autowired - private DataSource dataSource; - - @Autowired - private PlatformTransactionManager transactionManager; - - @Autowired - private JobExecutor jobExecutor; - - public String getBuildresponseurl() { - return buildresponseurl; - } - - public void setBuildresponseurl(String buildresponseurl) { - this.buildresponseurl = buildresponseurl; - } - - public String getTokenId() { - return tokenId; - } - - public void setTokenId(String tokenId) { - this.tokenId = tokenId; - } - - @Bean - public RestTemplate restTemplate(RestTemplateBuilder builder) { - // Do any additional configuration here - return builder.build(); - } - - - - - /*@Bean - public JobExecutor jobExecutor() { - final JobExecutor jobExecutor = new RuntimeContainerJobExecutor(); - jobExecutor.setWaitTimeInMillis(5000); - jobExecutor.setLockTimeInMillis(18000000); - return jobExecutor; - } - @Bean - - public ProcessEngineConfiguration SpringProcessEngineConfiguration () { - - ProcessEngineConfiguration ProcessEngineConfiguration=new SpringProcessEngineConfiguration().setJobExecutor(jobexecutor).setProcessEngineName("default"); - return ProcessEngineConfiguration; - }*/ - - @Bean - @Primary - public static JobExecutor jobExecutor(@Qualifier("camundaTaskExecutor") final TaskExecutor taskExecutor) { - final SpringJobExecutor springJobExecutor = new SpringJobExecutor(); - springJobExecutor.setTaskExecutor(taskExecutor); - springJobExecutor.setRejectedJobsHandler(new CallerRunsRejectedJobsHandler()); - springJobExecutor.setWaitTimeInMillis(5000); - springJobExecutor.setLockTimeInMillis(36000000); - return springJobExecutor; - } - - @Bean - @Primary - public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException { - SpringProcessEngineConfiguration config = (SpringProcessEngineConfiguration) new SpringProcessEngineConfiguration().setJobExecutor(jobExecutor); - config.setDataSource(dataSource); - config.setTransactionManager(transactionManager); - config.setDatabaseSchemaUpdate("true"); - config.setJobExecutorActivate(true); - config.setAuthorizationEnabled(true); - config.setDefaultSerializationFormat("application/json"); - PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); - config.setDeploymentResources(resolver.getResources("classpath:*.bpmn")); - //config.setProcessEnginePlugins(); - return config; - } - - @Bean - public PlatformTransactionManager getTransactionManager() { - PlatformTransactionManager ptm=new DataSourceTransactionManager(dataSource); - return ptm; - } - - - @Bean - public CorsFilter corsFilter() { - UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); - CorsConfiguration config = new CorsConfiguration(); - config.setAllowCredentials(true); - config.addAllowedOrigin("*"); - config.addAllowedHeader("*"); - config.addAllowedMethod("OPTIONS"); - config.addAllowedMethod("GET"); - config.addAllowedMethod("POST"); - config.addAllowedMethod("PATCH"); - config.addAllowedMethod("PUT"); - config.addAllowedMethod("DELETE"); - source.registerCorsConfiguration("/**", config); - return new CorsFilter(source); - } - - @Bean(name="akrainoprocessExecutor") - public TaskExecutor workExecutor() { - ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); - threadPoolTaskExecutor.setThreadNamePrefix("Async-"); - threadPoolTaskExecutor.setCorePoolSize(10); - threadPoolTaskExecutor.setMaxPoolSize(50); - threadPoolTaskExecutor.setQueueCapacity(600); - threadPoolTaskExecutor.afterPropertiesSet(); - return threadPoolTaskExecutor; - } - } - - +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.config; + + +import java.io.IOException; + + +import javax.sql.DataSource; + +import org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.camunda.bpm.engine.impl.jobexecutor.CallerRunsRejectedJobsHandler; +import org.camunda.bpm.engine.impl.jobexecutor.JobExecutor; +import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration; +import org.camunda.bpm.engine.spring.components.jobexecutor.SpringJobExecutor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.client.RestTemplateBuilder; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Primary; +import org.springframework.core.io.support.PathMatchingResourcePatternResolver; +import org.springframework.core.task.TaskExecutor; +import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; +import org.springframework.transaction.PlatformTransactionManager; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + + + +@Configuration + + public class CamundaCorsFilter { + + + @Value("${camunda.bpm.buildresponseurl}") + private String buildresponseurl; + + @Value("${camunda.bpm.tokenId}") + private String tokenId; + + @Autowired + private DataSource dataSource; + + @Autowired + private PlatformTransactionManager transactionManager; + + @Autowired + private JobExecutor jobExecutor; + + public String getBuildresponseurl() { + return buildresponseurl; + } + + public void setBuildresponseurl(String buildresponseurl) { + this.buildresponseurl = buildresponseurl; + } + + public String getTokenId() { + return tokenId; + } + + public void setTokenId(String tokenId) { + this.tokenId = tokenId; + } + + @Bean + public RestTemplate restTemplate(RestTemplateBuilder builder) { + // Do any additional configuration here + return builder.build(); + } + + + + + /*@Bean + public JobExecutor jobExecutor() { + final JobExecutor jobExecutor = new RuntimeContainerJobExecutor(); + jobExecutor.setWaitTimeInMillis(5000); + jobExecutor.setLockTimeInMillis(18000000); + return jobExecutor; + } + @Bean + + public ProcessEngineConfiguration SpringProcessEngineConfiguration () { + + ProcessEngineConfiguration ProcessEngineConfiguration=new SpringProcessEngineConfiguration().setJobExecutor(jobexecutor).setProcessEngineName("default"); + return ProcessEngineConfiguration; + }*/ + + @Bean + @Primary + public static JobExecutor jobExecutor(@Qualifier("camundaTaskExecutor") final TaskExecutor taskExecutor) { + final SpringJobExecutor springJobExecutor = new SpringJobExecutor(); + springJobExecutor.setTaskExecutor(taskExecutor); + springJobExecutor.setRejectedJobsHandler(new CallerRunsRejectedJobsHandler()); + springJobExecutor.setWaitTimeInMillis(5000); + springJobExecutor.setLockTimeInMillis(36000000); + return springJobExecutor; + } + + @Bean + @Primary + public ProcessEngineConfigurationImpl processEngineConfiguration() throws IOException { + SpringProcessEngineConfiguration config = (SpringProcessEngineConfiguration) new SpringProcessEngineConfiguration().setJobExecutor(jobExecutor); + config.setDataSource(dataSource); + config.setTransactionManager(transactionManager); + config.setDatabaseSchemaUpdate("true"); + config.setJobExecutorActivate(true); + config.setAuthorizationEnabled(true); + config.setDefaultSerializationFormat("application/json"); + PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); + config.setDeploymentResources(resolver.getResources("classpath:*.bpmn")); + //config.setProcessEnginePlugins(); + return config; + } + + @Bean + public PlatformTransactionManager getTransactionManager() { + PlatformTransactionManager ptm=new DataSourceTransactionManager(dataSource); + return ptm; + } + + + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + CorsConfiguration config = new CorsConfiguration(); + config.setAllowCredentials(true); + config.addAllowedOrigin("*"); + config.addAllowedHeader("*"); + config.addAllowedMethod("OPTIONS"); + config.addAllowedMethod("GET"); + config.addAllowedMethod("POST"); + config.addAllowedMethod("PATCH"); + config.addAllowedMethod("PUT"); + config.addAllowedMethod("DELETE"); + source.registerCorsConfiguration("/**", config); + return new CorsFilter(source); + } + + @Bean(name="akrainoprocessExecutor") + public TaskExecutor workExecutor() { + ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor(); + threadPoolTaskExecutor.setThreadNamePrefix("Async-"); + threadPoolTaskExecutor.setCorePoolSize(10); + threadPoolTaskExecutor.setMaxPoolSize(50); + threadPoolTaskExecutor.setQueueCapacity(600); + threadPoolTaskExecutor.afterPropertiesSet(); + return threadPoolTaskExecutor; + } + } + + diff --git a/akraino/src/main/java/com/akraino/bpm/controller/CamundaRestController.java b/akraino/src/main/java/com/akraino/bpm/controller/CamundaRestController.java index 798f513..a6e6cba 100644 --- a/akraino/src/main/java/com/akraino/bpm/controller/CamundaRestController.java +++ b/akraino/src/main/java/com/akraino/bpm/controller/CamundaRestController.java @@ -1,107 +1,108 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.controller; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RestController; - - -import com.akraino.bpm.model.Airship; -import com.akraino.bpm.model.Apache; -import com.akraino.bpm.model.Build; -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.model.Deploy; -import com.akraino.bpm.model.Onap; -import com.akraino.bpm.model.Tempest; -import com.akraino.bpm.service.AsyncProcessExecutorService; - -import io.swagger.annotations.Api; - -@Api -@RestController -public class CamundaRestController { - - - - @Autowired - private AsyncProcessExecutorService asyncProcessExecutorService; - - private static Logger logger = LoggerFactory.getLogger(CamundaRestController.class); - - @PostMapping("/build/") - public ResponseEntity build(@RequestBody Build build) { - logger.debug("Request received for Build ",build.toString()); - asyncProcessExecutorService.executeBuildProcess(build); - return new ResponseEntity(new BuildResponse("in progress",null,null,null,null,build.getSitename(),null,null,null),HttpStatus.OK); - - } - - - - - @PostMapping("/deploy/") - public ResponseEntity deploy(@RequestBody Deploy deploy) { - logger.debug("Request received for executing {} and targetDirectory {} ",deploy.toString()); - asyncProcessExecutorService.executeDeployProcess(deploy); - return new ResponseEntity(new BuildResponse(null,"in progress","not started","not started","not started",deploy.getSitename(),null,null,null),HttpStatus.OK); - } - - - - - @PostMapping("/airship/") - public ResponseEntity airship(@RequestBody Airship airship) { - logger.debug("Request received for airship {} ",airship.toString()); - asyncProcessExecutorService.executeAirshipProcess(airship); - return new ResponseEntity(new BuildResponse(null,null,null,null,"in progress",airship.getSitename(),null,null,null),HttpStatus.OK); - } - - - - @PostMapping("/tempest/") - public ResponseEntity tempest(@RequestBody Tempest tempest) { - logger.debug("Request received for onap ",tempest.toString()); - asyncProcessExecutorService.executeTempestProcess(tempest); - return new ResponseEntity(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"in progress"),HttpStatus.OK); - } - - - - - @PostMapping("/apache/") - public ResponseEntity apache(@RequestBody Apache apache) { - logger.debug("Request received for onap ",apache.toString()); - asyncProcessExecutorService.executeApacheProcess(apache); - return new ResponseEntity(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"in progress",null),HttpStatus.OK); - } - - - - - @PostMapping("/onap/") - public ResponseEntity onap(@RequestBody Onap onap) { - logger.debug("Request received for onap ",onap.toString()); - asyncProcessExecutorService.executeOnapProcess(onap); - return new ResponseEntity(new BuildResponse(null,null,null,null,null,onap.getSitename(),"in progress",null,null),HttpStatus.OK); - } -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.controller; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + + +import com.akraino.bpm.model.Airship; +import com.akraino.bpm.model.Apache; +import com.akraino.bpm.model.Build; +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.model.Deploy; +import com.akraino.bpm.model.Onap; +import com.akraino.bpm.model.Tempest; +import com.akraino.bpm.service.AsyncProcessExecutorService; + +import io.swagger.annotations.Api; + +@Api +@RestController +public class CamundaRestController { + + + + @Autowired + private AsyncProcessExecutorService asyncProcessExecutorService; + + private static Logger logger = LoggerFactory.getLogger(CamundaRestController.class); + + @PostMapping("/build/") + public ResponseEntity build(@RequestBody Build build) { + logger.debug("Request received for Build ",build.toString()); + asyncProcessExecutorService.executeBuildProcess(build); + return new ResponseEntity(new BuildResponse("in progress",null,null,null,null,build.getSitename(),null,null,null),HttpStatus.OK); + + } + + + + + @PostMapping("/deploy/") + public ResponseEntity deploy(@RequestBody Deploy deploy) { + logger.debug("Request received for executing {} and targetDirectory {} ",deploy.toString()); + asyncProcessExecutorService.executeDeployProcess(deploy); + return new ResponseEntity(new BuildResponse(null,"in progress","not started","not started","not started",deploy.getSitename(),null,null,null),HttpStatus.OK); + } + + + + + @PostMapping("/airship/") + public ResponseEntity airship(@RequestBody Airship airship) { + logger.debug("Request received for airship {} ",airship.toString()); + asyncProcessExecutorService.executeAirshipProcess(airship); + return new ResponseEntity(new BuildResponse(null,null,null,null,"in progress",airship.getSitename(),null,null,null),HttpStatus.OK); + } + + + + @PostMapping("/tempest/") + public ResponseEntity tempest(@RequestBody Tempest tempest) { + logger.debug("Request received for onap ",tempest.toString()); + asyncProcessExecutorService.executeTempestProcess(tempest); + return new ResponseEntity(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"in progress"),HttpStatus.OK); + } + + + + + @PostMapping("/apache/") + public ResponseEntity apache(@RequestBody Apache apache) { + logger.debug("Request received for onap ",apache.toString()); + asyncProcessExecutorService.executeApacheProcess(apache); + return new ResponseEntity(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"in progress",null),HttpStatus.OK); + } + + + + + @PostMapping("/onap/") + public ResponseEntity onap(@RequestBody Onap onap) { + logger.debug("Request received for onap ",onap.toString()); + asyncProcessExecutorService.executeOnapProcess(onap); + return new ResponseEntity(new BuildResponse(null,null,null,null,null,onap.getSitename(),"in progress",null,null),HttpStatus.OK); + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/ApacheScriptExecutorTaskDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/ApacheScriptExecutorTaskDelegate.java index e0c5f12..90c93a7 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/ApacheScriptExecutorTaskDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/ApacheScriptExecutorTaskDelegate.java @@ -40,9 +40,10 @@ public class ApacheScriptExecutorTaskDelegate implements JavaDelegate { ScriptExecutionService scriptExecutionService; public void execute(DelegateExecution ctx) throws Exception { - String filepath=(String)ctx.getVariable("filepath"); - logger.debug("task execution started :"+filepath); - scriptExecutionService.executeScript(filepath); + String filename=(String)ctx.getVariable("scpfilename"); + String scpdir=(String)ctx.getVariable("scpdir"); + logger.debug("task execution started filename:{}, directory:{}",filename,scpdir); + scriptExecutionService.executeCDScript(scpdir, filename); } } diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/DeployPostVerficationRemoteScriptExecutor.java b/akraino/src/main/java/com/akraino/bpm/delegate/DeployPostVerficationRemoteScriptExecutor.java index 895938a..cca42b0 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/DeployPostVerficationRemoteScriptExecutor.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/DeployPostVerficationRemoteScriptExecutor.java @@ -1,67 +1,67 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.RemoteScriptExecutionService; - - - -@Component -public class DeployPostVerficationRemoteScriptExecutor implements JavaDelegate { - - - - private static Logger logger = LoggerFactory.getLogger(DeployPostVerficationRemoteScriptExecutor.class); - - @Autowired - RemoteScriptExecutionService remoteScriptExecutionService; - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - public void execute(DelegateExecution ctx) throws Exception { - String remotserver=(String)ctx.getVariable("remotserver"); - int portnumner=(Integer)ctx.getVariable("port"); - String username=(String)ctx.getVariable("username"); - String password=(String)ctx.getVariable("password"); - String filename=(String)ctx.getVariable("postverificationscript"); - String fileparams=(String)ctx.getVariable("postverificationScriptparams"); - String srcdir=(String)ctx.getVariable("srcdir"); - String destdir=(String)ctx.getVariable("destdir"); - String sitename=(String)ctx.getVariable("sitename"); - - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","inprogress",sitename,null,null,null)); - logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}", - remotserver,portnumner,username,password,filename,fileparams,srcdir,destdir); - - String command="sh " +destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); - logger.debug("Execution command {}",command); - remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,srcdir,destdir,command); - - - } - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.RemoteScriptExecutionService; + + + +@Component +public class DeployPostVerficationRemoteScriptExecutor implements JavaDelegate { + + + + private static Logger logger = LoggerFactory.getLogger(DeployPostVerficationRemoteScriptExecutor.class); + + @Autowired + RemoteScriptExecutionService remoteScriptExecutionService; + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + public void execute(DelegateExecution ctx) throws Exception { + String remotserver=(String)ctx.getVariable("remotserver"); + int portnumner=(Integer)ctx.getVariable("port"); + String username=(String)ctx.getVariable("username"); + String password=(String)ctx.getVariable("password"); + String filename=(String)ctx.getVariable("postverificationscript"); + String fileparams=(String)ctx.getVariable("postverificationScriptparams"); + String srcdir=(String)ctx.getVariable("srcdir"); + String destdir=(String)ctx.getVariable("destdir"); + String sitename=(String)ctx.getVariable("sitename"); + + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","inprogress",sitename,null,null,null)); + logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}", + remotserver,portnumner,username,password,filename,fileparams,srcdir,destdir); + + String command="sh " +destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); + logger.debug("Execution command {}",command); + remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,srcdir,destdir,command); + + + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteDeploymentVerificationDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteDeploymentVerificationDelegate.java index df9e36c..49f98b4 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteDeploymentVerificationDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteDeploymentVerificationDelegate.java @@ -1,77 +1,77 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.RemoteDeploymentVerificationService; - - - -@Component -public class DeployRemoteDeploymentVerificationDelegate implements JavaDelegate { - - private static Logger logger = LoggerFactory.getLogger(DeployRemoteDeploymentVerificationDelegate.class); - - @Autowired - RemoteDeploymentVerificationService remotedeploymentVerificationService; - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - - public void execute(DelegateExecution ctx) throws Exception { - - try { - String verifierFilename=(String)ctx.getVariable("verifier"); - int waittime=(Integer)ctx.getVariable("waittime"); - int iterations=(Integer)ctx.getVariable("iterations"); - String remotserver=(String)ctx.getVariable("remotserver"); - int portnumner=(Integer)ctx.getVariable("port"); - String username=(String)ctx.getVariable("username"); - String password=(String)ctx.getVariable("password"); - String srcdir=(String)ctx.getVariable("srcdir"); - String destdir=(String)ctx.getVariable("destdir"); - String filepparams=(String)ctx.getVariable("verifierfileparams"); - String sitename=(String)ctx.getVariable("sitename"); - - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started", sitename,null,null,null)); - - logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} , waittime : {},No of iterations :{}", - remotserver,portnumner,username,password,verifierFilename,srcdir,destdir,waittime,iterations); - - String command="sh " +destdir+"/"+verifierFilename+" "+(filepparams!=null?filepparams.replaceAll(",", " "):" "); - logger.debug("Execution command {}",command); - remotedeploymentVerificationService.executeScript(remotserver,username,password,portnumner,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command); - }catch(TaskExecutorException ex) { - throw ex; - } - - - } - -} - +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.RemoteDeploymentVerificationService; + + + +@Component +public class DeployRemoteDeploymentVerificationDelegate implements JavaDelegate { + + private static Logger logger = LoggerFactory.getLogger(DeployRemoteDeploymentVerificationDelegate.class); + + @Autowired + RemoteDeploymentVerificationService remotedeploymentVerificationService; + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + + public void execute(DelegateExecution ctx) throws Exception { + + try { + String verifierFilename=(String)ctx.getVariable("verifier"); + int waittime=(Integer)ctx.getVariable("waittime"); + int iterations=(Integer)ctx.getVariable("iterations"); + String remotserver=(String)ctx.getVariable("remotserver"); + int portnumner=(Integer)ctx.getVariable("port"); + String username=(String)ctx.getVariable("username"); + String password=(String)ctx.getVariable("password"); + String srcdir=(String)ctx.getVariable("srcdir"); + String destdir=(String)ctx.getVariable("destdir"); + String filepparams=(String)ctx.getVariable("verifierfileparams"); + String sitename=(String)ctx.getVariable("sitename"); + + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started", sitename,null,null,null)); + + logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} , waittime : {},No of iterations :{}", + remotserver,portnumner,username,password,verifierFilename,srcdir,destdir,waittime,iterations); + + String command="sh " +destdir+"/"+verifierFilename+" "+(filepparams!=null?filepparams.replaceAll(",", " "):" "); + logger.debug("Execution command {}",command); + remotedeploymentVerificationService.executeScript(remotserver,username,password,portnumner,verifierFilename,filepparams,srcdir,destdir,waittime,iterations,command); + }catch(TaskExecutorException ex) { + throw ex; + } + + + } + +} + diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteScriptExecutorTaskDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteScriptExecutorTaskDelegate.java index 96f4b4a..e68ae98 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteScriptExecutorTaskDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/DeployRemoteScriptExecutorTaskDelegate.java @@ -1,65 +1,65 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.RemoteScriptExecutionService; - - - -@Component -public class DeployRemoteScriptExecutorTaskDelegate implements JavaDelegate { - - - - private static Logger logger = LoggerFactory.getLogger(DeployRemoteScriptExecutorTaskDelegate.class); - - @Autowired - RemoteScriptExecutionService remoteScriptExecutionService; - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - public void execute(DelegateExecution ctx) throws Exception { - String remotserver=(String)ctx.getVariable("remotserver"); - int portnumner=(Integer)ctx.getVariable("port"); - String username=(String)ctx.getVariable("username"); - String password=(String)ctx.getVariable("password"); - String filename=(String)ctx.getVariable("filename"); - String fileparams=(String)ctx.getVariable("fileparams"); - String srcdir=(String)ctx.getVariable("srcdir"); - String destdir=(String)ctx.getVariable("destdir"); - String sitename=(String)ctx.getVariable("sitename"); - - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "inprogress", "not started","not started", sitename,null,null,null)); - logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}", - remotserver,portnumner,username,password,filename,fileparams,srcdir,destdir); - - String command="sh " +destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); - logger.debug("Execution command {}",command); - remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,srcdir,destdir,command); - } - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.RemoteScriptExecutionService; + + + +@Component +public class DeployRemoteScriptExecutorTaskDelegate implements JavaDelegate { + + + + private static Logger logger = LoggerFactory.getLogger(DeployRemoteScriptExecutorTaskDelegate.class); + + @Autowired + RemoteScriptExecutionService remoteScriptExecutionService; + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + public void execute(DelegateExecution ctx) throws Exception { + String remotserver=(String)ctx.getVariable("remotserver"); + int portnumner=(Integer)ctx.getVariable("port"); + String username=(String)ctx.getVariable("username"); + String password=(String)ctx.getVariable("password"); + String filename=(String)ctx.getVariable("filename"); + String fileparams=(String)ctx.getVariable("fileparams"); + String srcdir=(String)ctx.getVariable("srcdir"); + String destdir=(String)ctx.getVariable("destdir"); + String sitename=(String)ctx.getVariable("sitename"); + + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "inprogress", "not started","not started", sitename,null,null,null)); + logger.debug("task execution started remotserver {} , portnumner {},username {}, password {},filename : {} ,fileparams={},src dir={},dest dir={}", + remotserver,portnumner,username,password,filename,fileparams,srcdir,destdir); + + String command="sh " +destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); + logger.debug("Execution command {}",command); + remoteScriptExecutionService.executeRemoteScript(remotserver,username,password,portnumner,filename,fileparams,srcdir,destdir,command); + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/DeployScriptExecutorTaskDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/DeployScriptExecutorTaskDelegate.java index a708b8a..a86bcf4 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/DeployScriptExecutorTaskDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/DeployScriptExecutorTaskDelegate.java @@ -1,50 +1,50 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.ScriptExecutionService; - - -@Component -public class DeployScriptExecutorTaskDelegate implements JavaDelegate { - - private static Logger logger = LoggerFactory.getLogger(DeployScriptExecutorTaskDelegate.class); - - @Autowired - ScriptExecutionService scriptExecutionService; - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - public void execute(DelegateExecution ctx) throws Exception { - - String filepath=(String)ctx.getVariable("filepath"); - logger.debug("task execution started :"+filepath); - scriptExecutionService.executeScript(filepath); - - } - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.ScriptExecutionService; + + +@Component +public class DeployScriptExecutorTaskDelegate implements JavaDelegate { + + private static Logger logger = LoggerFactory.getLogger(DeployScriptExecutorTaskDelegate.class); + + @Autowired + ScriptExecutionService scriptExecutionService; + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + public void execute(DelegateExecution ctx) throws Exception { + + String filepath=(String)ctx.getVariable("filepath"); + logger.debug("task execution started :"+filepath); + scriptExecutionService.executeScript(filepath); + + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/DeploymentVerificationDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/DeploymentVerificationDelegate.java index dda3d73..102b320 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/DeploymentVerificationDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/DeploymentVerificationDelegate.java @@ -1,66 +1,66 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.DeploymentVerificationService; - - - -@Component -public class DeploymentVerificationDelegate implements JavaDelegate { - - private static Logger logger = LoggerFactory.getLogger(DeploymentVerificationDelegate.class); - - @Autowired - DeploymentVerificationService deploymentVerificationService; - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - public void execute(DelegateExecution ctx) throws Exception { - - String sitename=(String)ctx.getVariable("sitename"); - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started",sitename,null,null,null)); - - try { - String verifierFilepath=(String)ctx.getVariable("verifier"); - int waittime=(Integer)ctx.getVariable("waittime"); - int iterations=(Integer)ctx.getVariable("iterations"); - - - logger.debug("task execution started filename : {} , waittime : {},No of iterations :{}",verifierFilepath,waittime,iterations); - deploymentVerificationService.executeScript(verifierFilepath,waittime,iterations); - }catch(TaskExecutorException ex) { - throw ex; - } - - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","not started",sitename,null,null,null)); - } - -} - +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.DeploymentVerificationService; + + + +@Component +public class DeploymentVerificationDelegate implements JavaDelegate { + + private static Logger logger = LoggerFactory.getLogger(DeploymentVerificationDelegate.class); + + @Autowired + DeploymentVerificationService deploymentVerificationService; + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + public void execute(DelegateExecution ctx) throws Exception { + + String sitename=(String)ctx.getVariable("sitename"); + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "inprogress","not started",sitename,null,null,null)); + + try { + String verifierFilepath=(String)ctx.getVariable("verifier"); + int waittime=(Integer)ctx.getVariable("waittime"); + int iterations=(Integer)ctx.getVariable("iterations"); + + + logger.debug("task execution started filename : {} , waittime : {},No of iterations :{}",verifierFilepath,waittime,iterations); + deploymentVerificationService.executeScript(verifierFilepath,waittime,iterations); + }catch(TaskExecutorException ex) { + throw ex; + } + + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "completed", "completed","not started",sitename,null,null,null)); + } + +} + diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/TempestScriptExecutorTaskDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/TempestScriptExecutorTaskDelegate.java index 9671642..115334e 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/TempestScriptExecutorTaskDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/TempestScriptExecutorTaskDelegate.java @@ -39,9 +39,11 @@ public class TempestScriptExecutorTaskDelegate implements JavaDelegate { ScriptExecutionService scriptExecutionService; public void execute(DelegateExecution ctx) throws Exception { - String filepath=(String)ctx.getVariable("filepath"); - logger.debug("task execution started :"+filepath); - scriptExecutionService.executeScript(filepath); + String filename=(String)ctx.getVariable("ScpScriptFilepath"); + String dir=(String)ctx.getVariable("scpsrcdir"); + + logger.debug("task execution started filename:{},srcdir:{} :",filename,dir); + scriptExecutionService.executeCDScript(dir,filename); } } diff --git a/akraino/src/main/java/com/akraino/bpm/delegate/WinScpScriptDelegate.java b/akraino/src/main/java/com/akraino/bpm/delegate/WinScpScriptDelegate.java index 8145f66..e8a165d 100644 --- a/akraino/src/main/java/com/akraino/bpm/delegate/WinScpScriptDelegate.java +++ b/akraino/src/main/java/com/akraino/bpm/delegate/WinScpScriptDelegate.java @@ -1,54 +1,56 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.delegate; - - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; -import com.akraino.bpm.service.ScriptExecutionService; - - -@Component -public class WinScpScriptDelegate implements JavaDelegate { - - private static Logger logger = LoggerFactory.getLogger(WinScpScriptDelegate.class); - - @Autowired - DeployResponseSenderService deployResponseSenderService; - - @Autowired - ScriptExecutionService scriptExecutionService; - - public void execute(DelegateExecution ctx) throws Exception { - - String sitename=(String)ctx.getVariable("sitename"); - deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "inprogress", "not started","not started",sitename,null,null,null)); - String filepath=(String)ctx.getVariable("ScpScriptFilepath"); - logger.debug("Win SCP task execution started :"+filepath); - scriptExecutionService.executeScript(filepath); - - - } - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.delegate; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.delegate.JavaDelegate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; +import com.akraino.bpm.service.ScriptExecutionService; + + +@Component +public class WinScpScriptDelegate implements JavaDelegate { + + private static Logger logger = LoggerFactory.getLogger(WinScpScriptDelegate.class); + + @Autowired + DeployResponseSenderService deployResponseSenderService; + + @Autowired + ScriptExecutionService scriptExecutionService; + + public void execute(DelegateExecution ctx) throws Exception { + + String sitename=(String)ctx.getVariable("sitename"); + deployResponseSenderService.sendResponse(new BuildResponse("completed", "completed", "inprogress", "not started","not started",sitename,null,null,null)); + String filename=(String)ctx.getVariable("ScpScriptFilepath"); + String dir=(String)ctx.getVariable("scpsrcdir"); + logger.debug("Win SCP task execution started filename:{},directory:{}",filename,dir); + + scriptExecutionService.executeCDScript(dir, filename); + + + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/model/Airship.java b/akraino/src/main/java/com/akraino/bpm/model/Airship.java index 158d635..6f35a1b 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Airship.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Airship.java @@ -1,128 +1,128 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Airship { - - private String sitename; - private String filepath; - private String fileparams; - private String winscpdir; - private String winscpfilepath; - private String winscpfileparams; - private String remotserver; - private int port; - private String username; - private String password; - private String destdir; - private String remotefilename; - private String remotefileparams; - - - public String getFilepath() { - return filepath; - } - public void setFilepath(String filepath) { - this.filepath = filepath; - } - public String getFileparams() { - return fileparams; - } - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - public String getWinscpfilepath() { - return winscpfilepath; - } - public void setWinscpfilepath(String winscpfilepath) { - this.winscpfilepath = winscpfilepath; - } - public String getWinscpfileparams() { - return winscpfileparams; - } - public void setWinscpfileparams(String winscpfileparams) { - this.winscpfileparams = winscpfileparams; - } - public String getDestdir() { - return destdir; - } - public void setDestdir(String destdir) { - this.destdir = destdir; - } - - public String getRemotserver() { - return remotserver; - } - public void setRemotserver(String remotserver) { - this.remotserver = remotserver; - } - public int getPort() { - return port; - } - public void setPort(int port) { - this.port = port; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - public String getRemotefilename() { - return remotefilename; - } - public void setRemotefilename(String remotefilename) { - this.remotefilename = remotefilename; - } - public String getRemotefileparams() { - return remotefileparams; - } - public void setRemotefileparams(String remotefileparams) { - this.remotefileparams = remotefileparams; - } - public String getWinscpdir() { - return winscpdir; - } - public void setWinscpdir(String winscpdir) { - this.winscpdir = winscpdir; - } - public String getSitename() { - return sitename; - } - public void setSitename(String sitename) { - this.sitename = sitename; - } - @Override - public String toString() { - return "Airship [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams - + ", winscpdir=" + winscpdir + ", winscpfilepath=" + winscpfilepath + ", winscpfileparams=" - + winscpfileparams + ", remotserver=" + remotserver + ", port=" + port + ", username=" + username - + ", password=" + password + ", destdir=" + destdir + ", remotefilename=" + remotefilename - + ", remotefileparams=" + remotefileparams + "]"; - } - - - - - - } +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Airship { + + private String sitename; + private String filepath; + private String fileparams; + private String winscpdir; + private String winscpfilepath; + private String winscpfileparams; + private String remotserver; + private int port; + private String username; + private String password; + private String destdir; + private String remotefilename; + private String remotefileparams; + + + public String getFilepath() { + return filepath; + } + public void setFilepath(String filepath) { + this.filepath = filepath; + } + public String getFileparams() { + return fileparams; + } + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + public String getWinscpfilepath() { + return winscpfilepath; + } + public void setWinscpfilepath(String winscpfilepath) { + this.winscpfilepath = winscpfilepath; + } + public String getWinscpfileparams() { + return winscpfileparams; + } + public void setWinscpfileparams(String winscpfileparams) { + this.winscpfileparams = winscpfileparams; + } + public String getDestdir() { + return destdir; + } + public void setDestdir(String destdir) { + this.destdir = destdir; + } + + public String getRemotserver() { + return remotserver; + } + public void setRemotserver(String remotserver) { + this.remotserver = remotserver; + } + public int getPort() { + return port; + } + public void setPort(int port) { + this.port = port; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + public String getRemotefilename() { + return remotefilename; + } + public void setRemotefilename(String remotefilename) { + this.remotefilename = remotefilename; + } + public String getRemotefileparams() { + return remotefileparams; + } + public void setRemotefileparams(String remotefileparams) { + this.remotefileparams = remotefileparams; + } + public String getWinscpdir() { + return winscpdir; + } + public void setWinscpdir(String winscpdir) { + this.winscpdir = winscpdir; + } + public String getSitename() { + return sitename; + } + public void setSitename(String sitename) { + this.sitename = sitename; + } + @Override + public String toString() { + return "Airship [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams + + ", winscpdir=" + winscpdir + ", winscpfilepath=" + winscpfilepath + ", winscpfileparams=" + + winscpfileparams + ", remotserver=" + remotserver + ", port=" + port + ", username=" + username + + ", password=" + password + ", destdir=" + destdir + ", remotefilename=" + remotefilename + + ", remotefileparams=" + remotefileparams + "]"; + } + + + + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/model/Apache.java b/akraino/src/main/java/com/akraino/bpm/model/Apache.java index 78ed8dc..036e748 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Apache.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Apache.java @@ -1,208 +1,208 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Apache { - - private String sitename; - private String remoteserver; - private String username; - private String password; - private int portnumber; - private String srcdir; - private String destdir; - private String filename; - private String fileparams; - private String deploymentverifier; - private String verifierparams; - int noofiterations; - int waittime; - String filetrasferscript; - String filetransferparams; - - - public String getSrcdir() { - return srcdir; - } - - - public void setSrcdir(String srcdir) { - this.srcdir = srcdir; - } - - - public String getDestdir() { - return destdir; - } - - - public void setDestdir(String destdir) { - this.destdir = destdir; - } - - - public String getRemoteserver() { - return remoteserver; - } - - - public void setRemoteserver(String remoteserver) { - this.remoteserver = remoteserver; - } - - - public String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - public int getPortnumber() { - return portnumber; - } - - - public void setPortnumber(int portnumber) { - this.portnumber = portnumber; - } - - - - - - public String getFilename() { - return filename; - } - - - public void setFilename(String filename) { - this.filename = filename; - } - - - public String getFileparams() { - return fileparams; - } - - - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - - - public String getDeploymentverifier() { - return deploymentverifier; - } - - - public void setDeploymentverifier(String deploymentverifier) { - this.deploymentverifier = deploymentverifier; - } - - - public int getNoofiterations() { - return noofiterations; - } - - - public void setNoofiterations(int noofiterations) { - this.noofiterations = noofiterations; - } - - - public int getWaittime() { - return waittime; - } - - - public void setWaittime(int waittime) { - this.waittime = waittime; - } - - - - - public String getVerifierparams() { - return verifierparams; - } - - - public void setVerifierparams(String verifierparams) { - this.verifierparams = verifierparams; - } - - - public String getFiletrasferscript() { - return filetrasferscript; - } - - - public void setFiletrasferscript(String filetrasferscript) { - this.filetrasferscript = filetrasferscript; - } - - - public String getFiletransferparams() { - return filetransferparams; - } - - - public void setFiletransferparams(String filetransferparams) { - this.filetransferparams = filetransferparams; - } - - - public String getSitename() { - return sitename; - } - - - public void setSitename(String sitename) { - this.sitename = sitename; - } - - - @Override - public String toString() { - return "Apache [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username - + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" - + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" - + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations - + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" - + filetransferparams + "]"; - } - - - - - - - } +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Apache { + + private String sitename; + private String remoteserver; + private String username; + private String password; + private int portnumber; + private String srcdir; + private String destdir; + private String filename; + private String fileparams; + private String deploymentverifier; + private String verifierparams; + int noofiterations; + int waittime; + String filetrasferscript; + String filetransferparams; + + + public String getSrcdir() { + return srcdir; + } + + + public void setSrcdir(String srcdir) { + this.srcdir = srcdir; + } + + + public String getDestdir() { + return destdir; + } + + + public void setDestdir(String destdir) { + this.destdir = destdir; + } + + + public String getRemoteserver() { + return remoteserver; + } + + + public void setRemoteserver(String remoteserver) { + this.remoteserver = remoteserver; + } + + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public int getPortnumber() { + return portnumber; + } + + + public void setPortnumber(int portnumber) { + this.portnumber = portnumber; + } + + + + + + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public String getFileparams() { + return fileparams; + } + + + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + + + public String getDeploymentverifier() { + return deploymentverifier; + } + + + public void setDeploymentverifier(String deploymentverifier) { + this.deploymentverifier = deploymentverifier; + } + + + public int getNoofiterations() { + return noofiterations; + } + + + public void setNoofiterations(int noofiterations) { + this.noofiterations = noofiterations; + } + + + public int getWaittime() { + return waittime; + } + + + public void setWaittime(int waittime) { + this.waittime = waittime; + } + + + + + public String getVerifierparams() { + return verifierparams; + } + + + public void setVerifierparams(String verifierparams) { + this.verifierparams = verifierparams; + } + + + public String getFiletrasferscript() { + return filetrasferscript; + } + + + public void setFiletrasferscript(String filetrasferscript) { + this.filetrasferscript = filetrasferscript; + } + + + public String getFiletransferparams() { + return filetransferparams; + } + + + public void setFiletransferparams(String filetransferparams) { + this.filetransferparams = filetransferparams; + } + + + public String getSitename() { + return sitename; + } + + + public void setSitename(String sitename) { + this.sitename = sitename; + } + + + @Override + public String toString() { + return "Apache [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username + + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" + + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" + + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations + + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" + + filetransferparams + "]"; + } + + + + + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/model/Build.java b/akraino/src/main/java/com/akraino/bpm/model/Build.java index 6c2c58b..03c4b18 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Build.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Build.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Build { - - private String sitename; - private String filepath; - private String fileparams; - private String targetfolder; - - - - - public String getSitename() { - return sitename; - } - public void setSitename(String sitename) { - this.sitename = sitename; - } - public String getFilepath() { - return filepath; - } - public void setFilepath(String filepath) { - this.filepath = filepath; - } - public String getFileparams() { - return fileparams; - } - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - public String getTargetfolder() { - return targetfolder; - } - public void setTargetfolder(String targetfolder) { - this.targetfolder = targetfolder; - } - - @Override - public String toString() { - return "Build [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams - + ", targetfolder=" + targetfolder + "]"; - } - - - - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Build { + + private String sitename; + private String filepath; + private String fileparams; + private String targetfolder; + + + + + public String getSitename() { + return sitename; + } + public void setSitename(String sitename) { + this.sitename = sitename; + } + public String getFilepath() { + return filepath; + } + public void setFilepath(String filepath) { + this.filepath = filepath; + } + public String getFileparams() { + return fileparams; + } + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + public String getTargetfolder() { + return targetfolder; + } + public void setTargetfolder(String targetfolder) { + this.targetfolder = targetfolder; + } + + @Override + public String toString() { + return "Build [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams + + ", targetfolder=" + targetfolder + "]"; + } + + + + +} diff --git a/akraino/src/main/java/com/akraino/bpm/model/BuildResponse.java b/akraino/src/main/java/com/akraino/bpm/model/BuildResponse.java index c81596a..c463fec 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/BuildResponse.java +++ b/akraino/src/main/java/com/akraino/bpm/model/BuildResponse.java @@ -1,135 +1,146 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class BuildResponse { - - private String siteName; - private String buildStatus; - private String createTarStatus; - private String genesisNodeStatus; - private String deployToolsStatus; - private String deployStatus; - private String onapStatus; - private String vCDNStatus; - private String tempestStatus; - - public BuildResponse(String buildStatus, String createTarStatus, String genesisNodeStatus, String deployToolsStatus,String deployStatus, - String siteName,String onapStatus,String vCDNStatus,String tempestStatus) { - super(); - this.buildStatus = buildStatus; - this.createTarStatus = createTarStatus; - this.genesisNodeStatus = genesisNodeStatus; - this.deployToolsStatus = deployToolsStatus; - this.deployStatus=deployStatus; - this.siteName = siteName; - this.onapStatus=onapStatus; - this.vCDNStatus=vCDNStatus; - this.tempestStatus=tempestStatus; - } - - - public String getBuildStatus() { - return buildStatus; - } - - - public void setBuildStatus(String buildStatus) { - this.buildStatus = buildStatus; - } - - public String getCreateTarStatus() { - return createTarStatus; - } - - public void setCreateTarStatus(String createTarStatus) { - this.createTarStatus = createTarStatus; - } - - - public String getGenesisNodeStatus() { - return genesisNodeStatus; - } - - - public void setGenesisNodeStatus(String genesisNodeStatus) { - this.genesisNodeStatus = genesisNodeStatus; - } - - - public String getDeployToolsStatus() { - return deployToolsStatus; - } - - - public void setDeployToolsStatus(String deployToolsStatus) { - this.deployToolsStatus = deployToolsStatus; - } - - - public String getSiteName() { - return siteName; - } - - public void setSiteName(String siteName) { - this.siteName = siteName; - } - - - - - public String getDeployStatus() { - return deployStatus; - } - - - public void setDeployStatus(String deployStatus) { - this.deployStatus = deployStatus; - } - - - public String getOnapStatus() { - return onapStatus; - } - - - public void setOnapStatus(String onapStatus) { - this.onapStatus = onapStatus; - } - - - public String getvCDNStatus() { - return vCDNStatus; - } - - - public void setvCDNStatus(String vCDNStatus) { - this.vCDNStatus = vCDNStatus; - } - - - public String getTempestStatus() { - return tempestStatus; - } - - - public void setTempestStatus(String tempestStatus) { - this.tempestStatus = tempestStatus; - } - - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class BuildResponse { + + private String siteName; + private String buildStatus; + private String createTarStatus; + private String genesisNodeStatus; + private String deployToolsStatus; + private String deployStatus; + private String onapStatus; + private String vCDNStatus; + private String tempestStatus; + + public BuildResponse(String buildStatus, String createTarStatus, String genesisNodeStatus, String deployToolsStatus,String deployStatus, + String siteName,String onapStatus,String vCDNStatus,String tempestStatus) { + super(); + this.buildStatus = buildStatus; + this.createTarStatus = createTarStatus; + this.genesisNodeStatus = genesisNodeStatus; + this.deployToolsStatus = deployToolsStatus; + this.deployStatus=deployStatus; + this.siteName = siteName; + this.onapStatus=onapStatus; + this.vCDNStatus=vCDNStatus; + this.tempestStatus=tempestStatus; + } + + + public String getBuildStatus() { + return buildStatus; + } + + + public void setBuildStatus(String buildStatus) { + this.buildStatus = buildStatus; + } + + public String getCreateTarStatus() { + return createTarStatus; + } + + public void setCreateTarStatus(String createTarStatus) { + this.createTarStatus = createTarStatus; + } + + + public String getGenesisNodeStatus() { + return genesisNodeStatus; + } + + + public void setGenesisNodeStatus(String genesisNodeStatus) { + this.genesisNodeStatus = genesisNodeStatus; + } + + + public String getDeployToolsStatus() { + return deployToolsStatus; + } + + + public void setDeployToolsStatus(String deployToolsStatus) { + this.deployToolsStatus = deployToolsStatus; + } + + + public String getSiteName() { + return siteName; + } + + public void setSiteName(String siteName) { + this.siteName = siteName; + } + + + + + public String getDeployStatus() { + return deployStatus; + } + + + public void setDeployStatus(String deployStatus) { + this.deployStatus = deployStatus; + } + + + public String getOnapStatus() { + return onapStatus; + } + + + public void setOnapStatus(String onapStatus) { + this.onapStatus = onapStatus; + } + + + public String getvCDNStatus() { + return vCDNStatus; + } + + + public void setvCDNStatus(String vCDNStatus) { + this.vCDNStatus = vCDNStatus; + } + + + public String getTempestStatus() { + return tempestStatus; + } + + + public void setTempestStatus(String tempestStatus) { + this.tempestStatus = tempestStatus; + } + + + @Override + public String toString() { + return "BuildResponse [siteName=" + siteName + ", buildStatus=" + buildStatus + ", createTarStatus=" + + createTarStatus + ", genesisNodeStatus=" + genesisNodeStatus + ", deployToolsStatus=" + + deployToolsStatus + ", deployStatus=" + deployStatus + ", onapStatus=" + onapStatus + ", vCDNStatus=" + + vCDNStatus + ", tempestStatus=" + tempestStatus + "]"; + } + + + + +} diff --git a/akraino/src/main/java/com/akraino/bpm/model/Deploy.java b/akraino/src/main/java/com/akraino/bpm/model/Deploy.java index fc0b7ff..5a5bc59 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Deploy.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Deploy.java @@ -1,178 +1,178 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Deploy { - - private String sitename; - private String filepath; - private String fileparams; - private String winscpfilepath; - private String winscpfileparams; - private String remotserver; - private int port; - private String username; - private String password; - private String destdir; - private String remotefilename; - private String remotefileparams; - private String deploymentverifier; - private String deploymentverifierfileparams; - int noofiterations; - int waittime; - String postverificationscript; - String postverificationScriptparams; - - - - - public String getSitename() { - return sitename; - } - public void setSitename(String sitename) { - this.sitename = sitename; - } - public String getFilepath() { - return filepath; - } - public void setFilepath(String filepath) { - this.filepath = filepath; - } - public String getFileparams() { - return fileparams; - } - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - public String getWinscpfilepath() { - return winscpfilepath; - } - public void setWinscpfilepath(String winscpfilepath) { - this.winscpfilepath = winscpfilepath; - } - public String getWinscpfileparams() { - return winscpfileparams; - } - public void setWinscpfileparams(String winscpfileparams) { - this.winscpfileparams = winscpfileparams; - } - public String getDestdir() { - return destdir; - } - public void setDestdir(String destdir) { - this.destdir = destdir; - } - - - - public String getRemotserver() { - return remotserver; - } - public void setRemotserver(String remotserver) { - this.remotserver = remotserver; - } - public int getPort() { - return port; - } - public void setPort(int port) { - this.port = port; - } - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - public String getRemotefilename() { - return remotefilename; - } - public void setRemotefilename(String remotefilename) { - this.remotefilename = remotefilename; - } - public String getRemotefileparams() { - return remotefileparams; - } - public void setRemotefileparams(String remotefileparams) { - this.remotefileparams = remotefileparams; - } - public String getDeploymentverifier() { - return deploymentverifier; - } - public void setDeploymentverifier(String deploymentverifier) { - this.deploymentverifier = deploymentverifier; - } - public int getNoofiterations() { - return noofiterations; - } - public void setNoofiterations(int noofiterations) { - this.noofiterations = noofiterations; - } - public int getWaittime() { - return waittime; - } - public void setWaittime(int waittime) { - this.waittime = waittime; - } - - public String getDeploymentverifierfileparams() { - return deploymentverifierfileparams; - } - - public void setDeploymentverifierfileparams(String deploymentverifierfileparams) { - this.deploymentverifierfileparams = deploymentverifierfileparams; - } - - public String getPostverificationscript() { - return postverificationscript; - } - - public void setPostverificationscript(String postverificationscript) { - this.postverificationscript = postverificationscript; - } - - public String getPostverificationScriptparams() { - return postverificationScriptparams; - } - - - public void setPostverificationScriptparams(String postverificationScriptparams) { - this.postverificationScriptparams = postverificationScriptparams; - } - - - @Override - public String toString() { - return "Deploy [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams - + ", winscpfilepath=" + winscpfilepath + ", winscpfileparams=" + winscpfileparams + ", remotserver=" - + remotserver + ", port=" + port + ", username=" + username + ", password=" + password + ", destdir=" - + destdir + ", remotefilename=" + remotefilename + ", remotefileparams=" + remotefileparams - + ", deploymentverifier=" + deploymentverifier + ", deploymentverifierfileparams=" - + deploymentverifierfileparams + ", noofiterations=" + noofiterations + ", waittime=" + waittime - + ", postverificationscript=" + postverificationscript + ", postverificationScriptparams=" - + postverificationScriptparams + "]"; - } - - - - - } +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Deploy { + + private String sitename; + private String filepath; + private String fileparams; + private String winscpfilepath; + private String winscpfileparams; + private String remotserver; + private int port; + private String username; + private String password; + private String destdir; + private String remotefilename; + private String remotefileparams; + private String deploymentverifier; + private String deploymentverifierfileparams; + int noofiterations; + int waittime; + String postverificationscript; + String postverificationScriptparams; + + + + + public String getSitename() { + return sitename; + } + public void setSitename(String sitename) { + this.sitename = sitename; + } + public String getFilepath() { + return filepath; + } + public void setFilepath(String filepath) { + this.filepath = filepath; + } + public String getFileparams() { + return fileparams; + } + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + public String getWinscpfilepath() { + return winscpfilepath; + } + public void setWinscpfilepath(String winscpfilepath) { + this.winscpfilepath = winscpfilepath; + } + public String getWinscpfileparams() { + return winscpfileparams; + } + public void setWinscpfileparams(String winscpfileparams) { + this.winscpfileparams = winscpfileparams; + } + public String getDestdir() { + return destdir; + } + public void setDestdir(String destdir) { + this.destdir = destdir; + } + + + + public String getRemotserver() { + return remotserver; + } + public void setRemotserver(String remotserver) { + this.remotserver = remotserver; + } + public int getPort() { + return port; + } + public void setPort(int port) { + this.port = port; + } + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + public String getRemotefilename() { + return remotefilename; + } + public void setRemotefilename(String remotefilename) { + this.remotefilename = remotefilename; + } + public String getRemotefileparams() { + return remotefileparams; + } + public void setRemotefileparams(String remotefileparams) { + this.remotefileparams = remotefileparams; + } + public String getDeploymentverifier() { + return deploymentverifier; + } + public void setDeploymentverifier(String deploymentverifier) { + this.deploymentverifier = deploymentverifier; + } + public int getNoofiterations() { + return noofiterations; + } + public void setNoofiterations(int noofiterations) { + this.noofiterations = noofiterations; + } + public int getWaittime() { + return waittime; + } + public void setWaittime(int waittime) { + this.waittime = waittime; + } + + public String getDeploymentverifierfileparams() { + return deploymentverifierfileparams; + } + + public void setDeploymentverifierfileparams(String deploymentverifierfileparams) { + this.deploymentverifierfileparams = deploymentverifierfileparams; + } + + public String getPostverificationscript() { + return postverificationscript; + } + + public void setPostverificationscript(String postverificationscript) { + this.postverificationscript = postverificationscript; + } + + public String getPostverificationScriptparams() { + return postverificationScriptparams; + } + + + public void setPostverificationScriptparams(String postverificationScriptparams) { + this.postverificationScriptparams = postverificationScriptparams; + } + + + @Override + public String toString() { + return "Deploy [sitename=" + sitename + ", filepath=" + filepath + ", fileparams=" + fileparams + + ", winscpfilepath=" + winscpfilepath + ", winscpfileparams=" + winscpfileparams + ", remotserver=" + + remotserver + ", port=" + port + ", username=" + username + ", password=" + password + ", destdir=" + + destdir + ", remotefilename=" + remotefilename + ", remotefileparams=" + remotefileparams + + ", deploymentverifier=" + deploymentverifier + ", deploymentverifierfileparams=" + + deploymentverifierfileparams + ", noofiterations=" + noofiterations + ", waittime=" + waittime + + ", postverificationscript=" + postverificationscript + ", postverificationScriptparams=" + + postverificationScriptparams + "]"; + } + + + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/model/Onap.java b/akraino/src/main/java/com/akraino/bpm/model/Onap.java index 9a4b246..65cd159 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Onap.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Onap.java @@ -1,210 +1,210 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Onap { - - private String sitename; - private String remoteserver; - private String username; - private String password; - private int portnumber; - private String srcdir; - private String destdir; - private String filename; - private String fileparams; - private String deploymentverifier; - private String verifierparams; - int noofiterations; - int waittime; - String filetrasferscript; - String filetransferparams; - - - - - - - public String getSitename() { - return sitename; - } - - - public void setSitename(String sitename) { - this.sitename = sitename; - } - - - public String getSrcdir() { - return srcdir; - } - - - public void setSrcdir(String srcdir) { - this.srcdir = srcdir; - } - - - public String getDestdir() { - return destdir; - } - - - public void setDestdir(String destdir) { - this.destdir = destdir; - } - - - public String getRemoteserver() { - return remoteserver; - } - - - public void setRemoteserver(String remoteserver) { - this.remoteserver = remoteserver; - } - - - public String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - public int getPortnumber() { - return portnumber; - } - - - public void setPortnumber(int portnumber) { - this.portnumber = portnumber; - } - - - - - - public String getFilename() { - return filename; - } - - - public void setFilename(String filename) { - this.filename = filename; - } - - - public String getFileparams() { - return fileparams; - } - - - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - - - public String getDeploymentverifier() { - return deploymentverifier; - } - - - public void setDeploymentverifier(String deploymentverifier) { - this.deploymentverifier = deploymentverifier; - } - - - public int getNoofiterations() { - return noofiterations; - } - - - public void setNoofiterations(int noofiterations) { - this.noofiterations = noofiterations; - } - - - public int getWaittime() { - return waittime; - } - - - public void setWaittime(int waittime) { - this.waittime = waittime; - } - - - - - public String getVerifierparams() { - return verifierparams; - } - - - public void setVerifierparams(String verifierparams) { - this.verifierparams = verifierparams; - } - - - public String getFiletrasferscript() { - return filetrasferscript; - } - - - public void setFiletrasferscript(String filetrasferscript) { - this.filetrasferscript = filetrasferscript; - } - - - - public String getFiletransferparams() { - return filetransferparams; - } - - - public void setFiletransferparams(String filetransferparams) { - this.filetransferparams = filetransferparams; - } - - - @Override - public String toString() { - return "Onap [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username - + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" - + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" - + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations - + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" - + filetransferparams + "]"; - } - - - - } +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Onap { + + private String sitename; + private String remoteserver; + private String username; + private String password; + private int portnumber; + private String srcdir; + private String destdir; + private String filename; + private String fileparams; + private String deploymentverifier; + private String verifierparams; + int noofiterations; + int waittime; + String filetrasferscript; + String filetransferparams; + + + + + + + public String getSitename() { + return sitename; + } + + + public void setSitename(String sitename) { + this.sitename = sitename; + } + + + public String getSrcdir() { + return srcdir; + } + + + public void setSrcdir(String srcdir) { + this.srcdir = srcdir; + } + + + public String getDestdir() { + return destdir; + } + + + public void setDestdir(String destdir) { + this.destdir = destdir; + } + + + public String getRemoteserver() { + return remoteserver; + } + + + public void setRemoteserver(String remoteserver) { + this.remoteserver = remoteserver; + } + + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public int getPortnumber() { + return portnumber; + } + + + public void setPortnumber(int portnumber) { + this.portnumber = portnumber; + } + + + + + + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public String getFileparams() { + return fileparams; + } + + + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + + + public String getDeploymentverifier() { + return deploymentverifier; + } + + + public void setDeploymentverifier(String deploymentverifier) { + this.deploymentverifier = deploymentverifier; + } + + + public int getNoofiterations() { + return noofiterations; + } + + + public void setNoofiterations(int noofiterations) { + this.noofiterations = noofiterations; + } + + + public int getWaittime() { + return waittime; + } + + + public void setWaittime(int waittime) { + this.waittime = waittime; + } + + + + + public String getVerifierparams() { + return verifierparams; + } + + + public void setVerifierparams(String verifierparams) { + this.verifierparams = verifierparams; + } + + + public String getFiletrasferscript() { + return filetrasferscript; + } + + + public void setFiletrasferscript(String filetrasferscript) { + this.filetrasferscript = filetrasferscript; + } + + + + public String getFiletransferparams() { + return filetransferparams; + } + + + public void setFiletransferparams(String filetransferparams) { + this.filetransferparams = filetransferparams; + } + + + @Override + public String toString() { + return "Onap [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username + + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" + + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" + + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations + + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" + + filetransferparams + "]"; + } + + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/model/Tempest.java b/akraino/src/main/java/com/akraino/bpm/model/Tempest.java index 7f180c2..5d935df 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/Tempest.java +++ b/akraino/src/main/java/com/akraino/bpm/model/Tempest.java @@ -1,211 +1,211 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.model; - -public class Tempest { - - private String sitename; - private String remoteserver; - private String username; - private String password; - private int portnumber; - private String srcdir; - private String destdir; - private String filename; - private String fileparams; - private String deploymentverifier; - private String verifierparams; - int noofiterations; - int waittime; - String filetrasferscript; - String filetransferparams; - - - - - - public String getSitename() { - return sitename; - } - - - public void setSitename(String sitename) { - this.sitename = sitename; - } - - - public String getSrcdir() { - return srcdir; - } - - - public void setSrcdir(String srcdir) { - this.srcdir = srcdir; - } - - - public String getDestdir() { - return destdir; - } - - - public void setDestdir(String destdir) { - this.destdir = destdir; - } - - - public String getRemoteserver() { - return remoteserver; - } - - - public void setRemoteserver(String remoteserver) { - this.remoteserver = remoteserver; - } - - - public String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - public int getPortnumber() { - return portnumber; - } - - - public void setPortnumber(int portnumber) { - this.portnumber = portnumber; - } - - - - - - public String getFilename() { - return filename; - } - - - public void setFilename(String filename) { - this.filename = filename; - } - - - public String getFileparams() { - return fileparams; - } - - - public void setFileparams(String fileparams) { - this.fileparams = fileparams; - } - - - public String getDeploymentverifier() { - return deploymentverifier; - } - - - public void setDeploymentverifier(String deploymentverifier) { - this.deploymentverifier = deploymentverifier; - } - - - public int getNoofiterations() { - return noofiterations; - } - - - public void setNoofiterations(int noofiterations) { - this.noofiterations = noofiterations; - } - - - public int getWaittime() { - return waittime; - } - - - public void setWaittime(int waittime) { - this.waittime = waittime; - } - - - - - public String getVerifierparams() { - return verifierparams; - } - - - public void setVerifierparams(String verifierparams) { - this.verifierparams = verifierparams; - } - - - public String getFiletrasferscript() { - return filetrasferscript; - } - - - public void setFiletrasferscript(String filetrasferscript) { - this.filetrasferscript = filetrasferscript; - } - - - - - public String getFiletransferparams() { - return filetransferparams; - } - - - public void setFiletransferparams(String filetransferparams) { - this.filetransferparams = filetransferparams; - } - - - @Override - public String toString() { - return "Tempest [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username - + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" - + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" - + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations - + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" - + filetransferparams + "]"; - } - - - - - } +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.model; + +public class Tempest { + + private String sitename; + private String remoteserver; + private String username; + private String password; + private int portnumber; + private String srcdir; + private String destdir; + private String filename; + private String fileparams; + private String deploymentverifier; + private String verifierparams; + int noofiterations; + int waittime; + String filetrasferscript; + String filetransferparams; + + + + + + public String getSitename() { + return sitename; + } + + + public void setSitename(String sitename) { + this.sitename = sitename; + } + + + public String getSrcdir() { + return srcdir; + } + + + public void setSrcdir(String srcdir) { + this.srcdir = srcdir; + } + + + public String getDestdir() { + return destdir; + } + + + public void setDestdir(String destdir) { + this.destdir = destdir; + } + + + public String getRemoteserver() { + return remoteserver; + } + + + public void setRemoteserver(String remoteserver) { + this.remoteserver = remoteserver; + } + + + public String getUsername() { + return username; + } + + + public void setUsername(String username) { + this.username = username; + } + + + public String getPassword() { + return password; + } + + + public void setPassword(String password) { + this.password = password; + } + + + public int getPortnumber() { + return portnumber; + } + + + public void setPortnumber(int portnumber) { + this.portnumber = portnumber; + } + + + + + + public String getFilename() { + return filename; + } + + + public void setFilename(String filename) { + this.filename = filename; + } + + + public String getFileparams() { + return fileparams; + } + + + public void setFileparams(String fileparams) { + this.fileparams = fileparams; + } + + + public String getDeploymentverifier() { + return deploymentverifier; + } + + + public void setDeploymentverifier(String deploymentverifier) { + this.deploymentverifier = deploymentverifier; + } + + + public int getNoofiterations() { + return noofiterations; + } + + + public void setNoofiterations(int noofiterations) { + this.noofiterations = noofiterations; + } + + + public int getWaittime() { + return waittime; + } + + + public void setWaittime(int waittime) { + this.waittime = waittime; + } + + + + + public String getVerifierparams() { + return verifierparams; + } + + + public void setVerifierparams(String verifierparams) { + this.verifierparams = verifierparams; + } + + + public String getFiletrasferscript() { + return filetrasferscript; + } + + + public void setFiletrasferscript(String filetrasferscript) { + this.filetrasferscript = filetrasferscript; + } + + + + + public String getFiletransferparams() { + return filetransferparams; + } + + + public void setFiletransferparams(String filetransferparams) { + this.filetransferparams = filetransferparams; + } + + + @Override + public String toString() { + return "Tempest [sitename=" + sitename + ", remoteserver=" + remoteserver + ", username=" + username + + ", password=" + password + ", portnumber=" + portnumber + ", srcdir=" + srcdir + ", destdir=" + + destdir + ", filename=" + filename + ", fileparams=" + fileparams + ", deploymentverifier=" + + deploymentverifier + ", verifierparams=" + verifierparams + ", noofiterations=" + noofiterations + + ", waittime=" + waittime + ", filetrasferscript=" + filetrasferscript + ", filetransferparams=" + + filetransferparams + "]"; + } + + + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/service/AsyncProcessExecutorService.java b/akraino/src/main/java/com/akraino/bpm/service/AsyncProcessExecutorService.java index bee88d9..0a78b78 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/AsyncProcessExecutorService.java +++ b/akraino/src/main/java/com/akraino/bpm/service/AsyncProcessExecutorService.java @@ -1,39 +1,39 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service; - -import com.akraino.bpm.model.Airship; -import com.akraino.bpm.model.Apache; -import com.akraino.bpm.model.Build; -import com.akraino.bpm.model.Deploy; -import com.akraino.bpm.model.Onap; -import com.akraino.bpm.model.Tempest; - -public interface AsyncProcessExecutorService { - - public void executeAirshipProcess(Airship airship); - - public void executeBuildProcess(Build build); - - public void executeDeployProcess(Deploy deploy); - - public void executeOnapProcess(Onap onap); - - public void executeTempestProcess(Tempest tempest); - - public void executeApacheProcess(Apache apache); -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service; + +import com.akraino.bpm.model.Airship; +import com.akraino.bpm.model.Apache; +import com.akraino.bpm.model.Build; +import com.akraino.bpm.model.Deploy; +import com.akraino.bpm.model.Onap; +import com.akraino.bpm.model.Tempest; + +public interface AsyncProcessExecutorService { + + public void executeAirshipProcess(Airship airship); + + public void executeBuildProcess(Build build); + + public void executeDeployProcess(Deploy deploy); + + public void executeOnapProcess(Onap onap); + + public void executeTempestProcess(Tempest tempest); + + public void executeApacheProcess(Apache apache); +} diff --git a/akraino/src/main/java/com/akraino/bpm/service/DeployResponseSenderService.java b/akraino/src/main/java/com/akraino/bpm/service/DeployResponseSenderService.java index 8c0463d..8a96989 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/DeployResponseSenderService.java +++ b/akraino/src/main/java/com/akraino/bpm/service/DeployResponseSenderService.java @@ -16,10 +16,11 @@ package com.akraino.bpm.service; + import com.akraino.bpm.model.BuildResponse; public interface DeployResponseSenderService { public void sendResponse(BuildResponse response); - + } diff --git a/akraino/src/main/java/com/akraino/bpm/service/ScriptExecutionService.java b/akraino/src/main/java/com/akraino/bpm/service/ScriptExecutionService.java index 86f2dd6..446e97e 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/ScriptExecutionService.java +++ b/akraino/src/main/java/com/akraino/bpm/service/ScriptExecutionService.java @@ -22,6 +22,8 @@ public interface ScriptExecutionService { public void executeCDScript(String dir,String cmd); + + //public void executeAirshipScript(String cmd); diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/AsyncProcessExecutorServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/AsyncProcessExecutorServiceImpl.java index 73dd05b..5179c51 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/AsyncProcessExecutorServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/AsyncProcessExecutorServiceImpl.java @@ -1,228 +1,253 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import org.camunda.bpm.engine.ProcessEngine; -import org.camunda.bpm.engine.runtime.ProcessInstance; -import org.camunda.bpm.engine.variable.Variables; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; -import org.springframework.stereotype.Service; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.model.Airship; -import com.akraino.bpm.model.Apache; -import com.akraino.bpm.model.Build; -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.model.Deploy; -import com.akraino.bpm.model.Onap; -import com.akraino.bpm.model.Tempest; -import com.akraino.bpm.service.AsyncProcessExecutorService; -import com.akraino.bpm.service.DeployResponseSenderService; - -@Service("asyncProcessExecutorService") -public class AsyncProcessExecutorServiceImpl implements AsyncProcessExecutorService{ - - @Autowired - private ProcessEngine camunda; - - @Autowired - private DeployResponseSenderService deployResponseSenderService; - - private static Logger logger = LoggerFactory.getLogger(AsyncProcessExecutorServiceImpl.class); - - @Async - public void executeAirshipProcess(Airship airship) { - - try { - executeAirshipservice(airship); - }catch(TaskExecutorException ex) { - logger.error("Airship execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),airship.getSitename(),null,null,null)); - } - logger.error("Airship execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"success",airship.getSitename(),null,null,null)); - - - - } - - private ProcessInstance executeAirshipservice(Airship airship) { - - String filepath1=airship.getFilepath()+" "+(airship.getFileparams()!=null?airship.getFileparams().replaceAll(",", " "):" "); - String filepath2=airship.getWinscpfilepath()+" "+(airship.getWinscpfileparams()!=null?airship.getWinscpfileparams().replaceAll(",", " "):" "); - return camunda.getRuntimeService().startProcessInstanceByKey("airship", - Variables.putValue("filepath", filepath1).putValue("scpdir", airship.getWinscpdir()).putValue("ScpScriptFilepath", filepath2).putValue("remotserver", airship.getRemotserver()) - .putValue("username", airship.getUsername()) - .putValue("password", airship.getPassword()) - .putValue("port", airship.getPort()).putValue("destdir",airship.getDestdir()).putValue("remotefilename", airship.getRemotefilename()) - .putValue("remotefileparams", airship.getRemotefileparams()).putValue("sitename", airship.getSitename())); - - } - - @Async - public void executeBuildProcess(Build build) { - - try { - executeBuildService(build); - }catch(TaskExecutorException ex) { - logger.error("Build execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse("exception: "+ex.getMessage(),null,null,null,null,build.getSitename(),null,null,null)); - } - logger.error("Build execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse("success",null,null,null,null,build.getSitename(),null,null,null)); - } - - - private ProcessInstance executeBuildService(Build build) { - - String filepath=build.getFilepath()+" "+(build.getFileparams()!=null?build.getFileparams().replaceAll(",", " "):" "); - return camunda.getRuntimeService().startProcessInstanceByKey("build", - Variables.putValue("filepath", filepath).putValue("targetfolder", build.getTargetfolder())); - } - - @Async - public void executeDeployProcess(Deploy deploy) { - - try { - executeDeployService(deploy); - }catch(TaskExecutorException ex) { - logger.error("deploy execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),deploy.getSitename(),null,null,null)); - } - logger.debug("deploy execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse("success","success","success","success","success",deploy.getSitename(),null,null,null)); - } - - - private ProcessInstance executeDeployService(Deploy deploy) { - - String filepath1=deploy.getFilepath()+" "+(deploy.getFileparams()!=null?deploy.getFileparams().replaceAll(",", " "):" "); - String filepath2=deploy.getWinscpfilepath()+" "+(deploy.getWinscpfileparams()!=null?deploy.getWinscpfileparams().replaceAll(",", " "):" "); - return camunda.getRuntimeService().startProcessInstanceByKey("deploy", - Variables.putValue("filepath", filepath1).putValue("ScpScriptFilepath", filepath2).putValue("remotserver", deploy.getRemotserver()) - .putValue("username", deploy.getUsername()) - .putValue("password", deploy.getPassword()) - .putValue("port", deploy.getPort()).putValue("destdir",deploy.getDestdir()).putValue("remotefilename", deploy.getRemotefilename()) - .putValue("fileparams", deploy.getFileparams()). - putValue("verifier", deploy.getDeploymentverifier()).putValue("verifierfileparams", - deploy.getDeploymentverifierfileparams()).putValue("waittime", deploy.getWaittime()). - putValue("iterations", deploy.getNoofiterations()).putValue("postverificationscript", deploy.getPostverificationscript()). - putValue("postverificationScriptparams", deploy.getDeploymentverifierfileparams()).putValue("sitename", deploy.getSitename())); - - } - - @Async - public void executeOnapProcess(Onap onap) { - - try { - executeOnapService(onap); - }catch(TaskExecutorException ex) { - logger.error("Onap execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"exception: "+ex.getMessage(),null,null)); - } - logger.error("Onap execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"succes",null,null)); - - - } - - - private ProcessInstance executeOnapService(Onap onap) { - - String transferfile= onap.getFiletrasferscript()+" "+(onap.getFiletransferparams()!=null?onap.getFiletransferparams().replaceAll(",", " "):" "); - return camunda.getRuntimeService().startProcessInstanceByKey("onap", - Variables.putValue("filename", onap.getFilename()).putValue("fileparams", onap.getFileparams()). - putValue("verifier", onap.getDeploymentverifier()).putValue("verifierfileparams", onap.getVerifierparams()).putValue("waittime", onap.getWaittime()). - putValue("iterations", onap.getNoofiterations()).putValue("remotserver", onap.getRemoteserver()) - .putValue("username", onap.getUsername()) - .putValue("password", onap.getPassword()) - .putValue("port", onap.getPortnumber()).putValue("srcdir", onap.getSrcdir()).putValue("destdir",onap.getDestdir()).putValue("filepath", transferfile) - ); - - } - - - @Async - public void executeTempestProcess(Tempest tempest) { - try { - executeTempestService(tempest); - }catch(TaskExecutorException ex) { - logger.error("Tempest execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"exception: "+ex.getMessage())); - } - logger.error("Tempest execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"success")); - - } - - private ProcessInstance executeTempestService(Tempest tempest) { - - - String transferfile= tempest.getFiletrasferscript()+" "+(tempest.getFiletransferparams()!=null?tempest.getFiletransferparams().replaceAll(",", " "):" "); - - return camunda.getRuntimeService().startProcessInstanceByKey("tempest", - Variables.putValue("filename", tempest.getFilename()).putValue("fileparams", tempest.getFileparams()). - putValue("verifier", tempest.getDeploymentverifier()).putValue("verifierfileparams", tempest.getVerifierparams()).putValue("waittime", tempest.getWaittime()). - putValue("iterations", tempest.getNoofiterations()).putValue("remotserver", tempest.getRemoteserver()) - .putValue("username", tempest.getUsername()) - .putValue("password", tempest.getPassword()) - .putValue("port", tempest.getPortnumber()).putValue("srcdir", tempest.getSrcdir()).putValue("destdir",tempest.getDestdir()).putValue("filepath", transferfile) - ); - - } - - - @Async - public void executeApacheProcess(Apache apache) { - try { - executeApacheService(apache); - }catch(TaskExecutorException ex) { - logger.error("Apache execution failed ",ex); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"exception: "+ex.getMessage(),null)); - } - logger.error("Apache execution sucess "); - deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"success",null)); - - - } - - - private ProcessInstance executeApacheService(Apache apache) { - - String transferfile= apache.getFiletrasferscript()+" "+(apache.getFiletransferparams()!=null?apache.getFiletransferparams().replaceAll(",", " "):" "); - - return camunda.getRuntimeService().startProcessInstanceByKey("apache", - Variables.putValue("filename", apache.getFilename()).putValue("fileparams", apache.getFileparams()). - putValue("verifier", apache.getDeploymentverifier()).putValue("verifierfileparams", apache.getVerifierparams()).putValue("waittime", apache.getWaittime()). - putValue("iterations", apache.getNoofiterations()).putValue("remotserver", apache.getRemoteserver()) - .putValue("username", apache.getUsername()) - .putValue("password", apache.getPassword()) - .putValue("port", apache.getPortnumber()).putValue("srcdir", apache.getSrcdir()).putValue("destdir",apache.getDestdir()).putValue("filepath", transferfile) - ); - - } - - - - - - - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import org.camunda.bpm.engine.ProcessEngine; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.variable.Variables; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.model.Airship; +import com.akraino.bpm.model.Apache; +import com.akraino.bpm.model.Build; +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.model.Deploy; +import com.akraino.bpm.model.Onap; +import com.akraino.bpm.model.Tempest; +import com.akraino.bpm.service.AsyncProcessExecutorService; +import com.akraino.bpm.service.DeployResponseSenderService; + +@Service("asyncProcessExecutorService") +public class AsyncProcessExecutorServiceImpl implements AsyncProcessExecutorService{ + + @Autowired + private ProcessEngine camunda; + + @Autowired + private DeployResponseSenderService deployResponseSenderService; + + private static Logger logger = LoggerFactory.getLogger(AsyncProcessExecutorServiceImpl.class); + + @Async + public void executeAirshipProcess(Airship airship) { + + try { + executeAirshipservice(airship); + }catch(TaskExecutorException ex) { + logger.error("Airship execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),airship.getSitename(),null,null,null)); + return; + } + logger.debug("Airship execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"success",airship.getSitename(),null,null,null)); + + + + } + + private ProcessInstance executeAirshipservice(Airship airship) { + + String filepath1=airship.getFilepath()+" "+(airship.getFileparams()!=null?airship.getFileparams().replaceAll(",", " "):" "); + String filepath2=airship.getWinscpfilepath()+" "+(airship.getWinscpfileparams()!=null?airship.getWinscpfileparams().replaceAll(",", " "):" "); + return camunda.getRuntimeService().startProcessInstanceByKey("airship", + Variables.putValue("filepath", filepath1).putValue("scpdir", airship.getWinscpdir()).putValue("ScpScriptFilepath", filepath2).putValue("remotserver", airship.getRemotserver()) + .putValue("username", airship.getUsername()) + .putValue("password", airship.getPassword()) + .putValue("port", airship.getPort()).putValue("destdir",airship.getDestdir()).putValue("remotefilename", airship.getRemotefilename()) + .putValue("remotefileparams", airship.getRemotefileparams()).putValue("sitename", airship.getSitename())); + + } + + @Async + public void executeBuildProcess(Build build) { + + try { + executeBuildService(build); + }catch(TaskExecutorException ex) { + logger.error("Build execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse("exception: "+ex.getMessage(),null,null,null,null,build.getSitename(),null,null,null)); + return; + } + logger.debug("Build execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse("success",null,null,null,null,build.getSitename(),null,null,null)); + } + + + private ProcessInstance executeBuildService(Build build) { + + String filepath=build.getFilepath()+" "+(build.getFileparams()!=null?build.getFileparams().replaceAll(",", " "):" "); + return camunda.getRuntimeService().startProcessInstanceByKey("build", + Variables.putValue("filepath", filepath).putValue("targetfolder", build.getTargetfolder())); + } + + @Async + public void executeDeployProcess(Deploy deploy) { + + try { + executeDeployService(deploy); + }catch(TaskExecutorException ex) { + logger.error("deploy execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,"exception: "+ex.getMessage(),deploy.getSitename(),null,null,null)); + return; + } + logger.debug("deploy execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse("success","success","success","success","success",deploy.getSitename(),null,null,null)); + } + + + private ProcessInstance executeDeployService(Deploy deploy) { + + String filepath1=deploy.getFilepath()+" "+(deploy.getFileparams()!=null?deploy.getFileparams().replaceAll(",", " "):" "); + + + int lastindex=deploy.getWinscpfilepath().lastIndexOf("/"); + String scpSrcDir=deploy.getWinscpfilepath().substring(0,lastindex); + String scpfilename=deploy.getWinscpfilepath().substring(lastindex+1,deploy.getWinscpfilepath().length()); + String transferfile= scpfilename+" "+(deploy.getWinscpfileparams()!=null?deploy.getWinscpfileparams().replaceAll(",", " "):" "); + + + + return camunda.getRuntimeService().startProcessInstanceByKey("deploy", + Variables.putValue("filepath", filepath1).putValue("scpsrcdir", scpSrcDir). + putValue("ScpScriptFilepath", transferfile).putValue("remotserver", deploy.getRemotserver()) + .putValue("username", deploy.getUsername()) + .putValue("password", deploy.getPassword()) + .putValue("port", deploy.getPort()).putValue("destdir",deploy.getDestdir()).putValue("remotefilename", deploy.getRemotefilename()) + .putValue("fileparams", deploy.getFileparams()). + putValue("verifier", deploy.getDeploymentverifier()).putValue("verifierfileparams", + deploy.getDeploymentverifierfileparams()).putValue("waittime", deploy.getWaittime()). + putValue("iterations", deploy.getNoofiterations()).putValue("postverificationscript", deploy.getPostverificationscript()). + putValue("postverificationScriptparams", deploy.getDeploymentverifierfileparams()).putValue("sitename", deploy.getSitename())); + + } + + @Async + public void executeOnapProcess(Onap onap) { + + try { + executeOnapService(onap); + }catch(TaskExecutorException ex) { + logger.error("Onap execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"exception: "+ex.getMessage(),null,null)); + return; + } + logger.debug("Onap execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,onap.getSitename(),"succes",null,null)); + + + } + + + private ProcessInstance executeOnapService(Onap onap) { + + int lastindex=onap.getFiletrasferscript().lastIndexOf("/"); + String scpSrcDir=onap.getFiletrasferscript().substring(0,lastindex); + String scpfilename=onap.getFiletrasferscript().substring(lastindex+1,onap.getFiletrasferscript().length()); + String transferfile= scpfilename+" "+(onap.getFiletransferparams()!=null?onap.getFiletransferparams().replaceAll(",", " "):" "); + + + return camunda.getRuntimeService().startProcessInstanceByKey("onap", + Variables.putValue("filename", onap.getFilename()).putValue("fileparams", onap.getFileparams()). + putValue("verifier", onap.getDeploymentverifier()).putValue("verifierfileparams", onap.getVerifierparams()).putValue("waittime", onap.getWaittime()). + putValue("iterations", onap.getNoofiterations()).putValue("remotserver", onap.getRemoteserver()) + .putValue("username", onap.getUsername()) + .putValue("password", onap.getPassword()) + .putValue("port", onap.getPortnumber()).putValue("srcdir", onap.getSrcdir()).putValue("destdir",onap.getDestdir()).putValue("ScpScriptFilepath", transferfile). + putValue("scpsrcdir", scpSrcDir) + ); + + } + + + @Async + public void executeTempestProcess(Tempest tempest) { + try { + executeTempestService(tempest); + }catch(TaskExecutorException ex) { + logger.error("Tempest execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"exception: "+ex.getMessage())); + return; + } + logger.debug("Tempest execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,tempest.getSitename(),null,null,"success")); + + } + + private ProcessInstance executeTempestService(Tempest tempest) { + + int lastindex=tempest.getFiletrasferscript().lastIndexOf("/"); + String scpSrcDir=tempest.getFiletrasferscript().substring(0,lastindex); + String scpfilename=tempest.getFiletrasferscript().substring(lastindex+1,tempest.getFiletrasferscript().length()); + String transferfile= scpfilename+" "+(tempest.getFiletransferparams()!=null?tempest.getFiletransferparams().replaceAll(",", " "):" "); + + return camunda.getRuntimeService().startProcessInstanceByKey("tempest", + Variables.putValue("filename", tempest.getFilename()).putValue("fileparams", tempest.getFileparams()). + putValue("verifier", tempest.getDeploymentverifier()).putValue("verifierfileparams", tempest.getVerifierparams()).putValue("waittime", tempest.getWaittime()). + putValue("iterations", tempest.getNoofiterations()).putValue("remotserver", tempest.getRemoteserver()) + .putValue("username", tempest.getUsername()) + .putValue("password", tempest.getPassword()) + .putValue("port", tempest.getPortnumber()).putValue("srcdir", tempest.getSrcdir()).putValue("destdir",tempest.getDestdir()).putValue("ScpScriptFilepath", transferfile). + putValue("scpsrcdir", scpSrcDir) + ); + + } + + + @Async + public void executeApacheProcess(Apache apache) { + try { + executeApacheService(apache); + }catch(TaskExecutorException ex) { + logger.error("Apache execution failed ",ex); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"exception: "+ex.getMessage(),null)); + return; + } + logger.debug("Apache execution sucess "); + deployResponseSenderService.sendResponse(new BuildResponse(null,null,null,null,null,apache.getSitename(),null,"success",null)); + + + } + + + private ProcessInstance executeApacheService(Apache apache) { + + int lastindex=apache.getFiletrasferscript().lastIndexOf("/"); + String scpSrcDir=apache.getFiletrasferscript().substring(0,lastindex); + String scpfilename=apache.getFiletrasferscript().substring(lastindex+1,apache.getFiletrasferscript().length()); + + String transferfile= scpfilename+" "+(apache.getFiletransferparams()!=null?apache.getFiletransferparams().replaceAll(",", " "):" "); + + return camunda.getRuntimeService().startProcessInstanceByKey("apache", + Variables.putValue("filename", apache.getFilename()).putValue("fileparams", apache.getFileparams()). + putValue("verifier", apache.getDeploymentverifier()).putValue("verifierfileparams", apache.getVerifierparams()).putValue("waittime", apache.getWaittime()). + putValue("iterations", apache.getNoofiterations()).putValue("remotserver", apache.getRemoteserver()) + .putValue("username", apache.getUsername()) + .putValue("password", apache.getPassword()) + .putValue("port", apache.getPortnumber()). + putValue("srcdir", apache.getSrcdir()).putValue("destdir",apache.getDestdir()). + putValue("scpfilename", transferfile).putValue("scpdir", scpSrcDir) + ); + + } + + + } diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/DeployResponseSenderServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/DeployResponseSenderServiceImpl.java index 939331a..6b0206b 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/DeployResponseSenderServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/DeployResponseSenderServiceImpl.java @@ -1,63 +1,63 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.config.CamundaCorsFilter; -import com.akraino.bpm.model.BuildResponse; -import com.akraino.bpm.service.DeployResponseSenderService; - -@Service("deployResponseSenderService") -public class DeployResponseSenderServiceImpl implements DeployResponseSenderService { - - private static Logger logger = LoggerFactory.getLogger(DeployResponseSenderServiceImpl.class); - - @Autowired - private RestTemplate restTemplate; - - @Autowired - private CamundaCorsFilter camundaCorsFilter; - - public void sendResponse(BuildResponse response) { - try { - logger.debug(response.toString()); - HttpHeaders header = new HttpHeaders(); - header.add("tokenId", camundaCorsFilter.getTokenId()); - HttpEntity request = new HttpEntity(response,header); - ResponseEntity httpresposne =restTemplate - .exchange(camundaCorsFilter.getBuildresponseurl(), HttpMethod.POST, request, Void.class); - - logger.debug("Build response HttpResponseStatus :"+httpresposne.getStatusCodeValue()); - }catch (Exception e ) { - logger.error("problem while sending response :"+e.getMessage()); - - throw new TaskExecutorException("problem while sending response :"+e.getMessage()); - - } - } - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.config.CamundaCorsFilter; +import com.akraino.bpm.model.BuildResponse; +import com.akraino.bpm.service.DeployResponseSenderService; + +@Service("deployResponseSenderService") +public class DeployResponseSenderServiceImpl implements DeployResponseSenderService { + + private static Logger logger = LoggerFactory.getLogger(DeployResponseSenderServiceImpl.class); + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private CamundaCorsFilter camundaCorsFilter; + + public void sendResponse(BuildResponse response) { + try { + logger.debug(response.toString()); + HttpHeaders header = new HttpHeaders(); + header.add("tokenId", camundaCorsFilter.getTokenId()); + HttpEntity request = new HttpEntity(response,header); + ResponseEntity httpresposne =restTemplate + .exchange(camundaCorsFilter.getBuildresponseurl(), HttpMethod.POST, request, Void.class); + + logger.debug("Build response HttpResponseStatus :"+httpresposne.getStatusCodeValue()); + }catch (Exception e ) { + logger.error("problem while sending response :"+e.getMessage()); + + throw new TaskExecutorException("problem while sending response :"+e.getMessage()); + + } + } + +} diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/FileTransferServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/FileTransferServiceImpl.java index 2754af2..d8b158c 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/FileTransferServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/FileTransferServiceImpl.java @@ -1,93 +1,93 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import java.io.File; -import java.io.FileInputStream; -import java.util.ArrayList; -import java.util.List; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.service.FileTransferService; -import com.jcraft.jsch.ChannelSftp; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; - -@Service("fileTransferService") -public class FileTransferServiceImpl implements FileTransferService { - - private static Logger logger = LoggerFactory.getLogger(FileTransferServiceImpl.class); - - public void transferFile(String srcdir, String destdir, String filename,String servername,String username,String password,int port) { - - logger.debug("file transfor filename={},srcdir={},destdir={}",filename,srcdir,destdir); - ChannelSftp sftpChannel=null; - try { - JSch jsch = new JSch(); - Session session = jsch.getSession(username, servername, port); - session.setConfig("StrictHostKeyChecking", "no"); - session.setPassword(password); - session.connect(); - sftpChannel = (ChannelSftp)session.openChannel("sftp"); - sftpChannel.setPty(true); - sftpChannel.connect(); - sftpChannel.cd(destdir); - sftpChannel.put(new FileInputStream(new File (srcdir+"/"+filename)), filename); - sftpChannel.chmod(Integer.parseInt("777", 8),filename); - } catch (Exception e) { - logger.error("Exception occured while ftp : "+e); - throw new TaskExecutorException("problem while transfering the file to remote machine :"+e.getMessage()); - } finally { - sftpChannel.disconnect(); - } - } - - - public void transferFile(String srcdir, String destdir,String servername,String username,String password,int port) { - - List files=getAllfiles(new File(srcdir)); - for(File file: files) { - transferFile(srcdir,destdir,file.getName(),servername,username,password,port); - } - - - } - - private List getAllfiles(File rootDirectory){ - List results = new ArrayList(); - - if(rootDirectory==null) { - throw new TaskExecutorException("problem while transfering the file to remote machine : src diectory Not found"); - } - - for(File currentItem : rootDirectory.listFiles()){ - if(currentItem.isDirectory()){ - results.addAll(getAllfiles(currentItem)); - } - else{ - results.add(currentItem); - } - } - return results; - } - - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.service.FileTransferService; +import com.jcraft.jsch.ChannelSftp; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.Session; + +@Service("fileTransferService") +public class FileTransferServiceImpl implements FileTransferService { + + private static Logger logger = LoggerFactory.getLogger(FileTransferServiceImpl.class); + + public void transferFile(String srcdir, String destdir, String filename,String servername,String username,String password,int port) { + + logger.debug("file transfor filename={},srcdir={},destdir={}",filename,srcdir,destdir); + ChannelSftp sftpChannel=null; + try { + JSch jsch = new JSch(); + Session session = jsch.getSession(username, servername, port); + session.setConfig("StrictHostKeyChecking", "no"); + session.setPassword(password); + session.connect(); + sftpChannel = (ChannelSftp)session.openChannel("sftp"); + sftpChannel.setPty(true); + sftpChannel.connect(); + sftpChannel.cd(destdir); + sftpChannel.put(new FileInputStream(new File (srcdir+"/"+filename)), filename); + sftpChannel.chmod(Integer.parseInt("777", 8),filename); + } catch (Exception e) { + logger.error("Exception occured while ftp : "+e); + throw new TaskExecutorException("problem while transfering the file to remote machine :"+e.getMessage()); + } finally { + sftpChannel.disconnect(); + } + } + + + public void transferFile(String srcdir, String destdir,String servername,String username,String password,int port) { + + List files=getAllfiles(new File(srcdir)); + for(File file: files) { + transferFile(srcdir,destdir,file.getName(),servername,username,password,port); + } + + + } + + private List getAllfiles(File rootDirectory){ + List results = new ArrayList(); + + if(rootDirectory==null) { + throw new TaskExecutorException("problem while transfering the file to remote machine : src diectory Not found"); + } + + for(File currentItem : rootDirectory.listFiles()){ + if(currentItem.isDirectory()){ + results.addAll(getAllfiles(currentItem)); + } + else{ + results.add(currentItem); + } + } + return results; + } + + +} diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteDeploymentverificationServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteDeploymentverificationServiceImpl.java index 865e768..b3335e7 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteDeploymentverificationServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteDeploymentverificationServiceImpl.java @@ -1,110 +1,110 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.service.RemoteDeploymentVerificationService; -import com.jcraft.jsch.ChannelExec; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; - - -@Service("remoteDeploymentVerificationService") -public class RemoteDeploymentverificationServiceImpl implements RemoteDeploymentVerificationService{ - - private static Logger logger = LoggerFactory.getLogger(RemoteDeploymentverificationServiceImpl.class); - - public void executeScript(String remoteserver,String username,String password,int portnumber, - String filename,String fileparams,String srcdir,String destdir,int waitttime,int iterations,String command) { - - boolean issuccess=false; - //String filepath=destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); - ChannelExec channelExec=null; - BufferedReader reader =null; - Session session=null; - for( int i=0;i<=iterations;i++) { - try { - logger.debug("Executing the deployment verification script.............iteration : {}",i); - Thread.sleep(waitttime*1000); - JSch jsch = new JSch(); - session = jsch.getSession(username, remoteserver, portnumber); - session.setConfig("StrictHostKeyChecking", "no"); - session.setPassword(password); - session.connect(); - channelExec = (ChannelExec)session.openChannel("exec"); - InputStream in = channelExec.getInputStream(); - channelExec.setPty(true); - channelExec.setCommand(command); - channelExec.connect(); - reader = new BufferedReader(new InputStreamReader(in)); - String line; - logger.debug("Script output......................"); - while ((line = reader.readLine()) != null){ - logger.debug(line); - } - channelExec.disconnect(); - while (!channelExec.isClosed()) { - - } - int exitStatus = channelExec.getExitStatus(); - logger.debug("Script exit code :"+exitStatus); - if(exitStatus==0) { - issuccess=true; - } - } - catch (IOException e) { - throw new TaskExecutorException(filename + " not found."); - } catch (Exception e) { - throw new TaskExecutorException("problem while executing the script "+command); - }finally{ - if(reader!=null) { - try { - reader.close(); - }catch(Exception e) { - throw new TaskExecutorException("onap build failed"); - } - } - if(session!=null) { - session.disconnect(); - } - } - - if(issuccess) { - break; - } - - } - - if(!issuccess) { - logger.debug("verification script returned 1 "); - throw new TaskExecutorException(" verification script exit code : 1"); - } - } - - - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.service.RemoteDeploymentVerificationService; +import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.Session; + + +@Service("remoteDeploymentVerificationService") +public class RemoteDeploymentverificationServiceImpl implements RemoteDeploymentVerificationService{ + + private static Logger logger = LoggerFactory.getLogger(RemoteDeploymentverificationServiceImpl.class); + + public void executeScript(String remoteserver,String username,String password,int portnumber, + String filename,String fileparams,String srcdir,String destdir,int waitttime,int iterations,String command) { + + boolean issuccess=false; + //String filepath=destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); + ChannelExec channelExec=null; + BufferedReader reader =null; + Session session=null; + for( int i=0;i<=iterations;i++) { + try { + logger.debug("Executing the deployment verification script.............iteration : {}",i); + Thread.sleep(waitttime*1000); + JSch jsch = new JSch(); + session = jsch.getSession(username, remoteserver, portnumber); + session.setConfig("StrictHostKeyChecking", "no"); + session.setPassword(password); + session.connect(); + channelExec = (ChannelExec)session.openChannel("exec"); + InputStream in = channelExec.getInputStream(); + channelExec.setPty(true); + channelExec.setCommand(command); + channelExec.connect(); + reader = new BufferedReader(new InputStreamReader(in)); + String line; + logger.debug("Script output......................"); + while ((line = reader.readLine()) != null){ + logger.debug(line); + } + channelExec.disconnect(); + while (!channelExec.isClosed()) { + + } + int exitStatus = channelExec.getExitStatus(); + logger.debug("Script exit code :"+exitStatus); + if(exitStatus==0) { + issuccess=true; + } + } + catch (IOException e) { + throw new TaskExecutorException(filename + " not found."); + } catch (Exception e) { + throw new TaskExecutorException("problem while executing the script "+command); + }finally{ + if(reader!=null) { + try { + reader.close(); + }catch(Exception e) { + throw new TaskExecutorException("onap build failed"); + } + } + if(session!=null) { + session.disconnect(); + } + } + + if(issuccess) { + break; + } + + } + + if(!issuccess) { + logger.debug("verification script returned 1 "); + throw new TaskExecutorException(" verification script exit code : 1"); + } + } + + + +} diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteScriptExecutionServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteScriptExecutionServiceImpl.java index b25e12e..1b23bba 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteScriptExecutionServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/RemoteScriptExecutionServiceImpl.java @@ -1,108 +1,108 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.service.RemoteScriptExecutionService; -import com.jcraft.jsch.ChannelExec; -import com.jcraft.jsch.JSch; -import com.jcraft.jsch.Session; - -@Service("remoteScriptExecutionService") -public class RemoteScriptExecutionServiceImpl implements RemoteScriptExecutionService{ - - private static Logger logger = LoggerFactory.getLogger(RemoteScriptExecutionServiceImpl.class); - - public void executeRemoteScript(String remoteserver,String username,String password,int portnumber,String filename, - String fileparams,String srcdir,String destdir,String command) { - - //String filepath=destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); - ChannelExec channelExec=null; - Session session=null; - BufferedReader reader =null; - try { - //tranferFile(remoteserver,portnumber,username,password,filename,srcdir,destdir); - logger.debug("executing the script "+command); - JSch jsch = new JSch(); - session = jsch.getSession(username, remoteserver, portnumber); - session.setConfig("StrictHostKeyChecking", "no"); - session.setPassword(password); - session.connect(); - session.setTimeout(36000000); - channelExec = (ChannelExec)session.openChannel("exec"); - InputStream in = channelExec.getInputStream(); - channelExec.setCommand(command); - channelExec.setPty(true); - - channelExec.connect(36000000); - reader = new BufferedReader(new InputStreamReader(in)); - String line; - logger.debug("Script output......................"); - while ((line = reader.readLine()) != null){ - logger.debug(line); - } - - channelExec.disconnect(); - while (!channelExec.isClosed()) { - - } - - int exitStatus = channelExec.getExitStatus(); - - logger.debug("Script exit code :"+exitStatus); - if(exitStatus!=0) { - throw new TaskExecutorException("problem while executing the script . exist code :"+exitStatus); - } - - - } catch (IOException e) { - throw new TaskExecutorException(filename + " not found."); - } catch (Exception e) { - throw new TaskExecutorException("Problem while executing script"+e.getMessage()); - }finally{ - if(reader!=null) { - try { - reader.close(); - }catch(Exception e) { - throw new TaskExecutorException("onap build failed"); - } - } - if(session!=null) { - session.disconnect(); - } - } - - - - } - - - - -} - - +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.service.RemoteScriptExecutionService; +import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.Session; + +@Service("remoteScriptExecutionService") +public class RemoteScriptExecutionServiceImpl implements RemoteScriptExecutionService{ + + private static Logger logger = LoggerFactory.getLogger(RemoteScriptExecutionServiceImpl.class); + + public void executeRemoteScript(String remoteserver,String username,String password,int portnumber,String filename, + String fileparams,String srcdir,String destdir,String command) { + + //String filepath=destdir+"/"+filename+" "+(fileparams!=null?fileparams.replaceAll(",", " "):" "); + ChannelExec channelExec=null; + Session session=null; + BufferedReader reader =null; + try { + //tranferFile(remoteserver,portnumber,username,password,filename,srcdir,destdir); + logger.debug("executing the script "+command); + JSch jsch = new JSch(); + session = jsch.getSession(username, remoteserver, portnumber); + session.setConfig("StrictHostKeyChecking", "no"); + session.setPassword(password); + session.connect(); + session.setTimeout(36000000); + channelExec = (ChannelExec)session.openChannel("exec"); + InputStream in = channelExec.getInputStream(); + channelExec.setCommand(command); + channelExec.setPty(true); + + channelExec.connect(36000000); + reader = new BufferedReader(new InputStreamReader(in)); + String line; + logger.debug("Script output......................"); + while ((line = reader.readLine()) != null){ + logger.debug(line); + } + + channelExec.disconnect(); + while (!channelExec.isClosed()) { + + } + + int exitStatus = channelExec.getExitStatus(); + + logger.debug("Script exit code :"+exitStatus); + if(exitStatus!=0) { + throw new TaskExecutorException("problem while executing the script . exist code :"+exitStatus); + } + + + } catch (IOException e) { + throw new TaskExecutorException(filename + " not found."); + } catch (Exception e) { + throw new TaskExecutorException("Problem while executing script"+e.getMessage()); + }finally{ + if(reader!=null) { + try { + reader.close(); + }catch(Exception e) { + throw new TaskExecutorException("onap build failed"); + } + } + if(session!=null) { + session.disconnect(); + } + } + + + + } + + + + +} + + diff --git a/akraino/src/main/java/com/akraino/bpm/service/impl/ScriptExecutionServiceImpl.java b/akraino/src/main/java/com/akraino/bpm/service/impl/ScriptExecutionServiceImpl.java index a8b4106..7462607 100644 --- a/akraino/src/main/java/com/akraino/bpm/service/impl/ScriptExecutionServiceImpl.java +++ b/akraino/src/main/java/com/akraino/bpm/service/impl/ScriptExecutionServiceImpl.java @@ -1,115 +1,115 @@ -/* - * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. - * - * 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 com.akraino.bpm.service.impl; - -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -import com.akraino.bpm.Exception.TaskExecutorException; -import com.akraino.bpm.service.ScriptExecutionService; - -@Service("scriptExecutionService") -public class ScriptExecutionServiceImpl implements ScriptExecutionService{ - - private static Logger logger = LoggerFactory.getLogger(ScriptExecutionServiceImpl.class); - - public void executeScript(String filepatch) { - - try { - logger.debug("Executing the script............."); - Process p = Runtime.getRuntime().exec(filepatch); - BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); - String line = ""; - while ((line = input.readLine()) != null) { - logger.debug(line); - } - p.waitFor(); - logger.debug("Script exit code :"+p.exitValue()); - if(p.exitValue()!=0) { - throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue()); - } - - - } catch (IOException e) { - throw new TaskExecutorException(filepatch + " not found."); - } catch (InterruptedException e) { - throw new TaskExecutorException("problem while executing the script "+filepatch); - } - - } - public void executeCDScript(String dir,String cmd) { - - try { - logger.debug("Executing the script.............dir:{},command:{}",dir,cmd); - - String[] command = { "/bin/sh", "-c", "sh "+cmd }; - Process p = Runtime.getRuntime().exec(command, null, new File(dir)); - p.waitFor(); - BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); - String line = ""; - while ((line = input.readLine()) != null) { - logger.debug(line); - } - logger.debug("Script exit code :"+p.exitValue()); - if(p.exitValue()!=0) { - throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue()); - } - - - } catch (IOException e) { - throw new TaskExecutorException(cmd + " not found."); - } catch (InterruptedException e) { - throw new TaskExecutorException("problem while executing the script "+cmd); - } - - } - - - /*public void executeAirshipScript(String cmd) { - - try { - logger.debug("Executing the script.............{}",cmd); - ProcessBuilder pb = new ProcessBuilder(cmd); - Process shellProcess = pb.start(); - - shellProcess.waitFor(); - BufferedReader input = new BufferedReader(new InputStreamReader(shellProcess.getInputStream())); - String line = ""; - while ((line = input.readLine()) != null) { - logger.debug(line); - } - logger.debug("Script exit code :"+shellProcess.exitValue()); - if(shellProcess.exitValue()!=0) { - throw new TaskExecutorException("problem while executing the script . exist code :"+shellProcess.exitValue()); - } - - - } catch (IOException e) { - throw new TaskExecutorException(cmd + " not found."); - } catch (InterruptedException e) { - throw new TaskExecutorException("problem while executing the script "+cmd); - } - - }*/ - -} +/* + * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. + * + * 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 com.akraino.bpm.service.impl; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import com.akraino.bpm.Exception.TaskExecutorException; +import com.akraino.bpm.service.ScriptExecutionService; + +@Service("scriptExecutionService") +public class ScriptExecutionServiceImpl implements ScriptExecutionService{ + + private static Logger logger = LoggerFactory.getLogger(ScriptExecutionServiceImpl.class); + + public void executeScript(String filepatch) { + + try { + logger.debug("Executing the script............."); + Process p = Runtime.getRuntime().exec(filepatch); + BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line = ""; + while ((line = input.readLine()) != null) { + logger.debug(line); + } + p.waitFor(); + logger.debug("Script exit code :"+p.exitValue()); + if(p.exitValue()!=0) { + throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue()); + } + + + } catch (IOException e) { + throw new TaskExecutorException(filepatch + " not found."); + } catch (InterruptedException e) { + throw new TaskExecutorException("problem while executing the script "+filepatch); + } + + } + public void executeCDScript(String dir,String cmd) { + + try { + logger.debug("Executing the script.............dir:{},command:{}",dir,cmd); + + String[] command = { "/bin/sh", "-c", "sh "+cmd }; + Process p = Runtime.getRuntime().exec(command, null, new File(dir)); + p.waitFor(); + BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); + String line = ""; + while ((line = input.readLine()) != null) { + logger.debug(line); + } + logger.debug("Script exit code :"+p.exitValue()); + if(p.exitValue()!=0) { + throw new TaskExecutorException("problem while executing the script . exist code :"+p.exitValue()); + } + + + } catch (IOException e) { + throw new TaskExecutorException(cmd + " not found."); + } catch (InterruptedException e) { + throw new TaskExecutorException("problem while executing the script "+cmd); + } + + } + + + /*public void executeAirshipScript(String cmd) { + + try { + logger.debug("Executing the script.............{}",cmd); + ProcessBuilder pb = new ProcessBuilder(cmd); + Process shellProcess = pb.start(); + + shellProcess.waitFor(); + BufferedReader input = new BufferedReader(new InputStreamReader(shellProcess.getInputStream())); + String line = ""; + while ((line = input.readLine()) != null) { + logger.debug(line); + } + logger.debug("Script exit code :"+shellProcess.exitValue()); + if(shellProcess.exitValue()!=0) { + throw new TaskExecutorException("problem while executing the script . exist code :"+shellProcess.exitValue()); + } + + + } catch (IOException e) { + throw new TaskExecutorException(cmd + " not found."); + } catch (InterruptedException e) { + throw new TaskExecutorException("problem while executing the script "+cmd); + } + + }*/ + +} diff --git a/akraino/src/main/resources/application.yaml b/akraino/src/main/resources/application.yaml index 80ddc8d..ac87f6a 100644 --- a/akraino/src/main/resources/application.yaml +++ b/akraino/src/main/resources/application.yaml @@ -1,15 +1,15 @@ -camunda.bpm: - admin-user: - id: admin - password: admin - firstName: administrator - filter: - create: All tasks - buildresponseurl: http://localhost:8069/AECPortalMgmt/install/status/ - tokenId: YWthZG1pbg==:9FCBA840BD274292F4DCC995BECE3D09 -logging: - file: C:/tmp/scriptexecutor.log - level: - com.akraino.bpm: debug - org.camunda.bpm: warn +camunda.bpm: + admin-user: + id: admin + password: admin + firstName: administrator + filter: + create: All tasks + buildresponseurl: http://localhost:8080/status/ + tokenId: YWthZG1pbg==:9FCBA840BD274292F4DCC995BECE3D09 +logging: + file: C:/tmp/scriptexecutor.log + level: + com.akraino.bpm: debug + org.camunda.bpm: warn org.springframework: warn \ No newline at end of file diff --git a/akraino/src/main/resources/onap.bpmn b/akraino/src/main/resources/onap.bpmn index 656ecd1..400b9c2 100644 --- a/akraino/src/main/resources/onap.bpmn +++ b/akraino/src/main/resources/onap.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_05ci0iu @@ -14,7 +14,7 @@ - + SequenceFlow_05ci0iu SequenceFlow_0envlli @@ -31,7 +31,7 @@ - File transfer script + File transfer script diff --git a/akraino/src/main/java/com/akraino/bpm/model/WorkflowResponse.java b/akraino/src/test/java/com/akraino/bpm/AkrainoSpringBootApplicationIT.java similarity index 59% rename from akraino/src/main/java/com/akraino/bpm/model/WorkflowResponse.java rename to akraino/src/test/java/com/akraino/bpm/AkrainoSpringBootApplicationIT.java index 0250334..f4a7ef4 100644 --- a/akraino/src/main/java/com/akraino/bpm/model/WorkflowResponse.java +++ b/akraino/src/test/java/com/akraino/bpm/AkrainoSpringBootApplicationIT.java @@ -14,29 +14,14 @@ * limitations under the License. */ -package com.akraino.bpm.model; +package com.akraino.bpm; -public class WorkflowResponse { - int status; - String message; - +import org.junit.runner.RunWith; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +public class AkrainoSpringBootApplicationIT { - public WorkflowResponse(int status, String message) { - super(); - this.status = status; - this.message = message; - } - public int getStatus() { - return status; - } - public void setStatus(int status) { - this.status = status; - } - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } + }