• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Online offline solution in Java

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am looking for a java based solution for an application with online/offline capabilities. User should be able to work offline (client) and when he comes online on company network, he should be able to send data to the server.

Also need a functionality to send data from server to client. What all APIs can be used?

Can JMS be one solution?

Any suggestions are welcome.


Thank you.
Abhijeet
 
Ranch Hand
Posts: 83
Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to develop standalone java application thick client which provides the user a way of saving the work done in local machine then when user choses to go online the saved work can be synchronized over network. This could be done over HTTP or network layer also.

What is the offline work user is going to do? Is it something like outlook mail client ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's advisable to separate the two parts - saving offline to work for later synchronization, and actually sending it to the server later.

Saving could take any number of forms, depending on the data (or Java objects) you need to store. One of the easiest is probably to use serialization, either of the javax.xml.XMLEncoder shape if the objects are JavaBeans, or of the binary variety (using ObjectOutputStream) if they are not. You could also use a flat file if the data items are simple.

As to sending the data to the server, all kinds of routes are possible: email, JMS, HTTP, sockets, web services... It depends on what the server supports, and makes sense for the data in question. Email and JMS send unformatted data, so the server would need to interpret/parse it in some fashion. HTTP allows to send name/value pairs, which is a step up. Web services have a notion of data types, so that's at an even higher level. Without knowing anything about the application in question, I'd probably go with an HTTP or web service solution.

One issue you need to think about is synchronization. After the user's last server access the data on the server may have changed, which could impact whether the changes the user is about to upload are still valid, or whether they should be rejected. It's possible that your application doesn't need to worry about that, though.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic