Class Protocol

java.lang.Object
org.restlet.data.Protocol

public final class Protocol extends Object
Protocol used by client and server connectors. Connectors enable the communication between components by implementing standard protocols.
Author:
Jerome Louvel
  • Field Details

    • UNKNOWN_PORT

      public static final int UNKNOWN_PORT
      Indicates that the port number is undefined.
      See Also:
    • ALL

      public static final Protocol ALL
      All-protocols wildcard.
    • CLAP

      public static final Protocol 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

      public static final Protocol 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

      public static final Protocol FTP
      FTP protocol.
    • HTTP

      public static final Protocol HTTP
      HTTP protocol.
    • HTTPS

      public static final Protocol HTTPS
      HTTPS protocol (via SSL socket).
    • JAR

      public static final Protocol 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".
      See Also:
    • JDBC

      public static final Protocol JDBC
      JDBC protocol.
    • RIAP

      public static final 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

      public static final Protocol WAR
      Local Web Archive access protocol.
    • ZIP

      public static final Protocol ZIP
      ZIP is a special scheme to access to representations inside Zip archive files. Example URI: "zip:file:///tmp/test.zip!/test.txt".
      See Also:
  • Constructor Details

    • Protocol

      public Protocol(String schemeName)
      Constructor.
      Parameters:
      schemeName - The scheme name.
    • Protocol

      public Protocol(String schemeName, String name, String description, int defaultPort)
      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

      public static Protocol valueOf(String name)
      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

      public static Protocol valueOf(String name, String version)
      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

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • getDefaultPort

      public int getDefaultPort()
      Returns the default port number.
      Returns:
      The default port number.
    • getDescription

      public String getDescription()
      Returns the description.
      Returns:
      The description.
    • getName

      public String getName()
      Returns the name.
      Returns:
      The name.
    • getSchemeName

      public String getSchemeName()
      Returns the URI scheme name.
      Returns:
      The URI scheme name.
    • getTechnicalName

      public String getTechnicalName()
      Returns the technical name that appears on the wire.
      Returns:
      The technical name that appears on the wire.
    • getVersion

      public String getVersion()
      Returns the version.
      Returns:
      The version.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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

      public String toString()
      Returns the name.
      Overrides:
      toString in class Object
      Returns:
      The name.