001package co.codewizards.cloudstore.ls.client.handler; 002 003import co.codewizards.cloudstore.ls.client.LocalServerClient; 004import co.codewizards.cloudstore.ls.core.dto.InverseServiceRequest; 005import co.codewizards.cloudstore.ls.core.dto.InverseServiceResponse; 006 007 008public interface InverseServiceRequestHandler<Q extends InverseServiceRequest, A extends InverseServiceResponse> { 009 010 /** 011 * Gets the priority of this handler. 012 * <p> 013 * The greatest number wins, if there are multiple handlers for the same class. 014 * @return the priority of this handler. 015 */ 016 int getPriority(); 017 018 /** 019 * Gets the class or interface to be handled. Sub-classes are handled, too! If undesired, use the {@link #getPriority() priority}. 020 * @return the class or interface to be handled. Must not be <code>null</code>. 021 */ 022 Class<? super Q> getInverseServiceRequestType(); 023 024 LocalServerClient getLocalServerClient(); 025 026 void setLocalServerClient(LocalServerClient localServerClient); 027 028 A handle(Q request) throws Exception; 029}