/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

System.assert(Internal.run_with_activation_context(function() {
	template CheckCommand "icinga-check-command" use (IcingaCheck = Internal.IcingaCheck) {
		execute = IcingaCheck

		vars.icinga_min_version = ""
	}

	template CheckCommand "cluster-check-command" use (ClusterCheck = Internal.ClusterCheck) {
		execute = ClusterCheck
	}

	template CheckCommand "cluster-zone-check-command" use (ClusterZoneCheck = Internal.ClusterZoneCheck) {
		execute = ClusterZoneCheck
	}

	template CheckCommand "plugin-check-command" use (PluginCheck = Internal.PluginCheck) default {
		execute = PluginCheck
	}

	template NotificationCommand "plugin-notification-command" use (PluginNotification = Internal.PluginNotification) default {
		execute = PluginNotification
	}

	template EventCommand "plugin-event-command" use (PluginEvent = Internal.PluginEvent) default {
		execute = PluginEvent
	}

	template CheckCommand "dummy-check-command" use (DummyCheck = Internal.DummyCheck) {
		execute = DummyCheck
	}

	template CheckCommand "random-check-command" use (RandomCheck = Internal.RandomCheck) {
		execute = RandomCheck
	}

	template CheckCommand "exception-check-command" use (ExceptionCheck = Internal.ExceptionCheck) {
		execute = ExceptionCheck
	}

	template CheckCommand "null-check-command" use (NullCheck = Internal.NullCheck) {
		execute = NullCheck
	}

	template EventCommand "null-event-command" use (NullEvent = Internal.NullEvent) {
		execute = NullEvent
	}

	template TimePeriod "empty-timeperiod" use (EmptyTimePeriod = Internal.EmptyTimePeriod) {
		update = EmptyTimePeriod
	}

	template TimePeriod "even-minutes-timeperiod" use (EvenMinutesTimePeriod = Internal.EvenMinutesTimePeriod) {
		update = EvenMinutesTimePeriod
	}

	template CheckCommand "sleep-check-command" use (SleepCheck = Internal.SleepCheck) {
	    execute = SleepCheck

	    vars.sleep_time = 1s
	}
}))

var methods = [
	"IcingaCheck",
	"ClusterCheck",
	"ClusterZoneCheck",
	"PluginCheck",
	"ClrCheck",
	"PluginNotification",
	"PluginEvent",
	"DummyCheck",
	"RandomCheck",
	"ExceptionCheck",
	"NullCheck",
	"NullEvent",
	"EmptyTimePeriod",
	"EvenMinutesTimePeriod",
	"SleepCheck"
]

for (method in methods) {
	Internal.remove(method)
}
