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

nz.ac.auckland.lmz.controlpanel.bus.AuthPanelEventHandler.groovy Maven / Gradle / Ivy

The newest version!
package nz.ac.auckland.lmz.controlpanel.bus

import groovy.transform.CompileStatic
import nz.ac.auckland.syllabus.events.Event
import nz.ac.auckland.syllabus.events.EventHandler
import nz.ac.auckland.syllabus.payload.EventRequestBase
import nz.ac.auckland.syllabus.payload.EventResponseBase


/**
 * Event handler for authentication panel. Signals on/off to HeaderDumpFilter (through system property)
 *
 * author: Irina Benediktovich - https://plus.google.com/+IrinaBenediktovich
 */
@Event(name = 'authpanel', namespace = 'admin')
@CompileStatic
class AuthPanelEventHandler implements EventHandler {

	static String FLAG_HEADER_DUMP = "FLAG_HEADER_DUMP"

	@Override
	AuthPanelResponse handleEvent(AuthPanelRequest requestType) throws Exception {
		System.setProperty(FLAG_HEADER_DUMP,  Boolean.valueOf(requestType.dumpHeaderFlag).toString())
		return new AuthPanelResponse()
	}

	static class AuthPanelRequest extends EventRequestBase {
		boolean dumpHeaderFlag
	}

	static class AuthPanelResponse extends EventResponseBase {
		String message = "Okey"
	}
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy