wood burning stoves 2.0*
The moose likes Java in General and the fly likes Online offline solution in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Online offline solution in Java" Watch "Online offline solution in Java" New topic
Author

Online offline solution in Java

Abhijeet Vaidya
Greenhorn

Joined: Apr 16, 2007
Posts: 20
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
Sachin Joshi
Ranch Hand

Joined: Aug 06, 2008
Posts: 83

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 ?


Web Development Tips and Tutorials - By Sachin
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41068
    
  43
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.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Online offline solution in Java
 
Similar Threads
offline mode requirement
Synchronizing two databases!
Print online Form using Servlets
Java Web application in Online/Offline mode
Java Web application in Online/Offline mode