Well, in the case of the URL loader, the URL and its major version is just a 
string, ex:

http://cdn.devicemap.apache.org/devicedata/v1/...

Then its just a matter of updating the string with the data version number it 
supports. Right now its in the client code. Im thinking the default location 
should be managed by us, the project.

Just incase... the reason for major versioning is to prevent a client from 
downloading device data in a format it cannot support, thus breaking the 
client. This is required since loading the data without a URL location reverts 
to a default location. Im thinking this may be a popular use case. See first 
example below.


If a client wants to pin itself to a specific version, it can just pass the 
optional second param to the initDeviceData() method which is the URL to a 
specific release. See second example below.

Ex:

http://svn.apache.org/viewvc/incubator/devicemap/trunk/devicemap/java/classifier/src/test/java/org/apache/devicemap/DeviceMapClientUrlTestOptional.java?view=markup


The first test loads from the default location: 
client.initDeviceData(LoaderOption.URL);

The second test loads from a custom location: 
client.initDeviceData(LoaderOption.URL, "http://www.rezsoft.org/dmap-data/";);

I think its better to have the user defined location be explicit in the code 
than have to read it from a config file. Would have to think about the 
tradeoffs more...


________________________________
 From: Werner Keil <[email protected]>
To: "[email protected]" <[email protected]>; 
Reza <[email protected]> 
Sent: Friday, July 18, 2014 10:14 AM
Subject: Re: URLResource reading from svn.apache.org by default?
 




1) The url has to contain the major version number (ex: ../v1/.., ../v2/.., 
../v3/..). This allows for different client versions to work against their 
supported data. Not sure if maven supports this OOTB or if we just release our 
own major version LATEST.


Without changing the POM if you wanted Maven to switch between /v1, /v2 or /v3 
that would require either user specific properties overriding the project 
specific one or one could call different profiles. 



On Fri, Jul 18, 2014 at 4:07 PM, Reza <[email protected]> wrote:

Is that URL HTTP?
>
>Currently there are 2 requirements for downloading devicemap resources over 
>the internet:
>
>1) The url has to contain the major version number (ex: ../v1/.., ../v2/.., 
>../v3/..). This allows for different client versions to work against their 
>supported data. Not sure if maven supports this OOTB or if we just release our 
>own major version LATEST.
>
>2) The download has to be fast. Don't want initialization taking more than 1 
>to 2 seconds. Putting a CDN infront of the URL will solve this.
>
>Am I missing anything else...?
>
>
>
>________________________________
> From: Bertrand Delacretaz <[email protected]>
>To: "[email protected]" <[email protected]>; 
>Reza <[email protected]>
>Sent: Friday, July 18, 2014 9:38 AM
>
>Subject: Re: URLResource reading from svn.apache.org by default?
>
>
>
>Hi,
>
>On Fri, Jul 18, 2014 at 3:06 PM, Reza <[email protected]> wrote:
>> ...a common complaint about using device classification is that you have to
>> constantly track and maintain new devices...
>
>You might also use the Maven distribution mechanism for these data
>files - in another project I'm using pax URL to resolve URLs like
>
>mvn:org.apache.sling/org.apache.sling.commons.log/LATEST
>
>to get the corresponding artifact from a Maven repository.
>
>The nice thing with that is that you don't have to worry about infrastructure.
>
>
>
>
>-Bertrand

Reply via email to