Connecting to windows server from PCF - java

I came across a very different requirement today where the Application running in PCF has to connect to Windows-Server and execute some business logics.
Currently the teams are achieving it using VB-Script. The command looks something like this
Dim computerToConnect As New System.DirectoryServices.DirectoryEntry("WinNT://" + Server + ",computer")
The same functionality the teams are trying to achieve through a spring-boot app running in PCF Linux stack.
Is there a way to achieve this in Java ?

Answering your question:
Yes, it is possible to connect into Windows Server from Spring Boot.
You can start from:
Investigate better what you really need to do inside the Windows Server, to understand how you can translate it in Java/Spring code;
Investigate what kind of authentication your company use in the Windows Server;
For example, if your company use LDAP/OpenLDAP, you need to learn how to connect from Spring Boot app into Windows Server using this kind of authentication;
Configure your Spring Boot app with the credentials to handle the authentication;
After authenticate, consume the resources you want, similar to VB-Script.

Related

How to host Spring Boot Application on Web Hosting Server

I know this question might sound stupid but for me it's new. I have developed a simple Spring Boot Application, provide some backend APIs, running on localhost. I have also bought an webhosting server with my own domain, let's say: www.my-domain.com. Right now in the my-domain.com I just have some simple html code. And what I want to do is having the spring boot application running also under this domain.
Is it possible then? If yes can anyone point me to some references please?. If no, what do I need to run an Java Application under my own domain?
Thank you very much!
You need to run the Spring boot application on the server, then you need to configure your web server (nginx/apache), configure Spring API path and port on the web server, and the traffic will go into your application.

Configuring Java Client for Hazelcast

I am trying to configure a JAVA client for Hazelcast. I have a web application deployed on tomcat servers. The example that I am following is this
Basic Clients Hazelcast. I have copied the code into my local machine and when I simply run it without running anything else and without the addAddress() step I get a java.net.ConnectionException. My doubts are:
1) What is the client in this case (I am assuming it is the web application that probably means I have to get the Hazelcast server up and running then what is to be done)?
2) How do I establish a link between the web app, the tomcat server and hazelcast cluster? The web app uses MongoDB as the backend. I was able to do a only MongoDB with Hazelcast integration but not the web app on tomcat server integration. What role does tomcat play here in this setup?
3) In the example what are the start.sh and stop.sh supposed to do? Where should I run them? If I simply open the git bash and run it. It doesn't seem to work.
I have looked at the documentation provided in the Hazelcast manual but I wasn't able to understand it as my current level of knowledge is woefully inadequate. If somebody could explain it to me or paste the links to some of the obvious stuff that I should know it would be great.
The answers are inline:
What is the client in this case(I am assuming it is the web
application that probably means I have to get the Hazelcast server up
and running then what is to be done)
The web application can be a Hazelcast client if you would like to use Hazelcast in client-server topology.
How do I establish a link between the web app, the tomcat server and
hazelcast cluster. The web app uses MongoDB as the backend. I was able
to do a only MongoDB with Hazelcast integration but not the web app on
tomcat server integration. What role does tomcat play here in this
setup.
Your web app runs in Tomcat server (web container) and the Hazelcast client you use in your web app can directly connect to the Hazelcast cluster members (server). You will just need to configure your client properly such as adding cluster member address by using clientConfig.getNetworkConfig().addAddress() API. Please see for more details about configuring client in this link: http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#configuring-java-client
In the example what are the start.sh and stop.sh supposed to do.
Where should I run them. If I simply open the git bash and run it. It
doesnt seem to work.
Those are sample start scripts for the sample client and member application. You don't need to use them in your application.
Please see the following guides for using Hazelcast in client-server topology:
https://hazelcast.org/getting-started-with-hazelcast/
http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#getting-started-with-java-client

XMPP - Spring Integration: Does the spring application run an embedded XMPP server

I'm trying to integrate instant messaging in my application that is based on the usual Spring-Maven stack. Two possibilities that I've come across are to either use raw Smack (igniterealtime.org) or go for the spring-integration support for XMPP (which is also based on Smack). My question is; "Is it required to run an XMPP server like openfire alongside or is there a possibility of the XMPP server running embedded within my application running on tomcat?". What would be an efficient scheme for the scenario? Thanks
The Smack (and therefore Spring Integration XMPP) is just an API (Client) for that protocol and what you need to know and configure is XmppConnection and particular host/port to connect.
To right an application based on those component you don't need to run an XMPP server.
For example we tested Spring Integration against regular Google Chat.
So, yes: Spring Integration doesn't run Embedded Server and even doesn't require an external to be run for you locally.

Java Desktop Application Client-Server all in one

I'm thinking about what might be the best solution to create a standalone client-server application in java with these features:
Server: it must provide APIs (probably rest?)
Client: javafx webview with angularjs to make requests to webserver.
Loader; it starts the server and the client;
The user can then manage the application directly from the webview or from the browser (to the server port)
This would also be able to create in the future a "cloud" version of the application, the client instead to query the localhost will perform to a remote server.
A solution of this type is correct?
What might be useful tools for its realization and how could it be structured?
I would like in particular a solution which does not require the use of a large Java Application Server, but something more simple that it can be included as a library.
I thought same architecture which you think because it's easy. localhost binding, angularjs, bootstrap in java Webview. one of solutions is Spring MVC Rest API with embedded tomcat. it may be not lightweight.

how to setup web service server with MySql for java developer

Hello Folks I am new to webservice I googled a lot I couldn't come to conclusion so I am seeking help here.
I am developing simple Android app for education purpose I know Java programming.
Please any one give me the steps to adopt in development to consume API signature from the webservice backend. If possible Local setup steps. I am using FrontEnd: Android widgets with http. I need backend setup information JAVA restful + MySql + Application server ?
Advance thanks
I personally run a server from home on a Raspberry Pi for my pet projects. It uses a LAMP setup, which stands for Linux+Apache+MySQL+PHP. Linux is the OS it runs on, Apache is the main webserver, and PHP is for dynamic webpage creation. I would recommend using something similar; packages like WAMP (replacing Linux with Windows) bundle all four of these services together for easy installation and setup. I believe there are also a number of free MySQL server hosts which you could use, if you don't want to deal with port-fowarding/handling traffic.

Categories

Resources