Search in sources :

Example 1 with SessionSetting

use of com.github.dreamhead.moco.parser.model.SessionSetting in project moco by dreamhead.

the class SocketServerParser method createServer.

@Override
protected SocketServer createServer(final ImmutableList<SessionSetting> sessionSettings, final Optional<Integer> port, final MocoConfig... configs) {
    SocketServer server = ActualSocketServer.createLogServer(port);
    for (SessionSetting session : sessionSettings) {
        logger.debug("Parse session: {}", session);
        session.bindTo(server);
    }
    return server;
}
Also used : SocketServer(com.github.dreamhead.moco.SocketServer) ActualSocketServer(com.github.dreamhead.moco.internal.ActualSocketServer) SessionSetting(com.github.dreamhead.moco.parser.model.SessionSetting)

Example 2 with SessionSetting

use of com.github.dreamhead.moco.parser.model.SessionSetting in project moco by dreamhead.

the class HttpServerParser method createServer.

@Override
protected HttpServer createServer(final ImmutableList<SessionSetting> sessionSettings, final Optional<Integer> port, final MocoConfig... configs) {
    ActualHttpServer targetServer = ActualHttpServer.createLogServer(port, configs);
    for (SessionSetting session : sessionSettings) {
        logger.debug("Parse session: {}", session);
        targetServer = targetServer.mergeServer(session.newHttpServer(port, configs));
    }
    return targetServer;
}
Also used : ActualHttpServer(com.github.dreamhead.moco.internal.ActualHttpServer) SessionSetting(com.github.dreamhead.moco.parser.model.SessionSetting)

Aggregations

SessionSetting (com.github.dreamhead.moco.parser.model.SessionSetting)2 SocketServer (com.github.dreamhead.moco.SocketServer)1 ActualHttpServer (com.github.dreamhead.moco.internal.ActualHttpServer)1 ActualSocketServer (com.github.dreamhead.moco.internal.ActualSocketServer)1