Skip to content

Commit

Permalink
Removed deprecated code
Browse files Browse the repository at this point in the history
Removed code deprecated in version 2.4, including native Restlet XML configuration mechasism.
        Please use Spring for an alternative approach if needed.
  • Loading branch information
jlouvel committed Oct 28, 2024
1 parent 37d5d73 commit 02a8ce3
Show file tree
Hide file tree
Showing 15 changed files with 833 additions and 2,090 deletions.
2 changes: 2 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Changes log
- Removed incubator to rely instead on pull requests.
- Renamed extension Inject into Guice as it isn't truly generic.
- Updated the links in all Javadocs file for accuracy.
- Removed code deprecated in version 2.4, including native Restlet XML configuration mechasism.
Please use Spring for an alternative approach if needed.

- 2.5 Milestone 1 (03/09/2020)
- Bugs fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ public class GaeEnroler implements Enroler {
/** The Administrator role. */
private Role adminRole;

/**
* Default constructor. It defines an administrator role, which name is
* "admin".
*/
public GaeEnroler() {
this("admin", "Administrator of the current application.");
}

/**
* Constructor.
*
Expand Down Expand Up @@ -73,32 +65,6 @@ public GaeEnroler(Role adminRole) {
setAdminRole(adminRole);
}

/**
* Constructor.
*
* @param adminRoleName
* The name of the administrator role.
* @deprecated Use {@link #GaeEnroler(Application, String)} instead.
*/
@Deprecated
public GaeEnroler(String adminRoleName) {
this(adminRoleName, "Administrator of the current application.");
}

/**
* Constructor.
*
* @param adminRoleName
* The name of the administrator role.
* @param adminRoleDescription
* The description of the administrator role.
* @deprecated Use {@link #GaeEnroler(Application, String, String)} instead.
*/
@Deprecated
public GaeEnroler(String adminRoleName, String adminRoleDescription) {
this(new Role(adminRoleName, adminRoleDescription));
}

/**
* Adds admin role object if user is an administrator according to Google
* App Engine UserService.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<HTML>
<BODY>
Server-side integration with GWT @minor-version@.
Server-side integration with GWT.

@since Restlet 1.1
@see <a href="@home-uri@">Google Web Toolkit</a>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<HTML>
<BODY>
Integration with Servlet API @minor-version@. Java Servlet technology provides Web developers with a simple, consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.
Integration with Servlet API. Java Servlet technology provides Web developers with a simple,
consistent mechanism for extending the functionality of a Web server and for accessing existing business systems.

@since Restlet 1.0
@see <a href="https://docs.oracle.com/javaee/7/tutorial/servlets.htm">Servlet HTTP server</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,6 @@ public StatusService getStatusService() {
return getServices().get(StatusService.class);
}

/**
* Returns a task service to run concurrent tasks. The service is enabled by
* default.
*
* @return A task service.
* @deprecated
*/
@Deprecated
public org.restlet.service.TaskService getTaskService() {
return getServices().get(org.restlet.service.TaskService.class);
}

/**
* Returns the tunnel service. The service is enabled by default.
*
Expand Down
119 changes: 0 additions & 119 deletions org.restlet.java/org.restlet/src/main/java/org/restlet/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,12 @@

package org.restlet;

import java.io.File;
import java.net.URI;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;

import org.restlet.data.Reference;
import org.restlet.engine.Engine;
import org.restlet.engine.component.ComponentHelper;
import org.restlet.engine.component.InternalRouter;
import org.restlet.representation.Representation;
import org.restlet.resource.ClientResource;
import org.restlet.routing.Router;
import org.restlet.routing.VirtualHost;
import org.restlet.security.Realm;
Expand All @@ -43,38 +37,6 @@
* that provides a transformation of data via its interface." Roy T.
* Fielding<br>
* <br>
* The configuration of a Component can be done programmatically or by using a
* XML document. There are dedicated constructors that accept either an URI
* reference to such XML document or a representation of such XML document,
* allowing easy configuration of the list of supported client and server
* connectors as well as services. In addition, you can add and configure
* virtual hosts (including the default one). Finally, you can attach
* applications either using their fully qualified class name or by pointing to
* a descriptor document (at this time only WADL description are supported, see
* the WADL Restlet extension for details).<br>
* <br>
* The XML Schema of the configuration files is available inside the API JAR
* under the "org.restlet.Component.xsd" name. Here is a sample of XML
* configuration:
*
* <pre>
* &lt;?xml version=&quot;1.0&quot;?&gt;
* &lt;component xmlns=&quot;http://restlet.org/schemas/2.0/Component&quot;&gt;
* &lt;client protocol=&quot;CLAP&quot; /&gt;
* &lt;client protocol=&quot;FILE&quot; /&gt;
* &lt;client protocols=&quot;HTTP HTTPS&quot; /&gt;
* &lt;server protocols=&quot;HTTP HTTPS&quot; /&gt;
*
* &lt;defaultHost&gt;
* &lt;attach uriPattern=&quot;/abcd/{xyz}&quot;
* targetClass=&quot;org.restlet.test.MyApplication&quot; /&gt;
* &lt;attach uriPattern=&quot;/efgh/{xyz}&quot;
* targetDescriptor=&quot;clap://class/org/restlet/test/MyApplication.wadl&quot; /&gt;
* &lt;/defaultHost&gt;
* &lt;/component&gt;
* </pre>
*
* <br>
* Components also have useful services associated. They are all enabled by
* default and are available as properties that can be eventually overridden:
* <ul>
Expand All @@ -96,32 +58,6 @@
*/
public class Component extends Restlet {

/**
* Used as bootstrap for configuring and running a component in command line.
* Just provide as first and unique parameter the URI to the XML file. Note that
* relative paths are accepted.
*
* @param args The list of in-line parameters.
* @deprecated Use XML support in the Spring extension instead.
*/
@Deprecated
public static void main(String[] args) throws Exception {
try {
if ((args == null) || (args.length != 1)) {
// Display program arguments
System.err.println("Can't launch the component. Requires the path to an XML configuration file.\n");
} else {
// Create and start the component
URI currentDirURI = (new File(".")).toURI();
URI confURI = currentDirURI.resolve(args[0]);
new Component(confURI.toString()).start();
}
} catch (Exception e) {
System.err.println("Can't launch the component.\nAn unexpected exception occurred:");
e.printStackTrace(System.err);
}
}

/** The modifiable list of client connectors. */
private final ClientList clients;

Expand Down Expand Up @@ -177,61 +113,6 @@ public Component() {
}
}

/**
* Constructor with the reference to the XML configuration file.
*
* @param xmlConfigRef The URI reference to the XML configuration file.
* @deprecated Use XML support in the Spring extension instead.
*/
@Deprecated
public Component(Reference xmlConfigRef) {
this();

// Get the representation of the configuration file.
Representation xmlConfigRepresentation = null;

if (xmlConfigRef != null) {
ClientResource cr = new ClientResource(xmlConfigRef);
xmlConfigRepresentation = cr.get();

if (xmlConfigRepresentation != null) {
new org.restlet.engine.component.ComponentXmlParser(this, xmlConfigRepresentation).parse();
} else {
getLogger().log(Level.WARNING,
"Unable to get the Component XML configuration located at this URI: " + xmlConfigRef);
}
}
}

/**
* Constructor with the representation of the XML configuration file.
*
* @param xmlConfigRepresentation The representation of the XML configuration
* file.
* @deprecated Use XML support in the Spring extension instead.
*/
@Deprecated
public Component(Representation xmlConfigRepresentation) {
this();

if (xmlConfigRepresentation != null) {
new org.restlet.engine.component.ComponentXmlParser(this, xmlConfigRepresentation).parse();
} else {
getLogger().log(Level.WARNING, "Unable to parse the Component XML configuration.");
}
}

/**
* Constructor with the URI reference to the XML configuration file.
*
* @param xmlConfigurationRef The URI reference to the XML configuration file.
* @deprecated Use XML support in the Spring extension instead.
*/
@Deprecated
public Component(String xmlConfigurationRef) {
this((xmlConfigurationRef == null) ? null : new Reference(xmlConfigurationRef));
}

/**
* Returns a modifiable list of client connectors.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,6 @@ public final class MediaType extends Metadata {
public static final MediaType APPLICATION_RDF_TRIX = register("application/trix",
"Simple XML serialized Resource Description Framework document");

/**
* @deprecated Replaced by the official {@link #TEXT_TURTLE} media type.
*/
@Deprecated
public static final MediaType APPLICATION_RDF_TURTLE = register("application/x-turtle",
"Plain text serialized Resource Description Framework document");

public static final MediaType APPLICATION_RDF_XML = register("application/rdf+xml",
"Normalized XML serialized Resource Description Framework document");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.logging.Level;

import org.restlet.Context;
import org.restlet.Message;
import org.restlet.Request;
import org.restlet.data.CacheDirective;
import org.restlet.data.ChallengeResponse;
Expand Down Expand Up @@ -60,19 +59,6 @@
* @author Jerome Louvel
*/
public class HttpRequest extends Request {
/**
* Adds a new header to the given request.
*
* @param request The request to update.
* @param headerName The header name to add.
* @param headerValue The header value to add.
* @deprecated Use {@link Message#getHeaders()} directly instead.
*/
@Deprecated
public static void addHeader(Request request, String headerName, String headerValue) {
request.getHeaders().add(new Header(headerName, headerValue));
}

/**
* Indicates if the access control data for request headers was parsed and added
*/
Expand Down
Loading

0 comments on commit 02a8ce3

Please sign in to comment.