import com.google.common.util.concurrent.Futures;
import java.io.IOException;
import java.util.Set;
+import javax.annotation.Nonnull;
import org.opendaylight.controller.cluster.schema.provider.RemoteYangTextSourceProvider;
import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
LOG.trace("Sending yang schema source for {}", identifier);
final Promise<YangTextSchemaSourceSerializationProxy> promise = akka.dispatch.Futures.promise();
- CheckedFuture<YangTextSchemaSource, ?> future = repository.getSchemaSource(identifier, YangTextSchemaSource.class);
+ CheckedFuture<YangTextSchemaSource, ?> future =
+ repository.getSchemaSource(identifier, YangTextSchemaSource.class);
Futures.addCallback(future, new FutureCallback<YangTextSchemaSource>() {
@Override
- public void onSuccess(YangTextSchemaSource result) {
+ public void onSuccess(@Nonnull YangTextSchemaSource result) {
try {
promise.success(new YangTextSchemaSourceSerializationProxy(result));
} catch (IOException e) {
}
@Override
- public void onFailure(Throwable t) {
- LOG.warn("Unable to retrieve schema source from provider", t);
- promise.failure(t);
+ public void onFailure(Throwable failure) {
+ LOG.warn("Unable to retrieve schema source from provider", failure);
+ promise.failure(failure);
}
});