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.
63 public SharedContext(final String contextId, final String key, final String value) {
64 this.context_id = contextId;
70 * Gets the database row ID.
72 * @return Database row ID
79 * Sets the database row ID.
83 public void setId(final Long id) {
88 * Gets the creation time
90 * @return Creation time as a Date
92 public Date getCreate_time() {
97 * Sets the creation time
101 public void setCreate_time(final Date create_time) {
102 this.create_time = create_time;
106 * Gets the context ID
110 public String getContext_id() {
115 * Sets the context ID
119 public void setContext_id(final String context_id) {
120 this.context_id = context_id;
124 * Gets the key of the key-value pair. Called ckey because "key" is a
125 * reserved word in Mysql.
129 public String getCkey() {
134 * Sets the key of the key-value pair.
138 public void setCkey(final String ckey) {
143 * Gets the value of the key-value pair. Called cvalue because "value" is a
144 * reserved word in Mysql.
148 public String getCvalue() {
153 * Sets the value of the key-value pair.
157 public void setCvalue(final String cvalue) {
158 this.cvalue = cvalue;