DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > A REST Project With Glassfish

A REST Project With Glassfish

Felipe Gaúcho user avatar by
Felipe Gaúcho
·
Sep. 08, 09 · Java Zone · Interview
Like (0)
Save
Tweet
7.92K Views

Join the DZone community and get the full member experience.

Join For Free
I am working out a new pet project, an online system to support PUJ Competitions. It is still a work under progress and I plan to start to blog some technical results here, but until that glorious free time I would give you a glimpse about what is keeping my blog so quiet :)

So, PUJ is an academic competition where undergraduate student submit their homeworks for the evaluation of Senior Professionals. It is a nice competition planned to happen in some JUGs in Brazil - and I hope to see it adopted in several other JUGs around the world.

I am producing basically a RESTfull web-service, based on Jersey and EJB 3.0. It is part of the self-education on Glassfish technologies I've started few years ago. I have so far:

  • Server: a EJB 3.0 backend + JPA/TopLink
  • Middleware: a Jersey RESTfull interface + JMS features like sending notification by email, twitter, etc
  • Frontend: an HTTP client - a DWR GUI...

The code and the application design is all under progress nowadays, noisy and smoking a bit ... but there are already some goodies for the eagers by novelties, so you can taste a bit of my REST-API on these HTTP Resources:

  • Read supported roles for institutions
  • Read all institutions with a PUJ Competition
  • Read the institutions by role (/arena-http/institution?role={ROLE}?offset={int}&max={int})
  • Read all participants of a competition (/{COMPETITION_NAME}/user)
  • Read the participants by role (/{COMPETITION_NAME}/user?role={USER_ROLE})
  • Read all homeworks of a competition (/{COMPETITION_NAME}/homework?offset={int}&max={int})
  • Read a homework by name (/{COMPETITION_NAME}/homework/{HOMEWORK_NAME})

Observations about the above API:

  • JSON - to receive the responses in the json format, the client should include the HTTP Header Accept=application/json
  • It will support HATEOAS asap, I am still dealing with the design requirements  for implementing it on Java with Jersey. If you have an idea on how to implement it elegantly, please share this information with us. Basically I plan to include a link on every element returned from the server, so spiders or htt client can extract the next step from the resource itself instead of having a previous knowledge about where to find what.
  • Most of the data comes directly from the database, serialized by JAXB and filtered onthe Jersey layer.
  • Pagination works fine - managed by the the persistence layer, and using Jersey @DefaultValues in case no parameter is suplied by the client.
  • File upload is coming soon.
  • Security is also enabled using web.xml configurations. It is just disabled for testing purposes.

It is a lot of fun, I am learning a lot and missing a lot some people to produce GUIs to consume my service. We have a brave frontend developer (Sombriks) and some other students flerting with the chance to collaborate. You have your opportunity, just get your preferred HTTP enabled technology and start to consume my RESTful service.. and be my guest to ask anything about it.

Interested? So here are the links to know more about it:

  • http://kenai.com/projects/puj/pages/PUJ-API
  • http://kenai.com/projects/puj/pages/PUJ-SPEC (this also contains a list of REST references)
  • http://kenai.com/projects/puj/pages/Home

That's it, I hope to find time to publish more detailed information about the project in the next few weeks, but for now this is the best I can offer ..

From http://weblogs.java.net/blog/felipegaucho

REST Web Protocols GlassFish

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Modernize Legacy Code in Production: Rebuild Your Airplane Midflight Without Crashing
  • ETL, ELT, and Reverse ETL
  • Why Is Software Integration Important for Business?
  • After COVID, Developers Really Are the New Kingmakers

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo