Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
904 | dev | 1 | package ak.hostcaptain.core.model; |
899 | dev | 2 | |
3 | import java.util.Date; |
||
4 | |||
5 | /** |
||
6 | * |
||
7 | * @hibernate.class table="domains" |
||
8 | */ |
||
9 | public class InetDomain |
||
913 | dev | 10 | extends GeneralModelObject |
899 | dev | 11 | { |
12 | private Long id; |
||
13 | private String name; |
||
14 | private User owner; |
||
15 | private Date modStamp; |
||
16 | |||
17 | protected InetDomain() |
||
18 | { |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * |
||
23 | * @hibernate.id generator-class="native" |
||
24 | */ |
||
25 | public Long getId() |
||
26 | { |
||
27 | return id; |
||
28 | } |
||
29 | |||
30 | public void setId(Long id) |
||
31 | { |
||
32 | this.id = id; |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * |
||
37 | * @hibernate.property |
||
38 | */ |
||
39 | public String getName() |
||
40 | { |
||
41 | return name; |
||
42 | } |
||
43 | |||
44 | public void setName(String name) |
||
45 | { |
||
46 | this.name = name; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * |
||
51 | * @hibernate.many-to-one |
||
52 | */ |
||
53 | public User getOwner() |
||
54 | { |
||
55 | return owner; |
||
56 | } |
||
57 | |||
58 | public void setOwner(User owner) |
||
59 | { |
||
60 | this.owner = owner; |
||
61 | } |
||
62 | |||
63 | /** |
||
64 | * |
||
65 | * @hibernate.timestamp column="mod_stamp" |
||
66 | */ |
||
67 | public Date getModStamp() |
||
68 | { |
||
69 | return modStamp; |
||
70 | } |
||
71 | |||
72 | public void setModStamp(Date modStamp) |
||
73 | { |
||
74 | this.modStamp = modStamp; |
||
75 | } |
||
76 | |||
77 | public String getTypeKey() |
||
78 | { |
||
904 | dev | 79 | return ak.hostcaptain.core.CoreResources.TYPE_DOMAIN; |
899 | dev | 80 | } |
81 | |||
913 | dev | 82 | public String getIdentKey() |
899 | dev | 83 | { |
913 | dev | 84 | return ak.hostcaptain.core.CoreResources.IDENT_DOMAIN; |
899 | dev | 85 | } |
913 | dev | 86 | |
87 | public Object[] getIdentParams() |
||
88 | { |
||
89 | return new Object[] { getName() }; |
||
90 | } |
||
914 | dev | 91 | |
92 | public boolean viewableBy(User user) |
||
93 | { |
||
94 | return user.isSuperuser() || user.equals(owner); |
||
95 | } |
||
96 | |||
97 | public boolean editableBy(User user) |
||
98 | { |
||
99 | return user.isSuperuser(); |
||
100 | } |
||
101 | |||
102 | public boolean deleteableBy(User user) |
||
103 | { |
||
104 | return user.isSuperuser(); |
||
105 | } |
||
899 | dev | 106 | } |