1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.gwe.app.daemon.domain;
18
19 import org.gwe.api.exceptions.PasswordMismatchException;
20 import org.gwe.drivers.netAccess.HostHandle;
21 import org.gwe.persistence.dao.AllocationInfoDAO;
22 import org.gwe.persistence.dao.ComputeResourceInfoDAO;
23 import org.gwe.persistence.dao.HeadResourceInfoDAO;
24 import org.gwe.persistence.dao.JobExecutionInfoDAO;
25 import org.gwe.persistence.dao.JobInfoDAO;
26 import org.gwe.persistence.dao.OrderInfoDAO;
27 import org.gwe.persistence.model.DaemonConfigDesc;
28 import org.gwe.utils.security.AccountInfo;
29 import org.gwe.utils.security.ResourceLink;
30
31
32
33
34
35
36
37 public class BaseDomain {
38
39 private DaemonConfigDesc config;
40 private ResourceLink<HostHandle> authLink = null;
41
42 protected HeadResourceInfoDAO headResourceDAO;
43 protected OrderInfoDAO orderDAO;
44 protected AllocationInfoDAO allocationDAO;
45 protected ComputeResourceInfoDAO computeResourceDAO;
46 protected JobInfoDAO jobDAO;
47 protected JobExecutionInfoDAO jobExecutionDAO;
48
49 public DaemonConfigDesc getConfig() {
50 return config;
51 }
52
53 public void setConfig(DaemonConfigDesc config) {
54 this.config = config;
55 }
56
57 public void verifyAccount(AccountInfo applyingAuth) throws PasswordMismatchException {
58 if (authLink == null) authLink = config.getDaemonHostLink();
59 if (!applyingAuth.equals(authLink.getAccountInfo()))
60 throw new PasswordMismatchException(authLink);
61 }
62
63 public HeadResourceInfoDAO getHeadResourceDAO() {
64 return headResourceDAO;
65 }
66
67 public void setHeadResourceDAO(HeadResourceInfoDAO headResourceDAO) {
68 this.headResourceDAO = headResourceDAO;
69 }
70
71 public OrderInfoDAO getOrderDAO() {
72 return orderDAO;
73 }
74
75 public void setOrderDAO(OrderInfoDAO orderDAO) {
76 this.orderDAO = orderDAO;
77 }
78
79 public AllocationInfoDAO getAllocationDAO() {
80 return allocationDAO;
81 }
82
83 public void setAllocationDAO(AllocationInfoDAO allocationDAO) {
84 this.allocationDAO = allocationDAO;
85 }
86
87 public ComputeResourceInfoDAO getComputeResourceDAO() {
88 return computeResourceDAO;
89 }
90
91 public void setComputeResourceDAO(ComputeResourceInfoDAO computeResourceDAO) {
92 this.computeResourceDAO = computeResourceDAO;
93 }
94
95 public JobInfoDAO getJobDAO() {
96 return jobDAO;
97 }
98
99 public void setJobDAO(JobInfoDAO jobDAO) {
100 this.jobDAO = jobDAO;
101 }
102
103 public JobExecutionInfoDAO getJobExecutionDAO() {
104 return jobExecutionDAO;
105 }
106
107 public void setJobExecutionDAO(JobExecutionInfoDAO jobExecutionDAO) {
108 this.jobExecutionDAO = jobExecutionDAO;
109 }
110 }