X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-rest-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fstreams%2Flisteners%2FListenerAdapter.java;h=15e4887ab8a8684f4a2755c35c91aad2e6ccae6c;hp=5fd76de98bb51c4e0b322f6c16f0bd17c5d417d2;hb=1ee71ae58a03de1c1f8fd8c789e7921508ba9f59;hpb=ac317ecb6d40d51ed026272b3b6b788e0e87ea9d diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java index 5fd76de98b..15e4887ab8 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/streams/listeners/ListenerAdapter.java @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014 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.controller.sal.streams.listeners; import io.netty.channel.Channel; @@ -73,7 +80,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates new {@link ListenerAdapter} listener specified by path and stream * name. - * + * * @param path * Path to data in data store. * @param streamName @@ -150,7 +157,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates new event specified by {@link EventType} type. - * + * * @param type * EventType */ @@ -160,7 +167,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Gets the {@link Channel} subscriber. - * + * * @return Channel */ public Channel getSubscriber() { @@ -169,7 +176,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Sets subscriber for event. - * + * * @param subscriber * Channel */ @@ -179,7 +186,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Gets event data. - * + * * @return String representation of event data. */ public String getData() { @@ -188,7 +195,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Sets event data. - * + * * @param String * data. */ @@ -198,7 +205,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Gets event type. - * + * * @return The type of the event. */ public EventType getType() { @@ -215,7 +222,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Prepare data in printable form and transform it to String. - * + * * @param change * DataChangeEvent * @return Data in printable form. @@ -263,7 +270,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Formats data specified by RFC3339. - * + * * @param d * Date * @return Data specified by RFC3339. @@ -274,7 +281,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates {@link Document} document. - * + * * @return {@link Document} document. */ private Document createDocument() { @@ -291,7 +298,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Adds values to data changed notification event element. - * + * * @param doc * {@link Document} * @param dataChangedNotificationEventElement @@ -329,7 +336,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Adds values from data to element. - * + * * @param doc * {@link Document} * @param data @@ -356,7 +363,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Adds values from data to element. - * + * * @param doc * {@link Document} * @param data @@ -383,7 +390,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates changed event element from data. - * + * * @param doc * {@link Document} * @param path @@ -426,7 +433,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Translates {@link CompositeNode} data to XML format. - * + * * @param path * Path to data in data store. * @param data @@ -455,7 +462,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Adds path as value to element. - * + * * @param path * Path to data in data store. * @param element @@ -497,7 +504,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Writes identifier that consists of prefix and QName. - * + * * @param element * {@link Element} * @param textContent @@ -519,7 +526,7 @@ public class ListenerAdapter implements DataChangeListener { } } - element.setAttribute("xmlns:" + prefix, namespace.toString()); + element.setAttribute("xmlns:" + prefix, namespace); textContent.append(prefix); prefixes.put(namespace, prefix); @@ -529,7 +536,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Generates new prefix which consists of four random characters . - * + * * @param prefixes * Collection of prefixes. * @return New prefix which consists of four random characters . @@ -550,7 +557,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Gets path pointed to data in data store. - * + * * @return Path pointed to data in data store. */ public InstanceIdentifier getPath() { @@ -559,7 +566,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Sets {@link ListenerRegistration} registration. - * + * * @param registration * ListenerRegistration */ @@ -570,7 +577,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Gets the name of the stream. - * + * * @return The name of the stream. */ public String getStreamName() { @@ -590,7 +597,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Checks if {@link ListenerRegistration} registration exist. - * + * * @return True if exist, false otherwise. */ public boolean isListening() { @@ -600,7 +607,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates event of type {@link EventType#REGISTER}, set {@link Channel} * subscriber to the event and post event into event bus. - * + * * @param subscriber * Channel */ @@ -617,7 +624,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Creates event of type {@link EventType#DEREGISTER}, sets {@link Channel} * subscriber to the event and posts event into event bus. - * + * * @param subscriber */ public void removeSubscriber(Channel subscriber) { @@ -629,7 +636,7 @@ public class ListenerAdapter implements DataChangeListener { /** * Checks if exists at least one {@link Channel} subscriber. - * + * * @return True if exist at least one {@link Channel} subscriber, false * otherwise. */