package ch.rasc.sse.eventbus;

import java.util.Set;

/**
 * Listen for internal events. All these methods are called synchronously.
 */
public interface SseEventBusListener {

	/**
	 * Called each time a message has been added to the internal sending queue
	 * @param clientEvent Data object comprises the client, event and value
	 * @param firstAttempt <code>true</code> if the message is queued the first time or
	 * <code>false</code> if this is a new attempt after a previous failed delivery
	 */
	default void afterEventQueued(ClientEvent clientEvent, boolean firstAttempt) {
		// no default implementation
	}

	/**
	 * Called each time a message has been sent either successfully or unsuccessfully
	 * @param clientEvent Data object comprises the client, event and value
	 * @param exception <code>null</code> message has been sent successfully, otherwise
	 * message delivery failed with this error
	 */
	default void afterEventSent(ClientEvent clientEvent, Exception exception) {
		// no default implementation
	}

	/**
	 * Called each time the library has unregistered one or more stale clients.
	 * @param clientIds collection of client identifications that have been removed from
	 * the registry
	 */
	default void afterClientsUnregistered(Set<String> clientIds) {
		// no default implementation
	}
}

@@ -1,8 +1,642 @@
+/**%0D%0A * Copyright 2016-2019 the original author or authors.%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *   http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A */%0D%0A
 package 

Add missing license header