Package org.restlet.data
Class Protocol
java.lang.Object
org.restlet.data.Protocol
Protocol used by client and server connectors. Connectors enable the
communication between components by implementing standard protocols.
- Author:
- Jerome Louvel
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProtocolAll-protocols wildcard.static final ProtocolCLAP (ClassLoader Access Protocol) is a custom scheme to access to representations via classloaders.static final ProtocolFILE is a standard scheme to access to representations stored in the file system (locally most of the time).static final ProtocolFTP protocol.static final ProtocolHTTP protocol.static final ProtocolHTTPS protocol (via SSL socket).static final ProtocolJAR (Java ARchive) is a common scheme to access to representations inside archive files.static final ProtocolJDBC protocol.static final ProtocolRIAP (Restlet Internal Access Protocol) is a custom scheme to access representations via internal calls to virtual hosts/components.static final intIndicates that the port number is undefined.static final ProtocolLocal Web Archive access protocol.static final ProtocolZIP is a special scheme to access to representations inside Zip archive files. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor.Constructor.Protocol(String schemeName, String name, String description, int defaultPort, boolean confidential, String version) Constructor.Constructor.Protocol(String schemeName, String name, String technicalName, String description, int defaultPort, boolean confidential, String version) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the default port number.Returns the description.getName()Returns the name.Returns the URI scheme name.Returns the technical name that appears on the wire.Returns the version.inthashCode()booleanIndicates if the protocol guarantees the confidentially of the messages exchanged, for example via a SSL-secured connection.toString()Returns the name.static ProtocolCreates the protocol associated to a URI scheme name.static ProtocolCreates the protocol associated to a URI scheme name.
-
Field Details
-
UNKNOWN_PORT
public static final int UNKNOWN_PORTIndicates that the port number is undefined.- See Also:
-
ALL
All-protocols wildcard. -
CLAP
CLAP (ClassLoader Access Protocol) is a custom scheme to access to representations via classloaders. Example URI: "clap://thread/org/restlet/Restlet.class".
In order to work, CLAP requires a client connector provided by the core Restlet engine.- See Also:
-
FILE
FILE is a standard scheme to access to representations stored in the file system (locally most of the time). Example URI: "file:///D/root/index.html".
In order to work, FILE requires a client connector provided by the core Restlet engine.- See Also:
-
FTP
FTP protocol. -
HTTP
HTTP protocol. -
HTTPS
HTTPS protocol (via SSL socket). -
JAR
JAR (Java ARchive) is a common scheme to access to representations inside archive files. Example URI: "jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class". -
JDBC
JDBC protocol. -
RIAP
RIAP (Restlet Internal Access Protocol) is a custom scheme to access representations via internal calls to virtual hosts/components. Example URIs: "riap://component/myAppPath/myResource" and "riap://application/myResource".
In order to work, RIAP doesn't require any client connector and is automatically supported by the Restlet engine.- See Also:
-
WAR
Local Web Archive access protocol. -
ZIP
ZIP is a special scheme to access to representations inside Zip archive files. Example URI: "zip:file:///tmp/test.zip!/test.txt".
-
-
Constructor Details
-
Protocol
Constructor.- Parameters:
schemeName- The scheme name.
-
Protocol
Constructor.- Parameters:
schemeName- The scheme name.name- The unique name.description- The description.defaultPort- The default port.
-
Protocol
public Protocol(String schemeName, String name, String description, int defaultPort, boolean confidential) Constructor.- Parameters:
schemeName- The scheme name.name- The unique name.description- The description.defaultPort- The default port.confidential- The confidentiality.
-
Protocol
public Protocol(String schemeName, String name, String description, int defaultPort, boolean confidential, String version) Constructor.- Parameters:
schemeName- The scheme name.name- The unique name.description- The description.defaultPort- The default port.confidential- The confidentiality.version- The version.
-
Protocol
public Protocol(String schemeName, String name, String description, int defaultPort, String version) Constructor.- Parameters:
schemeName- The scheme name.name- The unique name.description- The description.defaultPort- The default port.version- The version.
-
Protocol
public Protocol(String schemeName, String name, String technicalName, String description, int defaultPort, boolean confidential, String version) Constructor.- Parameters:
schemeName- The scheme name.name- The unique name.technicalName- The technical name that appears on the wire.description- The description.defaultPort- The default port.confidential- The confidentiality.version- The version.
-
-
Method Details
-
valueOf
Creates the protocol associated to a URI scheme name. If an existing constant exists then it is returned, otherwise a new instance is created.- Parameters:
name- The scheme name.- Returns:
- The associated protocol.
-
valueOf
Creates the protocol associated to a URI scheme name. If an existing constant exists then it is returned, otherwise a new instance is created.- Parameters:
name- The scheme name.version- The version number.- Returns:
- The associated protocol.
-
equals
-
getDefaultPort
public int getDefaultPort()Returns the default port number.- Returns:
- The default port number.
-
getDescription
Returns the description.- Returns:
- The description.
-
getName
Returns the name.- Returns:
- The name.
-
getSchemeName
Returns the URI scheme name.- Returns:
- The URI scheme name.
-
getTechnicalName
Returns the technical name that appears on the wire.- Returns:
- The technical name that appears on the wire.
-
getVersion
Returns the version.- Returns:
- The version.
-
hashCode
public int hashCode() -
isConfidential
public boolean isConfidential()Indicates if the protocol guarantees the confidentially of the messages exchanged, for example via a SSL-secured connection.- Returns:
- True if the protocol is confidential.
-
toString
Returns the name.
-