UI to control machine access - java

I've a generic design question. Hope you folks can help me. Our technology stack is Java, Angular, Spring and REST. We wish to implement a reservation system (to reserve machines/servers) so that if one user wishes to ssh to a machine then they first reserve it one our UI and then they only can use it and no-one else can.
Do you guys know a way/technology/design where we could control access to machines this way (possibly something like LDAP) ?. Even something where the user logs into our UI, reserves the box by clicking a Reserve button etc and then clicks a Launch button - which could then launch an actual ssh command window or a remote desktop access session etc. In this way we could set a certain predefined username+password for our boxes (which our application could control) and we can allow users to connect to boxes via our UI.
Wondering if any one you had to do anything similiar to this before or if there is anything obvious I'm missing. Is it easy to "launch" a remote desktop connection or indeed an ssh terminal from java.
I'm fine with the UI part, rest, java etc. It's more the connections / logic to the remote machines that I'd like to get peoples thoughts on.
Sorry if this is too generic. I'd like to get some directions on it.
Any thoughts/guidance would be great.
Thanks - Ro

Related

Execute java GUI program from external website

maybe what I'm asking is difficult to do or even ridiculous, but I'll give it a try anyway.
I have a typical PHP website, with a products list. And I have a Java application which manages the products (CRUD). In that application I have a JDialog that pops up when I select to edit a product.
My question is: ¿Is there a way, no matter how difficult to implement, in which I click an "Edit product" button on the webpage and the java application JDialog pops up to edit that product?
Thank you.
I'm no expert on the matter but take a look at custom protocol handlers.
Define a custom protocol myapp:\\ that you can use on your web page in hrefs like:
Open Product 1
Then on OS level you need to specify how this protocol should be handled. (In your case that will be to run your Java program with the correct arguments to open product1). The installation of your Java program should make the necessary changes to the OS in order to correctly handle this custom protocol.
Take a look at this site for more information.

Update client computer using web application

I am developing an e-commerce web application, and in that ads from other giants pop up. I figured out that this is done by PriceFountain, which is actually a spyware. I found the steps to remove that from my laptop. more found here.
but the problem is my clients can also have this adware. I want to programmatically do following or either of them, on the client side:: (and if it is not possible at least inform the user to do so)
If, PriceFountain is present, uninstall it from their system. If it is an add-on, remove that.
Activate the pop-up blocker (deactivation can be achieved through javascript and jquery). But I want to activate. My site does not need pop-ups.
Alter the registry of user for the contents of PriceFountain.
I know this is somewhat an unethical hack, but can this be achieved and if so, how?
More of that, it is just my curiosity can we affect client site settings.?
You used to be able to do that (with jscript/vbscript) in IE if and only if the user added your site to his trusted sites (and allowed pretty much everywhere there), or if it was the intranet-site with relaxed permissions.
Back in the old day's I had such a thing for the intranet-help-site where users could browse through the faq and click on the 'execute solution' button for the common 'problems' (previously solved and added to DB).
For rather obvious security-reasons this is no longer the case (although one can still pull some stuff in legacy IE environments).
The point is: you can't do this on other browsers then IE (unless maybe you'd develop separate plug-ins for them and ask your users to install something that will essentially give you access to their whole machine). Realize that effectively what you are asking for is a way to fully control the user's machine. Would you install such a browser (on your parents pc)?
The best course of action would be to face-up, inform your users on your main-website (enter-page) that something bad spread throughout an ad-network and guide them through the steps (that you already found) necessary to relieve them from their problem.
Even if what you asked was possible, you'd still need the user's cooperation somewhere along the way, even if you'd were to write an application for this that the users could download and run (administrative/elevated)..
Good Luck!
EDIT: for the registry you might try something with the answers in this question: read/write to Windows Registry using Java
Still, you'd still need the user's co-operation.

How to access an applet from the java code?

We are developing an application which accesses an API exposed over some embedded system. This API internally validates the user to provide the access to the embedded system. To validate the call, it opens a dialog box and asks for username and password. This dialog box is essentially a Java applet opened in applet viewer.
We want to automate this whole process by building small exe or by doing the same in tomcat server. To do the same, we need get the object of the dialog box and fill the credentials. How can we achieve this. There must be some way to automate the testing of applets which can be used to do the above task.
Thanks for helping. It will be great if someone can provide a code snippet or link for the same :)
Reason why I want to have this kind of system:
We need to build an application which gets the memory status of PLC device. This device is connected with heavy machines and has its own programming language via digital networks. To get the memory map, there are APIs exposed in java which communicates with assembly language. We use these APIs to get the memory status of various memory variables from PLC device. On the basis of the memory status we raise an alert by sending an email or SMS. When we try to access the memory area of this device for the very first time, it pops up an authorization dialog box which asks for username and password of PLC device.
Hence, to automate the memory monitoring system which can send the alerts, we have to fill the authorization dialog box through java program or some of the other way. When I access memory of PLC from java console program we need this authorization dialog to be filled by itself without any manual intervention.
So, How can we get an object of this dialog box?
I hope scenario is clear. We don't need any framework to build which can automate the applet UI. We just need for specific dialog box. Please help!!
You can do with with any number of Java GUI functional testing tools. Here's a good list, looks like FEST or Jemmy might be a good approach:
Automated tests for Java Swing GUIs
It looks like they all build on top of java.awt.Robot so you can look at that if you want to roll your own.
If this does not work you may have to go to a native GUI testing framework. Some good options are listed here for Windows:
https://stackoverflow.com/questions/120359/tools-for-automated-gui-testing-on-windows
http://sikuli.org/ pretty good.

Java applet to connect different users to a shared screen window

No, Im not asking for a full made program :) Im kind of new to Java as language so Im not familiar with java libraries at all and my experience is mostly about php, but I understand OOP well.
My scenario:
I want to build a Java applet to my website, by which different users can share a same screen window in which they can drag and drop things(images) to specific positions and when one does, it would update the screen to the others. Before connecting, user would choose to build a new screen or join other. If he wants to join other he would just enter some existing (random) screen id to connect to. If he wants to create a new one he would access this screen in which he would see the screen id to share with someone else. I dont care if two persons wants to drag and drop different item to same spot, it would then just use the one that came last.
Now that you understand what I want to build...
What I really just need is the skeleton structure of something like this. What parts I will need to build something like this? Libraries and such, where should I look for tutorials, Best practices, hierarchy, should I use tcp or udp? I just need something where to start from.
An applet is run in the system memory of each individual client. There are strict rules about what applets can and cannot do, and I am not sure whether or not applets would be allowed to make remote connections to other users. I would advice doing some google leg work on java applet security and seeing what you dig up.
Assuming this is possible:
In terms of architecture, I think you would want one person designated as the host create the game and run all the game logic, while the clients just receive information pertinent to graphics being displayed (location, size, texture, what have you) and sends back information about what the client is doing.
I did something like this as a school project in high school, but I was forced to sign the applet to make it do remote http connections. I would assume this is still the same case.
Hope that helps a little bit.

Screen scraping with Java and X3270

I have been trying to use Java to connect to X3270 (actually, wc3270, since I'm working on a windows environment) and control it to access a mainframe, login, navigate a few screens and get the data returned from x3270's command "ascii" for further processing (like separating the needed fields).
Even if I can connect to x3270 and login into the server, I'm having trouble to reliably retrieve the screens from x3270 after sending a command, even using threads to read the socket continuously.
Can anyone tell me what I should be doing to get things right?
I cannot more highly recommend Jagacy 3270, a Java screen scraping library that's incredibly reliable and dead easy to use. I had tried rolling my own, and also both IBM HATS and IBM Host on Demand, and found Jagacy to be easy, quick, lightweight, and already done for me.
A full license isn't cheap, but was worth it to us.

Categories

Resources