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

org.webpieces.plugins.hsqldb.H2DbRoutes Maven / Gradle / Ivy

There is a newer version: 2.1.1
Show newest version
package org.webpieces.plugins.hsqldb;

import static org.webpieces.router.api.routes.Port.BOTH;

import org.webpieces.ctx.api.HttpMethod;
import org.webpieces.router.api.routebldr.DomainRouteBuilder;
import org.webpieces.router.api.routebldr.RouteBuilder;
import org.webpieces.router.api.routes.Routes;

public class H2DbRoutes implements Routes {
	
	private String urlPath;

	public H2DbRoutes(H2DbConfig config) {
		urlPath = config.getPluginPath();
	}

	@Override
	public void configure(DomainRouteBuilder domainRouteBldr) {
		RouteBuilder bldr = domainRouteBldr.getBackendRouteBuilder();
		bldr.addRoute(BOTH, HttpMethod.GET, urlPath, "H2DbController.redirectToDatabaseGui", H2DbRouteId.REDIRECT_TO_DB_GUI);
		
		RouteBuilder httpBuilder = domainRouteBldr.getAllDomainsRouteBuilder();
		httpBuilder.addRoute(BOTH, HttpMethod.GET, urlPath+"/database", "H2DbController.databaseGui", H2DbRouteId.DATABASE_GUI_PAGE);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy