View Javadoc
1   /*
2    * Copyright (C) 2013 4th Line GmbH, Switzerland
3    *
4    * The contents of this file are subject to the terms of either the GNU
5    * Lesser General Public License Version 2 or later ("LGPL") or the
6    * Common Development and Distribution License Version 1 or later
7    * ("CDDL") (collectively, the "License"). You may not use this file
8    * except in compliance with the License. See LICENSE.txt for more
9    * information.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14   */
15  
16  package org.fourthline.cling.support.messagebox.model;
17  
18  import org.fourthline.cling.support.messagebox.parser.MessageElement;
19  
20  /**
21   * @author Christian Bauer
22   */
23  public class MessageScheduleReminder extends Message {
24  
25      final private DateTime startTime;
26      final private NumberName owner;
27      final private String subject;
28      final private DateTime endTime;
29      final private String location;
30      final private String body;
31  
32      public MessageScheduleReminder(DateTime startTime, NumberName owner, String subject,
33                                     DateTime endTime, String location, String body) {
34          this(DisplayType.MAXIMUM, startTime, owner, subject, endTime, location, body);
35      }
36  
37      public MessageScheduleReminder(DisplayType displayType, DateTime startTime, NumberName owner, String subject,
38                                     DateTime endTime, String location, String body) {
39          super(Category.SCHEDULE_REMINDER, displayType);
40          this.startTime = startTime;
41          this.owner = owner;
42          this.subject = subject;
43          this.endTime = endTime;
44          this.location = location;
45          this.body = body;
46      }
47  
48      public DateTime getStartTime() {
49          return startTime;
50      }
51  
52      public NumberName getOwner() {
53          return owner;
54      }
55  
56      public String getSubject() {
57          return subject;
58      }
59  
60      public DateTime getEndTime() {
61          return endTime;
62      }
63  
64      public String getLocation() {
65          return location;
66      }
67  
68      public String getBody() {
69          return body;
70      }
71  
72      public void appendMessageElements(MessageElement parent) {
73          getStartTime().appendMessageElements(parent.createChild("StartTime"));
74          getOwner().appendMessageElements(parent.createChild("Owner"));
75          parent.createChild("Subject").setContent(getSubject());
76          getEndTime().appendMessageElements(parent.createChild("EndTime"));
77          parent.createChild("Location").setContent(getLocation());
78          parent.createChild("Body").setContent(getBody());
79      }
80  
81  }