diff options
Diffstat (limited to 'rest-client/src/main/java/org/openo/baseservice/roa/util/restclient')
12 files changed, 100 insertions, 146 deletions
diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/DefaultAsyncCallback.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/DefaultAsyncCallback.java index 8195b0d..81adeb6 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/DefaultAsyncCallback.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/DefaultAsyncCallback.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -21,7 +21,7 @@ package org.openo.baseservice.roa.util.restclient; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class DefaultAsyncCallback implements RestfulAsyncCallback { diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpBaseRest.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpBaseRest.java index 4f58778..3e64937 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpBaseRest.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpBaseRest.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -31,7 +31,6 @@ import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpExchange; import org.eclipse.jetty.http.HttpMethods; import org.openo.baseservice.remoteservice.exception.ServiceException; -import org.openo.baseservice.roa.util.ServiceUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +40,7 @@ import org.slf4j.LoggerFactory; * </p> * * @author - * @version SDNO 0.5 Aug 9, 2016 + * @version Aug 9, 2016 */ public abstract class HttpBaseRest implements Restful { @@ -68,7 +67,7 @@ public abstract class HttpBaseRest implements Restful { * <p> * </p> * - * @since SDNO 0.5 + * @since */ public HttpBaseRest() { super(); @@ -145,7 +144,7 @@ public abstract class HttpBaseRest implements Restful { * @param callback * @return * @throws ServiceException - * @since SDNO 0.5 + * @since */ protected RestfulResponse sendHttpRequest(final String method, final String servicePath, final RestfulParametes restParametes, final RestfulOptions options, final RestfulAsyncCallback callback) @@ -193,23 +192,6 @@ public abstract class HttpBaseRest implements Restful { } else { String host = defaultIP; int iPort = defaultPort; - String calledServiceName = null; - if(options != null) { - calledServiceName = options.getCalledServicName(); - } - final ServiceUtil serviceUtil = new ServiceUtil(calledServiceName, url.toString()); - final String configHost = serviceUtil.getServiceHost(); - final int configPort = serviceUtil.getServicePort(); - if(!configHost.isEmpty() && configPort > 0) { - if(options != null) { - options.setHost(configHost); - options.setPort(configPort); - } else { - host = configHost; - - iPort = configPort; - } - } if(options != null) { host = options.getHost(); if(host.isEmpty()) { diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpRest.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpRest.java index 50a3538..047f20e 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpRest.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/HttpRest.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory; * </p> * * @author - * @version SDNO 0.5 Aug 9, 2016 + * @version Aug 9, 2016 */ public class HttpRest extends HttpBaseRest { @@ -40,7 +40,7 @@ public class HttpRest extends HttpBaseRest { * * @param options: rest options. * @throws ServiceException - * @since SDNO 0.5 + * @since */ public void initHttpRest(final RestfulOptions option) throws ServiceException { if(option == null) { diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestHttpContentExchange.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestHttpContentExchange.java index 85118ce..99328a7 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestHttpContentExchange.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestHttpContentExchange.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -43,7 +43,7 @@ import java.util.zip.GZIPInputStream; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestHttpContentExchange extends ContentExchange { @@ -58,7 +58,7 @@ public class RestHttpContentExchange extends ContentExchange { * <p> * </p> * - * @since SDNO 0.5 + * @since * @param cacheFields whether to cache response header. * @param asyncCallback callback method. */ @@ -74,7 +74,7 @@ public class RestHttpContentExchange extends ContentExchange { * @param data GZipped data. * @return Uncompressed data. * @throws IOException - * @since SDNO 0.5 + * @since */ public String decompressGzipToStr(final byte[] data) throws IOException { if(data == null) { @@ -125,7 +125,7 @@ public class RestHttpContentExchange extends ContentExchange { * @param name buffer * @param value value * @throws IOException - * @since SDNO 0.5 + * @since */ @Override protected synchronized void onResponseHeader(final Buffer name, final Buffer value) throws IOException { @@ -203,7 +203,7 @@ public class RestHttpContentExchange extends ContentExchange { * * @return response object. * @throws IOException - * @since SDNO 0.5 + * @since */ public RestfulResponse getResponse() throws IOException { final RestfulResponse rsp = new RestfulResponse(); diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/Restful.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/Restful.java index 7a7c11e..8527e68 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/Restful.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/Restful.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -23,7 +23,7 @@ import org.openo.baseservice.remoteservice.exception.ServiceException; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public interface Restful { @@ -34,7 +34,7 @@ public interface Restful { * @param restParametes: query parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse get(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -46,7 +46,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse head(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -58,7 +58,7 @@ public interface Restful { * @param restParametes: request parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse head(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -70,7 +70,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse get(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -82,7 +82,7 @@ public interface Restful { * @param restParametes: request parameters. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncGet(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback) throws ServiceException; @@ -95,7 +95,7 @@ public interface Restful { * @param options: request options. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncGet(String servicePath, RestfulParametes restParametes, RestfulOptions options, RestfulAsyncCallback callback) throws ServiceException; @@ -107,7 +107,7 @@ public interface Restful { * @param restParametes: request parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse put(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -119,7 +119,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse put(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -131,7 +131,7 @@ public interface Restful { * @param restParametes: request parameters. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPut(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback) throws ServiceException; @@ -144,7 +144,7 @@ public interface Restful { * @param options: request options. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPut(String servicePath, RestfulParametes restParametes, RestfulOptions options, RestfulAsyncCallback callback) throws ServiceException; @@ -156,7 +156,7 @@ public interface Restful { * @param restParametes: request parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse post(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -168,7 +168,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse post(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -180,7 +180,7 @@ public interface Restful { * @param restParametes: request parameters. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPost(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback) throws ServiceException; @@ -193,7 +193,7 @@ public interface Restful { * @param options: request options. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPost(String servicePath, RestfulParametes restParametes, RestfulOptions options, RestfulAsyncCallback callback) throws ServiceException; @@ -205,7 +205,7 @@ public interface Restful { * @param restParametes: request parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse delete(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -217,7 +217,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse delete(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -229,7 +229,7 @@ public interface Restful { * @param restParametes: request parameters. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback) throws ServiceException; @@ -242,7 +242,7 @@ public interface Restful { * @param options: request options. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncDelete(String servicePath, RestfulParametes restParametes, RestfulOptions options, RestfulAsyncCallback callback) throws ServiceException; @@ -254,7 +254,7 @@ public interface Restful { * @param restParametes: request parameters. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse patch(String servicePath, RestfulParametes restParametes) throws ServiceException; @@ -266,7 +266,7 @@ public interface Restful { * @param options: request options. * @return response. * @throws ServiceException - * @since SDNO 0.5 + * @since */ RestfulResponse patch(String servicePath, RestfulParametes restParametes, RestfulOptions options) throws ServiceException; @@ -278,7 +278,7 @@ public interface Restful { * @param restParametes: request parameters. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulAsyncCallback callback) throws ServiceException; @@ -291,7 +291,7 @@ public interface Restful { * @param options: request options. * @param callback: response callback method. * @throws ServiceException - * @since SDNO 0.5 + * @since */ void asyncPatch(String servicePath, RestfulParametes restParametes, RestfulOptions options, RestfulAsyncCallback callback) throws ServiceException; diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulAsyncCallback.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulAsyncCallback.java index bf11c16..bf461c9 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulAsyncCallback.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulAsyncCallback.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -21,7 +21,7 @@ package org.openo.baseservice.roa.util.restclient; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public interface RestfulAsyncCallback { @@ -29,7 +29,7 @@ public interface RestfulAsyncCallback { * Response callback.<br/> * * @param response: response of ReST call. - * @since SDNO 0.5 + * @since */ void callback(RestfulResponse response); @@ -37,7 +37,7 @@ public interface RestfulAsyncCallback { * Exceptoin callback.<br/> * * @param e: ReST call exception. - * @since SDNO 0.5 + * @since */ void handleExcepion(Throwable e); } diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulClientConst.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulClientConst.java index ef02b7d..a3b6581 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulClientConst.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulClientConst.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -21,7 +21,7 @@ package org.openo.baseservice.roa.util.restclient; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestfulClientConst { @@ -37,8 +37,6 @@ public class RestfulClientConst { public static final String SERVER_KEY_NAME = "defaulServer"; - public static final String CALLED_SERVICE_NAME = "serviceName"; - public static final String HOST_KEY_NAME = "host"; public static final String PORT_KEY_NAME = "port"; diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulConfigure.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulConfigure.java index 3d0a0ff..3ce6859 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulConfigure.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulConfigure.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -33,7 +33,7 @@ import net.sf.json.JSONObject; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestfulConfigure { @@ -47,7 +47,7 @@ public class RestfulConfigure { * Use the default path initialization http Rest options. * </p> * - * @since SDNO 0.5 + * @since */ public RestfulConfigure() { final String config = "/etc/conf/restclient.json"; @@ -72,7 +72,7 @@ public class RestfulConfigure { * Use the specified file to initialize http Rest options. * </p> * - * @since SDNO 0.5 + * @since * @param configfile */ public RestfulConfigure(final String configfile) { diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulFactory.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulFactory.java index e53bab1..5b94374 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulFactory.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulFactory.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -29,7 +29,7 @@ import java.util.Map; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestfulFactory { @@ -57,7 +57,7 @@ public class RestfulFactory { * * @param protocol protocol. currently only support 'http'. * @return restful instance. - * @since SDNO 0.5 + * @since */ public static synchronized Restful getRestInstance(final String protocol) { Restful rest = INSTANCES.get(protocol); diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulOptions.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulOptions.java index 912abf5..6e5812f 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulOptions.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulOptions.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -24,7 +24,7 @@ import java.util.Map; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestfulOptions { @@ -35,36 +35,10 @@ public class RestfulOptions { private final Map<String, Object> optionsMap = new HashMap<>(); /** - * Set called service name.<br/> - * - * @param serviceName service name. - * @return true. - * @since SDNO 0.5 - */ - public boolean setCalledServiceName(final String serviceName) { - this.setOption(RestfulClientConst.CALLED_SERVICE_NAME, serviceName); - return true; - } - - /** - * Get called service name.<br/> - * - * @return - * @since SDNO 0.5 - */ - public String getCalledServicName() { - final Object obj = this.getOption(RestfulClientConst.CALLED_SERVICE_NAME); - if(null == obj) { - return ""; - } - return (String)obj; - } - - /** * Get port.<br/> * * @return port. - * @since SDNO 0.5 + * @since */ public int getPort() { final Object obj = this.getOption(RestfulClientConst.PORT_KEY_NAME); @@ -79,7 +53,7 @@ public class RestfulOptions { * * @param port port to set. * @return - * @since SDNO 0.5 + * @since */ public boolean setPort(final int port) { this.setOption(RestfulClientConst.PORT_KEY_NAME, port); @@ -90,7 +64,7 @@ public class RestfulOptions { * Get host.<br/> * * @return the host. - * @since SDNO 0.5 + * @since */ public String getHost() { final Object obj = this.getOption(RestfulClientConst.HOST_KEY_NAME); @@ -105,7 +79,7 @@ public class RestfulOptions { * * @param host host to set. * @return - * @since SDNO 0.5 + * @since */ public boolean setHost(final String host) { this.setOption(RestfulClientConst.HOST_KEY_NAME, host); @@ -117,7 +91,7 @@ public class RestfulOptions { * * @param timeout time-out to set in seconds. * @return - * @since SDNO 0.5 + * @since */ public boolean setRestTimeout(final int timeout) { if(0 < timeout && REST_OPTIONS_TIMEOUT_MAXTIMEOUT >= timeout) { @@ -131,7 +105,7 @@ public class RestfulOptions { * Get time-out.<br/> * * @return time-out in seconds. - * @since SDNO 0.5 + * @since */ public int getRestTimeout() { final Object obj = this.getOption(REST_OPTIONS_NAME_TIMEOUT); @@ -146,7 +120,7 @@ public class RestfulOptions { * * @param optionName option name. * @return option - * @since SDNO 0.5 + * @since */ public Object getOption(final String optionName) { return optionsMap.get(optionName); @@ -157,7 +131,7 @@ public class RestfulOptions { * * @param optionName option name. * @return option value as int. - * @since SDNO 0.5 + * @since */ public int getIntOption(final String optionName) { final Object obj = this.getOption(optionName); @@ -172,7 +146,7 @@ public class RestfulOptions { * * @param optionName option name. * @return option value as string. - * @since SDNO 0.5 + * @since */ public String getStringOption(final String optionName) { final Object obj = this.getOption(optionName); @@ -188,7 +162,7 @@ public class RestfulOptions { * @param option option name. * @param optionsValue option value. * @return - * @since SDNO 0.5 + * @since */ public Object setOption(final String option, final Object optionsValue) { return optionsMap.put(option, optionsValue); diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulParametes.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulParametes.java index c6c5933..aea8753 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulParametes.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulParametes.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -25,7 +25,7 @@ import java.util.Map; * </p> * * @author - * @version SDNO 0.5 Aug 9, 2016 + * @version Aug 9, 2016 */ public class RestfulParametes { @@ -40,7 +40,7 @@ public class RestfulParametes { * * @param key * @return - * @since SDNO 0.5 + * @since */ public String get(final String key) { return paramMap.get(key); @@ -50,7 +50,7 @@ public class RestfulParametes { * <br/> * * @param data - * @since SDNO 0.5 + * @since */ public void setRawData(final String data) { this.rawData = data; @@ -60,7 +60,7 @@ public class RestfulParametes { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public String getRawData() { return this.rawData; @@ -72,7 +72,7 @@ public class RestfulParametes { * @param key * @param value * @return - * @since SDNO 0.5 + * @since */ public String put(final String key, final String value) { return paramMap.put(key, value); @@ -84,7 +84,7 @@ public class RestfulParametes { * @param key * @param value * @return - * @since SDNO 0.5 + * @since */ public String putHttpContextHeader(final String key, final String value) { return headerMap.put(key, value); @@ -96,7 +96,7 @@ public class RestfulParametes { * @param key * @param value * @return - * @since SDNO 0.5 + * @since */ public String putHttpContextHeader(final String key, final int value) { return this.putHttpContextHeader(key, String.valueOf(value)); @@ -107,7 +107,7 @@ public class RestfulParametes { * * @param key * @return - * @since SDNO 0.5 + * @since */ public String getHttpContextHeader(final String key) { return headerMap.get(key); @@ -117,7 +117,7 @@ public class RestfulParametes { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public Map<String, String> getParamMap() { return paramMap; @@ -127,7 +127,7 @@ public class RestfulParametes { * <br/> * * @param paramMap - * @since SDNO 0.5 + * @since */ public void setParamMap(final Map<String, String> paramMap) { this.paramMap = paramMap; @@ -137,7 +137,7 @@ public class RestfulParametes { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public Map<String, String> getHeaderMap() { return this.headerMap; @@ -147,7 +147,7 @@ public class RestfulParametes { * <br/> * * @param headerMap - * @since SDNO 0.5 + * @since */ public void setHeaderMap(final Map<String, String> headerMap) { this.headerMap = headerMap; diff --git a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulResponse.java b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulResponse.java index 28a0c6d..25105b7 100644 --- a/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulResponse.java +++ b/rest-client/src/main/java/org/openo/baseservice/roa/util/restclient/RestfulResponse.java @@ -1,11 +1,11 @@ /* - * Copyright (c) 2016, Huawei Technologies Co., Ltd. + * Copyright 2016 Huawei Technologies Co., Ltd. * * 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 + * 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, @@ -24,7 +24,7 @@ import java.util.Map; * </p> * * @author - * @version SDNO 0.5 28-May-2016 + * @version 28-May-2016 */ public class RestfulResponse { @@ -38,7 +38,7 @@ public class RestfulResponse { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public int getStatus() { return status; @@ -48,7 +48,7 @@ public class RestfulResponse { * <br/> * * @param status - * @since SDNO 0.5 + * @since */ public void setStatus(final int status) { this.status = status; @@ -58,7 +58,7 @@ public class RestfulResponse { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public Map<String, String> getRespHeaderMap() { return respHeaderMap; @@ -68,7 +68,7 @@ public class RestfulResponse { * <br/> * * @param header - * @since SDNO 0.5 + * @since */ public void setRespHeaderMap(final Map<String, String> header) { this.respHeaderMap = header; @@ -79,7 +79,7 @@ public class RestfulResponse { * * @param key header param name. * @return header param value as integer. (-1 if error) - * @since SDNO 0.5 + * @since */ public int getRespHeaderInt(final String key) { if(respHeaderMap != null) { @@ -96,7 +96,7 @@ public class RestfulResponse { * * @param key header param name. * @return value as long. -1 if no value. - * @since SDNO 0.5 + * @since */ public long getRespHeaderLong(final String key) { if(respHeaderMap != null) { @@ -113,7 +113,7 @@ public class RestfulResponse { * * @param key header name. * @return header value. - * @since SDNO 0.5 + * @since */ public String getRespHeaderStr(final String key) { if(respHeaderMap != null) { @@ -126,7 +126,7 @@ public class RestfulResponse { * <br/> * * @return - * @since SDNO 0.5 + * @since */ public String getResponseContent() { return responseContent; @@ -136,7 +136,7 @@ public class RestfulResponse { * <br/> * * @param responseString - * @since SDNO 0.5 + * @since */ public void setResponseJson(final String responseString) { this.responseContent = responseString; |