2 * ================================================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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 * ================================================================================
20 package org.openecomp.portalapp.portal.domain;
22 import java.util.Date;
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;
30 import org.openecomp.portalsdk.core.domain.support.DomainVo;
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.
39 @Table(name = "fn_shared_context")
40 public class SharedContext extends DomainVo {
43 private static final long serialVersionUID = 7287469622586677888L;
46 @GeneratedValue(strategy = GenerationType.AUTO)
48 private Date create_time;
49 private String context_id;
51 private String cvalue;
54 * Mandatory no-argument constructor
56 public SharedContext() {
60 * Convenience constructor. The database ID and creation timestamp are
61 * populated when the object is added to the database.
70 public SharedContext(final String contextId, final String key, final String value) {
71 this.context_id = contextId;
77 * Gets the database row ID.
79 * @return Database row ID
86 * Sets the database row ID.
91 public void setId(final Long id) {
96 * Gets the creation time
98 * @return Creation time as a Date
100 public Date getCreate_time() {
105 * Sets the creation time
110 public void setCreate_time(final Date create_time) {
111 this.create_time = create_time;
115 * Gets the context ID
119 public String getContext_id() {
124 * Sets the context ID
129 public void setContext_id(final String context_id) {
130 this.context_id = context_id;
134 * Gets the key of the key-value pair. Called ckey because "key" is a
135 * reserved word in Mysql.
139 public String getCkey() {
144 * Sets the key of the key-value pair.
149 public void setCkey(final String ckey) {
154 * Gets the value of the key-value pair. Called cvalue because "value" is a
155 * reserved word in Mysql.
159 public String getCvalue() {
164 * Sets the value of the key-value pair.
169 public void setCvalue(final String cvalue) {
170 this.cvalue = cvalue;