/*
 * 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.reactivex.ext.auth.oauth2;

import io.vertx.reactivex.RxHelper;
import io.vertx.reactivex.ObservableHelper;
import io.vertx.reactivex.FlowableHelper;
import io.vertx.reactivex.impl.AsyncResultMaybe;
import io.vertx.reactivex.impl.AsyncResultSingle;
import io.vertx.reactivex.impl.AsyncResultCompletable;
import io.vertx.reactivex.WriteStreamObserver;
import io.vertx.reactivex.WriteStreamSubscriber;
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 original non RX-ified interface using Vert.x codegen.
/** * 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. * * <p/> * 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<OAuth2Response> __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.
Returns:HTTP status code
/** * 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.
Returns:the HTTP headers
/** * The HTTP response headers from the HTTP layer. * @return the HTTP headers */
@Deprecated() public io.vertx.reactivex.core.MultiMap headers() { io.vertx.reactivex.core.MultiMap ret = io.vertx.reactivex.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.
Params:
  • name – of the header to look up
Returns:the single value for the header.
/** * 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
Returns:a buffer with the HTTP response body
/** * The HTTP response body as a buffer * @return a buffer with the HTTP response body */
@Deprecated() public io.vertx.reactivex.core.buffer.Buffer body() { io.vertx.reactivex.core.buffer.Buffer ret = io.vertx.reactivex.core.buffer.Buffer.newInstance((io.vertx.core.buffer.Buffer)delegate.body()); return ret; }
The HTTP response body as a JsonObject
Returns:a JsonObject from the HTTP response body
/** * 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
Returns:a JsonArray from the HTTP response body
/** * 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.
Params:
  • contentType – a content type to test, e.g.: application/json
Returns:true if the header matches
/** * 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; } }