2 * ================================================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ================================================================================
\r
20 package org.openecomp.portalapp.portal.domain;
\r
22 import java.util.Date;
\r
24 import javax.persistence.Entity;
\r
25 import javax.persistence.GeneratedValue;
\r
26 import javax.persistence.GenerationType;
\r
27 import javax.persistence.Id;
\r
28 import javax.persistence.Table;
\r
30 import org.openecomp.portalsdk.core.domain.support.DomainVo;
\r
33 * A shared context is a key-value pair in a session. All shared-context objects
\r
34 * should be dropped when a session is destroyed. Because there's always a
\r
35 * chance of missing that event, this object notes its creation time so that it
\r
36 * can be expired after a suitable time interval.
\r
39 @Table(name = "fn_shared_context")
\r
40 public class SharedContext extends DomainVo {
\r
43 private static final long serialVersionUID = 7287469622586677888L;
\r
46 @GeneratedValue(strategy = GenerationType.AUTO)
\r
48 private Date create_time;
\r
49 private String context_id;
\r
50 private String ckey;
\r
51 private String cvalue;
\r
54 * Mandatory no-argument constructor
\r
56 public SharedContext() {
\r
60 * Convenience constructor. The database ID and creation timestamp are
\r
61 * populated when the object is added to the database.
\r
63 public SharedContext(final String contextId, final String key, final String value) {
\r
64 this.context_id = contextId;
\r
66 this.cvalue = value;
\r
70 * Gets the database row ID.
\r
72 * @return Database row ID
\r
74 public Long getId() {
\r
79 * Sets the database row ID.
\r
83 public void setId(final Long id) {
\r
88 * Gets the creation time
\r
90 * @return Creation time as a Date
\r
92 public Date getCreate_time() {
\r
97 * Sets the creation time
\r
99 * @param create_time
\r
101 public void setCreate_time(final Date create_time) {
\r
102 this.create_time = create_time;
\r
106 * Gets the context ID
\r
108 * @return Context ID
\r
110 public String getContext_id() {
\r
115 * Sets the context ID
\r
117 * @param context_id
\r
119 public void setContext_id(final String context_id) {
\r
120 this.context_id = context_id;
\r
124 * Gets the key of the key-value pair. Called ckey because "key" is a
\r
125 * reserved word in Mysql.
\r
129 public String getCkey() {
\r
134 * Sets the key of the key-value pair.
\r
138 public void setCkey(final String ckey) {
\r
143 * Gets the value of the key-value pair. Called cvalue because "value" is a
\r
144 * reserved word in Mysql.
\r
148 public String getCvalue() {
\r
153 * Sets the value of the key-value pair.
\r
157 public void setCvalue(final String cvalue) {
\r
158 this.cvalue = cvalue;
\r