Package org.attribyte.snook.auth
Class Origin
java.lang.Object
org.attribyte.snook.auth.Origin
An immutable origin for a request.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
EMPTY
The empty origin.
-
-
Constructor Details
-
Origin
Creates an origin from a string that must be a valid URI.- Parameters:
str- A valid URI as a string.- Throws:
IllegalArgumentException- if string is not a valid URI.
-
Origin
Creates an origin from a parsed URI.- Parameters:
uri- The URI.
-
Origin
Create an origin from a known host and port.- Parameters:
host- The host.port- The port.isSecure- Is the origin secure?
-
-
Method Details
-
host
The host or an empty string ifEMPTY.- Returns:
- The host or an empty string.
-
port
public final int port()- Returns:
- The port or
-1.
-
isSecure
public final boolean isSecure()- Returns:
- Is the origin secure (https)?
-
toString
-
equals
-
hashCode
public int hashCode()
-