Ticket #362 (closed task: fixed)

Opened 3 years ago

Last modified 3 years ago

Remove dependency on deprecated stuff in restlet.org 2.0

Reported by: mpo Owned by: mpo
Priority: major Milestone: 0.4
Component: -- unknown -- Version: 2.x
Keywords: Cc: kauri-discuss@…

Description

One important issue in this respect has been reported before under #213

However there is more to be done as has become obvious since restlet removed deprecated api stuff in trunk: http://restlet.tigris.org/source/browse/restlet?view=rev&revision=6867

I'm creating this issue as a central point listing all related changes in our code base.

Change History

comment:1 Changed 3 years ago by mpo

Simple renames:

  • org.restlet.routing.Variable#setDecodeOnParse to setDecodingOnParse
  • org.restlet.Apllication#setRoot to setInboundRoot
  • org.restlet.representation.Variant#setIdentifier to setLocationRef
  • org.restlet.util.ServerList#getTarget? to getNext
  • org.restlet.routing.Router#get-setDefaultMatchQuery to getDefaultMatchingQuery
  • org.restlet.routing.TemplateRoute#setMatchQuery? to setMatchingQuery

More subtle:

needs some more detail checking to understand the impact

  • TemplateRoute? mostly replaces Route, but the fact that the inheritance relation between both reversed makes this change a bit more interesting: most cases allow changing Route to TemplateRoute?, just be aware that the Router.getRouter() still returns a list of Route objects
  • ServerResource? is largely a replacement for Resource (unless in client-side usage where ClientResource? is to be used - afaics never in our kauri case)

Note however that the useful methodnames all have dropped their handleSomeActionPhrase() signature in favour of more direct regognisable http-method-like() names to be more in line with the uniform interface.

  • represent() becomes get()
  • storeRepresentation() becomes put()
  • acceptRepresentation() becomes post()
  • handleHead() becomes head()
  • handleOptions() becomes options()
  • removeRepresentations() becomes delete()

Additionally init() is now final, you should override doInit() for any specific post-install stuff

comment:2 Changed 3 years ago by mpo

Made some more progress here. Things to note:

  • org.restlet.Request (borrowing from org.restlet.Message) has its #getEntityAsForm() removed. The same is available via getResourceRef().getQueryAsForm()

see http://permalink.gmane.org/gmane.comp.java.restlet/12678

  • org.restlet.Response no longer has a setChallengeRequest() one should in stead add the request to the list of getChallengeRequests()

comment:3 Changed 3 years ago by mpo

I've just published svn6875 of restlet (2.1-dev) to the maven repo for building

Will upgrade the pom, and commit all needed code changes next.

Note however in the follow up of #349 that the inheritance reverse (in restlet.org) between TemplateRoute? and Route creates an incompatible change between 2.1 and 2.0: so there is more at hand then just deprecation and so we can't easily have (AFAICS) code that builds against both versions.

comment:4 Changed 3 years ago by mpo

  • Status changed from new to closed
  • Resolution set to fixed

(In [1706]) fixes #213 and #362
Updating the restlet.org dependency to svn6875 which is a trunk snapshot from 2.1-dev
Code builds and tests locally, please test on your platforms as well.

Note: See TracTickets for help on using tickets.