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
42 private MessageType(int type)
47 public int getMessageType()
52 public long mMessageId = 0;
53 public String mProviderId = null;
55 public String mSourceName = null;
56 public MessageType mType = MessageType.ALERT;
57 public String mTime = null;
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;
65 private long mNativeHandle = 0;
67 public Message(String title, String contentText, String sourceName)
69 Log.i (LOG_TAG, "Message()");
72 mContentText = contentText;
73 mSourceName = sourceName;
76 public long getMessageId()
81 public String getProviderId()
86 public String getSourceName ()
91 public MessageType getType()
96 public String getTime()
106 public String getTitle()
111 public String getContentText()
116 public MediaContents getMediaContents()
118 return mMediaContents;
121 public String getTopic()
126 public OcRepresentation getExtraInfo()
131 public void setSourceName (String sourceName)
133 mSourceName = sourceName;
136 public void setType(MessageType type)
141 public void setTime(String time)
146 public void setTTL(long ttl)
151 public void setTitle(String title)
156 public void setContentText(String contextText)
158 mContentText = contextText;
161 public void setMediaContents(MediaContents mediaContents)
163 mMediaContents = mediaContents;
166 public void setTopic(String topic)
171 public void setExtraInfo(OcRepresentation extraInfo)
173 mExtraInfo = extraInfo;