nexus site path corrected
[portal.git] / ecomp-portal-BE / src / main / java / org / openecomp / portalapp / portal / domain / SharedContext.java
1 /*-
2  * ================================================================================
3  * eCOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.domain;
21
22 import java.util.Date;
23
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.GenerationType;
27 import javax.persistence.Id;
28 import javax.persistence.Table;
29
30 import org.openecomp.portalsdk.core.domain.support.DomainVo;
31
32 /**
33  * A shared context is a key-value pair in a session. All shared-context objects
34  * should be dropped when a session is destroyed. Because there's always a
35  * chance of missing that event, this object notes its creation time so that it
36  * can be expired after a suitable time interval.
37  */
38 @Entity
39 @Table(name = "fn_shared_context")
40 public class SharedContext extends DomainVo {
41
42         // generated
43         private static final long serialVersionUID = 7287469622586677888L;
44
45         @Id
46         @GeneratedValue(strategy = GenerationType.AUTO)
47         private Long id;
48         private Date create_time;
49         private String context_id;
50         private String ckey;
51         private String cvalue;
52
53         /**
54          * Mandatory no-argument constructor
55          */
56         public SharedContext() {
57         }
58
59         /**
60          * Convenience constructor. The database ID and creation timestamp are
61          * populated when the object is added to the database.
62          */
63         public SharedContext(final String contextId, final String key, final String value) {
64                 this.context_id = contextId;
65                 this.ckey = key;
66                 this.cvalue = value;
67         }
68
69         /**
70          * Gets the database row ID.
71          * 
72          * @return Database row ID
73          */
74         public Long getId() {
75                 return id;
76         }
77
78         /**
79          * Sets the database row ID.
80          * 
81          * @param id
82          */
83         public void setId(final Long id) {
84                 this.id = id;
85         }
86
87         /**
88          * Gets the creation time
89          * 
90          * @return Creation time as a Date
91          */
92         public Date getCreate_time() {
93                 return create_time;
94         }
95
96         /**
97          * Sets the creation time
98          * 
99          * @param create_time
100          */
101         public void setCreate_time(final Date create_time) {
102                 this.create_time = create_time;
103         }
104
105         /**
106          * Gets the context ID
107          * 
108          * @return Context ID
109          */
110         public String getContext_id() {
111                 return context_id;
112         }
113
114         /**
115          * Sets the context ID
116          * 
117          * @param context_id
118          */
119         public void setContext_id(final String context_id) {
120                 this.context_id = context_id;
121         }
122
123         /**
124          * Gets the key of the key-value pair. Called ckey because "key" is a
125          * reserved word in Mysql.
126          * 
127          * @return The key
128          */
129         public String getCkey() {
130                 return ckey;
131         }
132
133         /**
134          * Sets the key of the key-value pair.
135          * 
136          * @param ckey
137          */
138         public void setCkey(final String ckey) {
139                 this.ckey = ckey;
140         }
141
142         /**
143          * Gets the value of the key-value pair. Called cvalue because "value" is a
144          * reserved word in Mysql.
145          * 
146          * @return
147          */
148         public String getCvalue() {
149                 return cvalue;
150         }
151
152         /**
153          * Sets the value of the key-value pair.
154          * 
155          * @param cvalue
156          */
157         public void setCvalue(final String cvalue) {
158                 this.cvalue = cvalue;
159         }
160
161 }