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

com.jk.services.client.JKServiceCaller Maven / Gradle / Ivy

There is a newer version: 7.0.0-M7
Show newest version
/*
 * Copyright 2002-2021 Dr. Jalal Kiswani. 
 * Email: [email protected]
 * Check out https://smart-api.com for more details
 * 
 * All the opensource projects of Dr. Jalal Kiswani are free for personal and academic use only, 
 * for commercial usage and support, please contact the author.
 *
 * 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 com.jk.services.client;

import javax.ws.rs.client.Invocation.Builder;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

// TODO: Auto-generated Javadoc
/**
 * The Interface JKServiceCaller.
 */
public interface JKServiceCaller{
	
	/**
	 * Call.
	 *
	 * @param builder the builder
	 * @return the response
	 */
	public Response call(Builder builder) ;

	/**
	 * Read response.
	 *
	 * @param response the response
	 * @return the object
	 */
	public default Object readResponse(Response response) {
		return response.readEntity(String.class); 
	}

	/**
	 * Gets the accept media.
	 *
	 * @return the accept media
	 */
	public default String getAcceptMedia() {
		return MediaType.APPLICATION_JSON;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy