b27d2e2d45f71b2a5cd3e1766d14cc676c59b5f3
[portal/sdk.git] /
1 /*-
2  * ================================================================================
3  * eCOMP Portal SDK
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalsdk.workflow.services;
21
22 import java.util.List;
23
24 import org.openecomp.portalsdk.workflow.dao.WorkflowDAO;
25 import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule;
26 import org.openecomp.portalsdk.workflow.models.Workflow;
27 import org.openecomp.portalsdk.workflow.models.WorkflowLite;
28 import org.springframework.beans.factory.annotation.Autowired;
29 import org.springframework.stereotype.Service;
30
31
32 @Service("workflowService")
33 public class WorkflowServiceImpl implements WorkflowService {
34     
35     @Autowired
36     private WorkflowDAO workflowDAO;
37     
38         //@Autowired
39         //private DataAccessService  dataAccessService;
40         
41         @Autowired
42         private WorkflowScheduleService workflowScheduleService;
43
44         @Override
45         public void saveCronJob(WorkflowSchedule domainCronJobData) {
46                 // TODO Auto-generated method stub
47                 workflowScheduleService.saveWorkflowSchedule(domainCronJobData);
48 /*              triggerWorkflowScheduling((SchedulerFactoryBean)appContext.getBean(SchedulerFactoryBean.class),domainCronJobData);              
49 */      }
50
51         /*
52     private DataAccessService getDataAccessService() {
53                 // TODO Auto-generated method stub
54         return dataAccessService;
55         }
56         */
57
58         @Override
59     public Workflow addWorkflow(Workflow workflow, String creatorId) {
60         return workflowDAO.save(workflow, creatorId);
61     }
62
63     @Override
64         public Workflow editWorkflow(WorkflowLite workflow, String creatorId) {
65                 return workflowDAO.edit(workflow, creatorId);
66         }
67         
68     @Override
69     public void deleteWorkflow(Long workflowId) {
70         workflowDAO.delete(workflowId);
71     }
72
73     @Override
74     public List<Workflow> getAllWorkflows() {
75         return workflowDAO.getWorkflows();
76     }
77 }