summaryrefslogtreecommitdiffstats
path: root/netconf/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/streams/listeners/Event.java
blob: 486d8079958e2ba295a6178fbc23918488a6dd7d (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
/*
 * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.netconf.sal.streams.listeners;

import io.netty.channel.Channel;

/**
 * Represents event of specific {@link EventType} type, holds data and
 * {@link Channel} subscriber.
 */
class Event {
    private final EventType type;
    private Channel subscriber;
    private String data;

    /**
     * Creates new event specified by {@link EventType} type.
     *
     * @param type
     *            EventType
     */
    Event(final EventType type) {
        this.type = type;
    }

    /**
     * Gets the {@link Channel} subscriber.
     *
     * @return Channel
     */
    public Channel getSubscriber() {
        return this.subscriber;
    }

    /**
     * Sets subscriber for event.
     *
     * @param subscriber
     *            Channel
     */
    public void setSubscriber(final Channel subscriber) {
        this.subscriber = subscriber;
    }

    /**
     * Gets event String.
     *
     * @return String representation of event data.
     */
    public String getData() {
        return this.data;
    }

    /**
     * Sets event data.
     *
     * @param data
     *            String.
     */
    public void setData(final String data) {
        this.data = data;
    }

    /**
     * Gets event type.
     *
     * @return The type of the event.
     */
    public EventType getType() {
        return this.type;
    }
}