Fix build fail of notification android.
[platform/upstream/iotivity.git] / service / notification / android / notification-service / src / main / java / org / iotivity / service / ns / common / Message.java
1 //******************************************************************
2 //
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
21 package org.iotivity.service.ns.common;
22
23 import android.util.Log;
24 import org.iotivity.base.OcRepresentation;
25
26 /**
27   * @class   Message
28   * @brief   This class provides implementation of Notification Message object.
29   */
30 public class Message
31 {
32     private static final String LOG_TAG = "NotificationService_Message";
33
34     public enum MessageType
35     {
36         ALERT(0),
37         NOTICE(1),
38         EVENT(2),
39         INFO(3);
40         private int type;
41
42         private MessageType(int type)
43         {
44             this.type = type;
45         }
46
47         public int getMessageType()
48         {
49             return this.type;
50         }
51     };
52     public long mMessageId                     = 0;
53     public String mProviderId                  = null;
54
55     public String mSourceName                  = null;
56     public MessageType mType                   = MessageType.ALERT;
57     public String mTime                        = null;
58     public long mTTL                           = 0;
59     public String mTitle                       = null;
60     public String mContentText                 = null;
61     public MediaContents mMediaContents        = null;
62     public String mTopic                       = null;
63     public OcRepresentation mExtraInfo         = null;
64
65     private long mNativeHandle                 = 0;
66
67     public Message(String title, String contentText, String sourceName)
68     {
69         Log.i (LOG_TAG, "Message()");
70
71         mTitle = title;
72         mContentText = contentText;
73         mSourceName = sourceName;
74     }
75
76     public long getMessageId()
77     {
78         return mMessageId;
79     }
80
81     public String getProviderId()
82     {
83         return mProviderId;
84     }
85
86     public String getSourceName ()
87     {
88         return mSourceName;
89     }
90
91     public MessageType getType()
92     {
93         return mType;
94     }
95
96     public String getTime()
97     {
98         return mTime;
99     }
100
101     public long getTTL()
102     {
103         return mTTL;
104     }
105
106     public String getTitle()
107     {
108         return mTitle;
109     }
110
111     public String getContentText()
112     {
113         return mContentText;
114     }
115
116     public MediaContents getMediaContents()
117     {
118         return mMediaContents;
119     }
120
121     public String getTopic()
122     {
123         return mTopic;
124     }
125
126     public OcRepresentation getExtraInfo()
127     {
128         return mExtraInfo;
129     }
130
131     public void setSourceName (String sourceName)
132     {
133         mSourceName = sourceName;
134     }
135
136     public void setType(MessageType type)
137     {
138         mType = type;
139     }
140
141     public void setTime(String time)
142     {
143         mTime = time;
144     }
145
146     public void setTTL(long ttl)
147     {
148         mTTL = ttl;
149     }
150
151     public void setTitle(String title)
152     {
153         mTitle = title;
154     }
155
156     public void setContentText(String contextText)
157     {
158         mContentText = contextText;
159     }
160
161     public void setMediaContents(MediaContents mediaContents)
162     {
163         mMediaContents = mediaContents;
164     }
165
166     public void setTopic(String topic)
167     {
168         mTopic = topic;
169     }
170
171     public void setExtraInfo(OcRepresentation extraInfo)
172     {
173         mExtraInfo = extraInfo;
174     }
175 }