/* * Copyright (c) 2015 Spotify AB * * 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 com.spotify.dns; import java.util.Set; /** * A change notifier represents a watched lookup from a {@link DnsSrvWatcher}. * *
The records can be of any type. Usually something that directly reflects what your * application will use the records for. * *
A {@link Listener} can be attached to listen to change events on the watched set of records.
*
* @param One one listener can be added. Multiple calls to this method is an error.
*
* @param listener The listener to set
* @param fire Fire the notification event immediately. Can be used to ensure that no updates
* are missed when setting the listener
* @throws IllegalStateException if called more than once
*/
void setListener(Listener