swim.system.HttpProxy Maven / Gradle / Ivy
The newest version!
// Copyright 2015-2024 Nstream, 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 swim.system;
import java.net.InetSocketAddress;
import java.security.Principal;
import java.security.cert.Certificate;
import java.util.Collection;
import swim.api.auth.Identity;
import swim.codec.Decoder;
import swim.http.HttpRequest;
import swim.http.HttpResponse;
import swim.structure.Value;
import swim.uri.Uri;
public abstract class HttpProxy implements HttpBinding, HttpContext {
protected final HttpBinding linkBinding;
protected HttpContext linkContext;
public HttpProxy(HttpBinding linkBinding) {
this.linkBinding = linkBinding;
this.linkContext = null;
}
public final HttpBinding linkBinding() {
return this.linkBinding;
}
@Override
public final HttpBinding linkWrapper() {
return this.linkBinding.linkWrapper();
}
@Override
public final HttpContext linkContext() {
return this.linkContext;
}
@Override
public void setLinkContext(LinkContext linkContext) {
this.linkContext = (HttpContext) linkContext;
this.linkBinding.setLinkContext(this);
}
@Override
public CellContext cellContext() {
return this.linkBinding.cellContext();
}
@Override
public void setCellContext(CellContext cellContext) {
this.linkBinding.setCellContext(cellContext);
}
@SuppressWarnings("unchecked")
@Override
public T unwrapLink(Class linkClass) {
if (linkClass.isAssignableFrom(this.getClass())) {
return (T) this;
} else {
return this.linkContext.unwrapLink(linkClass);
}
}
@SuppressWarnings("unchecked")
@Override
public T bottomLink(Class linkClass) {
T link = this.linkContext.bottomLink(linkClass);
if (link == null && linkClass.isAssignableFrom(this.getClass())) {
link = (T) this;
}
return link;
}
@Override
public Uri requestUri() {
return this.linkBinding.requestUri();
}
@Override
public HttpRequest> request() {
return this.linkBinding.request();
}
@Override
public Uri meshUri() {
return this.linkBinding.meshUri();
}
@Override
public Uri hostUri() {
return this.linkBinding.hostUri();
}
@Override
public void setHostUri(Uri hostUri) {
this.linkBinding.setHostUri(hostUri);
}
@Override
public Uri nodeUri() {
return this.linkBinding.nodeUri();
}
@Override
public void setNodeUri(Uri nodeUri) {
this.linkBinding.setNodeUri(nodeUri);
}
@Override
public Uri laneUri() {
return this.linkBinding.laneUri();
}
@Override
public Value linkKey() {
return this.linkContext.linkKey();
}
@Override
public LinkAddress cellAddressDown() {
return this.linkBinding.cellAddressDown();
}
@Override
public LinkAddress cellAddressUp() {
return this.linkContext.cellAddressUp();
}
@Override
public boolean isConnectedDown() {
return this.linkBinding.isConnectedDown();
}
@Override
public boolean isRemoteDown() {
return this.linkBinding.isRemoteDown();
}
@Override
public boolean isSecureDown() {
return this.linkBinding.isSecureDown();
}
@Override
public String securityProtocolDown() {
return this.linkBinding.securityProtocolDown();
}
@Override
public String cipherSuiteDown() {
return this.linkBinding.cipherSuiteDown();
}
@Override
public InetSocketAddress localAddressDown() {
return this.linkBinding.localAddressDown();
}
@Override
public Identity localIdentityDown() {
return this.linkBinding.localIdentityDown();
}
@Override
public Principal localPrincipalDown() {
return this.linkBinding.localPrincipalDown();
}
@Override
public Collection localCertificatesDown() {
return this.linkBinding.localCertificatesDown();
}
@Override
public InetSocketAddress remoteAddressDown() {
return this.linkBinding.remoteAddressDown();
}
@Override
public Identity remoteIdentityDown() {
return this.linkBinding.remoteIdentityDown();
}
@Override
public Principal remotePrincipalDown() {
return this.linkBinding.remotePrincipalDown();
}
@Override
public Collection remoteCertificatesDown() {
return this.linkBinding.remoteCertificatesDown();
}
@Override
public boolean isConnectedUp() {
return this.linkContext.isConnectedUp();
}
@Override
public boolean isRemoteUp() {
return this.linkContext.isRemoteUp();
}
@Override
public boolean isSecureUp() {
return this.linkContext.isSecureUp();
}
@Override
public String securityProtocolUp() {
return this.linkContext.securityProtocolUp();
}
@Override
public String cipherSuiteUp() {
return this.linkContext.cipherSuiteUp();
}
@Override
public InetSocketAddress localAddressUp() {
return this.linkContext.localAddressUp();
}
@Override
public Identity localIdentityUp() {
return this.linkContext.localIdentityUp();
}
@Override
public Principal localPrincipalUp() {
return this.linkContext.localPrincipalUp();
}
@Override
public Collection localCertificatesUp() {
return this.linkContext.localCertificatesUp();
}
@Override
public InetSocketAddress remoteAddressUp() {
return this.linkContext.remoteAddressUp();
}
@Override
public Identity remoteIdentityUp() {
return this.linkContext.remoteIdentityUp();
}
@Override
public Principal remotePrincipalUp() {
return this.linkContext.remotePrincipalUp();
}
@Override
public Collection remoteCertificatesUp() {
return this.linkContext.remoteCertificatesUp();
}
@Override
public HttpRequest> doRequest() {
return this.linkBinding.doRequest();
}
@Override
public Decoder
© 2015 - 2025 Weber Informatics LLC | Privacy Policy