Making a program to be updated by users [closed] - java

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 trying to make a prototype for the company that I'm interning for. I would like to create a program that allows users to make minor updates that will, within 15ish seconds or so, update on everyone's screen. This program will only be used by about 20 people at one time at the most. For instance, if a person were to type click a button that went from red to green, the change to green would show on everyone's screen. I only know Java, but I'm not opposed to learning other languages. I'm just looking for places to read about this type of stuff, or ways that you know to do it.
I'm also hoping to allow an admin account to make usernames for people with differing amounts of access to making updates, but this is the later part to my project.
Thanks

With only 20 users or so, your options are pretty much wide open. You can use TCP or UDP, a web server with HTTP. I'd use TCP myself.
It will be easy to update only 20 people with small updates within 15 seconds.
Here's how to create a TCP server in C#.net
Here's how to create a simple TCP server in Java.
I suggest using ProtoBufs for the binary protocol. Its simple, compact, and allows you to change your language without needing to rewrite protocol parsing/unparsing code.

Related

How do I capture information from a table in a Java program? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 days ago.
Improve this question
I'm trying to capture data from a table without using an RPA. I'm studying interceptor system APIs, but I can't get much reference on how to do this.
The main problem is that I need to get a table quickly, without the need for scrolling. The possibility I thought of is to perform the capture in the operating system's render, since the table would already be loaded.
Does anyone have any idea how to do this and if possible send content for study and reference?
thank you and sorry for the bad english
I've already tried to use an interceptor that renders a part of the application's jar so that I can get the data, but I failed due to the JNI not being able to find the class. I hope to be able, somehow, to get this information quickly and without the need to read it on screen.
More details:
The software is a desktop application developed in Java using spring;
the application displays on the screen a table containing 5 columns and several lines, approximately 2000 lines, which is not fully displayed on the screen, thus containing a scroll bar;
I'm considering using an API hook to try to intercept the data that is sent to this table at the time it is built/rendered at the time the software is loaded. That way, I don't spend time reading the screen and scrolling to get all the lines.
To solve this issue, I'm using Java to access the JVM and testing some things, like JavaAgent and Javassist, but I'm not sure if that would be the best way or if there are other ways to explore.
It is also worth mentioning that I have the application's Jars and can decompile them.

Send commands from terminal to Java swing app [closed]

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 3 years ago.
Improve this question
I have a working java app and now I would like to extend it to be controlled over ssh. Let's say I have a swing button that increases a counter. I would like to be able to ssh in that computer and say something $: myapp increase and have the button's action listener executed.
Maybe I'm using the wrong keywords but I could not find a solution. The 'kinda' solution I could think of is using signals but I'm not even sure if they can be used as I am used to from C and if that can be done without knowing the actual process ID.
Any material that can get me started would be welcome.
signals are hard to read from java, because there is a lot of difference between OSes on how to do those (some don't even have the concept), and java is designed to expose anything that can be generalized across all OSes java runs on, and to not expose anything that might not be there.
The usual way to do it, is via TCP/IP (so, java.net.Socket), or HTTP (so, jetty or some such).
Note that webapps can trivially be accessed remotely and can be scripted fairly easily. You could also consider building a command line / terminal based app, for example with lanterna which you can shove into a terminal session keeper / eternal SSH kinda deal.

How to handle data synchronisation between 2 Spring apps? [closed]

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 4 years ago.
Improve this question
I'm looking for the optimal way to handle the following scenario, preferably some implementation that's already been made for something like this.
There are two Systems (Springboot Webapps) that are supposed to communicate which each other through a Rest-gateway. Transfers shall be handled with Json over HTTP.
1st System is the Project part, 2nd System is the Persons part and they both implement their own persistent sql-database. Both systems depend on each others data and it cannot be expected that both systems are online at all times.
What would be the best way to achieve that both systems data is always up 2 date? Is there any plugin you could recommend to handle the synchronization process which also implements scenarios like one system shutting down while sending or the other way round?
Thanks in advance!
If you can't expect both systems to be online at all times, and you don't want any downtime when one of them is down, I think that the best way to do it is to share a common database. This has some problems of its own and you should think if it's worth, maybe you would be better having two completely independent services which rely on each other and being ready to replicate one of them if it's needed.

How to make a real time concurency lock in a web application? [closed]

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 6 years ago.
Improve this question
I m develloping a web application, in which I have to show, let's say, a list of tasks.
What I need to do is once a user open a task (i.e open it in his browser), it gets deleted of all the others users lists or it shows that the task is taken, no one can open a task that is already opened by someone else.
In addition, I need that once a user close a task (for example user closes his browser) , it get re-added to other users tasks list.
How can I do that please ? WebSocket in client side ? Any other -better- choices? How to manage this in the server side ?
Thank you
There is two solutions (that I know of) for your problem :
Ajax (and Long Poll)
Using Ajax you can poll the server every X seconds for data necessary to implement the behavior you described. This may work but it is not a recommended way to go. read why on this thread.
WebSocket
Just like a socket you'd use on a desktop application (hence the name), you can open a WebSocket connection (not an HTTP one), keep it as long as needed and close it only when you're done with it. This is the preferred way to have data flowing constantly between a client and a server. It is also supported by almost every major browser out there
There is other technologies such as WebRTC and Server-Sent Events, but considering your description of the problem, those might not be what you're looking for.
Off-topic : And I'm not sure why your question has been downvoted, looks legit to me.

What is the best strategy to make my demo Java library/framework stop working after 30 days on Linux? [closed]

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 7 years ago.
Improve this question
Ok, it does not need to be something 100% secure. Something simple, that will cut 80% of people from using my demo library past 30 days and contact me.
The only thing I can think of is making my code save a file somewhere, with the date that the library started and after 30 days just exit displaying a message to contact for the full version. Of course, if the user finds out where this file is, all he has to do is delete it, so it would be nice if it could be in some kind of not so easy to find place (desktop or home directory would be silly I suppose).
Of course if he decompiles the code, he can easily turn that off, but again, I want some protection, even 50%, not 100%.
Target operating system is probably linux/unix, but I can also discover dynamically to make it work in any.
You don't mention the target operating system, so it is a little bit hard to answer the question. If your target is Windows, I would store the first start time in the Registry. Maybe this can help you.
I think your file strategy looks perfectly fine.
If you want to strengthen your scheme, you will have to contact a central service of some sort where you can detect if the same server tries to restart your evaluation time multiple times. The central server could i.e. sign a token with an expiry date that the library needs to run.
On the other hand, the more complicated this kind of schemes is, the more likely they are to fail at times and create problems for your legitimate users. You should consider this against the (probably very low) volume of users that would actively sabotage a more simple scheme.
PS: remember that in some environments multiple copies of different applications that uses your library may have to run simultaneously.

Categories