001/* 002 * JGrapes Event Driven Framework 003 * Copyright (C) 2017-2018 Michael N. Lipp 004 * 005 * This program is free software; you can redistribute it and/or modify it 006 * under the terms of the GNU Affero General Public License as published by 007 * the Free Software Foundation; either version 3 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, but 011 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 012 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License 013 * for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License along 016 * with this program; if not, see <http://www.gnu.org/licenses/>. 017 */ 018 019package org.jgrapes.webconsole.base.events; 020 021import java.net.URI; 022import java.time.Instant; 023import org.jdrupes.httpcodec.protocols.http.HttpRequest; 024import org.jgrapes.http.Session; 025import org.jgrapes.io.IOSubchannel; 026import org.jgrapes.webconsole.base.RenderSupport; 027 028/** 029 * An event that signals the request of a resource by the web console 030 * (browser). Resource request from the browser for a web console 031 * component resource are usually generated during console boot. See 032 * the description of {@link AddConletType} for details. 033 */ 034public class ConletResourceRequest extends ResourceRequest { 035 036 private final String conletType; 037 038 /** 039 * Creates a new request. 040 * 041 * @param conletType the web console component type 042 * @param resourceUri the requested resource 043 * @param httpRequest the original HTTP request 044 * @param httpChannel the channel that the HTTP request was received on 045 * @param renderSupport the render support 046 */ 047 public ConletResourceRequest(String conletType, URI resourceUri, 048 Instant ifModifiedSince, 049 HttpRequest httpRequest, IOSubchannel httpChannel, 050 Session session, RenderSupport renderSupport) { 051 super(resourceUri, ifModifiedSince, 052 httpRequest, httpChannel, session, renderSupport); 053 this.conletType = conletType; 054 } 055 056 /** 057 * @return the conletId 058 */ 059 public String conletClass() { 060 return conletType; 061 } 062 063}