juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [juneau] branch master updated: Remove deprecated code.
Date Tue, 13 Oct 2020 15:53:26 GMT
This is an automated email from the ASF dual-hosted git repository.

jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git


The following commit(s) were added to refs/heads/master by this push:
     new a84fa40  Remove deprecated code.
a84fa40 is described below

commit a84fa40dee55ab4ef9662e392b976c27ec400c6e
Author: JamesBognar <james.bognar@salesforce.com>
AuthorDate: Tue Oct 13 11:53:22 2020 -0400

    Remove deprecated code.
---
 .../juneau/rest/client/remote/RemoteMethod.java    | 118 ---------------------
 .../rest/client/remote/RemoteMethodMeta.java       |   8 +-
 .../rest/client/remote/RemoteMethodReturn.java     |  12 +--
 .../juneau/rest/client/remote/RemoteResource.java  |  50 ---------
 .../juneau/rest/client/remote/RemoteReturn.java    |  36 -------
 5 files changed, 3 insertions(+), 221 deletions(-)

diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethod.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethod.java
deleted file mode 100644
index 53431bb..0000000
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethod.java
+++ /dev/null
@@ -1,118 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.  See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership.
 The ASF 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 org.apache.juneau.rest.client.remote;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-
-import java.io.*;
-import java.lang.annotation.*;
-
-import org.apache.juneau.http.annotation.*;
-
-/**
- * Annotation applied to Java methods on REST proxy.
- *
- * <div class='warn'>
- * 	<b>Deprecated</b> - Use {@link org.apache.juneau.http.remote.RemoteMethod}
- * </div>
- *
- * <ul class='seealso'>
- * 	<li class='link'>{@doc RestcProxies}
- * </ul>
- */
-@Documented
-@Target(METHOD)
-@Retention(RUNTIME)
-@Inherited
-@Deprecated
-public @interface RemoteMethod {
-
-	/**
-	 * REST service path.
-	 *
-	 * <p>
-	 * The possible values are:
-	 * <ul class='spaced-list'>
-	 * 	<li>An absolute URI.
-	 * 	<li>A relative URI interpreted as relative to the root URI defined on the <c>RestClient</c>
and/or {@link RemoteResource#path()}.
-	 * 	<li>No path.
-	 * </ul>
-	 *
-	 * <p>
-	 * If you do not specify a path, then the path is inferred from the Java method name.
-	 *
-	 * <h5 class='figure'>Example:</h5>
-	 * <p class='bcode'>
-	 * 	<jc>// POST /pet</jc>
-	 * 	<ja>@RestMethod</ja>
-	 * 	<jk>public void</jk> postPet(...) {...}
-	 * </p>
-	 */
-	String path() default "";
-
-	/**
-	 * Defines the HTTP method to use for REST calls.
-	 *
-	 * <p>
-	 * If not specified, then the method is inferred from the Java method name.
-	 *
-	 * <h5 class='figure'>Example:</h5>
-	 * <p class='bcode'>
-	 * 	<jc>// POST /pet</jc>
-	 * 	<ja>@RestMethod</ja>
-	 * 	<jk>public void</jk> postPet(...) {...}
-	 * </p>
-	 *
-	 * <br>If the method cannot be inferred, then the default is <js>"GET"</js>.
-	 */
-	String method() default "";
-
-	/**
-	 * The value the remote method returns.
-	 *
-	 * <p>
-	 * Possible values:
-	 * <ul class='spaced-list'>
-	 * 	<li>
-	 * 		{@link RemoteReturn#BODY} (default) - The body of the HTTP response converted to a
POJO.
-	 * 		<br>The return type on the Java method can be any of the following:
-	 * 		<ul class='spaced-list'>
-	 * 			<li>
-	 * 				<jk>void</jk> - Don't parse any response.  Note that the method will
still throw an exception if an
-	 * 				error HTTP status is returned.
-	 * 			<li>
-	 * 				Any parsable POJO - The body of the response will be converted to the POJO using
the parser defined
-	 * 				on the <c>RestClient</c>.
-	 * 			<li>
-	 * 				Any POJO annotated with the {@link Response @Response} annotation.
-	 * 				This allows for response beans to be used which also allows for OpenAPI-based parsing
and validation.
-	 * 			<li>
-	 * 				<c>HttpResponse</c> - Returns the raw <c>HttpResponse</c>
returned by the inner
-	 * 				<c>HttpClient</c>.
-	 * 			<li>
-	 * 				{@link Reader} - Returns access to the raw reader of the response.
-	 * 			<li>
-	 * 				{@link InputStream} - Returns access to the raw input stream of the response.
-	 * 		</ul>
-	 * 	<li>
-	 * 		{@link RemoteReturn#STATUS} - The HTTP status code on the response.
-	 * 		<br>The return type on the Java method can be any of the following:
-	 * 		<ul>
-	 * 			<li><jk>int</jk>/<c>Integer</c> - The HTTP response
code.
-	 * 			<li><jk>boolean</jk>/<c>Boolean</c> - <jk>true</jk>
if the response code is <c>&lt;400</c>
-	 * 		</ul>
-	 * </ul>
-	 */
-	RemoteReturn returns() default RemoteReturn.BODY;
-}
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodMeta.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodMeta.java
index 27b78fc..3eaa498 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodMeta.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodMeta.java
@@ -79,20 +79,16 @@ public class RemoteMethodMeta {
 		RemoteMethodArg bodyArg;
 		RemoteMethodReturn methodReturn;
 
-		@SuppressWarnings("deprecation")
 		Builder(String parentPath, Method m, String defaultMethod) {
 
 			MethodInfo mi = MethodInfo.of(m);
 
-			org.apache.juneau.rest.client.remote.RemoteMethod orm = mi.getLastAnnotation(org.apache.juneau.rest.client.remote.RemoteMethod.class);
-			if (orm == null)
-				orm = mi.getResolvedReturnType().getLastAnnotation(org.apache.juneau.rest.client.remote.RemoteMethod.class);
 			RemoteMethod rm = mi.getLastAnnotation(RemoteMethod.class);
 			if (rm == null)
 				rm = mi.getResolvedReturnType().getLastAnnotation(RemoteMethod.class);
 
-			httpMethod = rm == null ? (orm == null ? "" : orm.method()) : rm.method();
-			path = rm == null ? (orm == null ? "" : orm.path()) : rm.path();
+			httpMethod = rm == null ? "" : rm.method();
+			path = rm == null ? "" : rm.path();
 
 			if (path.isEmpty()) {
 				path = HttpUtils.detectHttpPath(m, true);
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodReturn.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodReturn.java
index 32379b2..9c3404a 100644
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodReturn.java
+++ b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteMethodReturn.java
@@ -36,13 +36,9 @@ public final class RemoteMethodReturn {
 	private final ResponseBeanMeta meta;
 	private boolean isFuture, isCompletableFuture;
 
-	@SuppressWarnings("deprecation")
 	RemoteMethodReturn(MethodInfo m) {
 		ClassInfo rt = m.getReturnType();
 
-		org.apache.juneau.rest.client.remote.RemoteMethod orm = m.getLastAnnotation(org.apache.juneau.rest.client.remote.RemoteMethod.class);
-		if (orm == null)
-			orm = m.getResolvedReturnType().getLastAnnotation(org.apache.juneau.rest.client.remote.RemoteMethod.class);
 		RemoteMethod rm = m.getLastAnnotation(RemoteMethod.class);
 		if (rm == null)
 			rm = m.getResolvedReturnType().getLastAnnotation(RemoteMethod.class);
@@ -56,15 +52,9 @@ public final class RemoteMethodReturn {
 			isCompletableFuture = true;
 			rt = ClassInfo.of(((ParameterizedType)rt.innerType()).getActualTypeArguments()[0]);
 		}
+
 		if (rt.is(void.class) || rt.is(Void.class))
 			rv = RemoteReturn.NONE;
-		else if (orm != null)
-			switch (orm.returns()) {
-				case BEAN: rv = RemoteReturn.BEAN; break;
-				case BODY: rv = RemoteReturn.BODY; break;
-				case NONE: rv = RemoteReturn.NONE; break;
-				case STATUS: rv = RemoteReturn.STATUS; break;
-			}
 		else if (rm != null)
 			rv = rm.returns();
 		else
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteResource.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteResource.java
deleted file mode 100644
index c165070..0000000
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteResource.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.  See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership.
 The ASF 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 org.apache.juneau.rest.client.remote;
-
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-
-import java.lang.annotation.*;
-
-/**
- * Identifies a proxy against a REST interface.
- *
- * <div class='warn'>
- * 	<b>Deprecated</b> - Use {@link org.apache.juneau.http.remote.RemoteMethod}
- * </div>
- *
- * <ul class='seealso'>
- * 	<li class='link'>{@doc RestcProxies}
- * </ul>
- */
-@Documented
-@Target({TYPE})
-@Retention(RUNTIME)
-@Inherited
-@Deprecated
-public @interface RemoteResource {
-
-	/**
-	 * REST service path.
-	 *
-	 * <p>
-	 * The possible values are:
-	 * <ul class='spaced-list'>
-	 * 	<li>An absolute URI.
-	 * 	<li>A relative URI interpreted as relative to the root URI defined on the <c>RestClient</c>
-	 * 	<li>No path interpreted as the class name (e.g. <js>"http://localhost/root-url/org.foo.MyInterface"</js>)
-	 * </ul>
-	 */
-	String path() default "";
-}
diff --git a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteReturn.java
b/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteReturn.java
deleted file mode 100644
index fab5e16..0000000
--- a/juneau-rest/juneau-rest-client/src/main/java/org/apache/juneau/rest/client/remote/RemoteReturn.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.  See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership.
 The ASF 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 org.apache.juneau.rest.client.remote;
-
-/**
- * Possible values for the {@link RemoteMethod#returns() @RemoteMethod(returns)} annotation.
- *
- * <div class='warn'>
- * 	<b>Deprecated</b> - Use {@link org.apache.juneau.http.remote.RemoteReturn}
- * </div>
- */
-@Deprecated
-public enum RemoteReturn {
-
-	/** HTTP response body */
-	BODY,
-
-	/** HTTP status code */
-	STATUS,
-
-	/** Response bean */
-	BEAN,
-
-	/** Ignore (used for void methods) */
-	NONE;
-}


Mime
View raw message