Null check for ClientResponse in PolicyUril.java
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / command / PostSearchBean.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the “License”);
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.openecomp.portalapp.command;
39
40 import java.util.List;
41
42 import org.openecomp.portalapp.portal.domain.EPUser;
43 import org.openecomp.portalsdk.core.command.support.SearchBase;
44
45 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
46
47 @JsonSerialize
48 public class PostSearchBean extends SearchBase {
49
50     private EPUser     user     = null;
51     private EPUser     userOrig = null;
52     private String[] selected;
53     private String[] postHrid;
54     private String[] postOrgUserId;
55     private String[] postFirstName;
56     private String[] postLastName;
57     private String[] postOrgCode;
58     private String[] postPhone;
59     private String[] postEmail;
60     private String[] postAddress1;
61     private String[] postAddress2;
62     private String[] postCity;
63     private String[] postState;
64     private String[] postZipCode;
65     private String[] postLocationClli;
66     private String[] postBusinessCountryCode;
67     private String[] postBusinessCountryName;
68     private String[] postDepartment;
69     private String[] postDepartmentName;
70     private String[] postBusinessUnit;
71     private String[] postBusinessUnitName;
72     private String[] postJobTitle;
73     private String[] postOrgManagerUserId;
74     private String[] postCommandChain;
75     private String[] postCompanyCode;
76     private String[] postCompany;
77     private String[] postCostCenter;
78     private String[] postSiloStatus;
79     private String[] postFinancialLocCode;
80
81
82     public PostSearchBean() {
83       this(null);
84     } // PostSearchBean
85
86     public PostSearchBean(List<?> items) {
87       super(items);
88
89       user     = new EPUser();
90       userOrig = new EPUser();
91
92       setSortBy1("");
93       setSortBy1Orig("");
94
95       //setSortByList(...);
96     }   // PostSearchBean
97
98
99     public String getFirstName()                      { return user.getFirstName(); }
100     public String getLastName()                       { return user.getLastName(); }
101     public String getHrid()                           { return user.getHrid(); }
102     public String getOrgUserId()                      { return user.getOrgUserId(); }
103     public String getOrgCode()                        { return user.getOrgCode(); }
104     public String getEmail()                          { return user.getEmail(); }
105     public String getOrgManagerUserId()                  { return user.getOrgManagerUserId(); }
106     
107     public String getFirstNameOrig()                  { return user.getFirstName(); }
108     public String getLastNameOrig()                   { return user.getLastName(); }
109     public String getHridOrig()                       { return user.getHrid(); }
110     public String getOrgUserIdOrig()                  { return user.getOrgUserId(); }
111     public String getOrgCodeOrig()                    { return user.getOrgCode(); }
112     public String getEmailOrig()                      { return user.getEmail(); }
113     public String getOrgManagerUserIdOrig()              { return user.getOrgManagerUserId(); }
114     
115     
116     public EPUser getUser()                             { return user; }
117
118     public String[] getPostEmail() {
119         return postEmail;
120     }
121
122     public String[] getPostFirstName() {
123         return postFirstName;
124     }
125
126     public String[] getPostHrid() {
127         return postHrid;
128     }
129
130     public String[] getPostLastName() {
131         return postLastName;
132     }
133
134     public String[] getPostOrgCode() {
135         return postOrgCode;
136     }
137
138     public String[] getPostPhone() {
139         return postPhone;
140     }
141
142     public String[] getPostOrgUserId() {
143         return postOrgUserId;
144     }
145
146     public String[] getSelected() {
147         return selected;
148     }
149
150     public String[] getPostAddress1() {
151         return postAddress1;
152     }
153
154     public String[] getPostBusinessCountryCode() {
155         return postBusinessCountryCode;
156     }
157
158     public String[] getPostCity() {
159         return postCity;
160     }
161
162     public String[] getPostCommandChain() {
163         return postCommandChain;
164     }
165
166     public String[] getPostCompany() {
167         return postCompany;
168     }
169
170     public String[] getPostCompanyCode() {
171         return postCompanyCode;
172     }
173
174     public String[] getPostDepartment() {
175         return postDepartment;
176     }
177
178     public String[] getPostDepartmentName() {
179         return postDepartmentName;
180     }
181
182     public String[] getPostBusinessCountryName() {
183         return postBusinessCountryName;
184     }
185
186     public String[] getPostJobTitle() {
187         return postJobTitle;
188     }
189
190     public String[] getPostLocationClli() {
191         return postLocationClli;
192     }
193
194     public String[] getPostManagerUserId() {
195         return postOrgManagerUserId;
196     }
197
198     public String[] getPostState() {
199         return postState;
200     }
201
202     public String[] getPostZipCode() {
203         return postZipCode;
204     }
205
206     public void setFirstName(String value)            { user.setFirstName(value); }
207     public void setLastName(String value)             { user.setLastName(value); }
208     public void setHrid(String value)                 { user.setHrid(value); }
209     public void setOrgUserId(String value)            { user.setOrgUserId(value); }
210     public void setOrgCode(String value)              { user.setOrgCode(value); }
211     public void setEmail(String value)                { user.setEmail(value); }
212     public void setOrgManagerUserId(String value)     { user.setOrgManagerUserId(value); }
213     
214     public void setFirstNameOrig(String value)        { userOrig.setFirstName(value); }
215     public void setLastNameOrig(String value)         { userOrig.setLastName(value); }
216     public void setHridOrig(String value)             { userOrig.setHrid(value); }
217     public void setOrgUserIdOrig(String value)        { userOrig.setOrgUserId(value); }
218     public void setOrgCodeOrig(String value)          { userOrig.setOrgCode(value); }
219     public void setEmailOrig(String value)            { userOrig.setEmail(value); }
220     public void setOrgManagerUserIdOrig(String value) { userOrig.setOrgManagerUserId(value); }
221     
222     public void setUser(EPUser value)                   { this.user = value; }
223
224     public void setPostEmail(String[] postEmail) {
225         this.postEmail = postEmail;
226     }
227
228     public void setPostFirstName(String[] postFirstName) {
229         this.postFirstName = postFirstName;
230     }
231
232     public void setPostHrid(String[] postHrid) {
233         this.postHrid = postHrid;
234     }
235
236     public void setPostLastName(String[] postLastName) {
237         this.postLastName = postLastName;
238     }
239
240     public void setPostOrgCode(String[] postOrgCode) {
241         this.postOrgCode = postOrgCode;
242     }
243
244     public void setPostPhone(String[] postPhone) {
245         this.postPhone = postPhone;
246     }
247
248     public void setPostUserId(String[] postOrgUserId) {
249         this.postOrgUserId = postOrgUserId;
250     }
251
252     public void setSelected(String[] selected) {
253         this.selected = selected;
254     }
255
256     public void setPostAddress1(String[] postAddress1) {
257         this.postAddress1 = postAddress1;
258     }
259
260     public void setPostBusinessCountryCode(String[] postBusinessCountryCode) {
261         this.postBusinessCountryCode = postBusinessCountryCode;
262     }
263
264     public void setPostCity(String[] postCity) {
265         this.postCity = postCity;
266     }
267
268     public void setPostCommandChain(String[] postCommandChain) {
269         this.postCommandChain = postCommandChain;
270     }
271
272     public void setPostCompany(String[] postCompany) {
273         this.postCompany = postCompany;
274     }
275
276     public void setPostCompanyCode(String[] postCompanyCode) {
277         this.postCompanyCode = postCompanyCode;
278     }
279
280     public void setPostDepartment(String[] postDepartment) {
281         this.postDepartment = postDepartment;
282     }
283
284     public void setPostDepartmentName(String[] postDepartmentName) {
285         this.postDepartmentName = postDepartmentName;
286     }
287
288     public void setPostBusinessCountryName(String[] postBusinessCountryName) {
289         this.postBusinessCountryName = postBusinessCountryName;
290     }
291
292     public void setPostJobTitle(String[] postJobTitle) {
293         this.postJobTitle = postJobTitle;
294     }
295
296     public void setPostLocationClli(String[] postLocationClli) {
297         this.postLocationClli = postLocationClli;
298     }
299
300     public void setPostManagerUserId(String[] postOrgManagerUserId) {
301         this.postOrgManagerUserId = postOrgManagerUserId;
302     }
303
304     public void setPostState(String[] postState) {
305         this.postState = postState;
306     }
307
308     public void setPostZipCode(String[] postZipCode) {
309         this.postZipCode = postZipCode;
310     }
311     
312     public String[] getPostAddress2() {
313                 return postAddress2;
314         }
315
316         public void setPostAddress2(String[] postAddress2) {
317                 this.postAddress2 = postAddress2;
318         }
319
320         public EPUser getUserOrig() {
321                 return userOrig;
322         }
323
324         public void setUserOrig(EPUser userOrig) {
325                 this.userOrig = userOrig;
326         }
327
328         public String[] getPostBusinessUnit() {
329                 return postBusinessUnit;
330         }
331
332         public void setPostBusinessUnit(String[] postBusinessUnit) {
333                 this.postBusinessUnit = postBusinessUnit;
334         }
335
336         public String[] getPostBusinessUnitName() {
337                 return postBusinessUnitName;
338         }
339
340         public void setPostBusinessUnitName(String[] postBusinessUnitName) {
341                 this.postBusinessUnitName = postBusinessUnitName;
342         }
343
344         public String[] getPostCostCenter() {
345                 return postCostCenter;
346         }
347
348         public void setPostCostCenter(String[] postCostCenter) {
349                 this.postCostCenter = postCostCenter;
350         }
351
352         public String[] getPostSiloStatus() {
353                 return postSiloStatus;
354         }
355
356         public void setPostSiloStatus(String[] postSiloStatus) {
357                 this.postSiloStatus = postSiloStatus;
358         }
359
360         public String[] getPostFinancialLocCode() {
361                 return postFinancialLocCode;
362         }
363
364         public void setPostFinancialLocCode(String[] postFinancialLocCode) {
365                 this.postFinancialLocCode = postFinancialLocCode;
366         }
367
368         public void resetSearch() {
369           super.resetSearch();
370           setUser(new EPUser());
371         } // resetSearch
372
373
374         public boolean isCriteriaUpdated() {
375           if(user==null&&userOrig==null)
376             return false;
377           else if(user==null||userOrig==null)
378             return true;
379           else
380             return (! (
381                 Utilities.nvl(user.getFirstName()).equals(Utilities.nvl(userOrig.getFirstName()))&&
382                 Utilities.nvl(user.getLastName()).equals(Utilities.nvl(userOrig.getLastName()))&&
383                 //Utilities.nvl(user.getHrid()).equals(Utilities.nvl(userOrig.getHrid()))&&
384                 Utilities.nvl(user.getOrgUserId()).equals(Utilities.nvl(userOrig.getOrgUserId()))&&
385                 Utilities.nvl(user.getOrgCode()).equals(Utilities.nvl(userOrig.getOrgCode()))&&
386                 Utilities.nvl(user.getEmail()).equals(Utilities.nvl(userOrig.getEmail()))&&
387                 Utilities.nvl(user.getOrgManagerUserId()).equals(Utilities.nvl(userOrig.getOrgManagerUserId()))&&
388                 true));
389        } // isCriteriaUpdated
390
391 }       // PostSearchBean