Class ContextImpl

java.lang.Object
org.infinispan.cli.impl.ContextImpl
All Implemented Interfaces:
Closeable, AutoCloseable, org.aesh.readline.AeshContext, Context
Direct Known Subclasses:
KubernetesContext

public class ContextImpl extends Object implements Context, org.aesh.readline.AeshContext, Closeable
ContextImpl.
Since:
5.2
Author:
Tristan Tarrant
  • Constructor Details

    • ContextImpl

      public ContextImpl(Properties defaults)
  • Method Details

    • getConfigPath

      public Path getConfigPath()
      Specified by:
      getConfigPath in interface Context
    • isConnected

      public boolean isConnected()
      Specified by:
      isConnected in interface Context
    • setProperty

      public void setProperty(String key, String value)
      Specified by:
      setProperty in interface Context
    • getProperty

      public String getProperty(String key)
      Specified by:
      getProperty in interface Context
    • getProperty

      public String getProperty(Context.Property property)
      Specified by:
      getProperty in interface Context
    • getProperties

      public Properties getProperties()
      Specified by:
      getProperties in interface Context
    • resetProperties

      public void resetProperties()
      Specified by:
      resetProperties in interface Context
    • saveProperties

      public void saveProperties()
      Specified by:
      saveProperties in interface Context
    • setSslContext

      public void setSslContext(SSLContextSettings sslContext)
      Specified by:
      setSslContext in interface Context
    • connect

      public Connection connect(org.aesh.command.shell.Shell shell, String connectionString)
      Description copied from interface: Context
      Connects to a server
      Specified by:
      connect in interface Context
      Returns:
    • connect

      public Connection connect(org.aesh.command.shell.Shell shell, String connectionString, String username, String password)
      Description copied from interface: Context
      Connect to a server using the supplied username and password
      Specified by:
      connect in interface Context
      Returns:
    • refreshPrompt

      public void refreshPrompt()
      Specified by:
      refreshPrompt in interface Context
    • changeResource

      public org.aesh.command.CommandResult changeResource(Class<? extends Resource> fromResource, String resourceType, String name) throws org.aesh.command.CommandException
      Specified by:
      changeResource in interface Context
      Throws:
      org.aesh.command.CommandException
    • disconnect

      public void disconnect()
      Description copied from interface: Context
      Disconnects from the server
      Specified by:
      disconnect in interface Context
    • getEncoding

      public org.infinispan.commons.dataconversion.MediaType getEncoding()
      Specified by:
      getEncoding in interface Context
    • setEncoding

      public void setEncoding(org.infinispan.commons.dataconversion.MediaType encoding)
      Specified by:
      setEncoding in interface Context
    • setConsole

      public void setConsole(org.aesh.readline.ReadlineConsole console)
      Specified by:
      setConsole in interface Context
    • getRegistry

      public org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation> getRegistry()
      Specified by:
      getRegistry in interface Context
    • setRegistry

      public void setRegistry(org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation> registry)
      Specified by:
      setRegistry in interface Context
    • getConnection

      public Connection getConnection()
      Description copied from interface: Context
      Returns the current Connection
      Specified by:
      getConnection in interface Context
      Returns:
    • getCurrentWorkingDirectory

      public org.aesh.io.Resource getCurrentWorkingDirectory()
      Specified by:
      getCurrentWorkingDirectory in interface org.aesh.readline.AeshContext
    • setCurrentWorkingDirectory

      public void setCurrentWorkingDirectory(org.aesh.io.Resource cwd)
      Specified by:
      setCurrentWorkingDirectory in interface org.aesh.readline.AeshContext
    • exportedVariableNames

      public Set<String> exportedVariableNames()
      Specified by:
      exportedVariableNames in interface org.aesh.readline.AeshContext
    • exportedVariable

      public String exportedVariable(String key)
      Specified by:
      exportedVariable in interface org.aesh.readline.AeshContext
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable