Search in sources :

Example 1 with UnfoundAliveSererException

use of com.ctrip.xpipe.redis.meta.server.rest.exception.UnfoundAliveSererException in project x-pipe by ctripcorp.

the class AbstractDispatcherMetaServerController method populateModel.

@ModelAttribute
public void populateModel(@PathVariable final String clusterId, @RequestHeader(name = MetaServerService.HTTP_HEADER_FOWRARD, required = false) ForwardInfo forwardInfo, Model model, HttpServletRequest request) {
    if (forwardInfo != null) {
        logger.info("[populateModel]{},{}", clusterId, forwardInfo);
    }
    MetaServer metaServer = getMetaServer(clusterId, forwardInfo, request.getRequestURI());
    if (metaServer == null) {
        throw new UnfoundAliveSererException(clusterId, slotManager.getServerIdByKey(clusterId), currentMetaServer.getServerId());
    }
    model.addAttribute(MODEL_META_SERVER, metaServer);
    if (forwardInfo != null) {
        model.addAttribute(forwardInfo);
    }
}
Also used : UnfoundAliveSererException(com.ctrip.xpipe.redis.meta.server.rest.exception.UnfoundAliveSererException) MultiMetaServer(com.ctrip.xpipe.redis.meta.server.impl.MultiMetaServer) MetaServer(com.ctrip.xpipe.redis.meta.server.MetaServer) ModelAttribute(org.springframework.web.bind.annotation.ModelAttribute)

Aggregations

MetaServer (com.ctrip.xpipe.redis.meta.server.MetaServer)1 MultiMetaServer (com.ctrip.xpipe.redis.meta.server.impl.MultiMetaServer)1 UnfoundAliveSererException (com.ctrip.xpipe.redis.meta.server.rest.exception.UnfoundAliveSererException)1 ModelAttribute (org.springframework.web.bind.annotation.ModelAttribute)1