|
1 | 1 | package com.park.utmstack.domain.logstash_pipeline; |
2 | 2 |
|
| 3 | +import com.park.utmstack.domain.application_modules.UtmModule; |
3 | 4 | import com.park.utmstack.service.logstash_pipeline.enums.PipelineStatus; |
| 5 | +import lombok.*; |
| 6 | + |
4 | 7 | import org.hibernate.annotations.GenericGenerator; |
5 | 8 |
|
6 | 9 | import javax.persistence.*; |
7 | 10 | import javax.validation.constraints.Size; |
8 | 11 | import java.io.Serializable; |
9 | 12 |
|
10 | | -/** |
11 | | - * A UtmLogstashPipeline. |
12 | | - */ |
13 | 13 | @Entity |
14 | 14 | @Table(name = "utm_logstash_pipeline") |
| 15 | +@Getter |
| 16 | +@Setter |
| 17 | +@NoArgsConstructor |
| 18 | +@AllArgsConstructor |
| 19 | +@Builder |
15 | 20 | public class UtmLogstashPipeline implements Serializable { |
16 | 21 |
|
17 | 22 | private static final long serialVersionUID = 1L; |
@@ -48,103 +53,14 @@ public class UtmLogstashPipeline implements Serializable { |
48 | 53 | @Column(name = "events_out") |
49 | 54 | private Long eventsOut; |
50 | 55 |
|
| 56 | + @OneToOne |
| 57 | + @JoinColumn(name = "module_name", referencedColumnName = "module_name", insertable = false, updatable = false) |
| 58 | + private UtmModule utmModule; |
51 | 59 |
|
52 | | - public UtmLogstashPipeline(){} |
53 | | - public UtmLogstashPipeline(Long id, String pipelineId, |
54 | | - String pipelineName, |
55 | | - String pipelineStatus, |
56 | | - String moduleName, |
57 | | - Boolean systemOwner, |
58 | | - String pipelineDescription, |
59 | | - Boolean pipelineInternal, |
60 | | - Long eventsOut) { |
61 | | - this.id = id; |
62 | | - this.pipelineId = pipelineId; |
63 | | - this.pipelineName = pipelineName; |
64 | | - this.pipelineStatus = pipelineStatus; |
65 | | - this.moduleName = moduleName; |
66 | | - this.systemOwner = systemOwner; |
67 | | - this.pipelineDescription = pipelineDescription; |
68 | | - this.pipelineInternal = pipelineInternal==null?false:pipelineInternal; |
69 | | - this.eventsOut = eventsOut==null?0L:eventsOut; |
70 | | - } |
71 | | - |
72 | | - public Long getId() { |
73 | | - return id; |
74 | | - } |
75 | | - |
76 | | - public void setId(Long id) { |
77 | | - this.id = id; |
78 | | - } |
79 | | - |
80 | | - public String getPipelineId() { |
81 | | - return pipelineId; |
82 | | - } |
83 | | - |
84 | | - public void setPipelineId(String pipelineId) { |
85 | | - this.pipelineId = pipelineId; |
86 | | - } |
87 | | - |
88 | | - public String getPipelineName() { |
89 | | - return pipelineName; |
90 | | - } |
91 | | - |
92 | | - public void setPipelineName(String pipelineName) { |
93 | | - this.pipelineName = pipelineName; |
94 | | - } |
95 | | - |
96 | | - public String getPipelineStatus() { |
97 | | - return pipelineStatus; |
98 | | - } |
99 | | - |
100 | | - public void setPipelineStatus(String pipelineStatus) { |
101 | | - this.pipelineStatus = pipelineStatus; |
102 | | - } |
103 | | - |
104 | | - public String getModuleName() { |
105 | | - return moduleName; |
106 | | - } |
107 | | - |
108 | | - public void setModuleName(String moduleName) { |
109 | | - this.moduleName = moduleName; |
110 | | - } |
111 | | - |
112 | | - public Boolean getSystemOwner() { |
113 | | - return systemOwner; |
114 | | - } |
115 | | - |
116 | | - public void setSystemOwner(Boolean systemOwner) { |
117 | | - this.systemOwner = systemOwner; |
118 | | - } |
119 | | - |
120 | | - public String getPipelineDescription() { |
121 | | - return pipelineDescription; |
122 | | - } |
123 | | - |
124 | | - public void setPipelineDescription(String pipelineDescription) { |
125 | | - this.pipelineDescription = pipelineDescription; |
126 | | - } |
127 | | - |
128 | | - public Boolean getPipelineInternal() { |
129 | | - return pipelineInternal; |
130 | | - } |
131 | | - |
132 | | - public void setPipelineInternal(Boolean pipelineInternal) { |
133 | | - this.pipelineInternal = pipelineInternal; |
134 | | - } |
135 | | - |
136 | | - public Long getEventsOut() { |
137 | | - return eventsOut; |
138 | | - } |
139 | | - |
140 | | - public void setEventsOut(Long eventsOut) { |
141 | | - this.eventsOut = eventsOut; |
142 | | - } |
143 | | - |
144 | | - public void setDefaults(){ |
| 60 | + public void setDefaults() { |
145 | 61 | this.systemOwner = false; |
146 | | - this.pipelineInternal = this.pipelineInternal==null?false:this.pipelineInternal; |
147 | | - this.eventsOut = this.eventsOut==null?0L:this.eventsOut; |
| 62 | + this.pipelineInternal = this.pipelineInternal == null ? false : this.pipelineInternal; |
| 63 | + this.eventsOut = this.eventsOut == null ? 0L : this.eventsOut; |
148 | 64 | this.pipelineStatus = PipelineStatus.PIPELINE_STATUS_DOWN.get(); |
149 | 65 | } |
150 | 66 | } |
0 commit comments