Package org.jdrupes.vmoperator.vmmgmt
Class VmMgmt
java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.AbstractConlet<VmMgmt.VmsModel>
org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet<VmMgmt.VmsModel>
org.jdrupes.vmoperator.vmmgmt.VmMgmt
- All Implemented Interfaces:
Iterable<ComponentType>,Channel,ComponentType,Eligible,Manager
public class VmMgmt
extends org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet<VmMgmt.VmsModel>
The Class
VmMgmt.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Class Summary.static classThe periodically generated update event.classThe Class VmsModel.Nested classes/interfaces inherited from class org.jgrapes.webconsole.base.AbstractConlet
org.jgrapes.webconsole.base.AbstractConlet.ConletTrackingInfoNested classes/interfaces inherited from interface org.jgrapes.core.Channel
Channel.Default -
Field Summary
Fields inherited from class org.jgrapes.webconsole.base.AbstractConlet
TYPE_INSTANCE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<VmMgmt.VmsModel> createStateRepresentation(Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId) protected Set<org.jgrapes.webconsole.base.Conlet.RenderMode> doRenderConlet(org.jgrapes.webconsole.base.events.RenderConletRequestBase<?> event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId, VmMgmt.VmsModel conletState) protected booleandoSetLocale(org.jgrapes.webconsole.base.events.SetLocale event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId) protected voiddoUpdateConletState(org.jgrapes.webconsole.base.events.NotifyConletModel event, org.jgrapes.webconsole.base.ConsoleConnection channel, VmMgmt.VmsModel model) voidConfigure the component.voidonConsoleReady(org.jgrapes.webconsole.base.events.ConsoleReady event, org.jgrapes.webconsole.base.ConsoleConnection channel) OnConsoleReady, fire theAddConletType.voidonUpdate(VmMgmt.Update event, org.jgrapes.webconsole.base.ConsoleConnection connection) Handle the periodic update event by sendingNotifyConletViewevents.voidonVmResourceChanged(VmResourceChanged event, VmChannel channel) Track the VM definitions.Methods inherited from class org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet
doGetResource, fmConletModel, fmModel, fmModel, fmSessionModel, fmTypeModel, freemarkerConfig, processTemplate, processTemplateMethods inherited from class org.jgrapes.webconsole.base.AbstractConlet
afterOnClosed, conletIds, conletIdsByConsoleConnection, conletViews, createNewState, doConletDeleted, doRemoveConletType, generateInstanceId, l10nBundles, localizations, onAddConletRequest, onClosed, onConletDeleted, onConletResourceRequest, onDetached, onNotifyConletModel, onRenderConletRequest, onSetLocale, putInSession, readContent, readContent, recreateState, removeState, resourceBundle, setPeriodicRefresh, stateFromSession, statesFromSession, supportedLocales, trackConlet, trackedConnections, type, typeFromIdMethods inherited from class org.jgrapes.core.Component
channel, component, defaultCriterion, isEligibleFor, setNameMethods inherited from class org.jgrapes.core.internal.ComponentVertex
activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGeneratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
VmMgmt
Creates a new component with its channel set to the given channel.- Parameters:
componentChannel- the channel that the component’s handlers listen on by default and thatManager.fire(Event, Channel...)sends the event to
-
-
Method Details
-
onConfigurationUpdate
Configure the component.- Parameters:
event- the event
-
onConsoleReady
@Handler public void onConsoleReady(org.jgrapes.webconsole.base.events.ConsoleReady event, org.jgrapes.webconsole.base.ConsoleConnection channel) throws TemplateNotFoundException, MalformedTemplateNameException, ParseException, IOException OnConsoleReady, fire theAddConletType.- Parameters:
event- the eventchannel- the channel- Throws:
TemplateNotFoundException- the template not found exceptionMalformedTemplateNameException- the malformed template name exceptionParseException- the parse exceptionIOException- Signals that an I/O exception has occurred.
-
createStateRepresentation
protected Optional<VmMgmt.VmsModel> createStateRepresentation(Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId) throws Exception - Overrides:
createStateRepresentationin classorg.jgrapes.webconsole.base.AbstractConlet<VmMgmt.VmsModel>- Throws:
Exception
-
doRenderConlet
protected Set<org.jgrapes.webconsole.base.Conlet.RenderMode> doRenderConlet(org.jgrapes.webconsole.base.events.RenderConletRequestBase<?> event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId, VmMgmt.VmsModel conletState) throws Exception - Specified by:
doRenderConletin classorg.jgrapes.webconsole.base.AbstractConlet<VmMgmt.VmsModel>- Throws:
Exception
-
onVmResourceChanged
@Handler(namedChannels="manager") public void onVmResourceChanged(VmResourceChanged event, VmChannel channel) throws IOException Track the VM definitions.- Parameters:
event- the eventchannel- the channel- Throws:
IOException
-
onUpdate
@Handler public void onUpdate(VmMgmt.Update event, org.jgrapes.webconsole.base.ConsoleConnection connection) Handle the periodic update event by sendingNotifyConletViewevents.- Parameters:
event- the eventconnection- the console connection
-
doUpdateConletState
protected void doUpdateConletState(org.jgrapes.webconsole.base.events.NotifyConletModel event, org.jgrapes.webconsole.base.ConsoleConnection channel, VmMgmt.VmsModel model) throws Exception - Overrides:
doUpdateConletStatein classorg.jgrapes.webconsole.base.AbstractConlet<VmMgmt.VmsModel>- Throws:
Exception
-
doSetLocale
protected boolean doSetLocale(org.jgrapes.webconsole.base.events.SetLocale event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId) throws Exception - Overrides:
doSetLocalein classorg.jgrapes.webconsole.base.AbstractConlet<VmMgmt.VmsModel>- Throws:
Exception
-