Class Protocol


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

      Fields 
      Modifier and Type Field Description
      static Protocol AJP
      AJP 1.3 protocol to communicate with Apache HTTP server or Microsoft IIS.
      static Protocol ALL
      All protocols wildcard.
      static Protocol CLAP
      CLAP (ClassLoader Access Protocol) is a custom scheme to access to representations via classloaders.
      static Protocol FILE
      FILE is a standard scheme to access to representations stored in the file system (locally most of the time).
      static Protocol FTP
      FTP protocol.
      static Protocol HTTP
      HTTP protocol.
      static Protocol HTTPS
      HTTPS protocol (via SSL socket).
      static Protocol JAR
      JAR (Java ARchive) is a common scheme to access to representations inside archive files.
      static Protocol JDBC
      JDBC protocol.
      static Protocol POP
      POP protocol.
      static Protocol POPS
      POPS protocol (via SSL/TLS socket)..
      static Protocol RIAP
      RIAP (Restlet Internal Access Protocol) is a custom scheme to access representations via internal calls to virtual hosts/components.
      static Protocol SDC
      SDC (Secure Data Connector) protocol.
      static Protocol SIP
      SIP protocol.
      static Protocol SIPS
      SIPS protocol (via SSL socket).
      static Protocol SMTP
      SMTP protocol.
      static Protocol SMTPS
      SMTPS protocol (via SSL/TLS socket).
      static int UNKNOWN_PORT
      Indicates that the port number is undefined.
      static Protocol WAR
      Local Web Archive access protocol.
      static Protocol ZIP
      ZIP is a special scheme to access to representations inside Zip archive files.
    • Constructor Summary

      Constructors 
      Constructor Description
      Protocol​(java.lang.String schemeName)
      Constructor.
      Protocol​(java.lang.String schemeName, java.lang.String name, java.lang.String description, int defaultPort)
      Constructor.
      Protocol​(java.lang.String schemeName, java.lang.String name, java.lang.String description, int defaultPort, boolean confidential)
      Constructor.
      Protocol​(java.lang.String schemeName, java.lang.String name, java.lang.String description, int defaultPort, boolean confidential, java.lang.String version)
      Constructor.
      Protocol​(java.lang.String schemeName, java.lang.String name, java.lang.String description, int defaultPort, java.lang.String version)
      Constructor.
      Protocol​(java.lang.String schemeName, java.lang.String name, java.lang.String technicalName, java.lang.String description, int defaultPort, boolean confidential, java.lang.String version)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object object)
      int getDefaultPort()
      Returns the default port number.
      java.lang.String getDescription()
      Returns the description.
      java.lang.String getName()
      Returns the name.
      java.lang.String getSchemeName()
      Returns the URI scheme name.
      java.lang.String getTechnicalName()
      Returns the technical name that appears on the wire.
      java.lang.String getVersion()
      Returns the version.
      int hashCode()
      boolean isConfidential()
      Indicates if the protocol guarantees the confidentially of the messages exchanged, for example via a SSL-secured connection.
      java.lang.String toString()
      Returns the name.
      static Protocol valueOf​(java.lang.String name)
      Creates the protocol associated to a URI scheme name.
      static Protocol valueOf​(java.lang.String name, java.lang.String version)
      Creates the protocol associated to a URI scheme name.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • UNKNOWN_PORT

        public static final int UNKNOWN_PORT
        Indicates that the port number is undefined.
        See Also:
        Constant Field Values
      • AJP

        public static final Protocol AJP
        AJP 1.3 protocol to communicate with Apache HTTP server or Microsoft IIS.
      • 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:
        LocalReference
      • 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:
        LocalReference
      • 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).
      • JDBC

        public static final Protocol JDBC
        JDBC protocol.
      • POP

        public static final Protocol POP
        POP protocol.
      • POPS

        public static final Protocol POPS
        POPS protocol (via SSL/TLS socket)..
      • 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 requires any client connector and is automatically supported by the Restlet engine.
        See Also:
        LocalReference
      • SDC

        public static final Protocol SDC
        SDC (Secure Data Connector) protocol.

        SDC is natively available on the Google App Engine platform and via a special Restlet extension on other platforms.
      • SIP

        public static final Protocol SIP
        SIP protocol.
      • SIPS

        public static final Protocol SIPS
        SIPS protocol (via SSL socket).
      • SMTP

        public static final Protocol SMTP
        SMTP protocol.
      • SMTPS

        public static final Protocol SMTPS
        SMTPS protocol (via SSL/TLS socket).
      • WAR

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

      • Protocol

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

        public Protocol​(java.lang.String schemeName,
                        java.lang.String name,
                        java.lang.String description,
                        int defaultPort)
        Constructor.
        Parameters:
        schemeName - The scheme name.
        name - The unique name.
        description - The description.
        defaultPort - The default port.
      • Protocol

        public Protocol​(java.lang.String schemeName,
                        java.lang.String name,
                        java.lang.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​(java.lang.String schemeName,
                        java.lang.String name,
                        java.lang.String description,
                        int defaultPort,
                        boolean confidential,
                        java.lang.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​(java.lang.String schemeName,
                        java.lang.String name,
                        java.lang.String description,
                        int defaultPort,
                        java.lang.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​(java.lang.String schemeName,
                        java.lang.String name,
                        java.lang.String technicalName,
                        java.lang.String description,
                        int defaultPort,
                        boolean confidential,
                        java.lang.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 Detail

      • valueOf

        public static Protocol valueOf​(java.lang.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​(java.lang.String name,
                                       java.lang.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​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • getDefaultPort

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

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

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

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

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

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.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 java.lang.String toString()
        Returns the name.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The name.