Package org.infinispan.cli.impl
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.cli.Context
Context.Property
-
-
Constructor Summary
Constructors Constructor Description ContextImpl(Properties defaults)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.aesh.command.CommandResultchangeResource(Class<? extends Resource> fromResource, String resourceType, String name)voidclose()Connectionconnect(org.aesh.command.shell.Shell shell, String connectionString)Connects to a serverConnectionconnect(org.aesh.command.shell.Shell shell, String connectionString, String username, String password)Connect to a server using the supplied username and passwordvoiddisconnect()Disconnects from the serverStringexportedVariable(String key)Set<String>exportedVariableNames()PathgetConfigPath()ConnectiongetConnection()Returns the currentConnectionorg.aesh.io.ResourcegetCurrentWorkingDirectory()org.infinispan.commons.dataconversion.MediaTypegetEncoding()PropertiesgetProperties()StringgetProperty(String key)StringgetProperty(Context.Property property)org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation>getRegistry()booleanisConnected()voidrefreshPrompt()voidresetProperties()voidsaveProperties()voidsetConsole(org.aesh.readline.ReadlineConsole console)voidsetCurrentWorkingDirectory(org.aesh.io.Resource cwd)voidsetEncoding(org.infinispan.commons.dataconversion.MediaType encoding)voidsetProperty(String key, String value)voidsetRegistry(org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation> registry)voidsetSslContext(SSLContextSettings sslContext)
-
-
-
Constructor Detail
-
ContextImpl
public ContextImpl(Properties defaults)
-
-
Method Detail
-
getConfigPath
public Path getConfigPath()
- Specified by:
getConfigPathin interfaceContext
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceContext
-
setProperty
public void setProperty(String key, String value)
- Specified by:
setPropertyin interfaceContext
-
getProperty
public String getProperty(String key)
- Specified by:
getPropertyin interfaceContext
-
getProperty
public String getProperty(Context.Property property)
- Specified by:
getPropertyin interfaceContext
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceContext
-
resetProperties
public void resetProperties()
- Specified by:
resetPropertiesin interfaceContext
-
saveProperties
public void saveProperties()
- Specified by:
savePropertiesin interfaceContext
-
setSslContext
public void setSslContext(SSLContextSettings sslContext)
- Specified by:
setSslContextin interfaceContext
-
connect
public Connection connect(org.aesh.command.shell.Shell shell, String connectionString)
Description copied from interface:ContextConnects to a server
-
connect
public Connection connect(org.aesh.command.shell.Shell shell, String connectionString, String username, String password)
Description copied from interface:ContextConnect to a server using the supplied username and password
-
refreshPrompt
public void refreshPrompt()
- Specified by:
refreshPromptin interfaceContext
-
changeResource
public org.aesh.command.CommandResult changeResource(Class<? extends Resource> fromResource, String resourceType, String name) throws org.aesh.command.CommandException
- Specified by:
changeResourcein interfaceContext- Throws:
org.aesh.command.CommandException
-
disconnect
public void disconnect()
Description copied from interface:ContextDisconnects from the server- Specified by:
disconnectin interfaceContext
-
getEncoding
public org.infinispan.commons.dataconversion.MediaType getEncoding()
- Specified by:
getEncodingin interfaceContext
-
setEncoding
public void setEncoding(org.infinispan.commons.dataconversion.MediaType encoding)
- Specified by:
setEncodingin interfaceContext
-
setConsole
public void setConsole(org.aesh.readline.ReadlineConsole console)
- Specified by:
setConsolein interfaceContext
-
getRegistry
public org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation> getRegistry()
- Specified by:
getRegistryin interfaceContext
-
setRegistry
public void setRegistry(org.aesh.command.registry.CommandRegistry<? extends org.aesh.command.invocation.CommandInvocation> registry)
- Specified by:
setRegistryin interfaceContext
-
getConnection
public Connection getConnection()
Description copied from interface:ContextReturns the currentConnection- Specified by:
getConnectionin interfaceContext- Returns:
-
getCurrentWorkingDirectory
public org.aesh.io.Resource getCurrentWorkingDirectory()
- Specified by:
getCurrentWorkingDirectoryin interfaceorg.aesh.readline.AeshContext
-
setCurrentWorkingDirectory
public void setCurrentWorkingDirectory(org.aesh.io.Resource cwd)
- Specified by:
setCurrentWorkingDirectoryin interfaceorg.aesh.readline.AeshContext
-
exportedVariableNames
public Set<String> exportedVariableNames()
- Specified by:
exportedVariableNamesin interfaceorg.aesh.readline.AeshContext
-
exportedVariable
public String exportedVariable(String key)
- Specified by:
exportedVariablein interfaceorg.aesh.readline.AeshContext
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-