
io.reactivex.netty.protocol.http.server.FailedContentWriter Maven / Gradle / Ivy
/*
* Copyright 2016 Netflix, Inc.
*
* 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 io.reactivex.netty.protocol.http.server;
import io.reactivex.netty.protocol.http.TrailingHeaders;
import rx.Observable;
import rx.Subscriber;
import rx.functions.Func0;
import rx.functions.Func1;
import rx.functions.Func2;
class FailedContentWriter extends ResponseContentWriter {
FailedContentWriter() {
super(new OnSubscribe() {
@Override
public void call(Subscriber super Void> subscriber) {
subscriber.onError(new IllegalStateException("HTTP headers are already sent."));
}
});
}
@Override
public ResponseContentWriter write(Observable msgs) {
return this;
}
@Override
public Observable write(Observable contentSource,
Func0 trailerFactory,
Func2 trailerMutator) {
return this;
}
@Override
public Observable write(Observable contentSource, Func0 trailerFactory,
Func2 trailerMutator,
Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter write(Observable msgs, Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter writeAndFlushOnEach(Observable msgs) {
return this;
}
@Override
public ResponseContentWriter writeString(Observable msgs) {
return this;
}
@Override
public Observable writeString(Observable contentSource,
Func0 trailerFactory,
Func2 trailerMutator) {
return this;
}
@Override
public Observable writeString(Observable contentSource,
Func0 trailerFactory,
Func2 trailerMutator,
Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter writeString(Observable msgs, Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter writeStringAndFlushOnEach(Observable msgs) {
return this;
}
@Override
public ResponseContentWriter writeBytes(Observable msgs) {
return this;
}
@Override
public Observable writeBytes(Observable contentSource,
Func0 trailerFactory,
Func2 trailerMutator) {
return this;
}
@Override
public Observable writeBytes(Observable contentSource,
Func0 trailerFactory,
Func2 trailerMutator,
Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter writeBytes(Observable msgs, Func1 flushSelector) {
return this;
}
@Override
public ResponseContentWriter writeBytesAndFlushOnEach(Observable msgs) {
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy