01: /*
02: * Copyright 2005-2006 The Kuali Foundation.
03: *
04: *
05: * Licensed under the Educational Community License, Version 1.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.opensource.org/licenses/ecl1.php
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package edu.iu.uis.eden.clientapp.vo;
18:
19: /**
20: * Transport for representing a user, workgroup, or role associated with and request
21: *
22: * @workflow.webservice-object
23: * @author ewestfal
24: */
25: public class ResponsiblePartyVO implements java.io.Serializable {
26:
27: static final long serialVersionUID = 5716093378476396724L;
28:
29: private UserIdVO userId;
30: private WorkgroupIdVO workgroupId;
31: private String roleName;
32:
33: public ResponsiblePartyVO() {
34: }
35:
36: public ResponsiblePartyVO(WorkgroupIdVO workgroupId) {
37: this .workgroupId = workgroupId;
38: }
39:
40: public ResponsiblePartyVO(UserIdVO userId) {
41: this .userId = userId;
42: }
43:
44: public ResponsiblePartyVO(String roleName) {
45: this .roleName = roleName;
46: }
47:
48: public boolean isUser() {
49: return userId != null;
50: }
51:
52: public boolean isWorkgroup() {
53: return workgroupId != null;
54: }
55:
56: public boolean isRole() {
57: return roleName != null;
58: }
59:
60: public String toString() {
61: StringBuffer sb = new StringBuffer("[");
62: if (isUser()) {
63: sb.append("user=");
64: sb.append(userId == null ? "null" : userId.toString());
65: } else {
66: sb.append("workgroupID=");
67: sb.append(workgroupId == null ? "null" : workgroupId
68: .toString());
69: }
70:
71: sb.append("]");
72:
73: return sb.toString();
74: }
75:
76: public WorkgroupIdVO getWorkgroupId() {
77: return workgroupId;
78: }
79:
80: public void setWorkgroupId(WorkgroupIdVO workgroupId) {
81: this .workgroupId = workgroupId;
82: }
83:
84: public UserIdVO getUserId() {
85: return userId;
86: }
87:
88: public void setUserId(UserIdVO userId) {
89: this .userId = userId;
90: }
91:
92: public String getRoleName() {
93: return roleName;
94: }
95:
96: public void setRoleName(String roleName) {
97: this.roleName = roleName;
98: }
99: }
|