package org.iotivity.service.ns.common;
import android.util.Log;
+import org.iotivity.base.OcRepresentation;
/**
- * @class Message
- * @brief This class provides implementation of Notification Message object.
- */
-public class Message
-{
+ *
+ * This class provides implementation of Notification Message object.
+ *
+ */
+public class Message {
+
private static final String LOG_TAG = "NotificationService_Message";
- public enum MessageType
- {
- ALERT(0),
- NOTICE(1),
- EVENT(2),
- INFO(3);
+ /**
+ * This enum is used to represent different types of notification messages
+ */
+ public enum MessageType {
+ ALERT(1),
+ NOTICE(2),
+ EVENT(3),
+ INFO(4),
+ WARNING(5);
+
private int type;
- private MessageType(int type)
- {
- this.type = type;
- }
+ private MessageType(int type) {
+ this.type = type;
+ }
- public int getMessageType()
- {
- return this.type;
- }
+ public int getMessageType() {
+ return this.type;
+ }
};
- public long mMessageId = 0;
- public String mProviderId = null;
- public String mSourceName = null;
- public MessageType mType = MessageType.ALERT;
- public String mTime = null;
- public long mTTL = 0;
- public String mTitle = null;
- public String mContentText = null;
- public MediaContents mMediaContents = null;
+ private long mMessageId = 0;
+ private String mProviderId = null;
- private long mNativeHandle = 0;
+ private String mSourceName = null;
+ private MessageType mType = MessageType.ALERT;
+ private String mTime = null;
+ private long mTTL = 0;
+ private String mTitle = null;
+ private String mContentText = null;
+ private MediaContents mMediaContents = null;
+ private String mTopic = null;
+ private OcRepresentation mExtraInfo = null;
- public Message(String title, String contentText, String sourceName)
- {
- Log.i (LOG_TAG, "Message()");
+ public Message(String title, String contentText, String sourceName) {
+ Log.i(LOG_TAG, "Message()");
mTitle = title;
mContentText = contentText;
mSourceName = sourceName;
}
- public long getMessageId()
- {
+ public long getMessageId() {
return mMessageId;
}
- public String getProviderId()
- {
+ public String getProviderId() {
return mProviderId;
}
- public String getSourceName ()
- {
+ public String getSourceName() {
return mSourceName;
}
- public MessageType getType()
- {
+ public MessageType getType() {
return mType;
}
- public String getTime()
- {
+ public String getTime() {
return mTime;
}
- public long getTTL()
- {
+ public long getTTL() {
return mTTL;
}
- public String getTitle()
- {
+ public String getTitle() {
return mTitle;
}
- public String getContentText()
- {
+ public String getContentText() {
return mContentText;
}
- public MediaContents getMediaContents()
- {
+ public MediaContents getMediaContents() {
return mMediaContents;
}
- public void setSourceName (String sourceName)
- {
+ public String getTopic() {
+ return mTopic;
+ }
+
+ public OcRepresentation getExtraInfo() {
+ return mExtraInfo;
+ }
+
+ public void setSourceName(String sourceName) {
mSourceName = sourceName;
}
- public void setType(MessageType type)
- {
+ public void setType(MessageType type) {
mType = type;
}
- public void setTime(String time)
- {
+ public void setTime(String time) {
mTime = time;
}
- public void setTTL(long ttl)
- {
+ public void setTTL(long ttl) {
mTTL = ttl;
}
- public void setTitle(String title)
- {
+ public void setTitle(String title) {
mTitle = title;
}
- public void setContentText(String contextText)
- {
+ public void setContentText(String contextText) {
mContentText = contextText;
}
- public void setMediaContents(MediaContents mediaContents)
- {
+ public void setMediaContents(MediaContents mediaContents) {
mMediaContents = mediaContents;
}
+
+ public void setTopic(String topic) {
+ mTopic = topic;
+ }
+
+ public void setExtraInfo(OcRepresentation extraInfo) {
+ mExtraInfo = extraInfo;
+ }
}