]> git.basschouten.com Git - openhab-addons.git/blob
f860f1554e4dbb0eff23a5f340d3625dc997ff49
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.gardena.internal.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * Represents a Gardena session.
19  *
20  * @author Gerhard Riegler - Initial contribution
21  */
22 public class Session {
23     @SerializedName("id")
24     private String token;
25     private long created;
26
27     @SerializedName("attributes")
28     private SessionAttributes sessionAttributes = new SessionAttributes();
29
30     public Session() {
31         this.created = System.currentTimeMillis();
32     }
33
34     /**
35      * Returns the token of the session.
36      */
37     public String getToken() {
38         return token;
39     }
40
41     /**
42      * Returns the creation timestamp of the session.
43      */
44     public long getCreated() {
45         return created;
46     }
47
48     /**
49      * Returns the session attributes.
50      */
51     public SessionAttributes getSessionAttributes() {
52         return sessionAttributes;
53     }
54 }