forked from svenvc/zinc
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #58: conversion of ZnServerTests to support ZnGsServerTests ...…
… support full range of ZnServer options in ZnGemServer
- Loading branch information
1 parent
5cf3b2d
commit 6aac715
Showing
158 changed files
with
673 additions
and
230 deletions.
There are no files selected for viewing
10 changes: 7 additions & 3 deletions
10
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/authenticator..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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
accessing | ||
authenticator: anObject | ||
options | ||
authenticator: object | ||
"Set the object that will be sent #authenticateRequest:do: | ||
to authenticate or refuse the requests. Can be nil. | ||
When authentication succeeds, the block should be executed, | ||
when authentication fails, a appropriate response should be returned" | ||
|
||
authenticator := anObject | ||
self optionAt: #authenticator put: object |
12 changes: 9 additions & 3 deletions
12
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/authenticator.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 |
---|---|---|
@@ -1,4 +1,10 @@ | ||
accessing | ||
options | ||
authenticator | ||
|
||
^authenticator | ||
"Return the optional authenticator, | ||
the object that will be sent #authenticateRequest:do: | ||
to authenticate or refuse the requests. | ||
When authentication succeeds, the block should be executed, | ||
when authentication fails, a appropriate response should be returned. | ||
If there is no authenticator, all requests will pass" | ||
|
||
^ self optionAt: #authenticator ifAbsent: [ nil ] |
8 changes: 8 additions & 0 deletions
8
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/bindingAddress..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,8 @@ | ||
options | ||
bindingAddress: address | ||
"Set the interface address we will be listening on. | ||
Specify nil to listen on all/any interfaces, the default. | ||
Address must be a 4 element ByteArray, like #[127 0 0 1]. | ||
Cannot be changed after the server is already running." | ||
|
||
self optionAt: #bindAddress put: address |
6 changes: 6 additions & 0 deletions
6
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/bindingAddress.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 @@ | ||
options | ||
bindingAddress | ||
"Return the interface address we are (or will be) listening on. | ||
Nil means that we are (or will be) listening on all/any interfaces." | ||
|
||
^ self optionAt: #bindAddress ifAbsent: [ nil ] |
11 changes: 7 additions & 4 deletions
11
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/debugMode..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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
accessing | ||
debugMode: anObject | ||
|
||
debugMode := anObject | ||
options | ||
debugMode: boolean | ||
"Set my debug mode, the default being false. | ||
In debug mode, Smalltalk Error during #handleRequest: will raise a Debugger. | ||
When not in debug mode, a Smalltalk Error during #handleRequest: will result in an HTTP Server Error response." | ||
|
||
^ self optionAt: #debugMode put: boolean |
7 changes: 4 additions & 3 deletions
7
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/debugMode.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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
accessing | ||
options | ||
debugMode | ||
debugMode ifNil: [ debugMode := false ]. | ||
^ debugMode | ||
"Return whether we are in debug mode, the default is false." | ||
|
||
^ self optionAt: #debugMode ifAbsent: [ false ] |
9 changes: 6 additions & 3 deletions
9
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/delegate..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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
initialization | ||
delegate: aZnDelegate | ||
^ delegate := aZnDelegate | ||
options | ||
delegate: object | ||
"Set the delegate to object. Can be nil. | ||
This will be sent #handleRequest: to handle a request and produce a response" | ||
|
||
self optionAt: #delegate put: object |
8 changes: 6 additions & 2 deletions
8
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/delegate.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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
accessing | ||
options | ||
delegate | ||
^ delegate | ||
"Return the optional delegate, | ||
the object that will be sent #handleRequest: to handle a request and produce a response. | ||
The default delegate is ZnDefaultServerDelegate" | ||
|
||
^ self optionAt: #delegate ifAbsentPut: [ ZnDefaultServerDelegate new ] |
5 changes: 5 additions & 0 deletions
5
...itory/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/maximumEntitySize..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,5 @@ | ||
options | ||
maximumEntitySize: integer | ||
"Set the maximum entity size in bytes that I will read from a stream before signalling ZnEntityTooLarge" | ||
|
||
^ self optionAt: #maximumEntitySize put: integer |
5 changes: 5 additions & 0 deletions
5
...sitory/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/maximumEntitySize.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,5 @@ | ||
options | ||
maximumEntitySize | ||
"Return the maximum entity size in bytes that I will read from a stream before signalling ZnEntityTooLarge" | ||
|
||
^ self optionAt: #maximumEntitySize ifAbsent: [ ZnConstants defaultMaximumEntitySize ] |
8 changes: 8 additions & 0 deletions
8
...itory/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/optionAt.ifAbsent..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,8 @@ | ||
accessing | ||
optionAt: key ifAbsent: block | ||
"Return my option/settings stored under key. | ||
Execute block if I have no such option/setting. | ||
This is a generic interface, see my options protocol for specific usages." | ||
|
||
options ifNil: [ ^ block value ]. | ||
^ options at: key ifAbsent: block |
7 changes: 7 additions & 0 deletions
7
...ry/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/optionAt.ifAbsentPut..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 @@ | ||
accessing | ||
optionAt: key ifAbsentPut: block | ||
"Return my option/settings stored under key. | ||
If I have no such option/setting, store the result of evaluating block as new value and return it. | ||
This is a generic interface, see my options protocol for specific usages." | ||
|
||
^ options at: key ifAbsentPut: block |
7 changes: 7 additions & 0 deletions
7
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/optionAt.put..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 @@ | ||
accessing | ||
optionAt: key put: value | ||
"Set my option/setting identified by key to be value. | ||
This is a generic interface, see my options protocol for specific usages." | ||
|
||
options ifNil: [ options := Dictionary new ]. | ||
options at: key put: value |
5 changes: 5 additions & 0 deletions
5
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/reader..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,5 @@ | ||
options | ||
reader: block | ||
"Customize how entities are read from a stream, see #reader" | ||
|
||
self optionAt: #reader put: block |
5 changes: 5 additions & 0 deletions
5
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/reader.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,5 @@ | ||
options | ||
reader | ||
"Return a block that when given a stream reads an entity from it." | ||
|
||
^ self optionAt: #reader ifAbsentPut: [ [ :stream | ZnRequest readFrom: stream ] ] |
8 changes: 8 additions & 0 deletions
8
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/route..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,8 @@ | ||
options | ||
route: object | ||
"Set the route of the server. | ||
This is a short identification string to be appended at the end of server session ids, separated by a dot. | ||
Routes are used by load balancers and proxies to correctly implement session affiinity or stickyness. | ||
The default is nil, meaning that no route has to be appended." | ||
|
||
self optionAt: #route put: object |
8 changes: 8 additions & 0 deletions
8
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/route.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,8 @@ | ||
options | ||
route | ||
"Return the route of the server. | ||
This is a short identification string to be appended at the end of server session ids, separated by a dot. | ||
Routes are used by load balancers and proxies to correctly implement session affiinity or stickyness. | ||
The default is nil, meaning that no route has to be appended." | ||
|
||
^ self optionAt: #route ifAbsent: [ nil ] |
7 changes: 7 additions & 0 deletions
7
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/serverUrl..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 @@ | ||
options | ||
serverUrl: urlObject | ||
"Set the explicit external server URL to urlObject. Defaults to nil. | ||
urlObject should be a ZnUrl or a String that parses correctly to one. | ||
See also #url." | ||
|
||
^ self optionAt: #serverUrl put: urlObject asZnUrl |
5 changes: 5 additions & 0 deletions
5
repository/Zinc-GemStone-Server-Tools.package/ZnGemServer.class/instance/serverUrl.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,5 @@ | ||
options | ||
serverUrl | ||
"Return the explicitely set external server URL, if any. Defaults to nil." | ||
|
||
^ self optionAt: #serverUrl ifAbsent: [ nil ] |
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
5 changes: 5 additions & 0 deletions
5
...emStone-Server-Tools.package/ZnGemServer.class/instance/useGzipCompressionAndChunking..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,5 @@ | ||
options | ||
useGzipCompressionAndChunking: boolean | ||
"Set whether we should try to use gzip content encoding and chunked transfer encoding, the default being false." | ||
|
||
self optionAt: #useGzipCompressionAndChunking put: boolean |
5 changes: 5 additions & 0 deletions
5
...GemStone-Server-Tools.package/ZnGemServer.class/instance/useGzipCompressionAndChunking.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,5 @@ | ||
options | ||
useGzipCompressionAndChunking | ||
"Return whether we should try to use gzip content encoding and chunked transfer encoding, the default is false." | ||
|
||
^ self optionAt: #useGzipCompressionAndChunking ifAbsent: [ false ] |
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
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
2 changes: 1 addition & 1 deletion
2
repository/Zinc-GemStone-Server-Tools.package/monticello.meta/version
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ accessing | |
amount | ||
|
||
"Return the value of the instance variable 'amount'." | ||
^amount | ||
^amount |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ updating | |
total: newValue | ||
|
||
"Modify the value of the instance variable 'total'." | ||
total := newValue | ||
total := newValue |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ accessing | |
total | ||
|
||
"Return the value of the instance variable 'total'." | ||
^total | ||
^total |
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
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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ accessing | |
object | ||
|
||
"Return the value of the instance variable 'object'." | ||
^object | ||
^object |
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
3 changes: 2 additions & 1 deletion
3
repository/Zinc-HTTP.package/ZnChunkedReadStream.class/instance/collectionSpecies.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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
accessing | ||
collectionSpecies | ||
^ self isBinary ifTrue: [ ByteArray ] ifFalse: [ String ] | ||
^ self isBinary ifTrue: [ ByteArray ] ifFalse: [ String ] | ||
|
2 changes: 1 addition & 1 deletion
2
repository/Zinc-HTTP.package/ZnChunkedReadStream.class/instance/ensureChunkBufferOfSize..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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
private | ||
ensureChunkBufferOfSize: size | ||
(chunk notNil and: [ size <= chunk size ]) ifTrue: [ ^ self ]. | ||
chunk := self collectionSpecies new: size. | ||
chunk := self collectionSpecies new: size. |
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
2 changes: 1 addition & 1 deletion
2
repository/Zinc-HTTP.package/ZnChunkedReadStream.class/instance/isBinary.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
testing | ||
isBinary | ||
^ stream isBinary | ||
^ stream isBinary |
2 changes: 1 addition & 1 deletion
2
repository/Zinc-HTTP.package/ZnChunkedWriteStream.class/instance/isBinary.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
testing | ||
isBinary | ||
^ stream isBinary | ||
^ stream isBinary |
Oops, something went wrong.