All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vertx.rxjava.ext.auth.oauth2.OAuth2Response Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR2
Show newest version
/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you 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.vertx.rxjava.ext.auth.oauth2;

import rx.Observable;
import rx.Single;
import io.vertx.rx.java.RxHelper;
import io.vertx.rx.java.WriteStreamSubscriber;
import io.vertx.rx.java.SingleOnSubscribeAdapter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;

/**
 * A response from a fetch request.
 *
 * This class represents a secure response from a Oauth2 fetch call.
 *
 * A fetch is a simplified HTTP response from a protected resource.
 *
 * 

* NOTE: This class has been automatically generated from the {@link io.vertx.ext.auth.oauth2.OAuth2Response original} non RX-ified interface using Vert.x codegen. */ @RxGen(io.vertx.ext.auth.oauth2.OAuth2Response.class) public class OAuth2Response { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OAuth2Response that = (OAuth2Response) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final TypeArg __TYPE_ARG = new TypeArg<>( obj -> new OAuth2Response((io.vertx.ext.auth.oauth2.OAuth2Response) obj), OAuth2Response::getDelegate ); private final io.vertx.ext.auth.oauth2.OAuth2Response delegate; public OAuth2Response(io.vertx.ext.auth.oauth2.OAuth2Response delegate) { this.delegate = delegate; } public OAuth2Response(Object delegate) { this.delegate = (io.vertx.ext.auth.oauth2.OAuth2Response)delegate; } public io.vertx.ext.auth.oauth2.OAuth2Response getDelegate() { return delegate; } /** * the returned status code from the HTTP layer. * @return HTTP status code */ @Deprecated() public int statusCode() { int ret = delegate.statusCode(); return ret; } /** * The HTTP response headers from the HTTP layer. * @return the HTTP headers */ @Deprecated() public io.vertx.rxjava.core.MultiMap headers() { io.vertx.rxjava.core.MultiMap ret = io.vertx.rxjava.core.MultiMap.newInstance((io.vertx.core.MultiMap)delegate.headers()); return ret; } /** * Looks up a HTTP response header by name, in case where the response is a list of headers, * the first one is returned. * @param name of the header to look up * @return the single value for the header. */ @Deprecated() public String getHeader(String name) { String ret = delegate.getHeader(name); return ret; } /** * The HTTP response body as a buffer * @return a buffer with the HTTP response body */ @Deprecated() public io.vertx.rxjava.core.buffer.Buffer body() { io.vertx.rxjava.core.buffer.Buffer ret = io.vertx.rxjava.core.buffer.Buffer.newInstance((io.vertx.core.buffer.Buffer)delegate.body()); return ret; } /** * The HTTP response body as a JsonObject * @return a JsonObject from the HTTP response body */ @Deprecated() public JsonObject jsonObject() { JsonObject ret = delegate.jsonObject(); return ret; } /** * The HTTP response body as a JsonArray * @return a JsonArray from the HTTP response body */ @Deprecated() public JsonArray jsonArray() { JsonArray ret = delegate.jsonArray(); return ret; } /** * Helper to analize the response body. The test is performed against the header Content-Type, * the content of the body is not analyzed. * @param contentType a content type to test, e.g.: application/json * @return true if the header matches */ @Deprecated() public boolean is(String contentType) { boolean ret = delegate.is(contentType); return ret; } public static OAuth2Response newInstance(io.vertx.ext.auth.oauth2.OAuth2Response arg) { return arg != null ? new OAuth2Response(arg) : null; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy