Class OConsoleDatabaseApp
java.lang.Object
com.orientechnologies.common.console.OConsoleApplication
com.orientechnologies.orient.console.OConsoleDatabaseApp
- All Implemented Interfaces:
OProgressListener,OTableFormatter.OTableOutput,OCommandOutputListener
public class OConsoleDatabaseApp
extends OConsoleApplication
implements OCommandOutputListener, OProgressListener, OTableFormatter.OTableOutput
-
Nested Class Summary
Nested classes/interfaces inherited from class com.orientechnologies.common.console.OConsoleApplication
OConsoleApplication.RESULT -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ODatabaseDocumentInternalprotected Stringprotected ORecordprotected intprotected Objectprotected List<OIdentifiable>protected OrientDBprotected OURLConnectionFields inherited from class com.orientechnologies.common.console.OConsoleApplication
args, commandBuffer, COMMENT_PREFIXS, err, exitCommands, helpCommands, in, interactiveMode, methods, ONLINE_HELP_EXT, ONLINE_HELP_URL, out, PARAM_DISABLE_HISTORY, properties, reader, wordSeparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidalterClass(String iCommandText) voidalterCluster(String iCommandText) voidalterDatabase(String iCommandText) voidalterProperty(String iCommandText) voidalterSequence(String iCommandText) voidbackupDatabase(String iText) voidbegin()voidbrowseClass(String iClassName) voidbrowseCluster(String iClusterName) protected voidShould be used only by console commandsvoidcheckDatabase(String iOptions) protected voidShould be used only by console commandsprotected voidShould be used only by console commandsvoidclose()Closes the console freeing all the used resources.voidvoidcommit()voidcompareDatabases(String iDb1URL, String iDb2URL, String iUserName, String iUserPassword, String autoDiscoveringMappingData) voidconfig()voidvoidvoidvoidcreateClass(String iCommandText) voidcreateCluster(String iCommandText) voidcreateDatabase(String databaseURL, String userName, String userPassword, String storageType, String databaseType, String options) voidcreateEdge(String iCommandText) voidcreateFunction(String iCommandText) * Creates a function.voidcreateIndex(String iCommandText) voidcreateLink(String iCommandText) voidcreateProperty(String iCommandText) voidcreateSequence(String iCommandText) voidcreateUser(String iCommandText) voidcreateVertex(String iCommandText) voidcurrent()voidvoiddictionaryGet(String iKey) voiddictionaryPut(String iKey, String iRecordId) voiddictionaryRemove(String iKey) voidvoiddisplayRecord(String iRecordNumber) voidvoiddropCluster(String iClusterName) voiddropDatabase(String storageType) voiddropDatabase(String iDatabaseURL, String iUserName, String iUserPassword, String storageType) voidvoiddropProperty(String iCommandText) voiddropSequence(String iCommandText) voiddropServerUser(String iServerUserName) voidprotected voiddumpDistributedConfiguration(boolean iForce) protected voiddumpResultSet(int limit) voidprotected OConsoleApplication.RESULTexecuteServerCommand(String iCommand) protected voidexecuteServerSideScript(String iLanguage, String iText) voidvoidexportDatabase(String iText) voidexportRecord(String iFormat, String iOptions) voidexportSchema(String iOutputFilePath) voidfindReferences(String iCommandText) voidflushDatabase(String storageType) protected StringvoidfreezeDatabase(String storageType) voidgc()voidprotected StringShould be used only by console commandsShould be used only by console commandsShould be used only by console commandsShould be used only by console commandsShould be used only by console commandsShould be used only by console commandsprotected ODocumentprotected floatgetElapsedSecs(long start) intprotected StringvoidvoidbooleanvoidimportDatabase(String text) voidinfo()voidvoidinfoProperty(String iPropertyName) voidprotected booleanisCollectingCommands(String iLine) voidvoidvoidvoidlistClusters(String options) voidvoidvoidvoidvoidvoidvoidloadRecord(String iRecordId) voidloadRecord(String iRecordId, String iFetchPlan) voidloadRecordInternal(String iRecordId, String iFetchPlan) Should be used only by console commandsvoidloadScript(String scriptPath) static voidvoidvoidvoidmoveVertex(String iCommandText) voidnext()protected voidonAfter()protected voidonBefore()voidvoidonCompletition(Object iTask, boolean iSucceed) protected voidvoidvoidbooleanonProgress(Object iTask, long iCounter, float iPercent) voidconsole command to open a dbvoidoptimizeDatabase(String iCommandText) parseCommandOptions(String options) parseOptions(String iOptions) protected voidvoidprev()protected voidprotected voidvoidvoidvoidvoidvoidpwd()voidrebuildIndex(String iCommandText) voidreleaseDatabase(String storageType) voidreloadRecord(String iRecordId) voidreloadRecord(String iRecordId, String iFetchPlan) voidreloadRecordInternal(String iRecordId, String iFetchPlan) Should be used only by console commandsvoidvoidrepairDatabase(String iOptions) protected voidvoidrestoreDatabase(String text) protected static voidrestoreTerminal(boolean interactiveMode) voidvoidrollback()voidvoidvoidsetCurrentDatabase(ODatabaseDocumentInternal iCurrentDatabase) Pass an existent database instance to be used as current.protected OIdentifiablesetCurrentRecord(int iIndex) protected voidsetResultset(List<OIdentifiable> iResultset) voidsetServerUser(String iServerUserName, String iServerUserPasswd, String iPermissions) protected static booleansetTerminalToCBreak(boolean interactiveMode) voidprotected static intExecute the stty command with the specified arguments against the current active terminal.voidtransactional(String iCommandText) voidvoidtruncateClass(String iCommandText) voidtruncateCluster(String iCommandText) voidtruncateRecord(String iCommandText) voidprotected voidMethods inherited from class com.orientechnologies.common.console.OConsoleApplication
addCommand, error, execute, executeBatch, executeCommands, formatCommandSpecs, getClearName, getCommandLine, getConsoleMethods, getConsoleWidth, getCorrectMethodName, getMethod, getOnlineHelp, getVerboseLevel, help, isComment, isEchoEnabled, isInteractiveMode, isPropertyEnabled, message, run, setOutput, setReader, syntaxError
-
Field Details
-
currentDatabase
-
currentDatabaseName
-
currentRecord
-
currentRecordIdx
protected int currentRecordIdx -
currentResultSet
-
currentResult
-
urlConnection
-
orientDB
-
-
Constructor Details
-
OConsoleDatabaseApp
-
-
Method Details
-
main
-
restoreTerminal
protected static void restoreTerminal(boolean interactiveMode) -
setTerminalToCBreak
protected static boolean setTerminalToCBreak(boolean interactiveMode) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
stty
protected static int stty(String args, boolean interactiveMode) throws IOException, InterruptedException Execute the stty command with the specified arguments against the current active terminal.- Throws:
IOExceptionInterruptedException
-
connect
- Throws:
IOException
-
disconnect
public void disconnect() -
createDatabase
public void createDatabase(String databaseURL, String userName, String userPassword, String storageType, String databaseType, String options) throws IOException - Throws:
IOException
-
parseCommandOptions
-
listDatabases
- Throws:
IOException
-
listConnections
- Throws:
IOException
-
reloadSchema
- Throws:
IOException
-
createCluster
-
dropCluster
-
alterCluster
-
begin
- Throws:
IOException
-
commit
- Throws:
IOException
-
rollback
- Throws:
IOException
-
truncateClass
-
truncateCluster
-
truncateRecord
-
loadRecord
-
loadRecord
-
reloadRecord
-
reloadRecord
-
explain
-
transactional
-
insert
-
createVertex
-
createEdge
-
profileStorageOn
public void profileStorageOn() -
profileStorageOff
public void profileStorageOff() -
update
-
ha
-
moveVertex
-
optimizeDatabase
-
gc
public void gc() -
delete
-
grant
-
revoke
-
createLink
-
findReferences
-
alterDatabase
-
freezeDatabase
- Throws:
IOException
-
releaseDatabase
- Throws:
IOException
-
flushDatabase
- Throws:
IOException
-
current
public void current() -
next
public void next() -
prev
public void prev() -
alterClass
-
createClass
-
createSequence
-
alterSequence
-
dropSequence
-
createUser
-
dropUser
-
alterProperty
-
createProperty
-
createFunction
* Creates a function.- Parameters:
iCommandText- the command text to execute
-
traverse
-
select
-
match
-
move
-
eval
-
script
-
js
-
jss
-
setServerUser
-
dropServerUser
-
listServerUsers
public void listServerUsers() -
createIndex
- Throws:
IOException
-
dropDatabase
- Throws:
IOException
-
dropDatabase
public void dropDatabase(String iDatabaseURL, String iUserName, String iUserPassword, String storageType) throws IOException - Throws:
IOException
-
dropIndex
- Throws:
IOException
-
rebuildIndex
- Throws:
IOException
-
dropClass
- Throws:
IOException
-
dropProperty
- Throws:
IOException
-
browseClass
-
browseCluster
-
displayRecord
-
info
public void info() -
listProperties
public void listProperties() -
infoClass
-
infoProperty
-
listIndexes
public void listIndexes() -
listClusters
-
listClasses
public void listClasses() -
listServers
public void listServers() -
dictionaryGet
-
dictionaryPut
-
dictionaryRemove
-
clusterStatus
- Throws:
IOException
-
checkDatabase
- Throws:
IOException
-
repairDatabase
- Throws:
IOException
-
compareDatabases
public void compareDatabases(String iDb1URL, String iDb2URL, String iUserName, String iUserPassword, String autoDiscoveringMappingData) throws IOException - Throws:
IOException
-
loadScript
- Throws:
IOException
-
importDatabase
- Throws:
IOException
-
backupDatabase
- Throws:
IOException
-
restoreDatabase
- Throws:
IOException
-
exportDatabase
- Throws:
IOException
-
exportSchema
- Throws:
IOException
-
exportRecord
- Throws:
IOException
-
properties
public void properties() -
get
-
set
-
profiler
-
configGet
- Throws:
IOException
-
sleep
-
configSet
- Throws:
IOException
-
config
- Throws:
IOException
-
getCurrentDatabase
Should be used only by console commands -
setCurrentDatabase
Pass an existent database instance to be used as current. -
getCurrentDatabaseName
Should be used only by console commands -
getCurrentDatabaseUserName
Should be used only by console commands -
getCurrentDatabaseUserPassword
Should be used only by console commands -
getCurrentRecord
Should be used only by console commands -
getCurrentResultSet
Should be used only by console commands -
loadRecordInternal
Should be used only by console commands -
reloadRecordInternal
Should be used only by console commands -
open
console command to open a dbusage:
open dbName dbUser dbPwd- Parameters:
dbName-user-password-
-
executeServerCommand
- Overrides:
executeServerCommandin classOConsoleApplication
-
checkForRemoteServer
protected void checkForRemoteServer()Should be used only by console commands -
checkForDatabase
protected void checkForDatabase()Should be used only by console commands -
checkCurrentObject
protected void checkCurrentObject()Should be used only by console commands -
ask
-
onMessage
- Specified by:
onMessagein interfaceOCommandOutputListener
-
onBegin
- Specified by:
onBeginin interfaceOProgressListener
-
onProgress
- Specified by:
onProgressin interfaceOProgressListener
-
pwd
public void pwd() -
onCompletition
- Specified by:
onCompletitionin interfaceOProgressListener
-
close
public void close()Closes the console freeing all the used resources. -
dumpDistributedConfiguration
protected void dumpDistributedConfiguration(boolean iForce) -
getDistributedConfiguration
-
isCollectingCommands
- Overrides:
isCollectingCommandsin classOConsoleApplication
-
onBefore
protected void onBefore()- Overrides:
onBeforein classOConsoleApplication
-
setCurrentRecord
-
printApplicationInfo
protected void printApplicationInfo() -
dumpResultSet
protected void dumpResultSet(int limit) -
getElapsedSecs
protected float getElapsedSecs(long start) -
printError
-
updateDatabaseInfo
protected void updateDatabaseInfo() -
getContext
- Overrides:
getContextin classOConsoleApplication
-
getPrompt
- Overrides:
getPromptin classOConsoleApplication
-
parseResult
protected void parseResult() -
setResultset
-
resetResultSet
protected void resetResultSet() -
executeServerSideScript
-
parseOptions
-
getMaxMultiValueEntries
public int getMaxMultiValueEntries() -
onMessage
- Specified by:
onMessagein interfaceOTableFormatter.OTableOutput
-
onException
- Overrides:
onExceptionin classOConsoleApplication
-
onAfter
protected void onAfter()- Overrides:
onAfterin classOConsoleApplication
-
format
-
historyEnabled
public boolean historyEnabled()
-