SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Abdera, a Java AtomPub
   implementation
     David Calavera
         11870.com
vanity slide
•Software architect at 11870.com


• Open source “aholic”: Hudson, Netbeans


• Commiter of the Apache Abdera project
Overview
•Atom Publishing Protocol implementation


• Atom Syndication Format implementation


• version 0.5 comming soon
Creating feeds
Abdera abdera = new Abdera();
Feed feed = abdera.newFeed();
feed.setId(quot;tag:example.org,2008:/fooquot;);
feed.setTitle(quot;Test Feedquot;);
feed.setSubtitle(quot;Feed subtitlequot;);
feed.setUpdated(new Date());
feed.addAuthor(quot;David Calaveraquot;);
feed.addLink(quot;http://example.comquot;);
feed.addLink(quot;http://example.com/fooquot;,quot;selfquot;);

Entry entry = feed.addEntry();
entry.setId(quot;tag:example.org,2007:/foo/entries/1quot;);
entry.setTitle(quot;Entry titlequot;);
entry.setSummaryAsHtml(quot;<p>This is the entry title</p>quot;);
entry.setUpdated(new Date());
Reading feeds
Abdera abdera = new Abdera();
Parser parser = abdera.getParser();
URL url = new URL(quot;http://example.org/feedquot;);

Document<Feed> doc = parser.parse(url.openStream(),url);
Feed feed = doc.getRoot();

System.out.println(feed.getTitle());
for (Entry entry : feed.getEntries()) {
    System.out.println(quot;tquot; + entry.getTitle());
}
How does a server work?
•   from top to bottom
    • AbderaServlet
    • RequestContext
    • AbderaFilters
    • Provider
    • TargetResolver
    • RequestProcessor
    • Adapter
Target resolvers
•   RouteManager
TargetResolver ts = new RouteManager()
    .addRoute(quot;servicequot;, quot;/quot;, TargetType.TYPE_SERVICE)
    .addRoute(quot;feedquot;, quot;/:collectionquot;, TargetType.TYPE_COLLECTION)
    .addRoute(quot;entryquot;, quot;/:collection/:entry:quot;, TargetType.TYPE_ENTRY)
    .addRoute(quot;openSearchquot;, quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH);


•   RegexTargetResolver
TargetResolver ts = new RegexTargetResolver()
    .setPattern(quot;/atom(?[^#]*)?quot;, TargetType.TYPE_SERVICE)
    .setPattern(quot;/atom/([^/#?;]+)$quot;, TargetType.TYPE_COLLECTION)
    .setPattern(quot;/atom/([^/#?]+)/([^/#?]+)$quot;, TargetType.TYPE_ENTRY)
    .setPattern(quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH);
Adapters
•   CollectionAdapter
ResponseContext postEntry(RequestContext request);
ResponseContext deleteEntry(RequestContext request);
ResponseContext getEntry(RequestContext request);
ResponseContext headEntry(RequestContext request);
ResponseContext optionsEntry(RequestContext request);
ResponseContext putEntry(RequestContext request);
ResponseContext getFeed(RequestContext request);
ResponseContext getCategories(RequestContext request);
Adapters
•   MediaCollectionAdapter
ResponseContext postMedia(RequestContext request);
ResponseContext deleteMedia(RequestContext request);
ResponseContext getMedia(RequestContext request);
ResponseContext headMedia(RequestContext request);
ResponseContext optionsMedia(RequestContext request);
ResponseContext putMedia(RequestContext request);
More stuff
•   Spring integration
•   Multipart media creation
•   OAuth
•   Open search
•   JSON Serialization
•   Custom writers
•   Pre-built adapters
Questions?
•   Resources
    • Abdera: http://incubator.apache.org/abdera
    • AtomPub: http://ietf.org/rfc/rfc5023
    • Atom format: http://ietf.org/rfc/rfc4287
    • Atom list: http://www.imc.org/atom-syntax
    • My blog: http://thinkincode.net

Contenu connexe

Tendances

Using Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your DataUsing Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your DataMongoDB
 
AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)Brian Swartzfager
 
Perl 5.28 new features
Perl 5.28 new featuresPerl 5.28 new features
Perl 5.28 new featuresbrian d foy
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleVladimir Kostyukov
 
Building Go Web Apps
Building Go Web AppsBuilding Go Web Apps
Building Go Web AppsMark
 
Sql FUNCTIONS
Sql FUNCTIONSSql FUNCTIONS
Sql FUNCTIONSAbrar ali
 
Do something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseDo something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseBruce McPherson
 
Android HttpClient - new slide!
Android HttpClient - new slide!Android HttpClient - new slide!
Android HttpClient - new slide!Chalermchon Samana
 
exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxDaniel Gilhousen
 
Why Redux-Observable?
Why Redux-Observable?Why Redux-Observable?
Why Redux-Observable?Anna Su
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBSqreen
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentVladimir Medina
 
SPFx working with SharePoint data
SPFx working with SharePoint dataSPFx working with SharePoint data
SPFx working with SharePoint dataVladimir Medina
 
Storytelling By Numbers
Storytelling By NumbersStorytelling By Numbers
Storytelling By NumbersMichael King
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js FundamentalsMark
 
6 things about perl 6
6 things about perl 66 things about perl 6
6 things about perl 6brian d foy
 

Tendances (20)

Angular mix chrisnoring
Angular mix chrisnoringAngular mix chrisnoring
Angular mix chrisnoring
 
From * to Symfony2
From * to Symfony2From * to Symfony2
From * to Symfony2
 
Using Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your DataUsing Change Streams to Keep Up with Your Data
Using Change Streams to Keep Up with Your Data
 
AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)AngularJS $http Interceptors (Explanation and Examples)
AngularJS $http Interceptors (Explanation and Examples)
 
Perl 5.28 new features
Perl 5.28 new featuresPerl 5.28 new features
Perl 5.28 new features
 
Finch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with FinagleFinch.io - Purely Functional REST API with Finagle
Finch.io - Purely Functional REST API with Finagle
 
Building Go Web Apps
Building Go Web AppsBuilding Go Web Apps
Building Go Web Apps
 
Sql FUNCTIONS
Sql FUNCTIONSSql FUNCTIONS
Sql FUNCTIONS
 
Do something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as databaseDo something in 5 minutes with gas 1-use spreadsheet as database
Do something in 5 minutes with gas 1-use spreadsheet as database
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
Android HttpClient - new slide!
Android HttpClient - new slide!Android HttpClient - new slide!
Android HttpClient - new slide!
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailbox
 
Why Redux-Observable?
Why Redux-Observable?Why Redux-Observable?
Why Redux-Observable?
 
NoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDBNoSQL Injections in Node.js - The case of MongoDB
NoSQL Injections in Node.js - The case of MongoDB
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint Content
 
SPFx working with SharePoint data
SPFx working with SharePoint dataSPFx working with SharePoint data
SPFx working with SharePoint data
 
Storytelling By Numbers
Storytelling By NumbersStorytelling By Numbers
Storytelling By Numbers
 
Angular.js Fundamentals
Angular.js FundamentalsAngular.js Fundamentals
Angular.js Fundamentals
 
6 things about perl 6
6 things about perl 66 things about perl 6
6 things about perl 6
 

En vedette

Egyptian Aeraunautical Sports Club Guide
Egyptian Aeraunautical Sports Club GuideEgyptian Aeraunautical Sports Club Guide
Egyptian Aeraunautical Sports Club Guideahmad bassiouny
 
Life-feed | final presentation
Life-feed  |  final presentationLife-feed  |  final presentation
Life-feed | final presentationPixelkings
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9David Calavera
 
Conferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsConferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsDavid Calavera
 

En vedette (8)

Egyptian Aeraunautical Sports Club Guide
Egyptian Aeraunautical Sports Club GuideEgyptian Aeraunautical Sports Club Guide
Egyptian Aeraunautical Sports Club Guide
 
Life-feed | final presentation
Life-feed  |  final presentationLife-feed  |  final presentation
Life-feed | final presentation
 
My name is Trinidad
My name is TrinidadMy name is Trinidad
My name is Trinidad
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
JRuby hacking guide
JRuby hacking guideJRuby hacking guide
JRuby hacking guide
 
Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9Rubyspec y el largo camino hacia Ruby 1.9
Rubyspec y el largo camino hacia Ruby 1.9
 
Trinidad
TrinidadTrinidad
Trinidad
 
Conferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y RailsConferencia Rails: Integracion Continua Y Rails
Conferencia Rails: Integracion Continua Y Rails
 

Similaire à ApacheCon: Abdera A Java Atom Pub Implementation

And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportBen Scofield
 
Merb Pluming - The Router
Merb Pluming - The RouterMerb Pluming - The Router
Merb Pluming - The Routercarllerche
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAlexandre Victoor
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and DashboardsAtlassian
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0Matt Raible
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHPHari K T
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009bturnbull
 
Get Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsGet Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsDavey Shafik
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkBen Scofield
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stackPaul Bearne
 
Android Automated Testing
Android Automated TestingAndroid Automated Testing
Android Automated Testingroisagiv
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareAlona Mekhovova
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amfrailsconf
 

Similaire à ApacheCon: Abdera A Java Atom Pub Implementation (20)

Rack Middleware
Rack MiddlewareRack Middleware
Rack Middleware
 
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack Support
 
Merb Pluming - The Router
Merb Pluming - The RouterMerb Pluming - The Router
Merb Pluming - The Router
 
Avro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSONAvro, la puissance du binaire, la souplesse du JSON
Avro, la puissance du binaire, la souplesse du JSON
 
Intro Open Social and Dashboards
Intro Open Social and DashboardsIntro Open Social and Dashboards
Intro Open Social and Dashboards
 
What's Coming in Spring 3.0
What's Coming in Spring 3.0What's Coming in Spring 3.0
What's Coming in Spring 3.0
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009
 
Get Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP StreamsGet Soaked - An In Depth Look At PHP Streams
Get Soaked - An In Depth Look At PHP Streams
 
All I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web FrameworkAll I Need to Know I Learned by Writing My Own Web Framework
All I Need to Know I Learned by Writing My Own Web Framework
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
Sinatra
SinatraSinatra
Sinatra
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stack
 
jdbc
jdbcjdbc
jdbc
 
Apache Click
Apache ClickApache Click
Apache Click
 
Android Automated Testing
Android Automated TestingAndroid Automated Testing
Android Automated Testing
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Using and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middlewareUsing and scaling Rack and Rack-based middleware
Using and scaling Rack and Rack-based middleware
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amf
 

ApacheCon: Abdera A Java Atom Pub Implementation

  • 1. Abdera, a Java AtomPub implementation David Calavera 11870.com
  • 2. vanity slide •Software architect at 11870.com • Open source “aholic”: Hudson, Netbeans • Commiter of the Apache Abdera project
  • 3. Overview •Atom Publishing Protocol implementation • Atom Syndication Format implementation • version 0.5 comming soon
  • 4. Creating feeds Abdera abdera = new Abdera(); Feed feed = abdera.newFeed(); feed.setId(quot;tag:example.org,2008:/fooquot;); feed.setTitle(quot;Test Feedquot;); feed.setSubtitle(quot;Feed subtitlequot;); feed.setUpdated(new Date()); feed.addAuthor(quot;David Calaveraquot;); feed.addLink(quot;http://example.comquot;); feed.addLink(quot;http://example.com/fooquot;,quot;selfquot;); Entry entry = feed.addEntry(); entry.setId(quot;tag:example.org,2007:/foo/entries/1quot;); entry.setTitle(quot;Entry titlequot;); entry.setSummaryAsHtml(quot;<p>This is the entry title</p>quot;); entry.setUpdated(new Date());
  • 5. Reading feeds Abdera abdera = new Abdera(); Parser parser = abdera.getParser(); URL url = new URL(quot;http://example.org/feedquot;); Document<Feed> doc = parser.parse(url.openStream(),url); Feed feed = doc.getRoot(); System.out.println(feed.getTitle()); for (Entry entry : feed.getEntries()) { System.out.println(quot;tquot; + entry.getTitle()); }
  • 6. How does a server work? • from top to bottom • AbderaServlet • RequestContext • AbderaFilters • Provider • TargetResolver • RequestProcessor • Adapter
  • 7. Target resolvers • RouteManager TargetResolver ts = new RouteManager() .addRoute(quot;servicequot;, quot;/quot;, TargetType.TYPE_SERVICE) .addRoute(quot;feedquot;, quot;/:collectionquot;, TargetType.TYPE_COLLECTION) .addRoute(quot;entryquot;, quot;/:collection/:entry:quot;, TargetType.TYPE_ENTRY) .addRoute(quot;openSearchquot;, quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH); • RegexTargetResolver TargetResolver ts = new RegexTargetResolver() .setPattern(quot;/atom(?[^#]*)?quot;, TargetType.TYPE_SERVICE) .setPattern(quot;/atom/([^/#?;]+)$quot;, TargetType.TYPE_COLLECTION) .setPattern(quot;/atom/([^/#?]+)/([^/#?]+)$quot;, TargetType.TYPE_ENTRY) .setPattern(quot;/os.xmlquot;, CustomTargetType.OPEN_SEARCH);
  • 8. Adapters • CollectionAdapter ResponseContext postEntry(RequestContext request); ResponseContext deleteEntry(RequestContext request); ResponseContext getEntry(RequestContext request); ResponseContext headEntry(RequestContext request); ResponseContext optionsEntry(RequestContext request); ResponseContext putEntry(RequestContext request); ResponseContext getFeed(RequestContext request); ResponseContext getCategories(RequestContext request);
  • 9. Adapters • MediaCollectionAdapter ResponseContext postMedia(RequestContext request); ResponseContext deleteMedia(RequestContext request); ResponseContext getMedia(RequestContext request); ResponseContext headMedia(RequestContext request); ResponseContext optionsMedia(RequestContext request); ResponseContext putMedia(RequestContext request);
  • 10. More stuff • Spring integration • Multipart media creation • OAuth • Open search • JSON Serialization • Custom writers • Pre-built adapters
  • 11. Questions? • Resources • Abdera: http://incubator.apache.org/abdera • AtomPub: http://ietf.org/rfc/rfc5023 • Atom format: http://ietf.org/rfc/rfc4287 • Atom list: http://www.imc.org/atom-syntax • My blog: http://thinkincode.net