1 //******************************************************************
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 package org.iotivity.service.ns.common;
23 import android.util.Log;
24 import org.iotivity.base.OcRepresentation;
28 * @brief This class provides implementation of Notification Message object.
32 private static final String LOG_TAG = "NotificationService_Message";
34 public enum MessageType
43 private MessageType(int type)
48 public int getMessageType()
53 public long mMessageId = 0;
54 public String mProviderId = null;
56 public String mSourceName = null;
57 public MessageType mType = MessageType.ALERT;
58 public String mTime = null;
60 public String mTitle = null;
61 public String mContentText = null;
62 public MediaContents mMediaContents = null;
63 public String mTopic = null;
64 public OcRepresentation mExtraInfo = null;
66 private long mNativeHandle = 0;
68 public Message(String title, String contentText, String sourceName)
70 Log.i (LOG_TAG, "Message()");
73 mContentText = contentText;
74 mSourceName = sourceName;
77 public long getMessageId()
82 public String getProviderId()
87 public String getSourceName ()
92 public MessageType getType()
97 public String getTime()
107 public String getTitle()
112 public String getContentText()
117 public MediaContents getMediaContents()
119 return mMediaContents;
122 public String getTopic()
127 public OcRepresentation getExtraInfo()
132 public void setSourceName (String sourceName)
134 mSourceName = sourceName;
137 public void setType(MessageType type)
142 public void setTime(String time)
147 public void setTTL(long ttl)
152 public void setTitle(String title)
157 public void setContentText(String contextText)
159 mContentText = contextText;
162 public void setMediaContents(MediaContents mediaContents)
164 mMediaContents = mediaContents;
167 public void setTopic(String topic)
172 public void setExtraInfo(OcRepresentation extraInfo)
174 mExtraInfo = extraInfo;