-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented ICEndPoint and connection establishment
Commands: * NOOP * Login
- Loading branch information
Johannes Schneider
authored and
Johannes Schneider
committed
May 15, 2016
1 parent
8b943fe
commit 878bbb1
Showing
32 changed files
with
186 additions
and
1 deletion.
There are no files selected for viewing
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,2 @@ | ||
{"propertyFileExtension" : ".json", | ||
"packageExtension" : ".package" } |
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/commandFailed.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,4 @@ | ||
responses | ||
commandFailed | ||
|
||
^ ICStringFormatter concatinate: (self protocolCommandStart, 'NO') with: self protocolBlank |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/commandSucceeded.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,4 @@ | ||
responses | ||
commandSucceeded | ||
|
||
^ ICStringFormatter concatinate: (self protocolCommandStart, 'OK') with: self protocolBlank |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/errorBadProtocol.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,4 @@ | ||
errors | ||
errorBadProtocol | ||
|
||
^ 'server protocol not supported' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/errorLoginFailed.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,4 @@ | ||
errors | ||
errorLoginFailed | ||
|
||
^ 'authentification failed' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/errorNoConnection.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,4 @@ | ||
errors | ||
errorNoConnection | ||
|
||
^ 'connection not established' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/errorNoPasswordSet.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,4 @@ | ||
errors | ||
errorNoPasswordSet | ||
|
||
^ 'no password set' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/errorNoUsernameSet.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,4 @@ | ||
errors | ||
errorNoUsernameSet | ||
|
||
^ 'username not set' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/loginCommand.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,4 @@ | ||
commands | ||
loginCommand | ||
|
||
^ ICStringFormatter concatinate: (self protocolCommandStart, 'LOGIN') with: self protocolBlank |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/noopCommand.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,4 @@ | ||
commands | ||
noopCommand | ||
|
||
^ ICStringFormatter concatinate: (self protocolCommandStart, 'NOOP') with: self protocolBlank |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/protocolBlank.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,4 @@ | ||
constants | ||
protocolBlank | ||
|
||
^ ' ' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/protocolCommandStart.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,4 @@ | ||
constants | ||
protocolCommandStart | ||
|
||
^ '.' |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/class/protocolError.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,4 @@ | ||
responses | ||
protocolError | ||
|
||
^ ICStringFormatter concatinate: (self protocolCommandStart, 'BAD') with: self protocolBlank |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/commandSucceeded.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,4 @@ | ||
message handling | ||
commandSucceeded | ||
|
||
^ self lastResponse beginsWith: self class commandSucceeded |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/connectTo.on..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,4 @@ | ||
connection | ||
connectTo: host on: port | ||
|
||
self openOnHost: (NetNameResolver addressForName: host) port: port. |
7 changes: 7 additions & 0 deletions
7
packages/IMAPClient-Core.package/ICEndpoint.class/instance/connectTo.on.using.and..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 @@ | ||
connection | ||
connectTo: host on: port using: username and: password | ||
|
||
self user: username. | ||
self password: password. | ||
|
||
self openOnHost: (NetNameResolver addressForName: host) port: port. |
6 changes: 6 additions & 0 deletions
6
packages/IMAPClient-Core.package/ICEndpoint.class/instance/initialize.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,6 @@ | ||
initialization | ||
initialize | ||
|
||
super initialize. | ||
|
||
self loggedIn: false. |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/isLoggedIn.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,4 @@ | ||
accessing | ||
isLoggedIn | ||
|
||
^ self loggedIn |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/loggedIn..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,4 @@ | ||
accessing | ||
loggedIn: anObject | ||
|
||
loggedIn := anObject |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/loggedIn.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,4 @@ | ||
accessing | ||
loggedIn | ||
|
||
^ loggedIn |
15 changes: 15 additions & 0 deletions
15
packages/IMAPClient-Core.package/ICEndpoint.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,15 @@ | ||
message handling | ||
login | ||
|
||
self isConnected ifFalse: [ ^ Error signal: self class errorNoConnection ]. | ||
self user ifNil: [ ^ Error signal: self class errorNoUsernameSet ]. | ||
self password ifNil: [ ^ Error signal: self class errorNoPasswordSet ]. | ||
|
||
self | ||
sendCommand: (ICStringFormatter concatinate: (self class loginCommand, self user, self password) with: self class protocolBlank); | ||
fetchNextResponse. | ||
|
||
self responseIsError ifTrue: [ ^ Error signal: self class errorBadProtocol ]. | ||
self loggedIn: self commandSucceeded. | ||
self isLoggedIn ifFalse: [ ^ Error signal: self class errorLoginFailed ]. | ||
^ true |
11 changes: 11 additions & 0 deletions
11
packages/IMAPClient-Core.package/ICEndpoint.class/instance/ping.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,11 @@ | ||
message handling | ||
ping | ||
|
||
self isConnected ifFalse: [ ^ Error signal: self class errorNoConnection ]. | ||
|
||
self | ||
sendCommand: self class noopCommand; | ||
fetchNextResponse. | ||
|
||
self responseIsError ifTrue: [ ^ Error signal: self class errorBadProtocol ]. | ||
^ true |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/responseIsError.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,4 @@ | ||
error handling | ||
responseIsError | ||
|
||
^ self lastResponse beginsWith: self class protocolError |
4 changes: 4 additions & 0 deletions
4
packages/IMAPClient-Core.package/ICEndpoint.class/instance/responseIsWarning.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,4 @@ | ||
error handling | ||
responseIsWarning | ||
|
||
^ false. |
26 changes: 26 additions & 0 deletions
26
packages/IMAPClient-Core.package/ICEndpoint.class/methodProperties.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,26 @@ | ||
{ | ||
"class" : { | ||
"commandFailed" : "js 5/15/2016 13:39", | ||
"commandSucceeded" : "js 5/15/2016 13:39", | ||
"errorBadProtocol" : "js 5/15/2016 13:55", | ||
"errorLoginFailed" : "js 5/15/2016 13:55", | ||
"errorNoConnection" : "js 5/15/2016 13:50", | ||
"errorNoPasswordSet" : "js 5/15/2016 13:51", | ||
"errorNoUsernameSet" : "js 5/15/2016 13:51", | ||
"loginCommand" : "js 5/15/2016 13:39", | ||
"noopCommand" : "js 5/15/2016 13:58", | ||
"protocolBlank" : "js 5/15/2016 13:37", | ||
"protocolCommandStart" : "js 5/15/2016 13:37", | ||
"protocolError" : "js 5/15/2016 13:38" }, | ||
"instance" : { | ||
"commandSucceeded" : "js 5/15/2016 13:20", | ||
"connectTo:on:" : "js 5/15/2016 14:03", | ||
"connectTo:on:using:and:" : "js 5/15/2016 14:02", | ||
"initialize" : "js 5/15/2016 13:11", | ||
"isLoggedIn" : "js 5/15/2016 13:09", | ||
"loggedIn" : "js 5/15/2016 13:09", | ||
"loggedIn:" : "js 5/15/2016 13:09", | ||
"login" : "js 5/15/2016 14:00", | ||
"ping" : "js 5/15/2016 14:00", | ||
"responseIsError" : "js 5/15/2016 14:03", | ||
"responseIsWarning" : "js 5/15/2016 12:36" } } |
14 changes: 14 additions & 0 deletions
14
packages/IMAPClient-Core.package/ICEndpoint.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,14 @@ | ||
{ | ||
"category" : "IMAPClient-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"loggedIn" ], | ||
"name" : "ICEndpoint", | ||
"pools" : [ | ||
], | ||
"super" : "ProtocolClient", | ||
"type" : "normal" } |
Empty file.
9 changes: 9 additions & 0 deletions
9
packages/IMAPClient-Core.package/ICStringFormatter.class/class/concatinate.with..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,9 @@ | ||
formatter | ||
concatinate: strings with: symbol | ||
|
||
| result | | ||
|
||
result := strings first. | ||
strings allButFirst do: [ :s | result := symbol, result ]. | ||
|
||
^ result |
5 changes: 5 additions & 0 deletions
5
packages/IMAPClient-Core.package/ICStringFormatter.class/methodProperties.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,5 @@ | ||
{ | ||
"class" : { | ||
"concatinate:with:" : "js 5/15/2016 13:31" }, | ||
"instance" : { | ||
} } |
14 changes: 14 additions & 0 deletions
14
packages/IMAPClient-Core.package/ICStringFormatter.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,14 @@ | ||
{ | ||
"category" : "IMAPClient-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "ICStringFormatter", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
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