Skip to content

Commit

Permalink
Issue #4: on cusp of marrying the TDExternalSessionClient and GsDevKi…
Browse files Browse the repository at this point in the history
…t_stones structure to perform login using TDSessionDescription
  • Loading branch information
dalehenrich committed Jun 6, 2023
1 parent 8b3ef45 commit 2dc8ee8
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
evaluation
evaluateCommand: command batchMode: batchBool
| stonString transcriptOop |
stonString := self objectSerializer toString: command.
batchBool
ifFalse: [ transcriptOop := self session clientForwarderCache keyAtValue: Transcript ifAbsent: [ ] ].
[
(transcriptOop notNil and: [ batchBool not ])
ifTrue: [ self session clientForwarderCache at: transcriptOop put: self shell console ].
^ self session
executeStringExpectingStringNB:
'(' , self todeServerAccessString , ' for: ' , self shell shellId asString , ') evaluateSTONCommand:'
, stonString printString
envId: self environmentId ]
ensure: [
(session notNil and: [ transcriptOop notNil and: [ batchBool not ] ])
ifTrue: [ self session clientForwarderCache at: transcriptOop put: Transcript ] ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
session management
login
| sess gemNRS stoneNRS aUsername aPassword |
sess := GsTsExternalSession
gemNRS: gemNRS
stoneNRS: stoneNRS
username: aUsername
password: aPassword.
(sess loginWith: self sessionDescription)
ifFalse: [
| gciError messageText |
gciError := sess getAndClearLastError.
messageText := gciError message.
^ Error
signal:
messageText
, ' For further information about login failures, check the gem log file' ].
self class addDependent: self.
false
ifTrue: [ sess enableGemTrace ].
^ sess
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
session management
loginUsing: todeSessionClass
| sess |
self proxyBehaviorClass resetAllGlobalNames. "reset the cache on login"
sess := todeSessionClass new
topez: self;
yourself.
(sess loginWith: self sessionDescription)
ifFalse: [
| gciError messageText |
gciError := sess getAndClearLastError.
messageText := gciError message.
^ Error
signal:
messageText
, ' For further information about login failures, check the gem log file' ].
self class addDependent: self.
false
ifTrue: [ sess enableGemTrace ].
^ sess
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
session management
session
session
ifNil: [
session := self login.
self topezServerProxy ].
^ session
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shell: object
shell := object
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
shell
^shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"category" : "GsDevKit_stones-Tode",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"shell",
"session" ],
"name" : "TDExternalSessionClient",
"pools" : [
],
"super" : "Object",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
topezClientClass
^ TDExternalSessionClient
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
evaluator engine
evaluate: aString batchMode: aBool
[
| result |
TDCommandLine
fromStream: aString readStream
selectLine: [ :line |
self actionStack notEmpty
ifTrue: [
result := self accumulateText: line.
false "do not create or evaluate command for this line" ]
ifFalse: [
self addToHistory: line.
true "create and evaluate the command for this line" ] ]
forEachCommand: [ :command | result := self evaluateCommand: command batchMode: aBool ].
^ result ]
on: Error , TDRestoreFromBackupComplete , GsTopezCommandErrorNotification
do: [ :ex |
((ex isKindOf: GsTopezCommandErrorNotification) or: [ ex isKindOf: Error ])
ifTrue: [
| errorMessage |
self debugMode
ifTrue: [ ex pass ].
errorMessage := 'Topez ERROR: ' , ex description.
self resetStack.
^ errorMessage ].
self logout. "TDRestoreFromBackupComplete - logout and return restore message"
^ ex description ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
topezClientClass
^ self class topezClientClass

0 comments on commit 2dc8ee8

Please sign in to comment.