Package org.kiwiproject.registry.model
Class Port
java.lang.Object
org.kiwiproject.registry.model.Port
Model that defines a port being used by a service, including the port number, the purpose of the port, and whether
the port is secure or not.
For the type/purpose of the port, we are assuming that a service has a separate ports for the main application and the administrative endpoints (e.g. status and health checks)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumEnum defining the type of connector the port is used for.static enumEnum defining whether the port is secure or not. -
Method Summary
Modifier and TypeMethodDescriptionstatic Port.PortBuilderbuilder()booleanintReturn the scheme used by thePort.Securityof this port.getType()inthashCode()booleanisAdmin()Is this an admin port?booleanIs this an application port?booleanisSecure()Is this port secure?static Portof(int number, @Nullable Port.PortType portType, @Nullable Port.Security security) Convenience factory method to create a newPort.toString()
-
Method Details
-
of
public static Port of(int number, @Nullable Port.PortType portType, @Nullable Port.Security security) Convenience factory method to create a newPort.Default values are assigned to the port type and security if null arguments are supplied.
- Parameters:
number- the port number, must be in range 0 to 65535portType- the type of port (defaults to APPLICATION if null)security- is the port secure? (defaults to SECURE if null)- Returns:
- a new instance
-
isSecure
public boolean isSecure()Is this port secure?- Returns:
- true if this port is
Port.Security.SECURE
-
getScheme
Return the scheme used by thePort.Securityof this port.- Returns:
- the scheme (e.g. "https") for connecting to this port
-
isApplication
public boolean isApplication()Is this an application port?- Returns:
- true if port type is
Port.PortType.APPLICATION
-
isAdmin
public boolean isAdmin()Is this an admin port?- Returns:
- true if port type is
Port.PortType.ADMIN
-
builder
-
getNumber
public int getNumber() -
getType
-
getSecure
-
equals
-
hashCode
public int hashCode() -
toString
-