Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
how can we do server side push?
There are multiple ways to do server side push, main technologies are Long Poll and Web Streaming. However, with advent of HTML5, web socket is a good option. Beware: Not all browsers are HTML5 ready.
Read more on web-socket here
For Comet or Long Polling you can see discussion here: Best solution for Java HTTP push (messaging)
you can use JWebSocket which is open source and websocket that will do server side push based on HTML 5 specification.Hope please check this link http://jwebsocket.org/. Hope this will help you
long polling.. here is the article about server push with gwt http://code.google.com/p/google-web-toolkit-incubator/wiki/ServerPushFAQ . Bu the concepts are valid for other client side technologies..
Is it true that you are in a HTTP environment as GUrsel and UNNI assume?
In this case they point in the right direction. "Long Polling" or keywords like "Comet" and "Bayeux" should give you a good start to select a HTTP based protocol.
WebSocket seem to get the upcoming standard in the upcoming world of HTML5. As this is a quite interesting technology, many implementations exist already BUT are not yet standard!! You should also consider that major browsers have stopped Websocket support recently because of security issues.
In any non HTTP protocol environment, please clarify your question.
If anyone is interested in a Java implementation I just wrote a sample app and a blog post about it. It uses Java, Maven, Comet, Bayeux, Spring.
http://jaye.felipera.cloudbees.net/
http://geeks.aretotally.in/thinking-in-reverse-not-taking-orders-from-yo
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I have recently begun learning Android development and have written a Spring Boot Java application with REST using Spring MVC.
I would like some advice on how to connect to my server with an android client? Do I hit the REST controller using my android client?
What would you suggest is the best practice and what API would you recommend I use?
Thanks for your time and help!
It depends on the requirement of application. There are several scenario where you want application & server communication.
HTTP API call
When front end application require some data from back end server or want to send some data to the server as part of application functionalities, then you can use any http client APIs like Retrofit or Volley
Websocket
If your application needs bidirectional continuos communication then you should pref to use websocket-client
In this case you need to create a socket end point at your back end server.
Push Notification
Push notification is very obvious now days, If your server wants to deliver some data to your application, It is besically one way communication from server to client.
This explanation may help you to understand all possible scenario.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm creating a simple java application made in swing that communicates with a database. Multiple people will be using the application at the same time. As they are able to change things at the same time, if someone for example, adds a new user, and a different person is on that same page, I want the person who did not make the change to be notified that changes were made to the database since they last loaded it.
My lecturer in college advised me that WebSockets would be the way to go to achieve this, however after some reading about WebSockets in Java, it seems it is based to work with web browsers instead of between Java applications.
Can using WebSockets achieve what I am trying? Or, if not, what would be a way to achieve this?
Simple answer is Yes you can achieve what you needed
WebSocket is a communication protocol(#see RFC 6455) & it is not a must to use a Web browser.
You can achieve what you want to do with your app, it is just a matter of writing a custom WebSocket server to facilitate your requirements in your case sending database changes to the other clients(Which is called Server push)
There are several java libraries to get the work done,
netty WebSocket (My favorite)
jWebsocket
Atmosphere
Webbit
Netty WebSocket is a good one to start with and you can find examples in its project to write a custom client and a server
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm here to pose a kinda noob question, so please no hate here mates.
The java application I'm trying to create has the following structure.
login request via net Validation(same machine)
**JAVA PROGRAM** ---------------------------------> **WebService** ---------------------------------------> **db**
Response Response
**db** --------------> **WebService** ----------------> **JAVA PROGRAM**
But my doubt is on how to build that webservice.
I've watched several glassfish tutorials, but none of them seem to explain how to actually create this type of connections.
Thank you!
You should divide your problem into several sub-problems and then tackle them one by one. I'm not sure if I understood your setup correctly, but to me it seems like you need the following:
Client Java application and the application logic
Server Java application and the application logic
Database
Connection from the server application to the database
Connection from the client Java application to the server application
In addition, you need to decide what kind of a connection you are going to use between your client and a server. Would it be a SOAP-based web service, a ReST service, plain HTML, just a simple POST/GET, or something else? Also, what kind of frameworks are you using? Spring, perhaps? Wicket? Something else?
Do you have any of those decided or done yet? Feel free to start a new question, I foresee this one being closed in the near future, because it's not clear what you are asking. Do study the What topics can I ask about here? page. If you can show any code in your question, you are much more likely to get answers.
Anyway, to give at least some kind of an answer to your question, I'd use the Spring Framework. Google for spring sql tutorial and then either spring restful web services tutorial, spring servlet tutorial or spring soap web service tutorial based on your technology of choice.
Your database interaction will be same as normal does. You just need to broadcast your Validator class as a WebService.
Below links will help you to do so.
For connecting java class with MySql
For broadcasting your class as Webservice.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm not good in webservice stuffs. I only tried in my life REST in Java which is so easy to implement.
But, this time, I need to implement SOAP, using WSDL as a language.
Would you please tell me if this is what I should do :
Having an application in C/C++, I must add in it a higher level
"layer" which will be Webservice Provider. My Java application,
which would be deployed in another server, should have Webservice
Consumer / Webservice Client by SOAP, using WSDL as well.
Technically, can you give me some samples about what I can do on the both sides (C++ side, Java side) ?
Thank you a lot!
Edit :
For the ones who downvote, I would appreciate it if they justify their action in a comment.
Otherwise, I would really appreciate the person who tell me if my guessing is right or wrong..., at least.
Use Axis c++ for the server side. Take a close look at the documentation.
If you are done with the server side, you can retrieve the wsdl file at the service URL by adding ?wsdl to the request. This wsdl file can then be used to generate a java stub for the client code using for example wsdl4j.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
We should feed some system under test with ntp data, that we should control. Since the testing environment is mainly java-oriented, it would be perfect to find and reuse any java code, that forms and send ntp packets. There is no matter, how precise this server side would be, since the main idea of the test to provide the mocked time through via ntp packets. Is there any ntp java library, or may be example, especially for netty usage?
I would appreciate for any suggestions. Thanks in advance!
UPD. Since the question is taken to 'on hold' (I don't understand why, ntp + java seems to be too familiar to local folks, but not to me), I'd like to summarize it to simple question:
Is there Java API that can provide ntp server packets on ntp client dmand being simple like NTPPacket ntpp=new NTPPacket(new Time()); while all other wirings will be default?
Ho-ho, I see some haters already started their downvotes; it seems they just see the title, but not the details of the issues (I really dislike this kind of haters)
I have even to remove 'java' tag here. So, my suggestion that I can reuse http://mvnrepository.com/artifact/org.apache.directory.server/apacheds-protocol-ntp/2.0.0-M15 for this purpose