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

com.github.df.restypass.command.RestyCommand Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package com.github.df.restypass.command;

import com.github.df.restypass.event.EventEmit;
import com.github.df.restypass.lb.server.ServerInstance;
import org.asynchttpclient.uri.Uri;

import java.lang.reflect.Method;
import java.lang.reflect.Type;

/**
 * Resty请求命令
 * Created by darrenfu on 17-6-26.
 */
@SuppressWarnings("unused")
public interface RestyCommand extends RestyCommandLifeCycle, EventEmit {

    /**
     * HTTP
     */
    String HTTP = "http";
    /**
     * HTTPS
     */
    String HTTPS = "https";

    /**
     * RestyCommand的请求路径 (eg. /resty/user/get)
     *
     * @return the path
     */
    String getPath();

    /**
     * RestyCommand的请求方式(GET/POST)
     *
     * @return the http method
     */
    String getHttpMethod();

    /**
     * RestyCommand对应的服务名称
     *
     * @return the service name
     */
    String getServiceName();

    /**
     * RestyCommand对应的method
     *
     * @return the service method
     */
    Method getServiceMethod();

    /**
     * 获取RestyCommand的返回类型
     *
     * @return the return type
     */
    Type getReturnType();

    /**
     * 获取RestyCommand的请求参数
     *
     * @return the object [ ]
     */
    Object[] getArgs();

    /**
     * 获取Command的配置
     *
     * @return the resty command config
     */
    RestyCommandConfig getRestyCommandConfig();

    /**
     * 获取请求的URI
     *
     * @param serverInstance the server instance
     * @return the uri
     */
    Uri getUri(ServerInstance serverInstance);

    /**
     * 获取关联的请求模板
     *
     * @return the request template
     */
    RestyRequestTemplate getRequestTemplate();


    /**
     * 是否是异步命令-基于返回值future
     * 示例接口:Future getUser(String userId);
     *
     * @return the boolean
     */
    boolean isAsyncReturn();

    /**
     * 是否是异步命令-基于请求参数future
     * 

* 示例接口:User getUser(String userId, RestyFuture); * * @return the boolean */ boolean isAsyncArg(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy