-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #4: on cusp of marrying the TDExternalSessionClient and GsDevKi…
…t_stones structure to perform login using TDSessionDescription
- Loading branch information
1 parent
8b3ef45
commit 2dc8ee8
Showing
11 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
17 changes: 17 additions & 0 deletions
17
..._stones-Tode.package/TDExternalSessionClient.class/instance/evaluateCommand.batchMode..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] ] |
21 changes: 21 additions & 0 deletions
21
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/instance/login.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
20 changes: 20 additions & 0 deletions
20
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/instance/loginUsing..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
7 changes: 7 additions & 0 deletions
7
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/instance/session.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/instance/shell..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
shell: object | ||
shell := object |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/instance/shell.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
shell | ||
^shell |
15 changes: 15 additions & 0 deletions
15
src/GsDevKit_stones-Tode.package/TDExternalSessionClient.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" } |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Tode.package/TDShell.class/class/topezClientClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
topezClientClass | ||
^ TDExternalSessionClient |
28 changes: 28 additions & 0 deletions
28
src/GsDevKit_stones-Tode.package/TDShell.class/instance/evaluate.batchMode..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ] |
3 changes: 3 additions & 0 deletions
3
src/GsDevKit_stones-Tode.package/TDShell.class/instance/topezClientClass.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
topezClientClass | ||
^ self class topezClientClass |