aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/service/protocol/event/ChatRoomConferencePublishedEvent.java
blob: d230b789da5a0b8f8acf6f77f494b1fe58efdb5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
 * Jitsi, the OpenSource Java VoIP and Instant Messaging client.
 *
 * Copyright @ 2015 Atlassian Pty Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.java.sip.communicator.service.protocol.event;

import net.java.sip.communicator.service.protocol.*;

import java.util.*;

/**
 * Dispatched to notify interested parties that a <tt>ChatRoomMember</tt> has
 * published a conference description.
 *
 * @author Boris Grozev
 */
public class ChatRoomConferencePublishedEvent
    extends EventObject
{
    /**
     * The <tt>ChatRoom</tt> which is the source of this event.
     */
    private final ChatRoom chatRoom;

    /**
     * The <tt>ChatRoomMember</tt> who published a
     * <tt>ConferenceDescription</tt>
     */
    private final ChatRoomMember member;

    /**
     * The <tt>ConferenceDescription</tt> that was published.
     */
    private final ConferenceDescription conferenceDescription;
    
    /**
     * The type of the event. It can be <tt>CONFERENCE_DESCRIPTION_SENT</tt> or 
     * <tt>CONFERENCE_DESCRIPTION_RECEIVED</tt>.
     */
    private final int eventType;
    
    /**
     * Event type that indicates sending of conference description by the local 
     * user.
     */
    public final static int CONFERENCE_DESCRIPTION_SENT = 0;
    
    /**
     * Event type that indicates receiving conference description.
     */
    public final static int CONFERENCE_DESCRIPTION_RECEIVED = 1;

    /**
     * Creates a new instance.
     * @param chatRoom The <tt>ChatRoom</tt> which is the source of this event.
     * @param member The <tt>ChatRoomMember</tt> who published a
     * <tt>ConferenceDescription</tt>
     * @param conferenceDescription The <tt>ConferenceDescription</tt> that was
     * published.
     */
    public ChatRoomConferencePublishedEvent(
            int eventType,
            ChatRoom chatRoom,
            ChatRoomMember member,
            ConferenceDescription conferenceDescription)
    {
        super(chatRoom);
        
        this.eventType = eventType;
        this.chatRoom = chatRoom;
        this.member = member;
        this.conferenceDescription = conferenceDescription;
    }

    /**
     * Returns the <tt>ChatRoom</tt> which is the source of this event.
     * @return the <tt>ChatRoom</tt> which is the source of this event.
     */
    public ChatRoom getChatRoom()
    {
        return chatRoom;
    }

   /**
    * Returns the <tt>ChatRoomMember</tt> who published a
    * <tt>ConferenceDescription</tt>
    * @return the <tt>ChatRoomMember</tt> who published
    * a <tt>ConferenceDescription</tt>
    */
    public ChatRoomMember getMember()
    {
        return member;
    }

    /**
     * Returns the <tt>ConferenceDescription</tt> that was published.
     * @return the <tt>ConferenceDescription</tt> that was published.
     */
    public ConferenceDescription getConferenceDescription()
    {
        return conferenceDescription;
    }
    
    /**
     * Returns the event type.
     * @return the event type.
     */
    public int getType()
    {
        return eventType;
    }
}