Class VmAccess

java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet<VmAccess.ResourceModel>
org.jdrupes.vmoperator.vmaccess.VmAccess
All Implemented Interfaces:
Iterable<org.jgrapes.core.ComponentType>, org.jgrapes.core.Channel, org.jgrapes.core.ComponentType, org.jgrapes.core.Eligible, org.jgrapes.core.Manager

public class VmAccess extends org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet<VmAccess.ResourceModel>
The Class VmAccess.

The component supports the following configuration properties:

  • displayResource: a map with the following entries:
    • preferredIpVersion: ipv4 or ipv6 (default: ipv4). Determines the IP addresses uses in the generated connection file.
  • deleteConnectionFile: true or false (default: true). If true, the downloaded connection file will be deleted by the remote viewer when opened.
  • syncPreviewsFor: a list objects with either property user or role and the associated name (default: []). The remote viewer will synchronize the previews for the specified users and roles.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The Class AccessModel.
    static class 
    The periodically generated update event.

    Nested classes/interfaces inherited from class org.jgrapes.webconsole.base.AbstractConlet

    org.jgrapes.webconsole.base.AbstractConlet.ConletTrackingInfo

    Nested classes/interfaces inherited from interface org.jgrapes.core.Channel

    org.jgrapes.core.Channel.Default
  • Field Summary

    Fields inherited from class org.jgrapes.webconsole.base.AbstractConlet

    TYPE_INSTANCE_SEPARATOR

    Fields inherited from class org.jgrapes.core.Component

    logger

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    VmAccess(org.jgrapes.core.Channel componentChannel)
    Creates a new component with its channel set to the given channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    createNewState(org.jgrapes.webconsole.base.events.AddConletRequest event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId)
     
    createStateRepresentation(org.jgrapes.core.Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId)
     
    protected void
    doConletDeleted(org.jgrapes.webconsole.base.events.ConletDeleted event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId, VmAccess.ResourceModel conletState)
     
    protected Set<org.jgrapes.webconsole.base.Conlet.RenderMode>
    doRenderConlet(org.jgrapes.webconsole.base.events.RenderConletRequestBase<?> event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId, VmAccess.ResourceModel model)
     
    protected boolean
    doSetLocale(org.jgrapes.webconsole.base.events.SetLocale event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId)
     
    protected void
    doUpdateConletState(org.jgrapes.webconsole.base.events.NotifyConletModel event, org.jgrapes.webconsole.base.ConsoleConnection channel, VmAccess.ResourceModel model)
     
    void
    onConfigurationUpdate(org.jgrapes.util.events.ConfigurationUpdate event)
    Configure the component.
    void
    onConsoleConfigured(org.jgrapes.webconsole.base.events.ConsoleConfigured event, org.jgrapes.webconsole.base.ConsoleConnection connection)
    On console configured.
    void
    onConsolePrepared(org.jgrapes.webconsole.base.events.ConsolePrepared event, org.jgrapes.webconsole.base.ConsoleConnection connection)
    On console prepared.
    void
    onConsoleReady(org.jgrapes.webconsole.base.events.ConsoleReady event, org.jgrapes.webconsole.base.ConsoleConnection channel)
    On ConsoleReady, fire the AddConletType.
    void
    onStart(org.jgrapes.core.events.Start event)
    On start.
    void
    On vm pool changed.
    void
    Track the VM definitions and update conlets.
    recreateState(org.jgrapes.core.Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId)
     

    Methods inherited from class org.jgrapes.webconsole.base.freemarker.FreeMarkerConlet

    doGetResource, fmConletModel, fmModel, fmModel, fmSessionModel, fmTypeModel, freemarkerConfig, processTemplate, processTemplate

    Methods inherited from class org.jgrapes.webconsole.base.AbstractConlet

    afterOnClosed, conletIds, conletIdsByConsoleConnection, conletViews, doRemoveConletType, generateInstanceId, l10nBundles, localizations, onAddConletRequest, onClosed, onConletDeleted, onConletResourceRequest, onDetached, onNotifyConletModel, onRenderConletRequest, onSetLocale, putInSession, readContent, readContent, removeState, resourceBundle, setPeriodicRefresh, stateFromSession, statesFromSession, supportedLocales, trackConlet, trackedConnections, type, typeFromId

    Methods inherited from class org.jgrapes.core.Component

    channel, component, defaultCriterion, isEligibleFor, setName

    Methods 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, unregisterAsGenerator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.jgrapes.core.Manager

    stream
  • Constructor Details

    • VmAccess

      public VmAccess(org.jgrapes.core.Channel componentChannel)
      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 that Manager.fire(Event, Channel...) sends the event to
  • Method Details

    • onStart

      @Handler public void onStart(org.jgrapes.core.events.Start event)
      On start.
      Parameters:
      event - the event
    • onConfigurationUpdate

      @Handler public void onConfigurationUpdate(org.jgrapes.util.events.ConfigurationUpdate event)
      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 freemarker.template.TemplateNotFoundException, freemarker.template.MalformedTemplateNameException, freemarker.core.ParseException, IOException
      On ConsoleReady, fire the AddConletType.
      Parameters:
      event - the event
      channel - the channel
      Throws:
      freemarker.template.TemplateNotFoundException - the template not found exception
      freemarker.template.MalformedTemplateNameException - the malformed template name exception
      freemarker.core.ParseException - the parse exception
      IOException - Signals that an I/O exception has occurred.
    • onConsoleConfigured

      @Handler public void onConsoleConfigured(org.jgrapes.webconsole.base.events.ConsoleConfigured event, org.jgrapes.webconsole.base.ConsoleConnection connection) throws InterruptedException, IOException
      On console configured.
      Parameters:
      event - the event
      connection - the console connection
      Throws:
      InterruptedException - the interrupted exception
      IOException
    • onConsolePrepared

      @Handler public void onConsolePrepared(org.jgrapes.webconsole.base.events.ConsolePrepared event, org.jgrapes.webconsole.base.ConsoleConnection connection)
      On console prepared.
      Parameters:
      event - the event
      connection - the connection
    • createNewState

      protected Optional<VmAccess.ResourceModel> createNewState(org.jgrapes.webconsole.base.events.AddConletRequest event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId) throws Exception
      Overrides:
      createNewState in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception
    • createStateRepresentation

      protected Optional<VmAccess.ResourceModel> createStateRepresentation(org.jgrapes.core.Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection connection, String conletId) throws Exception
      Overrides:
      createStateRepresentation in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception
    • recreateState

      protected Optional<VmAccess.ResourceModel> recreateState(org.jgrapes.core.Event<?> event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId) throws Exception
      Overrides:
      recreateState in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      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, VmAccess.ResourceModel model) throws Exception
      Specified by:
      doRenderConlet in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception
    • doConletDeleted

      protected void doConletDeleted(org.jgrapes.webconsole.base.events.ConletDeleted event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId, VmAccess.ResourceModel conletState) throws Exception
      Overrides:
      doConletDeleted in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception
    • onVmResourceChanged

      @Handler(namedChannels="manager") public void onVmResourceChanged(VmResourceChanged event, VmChannel channel) throws IOException, InterruptedException
      Track the VM definitions and update conlets.
      Parameters:
      event - the event
      channel - the channel
      Throws:
      IOException
      InterruptedException
    • onVmPoolChanged

      @Handler(namedChannels="manager") public void onVmPoolChanged(VmPoolChanged event) throws InterruptedException
      On vm pool changed.
      Parameters:
      event - the event
      Throws:
      InterruptedException - the interrupted exception
    • doUpdateConletState

      protected void doUpdateConletState(org.jgrapes.webconsole.base.events.NotifyConletModel event, org.jgrapes.webconsole.base.ConsoleConnection channel, VmAccess.ResourceModel model) throws Exception
      Overrides:
      doUpdateConletState in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception
    • doSetLocale

      protected boolean doSetLocale(org.jgrapes.webconsole.base.events.SetLocale event, org.jgrapes.webconsole.base.ConsoleConnection channel, String conletId) throws Exception
      Overrides:
      doSetLocale in class org.jgrapes.webconsole.base.AbstractConlet<VmAccess.ResourceModel>
      Throws:
      Exception