View Javadoc

1   package org.restafarian.authorization.beans;
2   
3   import java.util.Date;
4   
5   import org.restafarian.core.beans.Person;
6   
7   /***
8    * <p>This entity bean defines a single Authorization.</p>
9    */
10  public class Authorization {
11  	private int id = -1;
12  	private boolean active = false;
13  	private String context = null;
14  	private String object = null;
15  	private String method = null;
16  	private String qualifier = null;
17  	private Person user = null;
18  	private Date activationDate = null;
19  	private Person activatedBy = null;
20  	private Date deactivationDate = null;
21  	private Person deactivatedBy = null;
22  
23  	public String toString() {
24  		StringBuffer buffer = new StringBuffer();
25  
26  		buffer.append("Authorization{id=");
27  		buffer.append(id);
28  		buffer.append(",active=");
29  		buffer.append(active);
30  		buffer.append(",context=\"");
31  		buffer.append(context);
32  		buffer.append("\",object=\"");
33  		buffer.append(object);
34  		buffer.append("\",method=\"");
35  		buffer.append(method);
36  		buffer.append("\",qualifier=\"");
37  		buffer.append(qualifier);
38  		buffer.append("\",user=Person{");
39  		if (user != null) {
40  			buffer.append("id=");
41  			buffer.append(user.getId());
42  			buffer.append(",name=\"");
43  			buffer.append(user.getName());
44  			buffer.append("\",uri=\"");
45  			buffer.append(user.getUri());
46  			buffer.append("\"");
47  		}
48  		buffer.append("},activationDate=\"");
49  		buffer.append(activationDate);
50  		buffer.append("\",activatedBy=Person{");
51  		if (activatedBy != null) {
52  			buffer.append("id=");
53  			buffer.append(activatedBy.getId());
54  			buffer.append(",name=\"");
55  			buffer.append(activatedBy.getName());
56  			buffer.append("\",uri=\"");
57  			buffer.append(activatedBy.getUri());
58  			buffer.append("\"");
59  		}
60  		buffer.append("},deactivationDate=\"");
61  		buffer.append(deactivationDate);
62  		buffer.append("\",deactivatedBy=Person{");
63  		if (deactivatedBy != null) {
64  			buffer.append("id=");
65  			buffer.append(deactivatedBy.getId());
66  			buffer.append(",name=\"");
67  			buffer.append(deactivatedBy.getName());
68  			buffer.append("\",uri=\"");
69  			buffer.append(deactivatedBy.getUri());
70  			buffer.append("\"");
71  		}
72  		buffer.append("}}");
73  
74  		return buffer.toString();
75  	}
76  
77  	public Person getActivatedBy() {
78  		return activatedBy;
79  	}
80  	public void setActivatedBy(Person activatedBy) {
81  		this.activatedBy = activatedBy;
82  	}
83  	public Date getActivationDate() {
84  		return activationDate;
85  	}
86  	public void setActivationDate(Date activationDate) {
87  		this.activationDate = activationDate;
88  	}
89  	public boolean isActive() {
90  		return active;
91  	}
92  	public void setActive(boolean active) {
93  		this.active = active;
94  	}
95  	public String getContext() {
96  		return context;
97  	}
98  	public void setContext(String context) {
99  		this.context = context;
100 	}
101 	public Person getDeactivatedBy() {
102 		return deactivatedBy;
103 	}
104 	public void setDeactivatedBy(Person deactivatedBy) {
105 		this.deactivatedBy = deactivatedBy;
106 	}
107 	public Date getDeactivationDate() {
108 		return deactivationDate;
109 	}
110 	public void setDeactivationDate(Date deactivationDate) {
111 		this.deactivationDate = deactivationDate;
112 	}
113 	public int getId() {
114 		return id;
115 	}
116 	public void setId(int id) {
117 		this.id = id;
118 	}
119 	public String getMethod() {
120 		return method;
121 	}
122 	public void setMethod(String method) {
123 		this.method = method;
124 	}
125 	public String getObject() {
126 		return object;
127 	}
128 	public void setObject(String object) {
129 		this.object = object;
130 	}
131 	public String getQualifier() {
132 		return qualifier;
133 	}
134 	public void setQualifier(String qualifier) {
135 		this.qualifier = qualifier;
136 	}
137 	public Person getUser() {
138 		return user;
139 	}
140 	public void setUser(Person user) {
141 		this.user = user;
142 	}
143 }