X Tutup
Skip to content

New enum "InternetProtocol" for supported IP protocols replaces "scheme"#76

Merged
marcuslinke merged 1 commit intodocker-java:masterfrom
albers:protocol-enum
Oct 16, 2014
Merged

New enum "InternetProtocol" for supported IP protocols replaces "scheme"#76
marcuslinke merged 1 commit intodocker-java:masterfrom
albers:protocol-enum

Conversation

@albers
Copy link
Copy Markdown
Contributor

@albers albers commented Oct 16, 2014

The legal values for internet protocols (here known as schemes) should be defined as an enum, not as String. This gives us type safety and some improvements in parsing and stringification.
See #70, AccessMode.
In addition, scheme is a misleading name. This PR replaces it with InternetProtocol.

The enum provides a home for parsing, stringification and the default
value of the supported protocols.

It also enforces the use of the more correct term "internet protocol"
instead of "scheme".
@gesellix
Copy link
Copy Markdown
Contributor

would the unix scheme as used in the default Docker config be relevant here? How about renaming InternetProtocol to Scheme? Given the syntax unix:///path/to/docker.sock I would see the address as URL, which defines the element before the colon as scheme... including a comment on its commonly used alias protocol.

@albers
Copy link
Copy Markdown
Contributor Author

albers commented Oct 16, 2014

In the context of URLs, scheme is the correct word. It can represent things like http, mail, tcp and file.

Here we have the distinct context of network ports like 80/tcp and 53/udp. In this context, tcp specifies the IP subprotocol, either TCP or UDP. unix is no such IP subprotocol.

InternetProtocol is only used in ExposedPort. It is not meant to represent URLs in other places.

@gesellix
Copy link
Copy Markdown
Contributor

alright, thanks for clarification!

marcuslinke added a commit that referenced this pull request Oct 16, 2014
New enum "InternetProtocol" for supported IP protocols replaces "scheme"
@marcuslinke marcuslinke merged commit ef33c69 into docker-java:master Oct 16, 2014
@albers albers deleted the protocol-enum branch October 17, 2014 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup