Reading MSMQ messages with Java Library on Unix machine? - java

I am looking for a java library that can handle MSMQ incoming messages on a Unix machine.
When searching the web for a solution a found almost nothing, and the few I did found are accessing MSMQ on windows OS.
In my case, my application is running on Unix and I want to transfer MSMQ messages directly to it from a Windows machine.
I guess I need some kind of a bride/listener/receiver for that.
The closest thing I could find was a service that offers a full solution and not a development tool.
Is there something out there that I missed which will serve my purpose?
what is the effort of writing it on my own? Is this even doable?

Related

Setting up server for android app

I have developed an android application and i need to set a server for sending and receiving data from clients. The server must also be able to run python script for data mining.I want to code the server in java(for analysing the data obtained from mining and handling the client requests).
what will be the way to set the server for my purpose. I have read that servers can be set up in eclipse or installing apache in linux in a virtual machine. will anyone of them fit my need or is there any other better alternative.
Well, it depends on your needs. If you want to run Python scripts from Java, I don't really see why you would code your server-side logic in Java and then use Python data-mining scripts (you might have some problems with execution of Python scripts through Java and server setup). I know that Python is much better in data-mining, so stick with it. Consider Python for server-side logic. In case you want to run data-mining script manually that doesn't really mater, so you can separate the languages.
In case you want to separate it into two languages, then you must install an application server for Java. There are plenty of options for that, even open-sourced (Wildfly, Glassfish, ...):
https://blog.idrsolutions.com/2015/04/top-10-open-source-java-and-javaee-application-servers/
You can set most of them in Eclipse for development, for production releases they can be installed either on Unix or Windows. The Apache option you mentioned is probably Apache Tomcat application server. You can read more about Java application server set-up in Eclipse:
http://www.eclipse.org/webtools/community/education/web/t320/Configuring_an_Application_Server_in_Eclipse.pdf
Depending upon the requirement, you can setup the server in many ways in any operating system like linux (fedora, ubuntu), windows, mac osx etc. There are many java web frameworks to follow to make your own server and provide API for mobile.
These are some java web frameworks:
playframework
Spring MVC
Grails
You can setup above and other frameworks and can setup in any enviorment. For initial, you can setup in your local system, then later you can upload into your remote server.
For setup, please see the respective framework's documentation.
It would be wise to choose json for communication between mobile and server. You can consume the API in android using default HttpURLConnection or you can follow other opensource http connection library like retrofit, asynchttp etc.

Windows Impersonation Java from *nix

I want to replace a legacy application running on Windows server by rewriting it in Java. This application is now connecting to a bunch of Windows servers (which are unavailable for installing another services and it is impossible to change them) via Windows Impersonation API.
I have come up with two libraries JNA and Waffle. To my understanding, Waffle uses JNA, and JNA provides calls to Windows API from java code.
The thing is, I will have my java application running on a redhat server which obviously does not have win32 api. Is there a *nix binding for Impersonation API? At least I may consider writing JNI over that binding.
I think there should be a way, because Mono and Wine provide similar abstractions on different platforms.
Have you checking on Mono or Wine to see it is supports impersonation? I don't believe it supports.
I think remote impersonation is encapsulated a lot of technologies, and some of it maybe undocumented. It might be very hard task to writing the client application to support server impersonation without using Windows API. The best way should be continue running on Windows. But if you really want to move the system to run on *nix, the best way should be create a proxy between *nix and Windows. Then later you can completely running on *nix when you don't need the services that running on Windows.

Java remote interactions

I'm in internship, and my mission is to build a deployment program in Java. My approach was based on a "tasks to do for a deployment" model with dynamic instanciation (but this is not the point). Every task does something locally or on the remote server (sometimes both). For example, I have a Copy task which copies a local file to the remote server. Got some tasks like this for basic interactions (Move, Delete, ...).
The point is, each deployment module is a server which has different parameters (OS, connection params, ...) and basic programs. One of them is a Linux server, so I figured I could use SSH (with JSCh) to do the job. But the other is a Windows machine, with no SSH whatsoever. I searched everywhere for several days to find what could be used, with no results.
So here is my question:
what Java API should I use to get the job done?
Is it possible with Telnet or FTP?
Is it possible at all without ssh ?
Little detail: I don't have any control on remote servers, I can't install new protocols or programs, nor have a RMI server launched on them.
Thanks for your answers.
There are a few options to interact with a remote Windows server. If your local Java application is running on Windows (that is, both your source and target server are running Windows), you can spawn a new process and execute PowerShell commands - see this link for an example.
There are ways to copy and delete files on a remote server using PowerShell. Since you didn't fully specify your requirements, I don't know if that covers all your use cases or not.
If your application does not run on Windows, you'll have to resort to a pure Java solution like j-Interop to connect to the remote system using DCOM / WMI. See this page for a good introduction to WMI and j-Interop. Word of warning though - getting DCOM to work requires some configuration changes, specifically changing permissions on registry keys, on modern versions of Windows (Windows 7 and up).

Call COM port from webpage

I'm looking for a way to call a COM port from a webpage.
I was thinking abut running a Java WebStart (or Flash?) program that opens a local web server that allows to interact with the COM port using JSONP.
Are there any show stopping security restrictions on the way that I don't know of? This should be possible:
use native libraries (Java COM bridge) from Java WS application
open a local port
access local port from javascript, likely using <script> tags
do all this without scaring users with "This website is trying to do something really nasty, get off as fast as you can" kind of messages :)
I've used a Java COM bridge before, so this shouldn't be the problem - at least as soon as I'm able to run native code.
So how would my JNLP file have to look like to get this working? Any alternatives to Java WS? Better install it as a daemon?
Impossible. This violates all sorts of very basic security principles, especially the part about do all this without scaring users with "This website is trying to do something really nasty, get off as fast as you can" kind of messages
This is EXACTLY what those messages are intended to prevent.
This article answers the first part of my question, the WS to COM approach that is: Juggling with DLLs, WebStart and Maven
Accessing an HTTP server on a local port should also be feasible as that's what Playdar does for instance.
What are you trying to achieve?
You need a standalone software that does the job. The user will have to install it. Like the security pathches.

How to get the details using telnet API

Is it possible to get the following information via Telnet?
Software version
config files
config register
information on traffic and errors
If you have sample code that you could share that would be really useful so that I can procceed further with your help .
I will be thankful for your valuable replies.
Telnet is nothing more than a communication protocol to generally a shell interface on another Unix machine. The remote telnet daemon will most likely invoke authentication and shell processes so everything that you are requesting is yes, possible though you will thus require authentication.
As you know telnet for shell is primarily used internally inside secured networks and rarely on the 'net any longer.
Telnet is wrong protocol to do this kind of stuff. It is an (out-dated) protocol for interactive terminal sessions. You should be looking at "ssh" to execute commands on the remote machines, and then figuring out which commands you need to execute to extract the information of interest to you.
Some of the information you are after may also (in theory) be available using SNMP, but things like configuration files and application versions won't. The "ssh" approach will allow you to harvest any information that is available via commands run from the command line.
Injecting Java into the mix is almost certainly a bad idea. Java is best at tasks that are platform independent, but what you are trying to do is inherently platform specific.

Categories

Resources