package io.datawire.boston.model

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty


data class ServicePort @JsonCreator constructor (
    @JsonProperty("port")
    val port: Int,

    @JsonProperty("secure")
    val secure: Boolean
)
package io.datawire.boston.model

import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty

/**
 *
 * @author Philip Lombardi <plombardi@datawire.iu
 */


data class ServicePort @JsonCreator constructor (

    /**
     * Indicates the named use for the port, for example, "http", "https", "ftp" or "gopher".
     */
    @JsonProperty("name")
    val name: String,

    /**
     * Indicates the port value.
     */
    @JsonProperty("port")
    val port: Int,

    /**
     * todo(plombardi): might remove this; not convinced it's useful beyond being metadata that is indicated by the name
     *
     * Indicates whether the port is secured. Security is an implementation detail of the named protocol, for example,
     * if the named protocol is HTTPS then clients will need to support HTTPS.
     */
    @JsonProperty("secure")
    val secure: Boolean
)
Add a name to the port which indicates the purpose.
Add a name to the port which indicates the purpose.

The ServicePort.name should be used to indicate what type of
URI scheme is required by a client, for example, 443 -> HTTPS.

Practically speaking this is mostly just useful metadata
similar to how ServicePort.secure is mostly useful metadata.

datawire/discovery,datawire/discovery,datawire/discovery