Solved

Show popup to specific Windows account

Posted on 2008-10-23
9
377 Views
Last Modified: 2013-12-05
Hello all,

I have developed a Java server-application... it is always listening to a port and when another application hits that port, my application prompts a JFrame (popup).

The problem we are having now is with Windows 2003 Terminal Server. If I start running my Java-server application using Administrator (Windows account) my Java-server application will always show the popup to Administrator user. If I use other Windows account (e.g. student) while my application is still running under Administrator Windows account, the popup window stills displaying at the Administrator user account.

I need the popup on the correct Windows account. The Java-server application (which shows the popup) knows which Windows user needs to receive the popup. But if it is running under Administrator, it will always display it to Administrator account and not to the one that needs to receive the popup.

I have tried running my Java-server application under SYSTEM account and still does not work.

How can I display that popup to that specific Windows account ?

Thank you very much.
0
Comment
Question by:cdtcol
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22827431
How are you getting which user is logged in currently?

System.getProperty("user.name");

Should get you value of the windows logon, but maybe this is what you are using already.
0
 

Author Comment

by:cdtcol
ID: 22831488
Thank you mwvisa1 for your interest.

My Java-server application waits in a port. Another application hits that port (at any time) and that second application is the one that send me the information about which Windows account I must show the popup. My Java-server application receives that info and shows the popup.

The problem is that the popup is shown where the Java-server application was first executed.. not the desired Windows account.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22832893
So the problem is (paraphrasing to ensure my understanding):

SourceApp --> tcpip/socket connection --> ServerApp --> tcpip/socket connection --> Client (ClientApp)

What you are getting is that the response is being sent on the originating tcpip connection when what you need to do is start a whole new tcpip/socket connection to send a message to Client (not sure you are using socket connections here -- just using as reference of where the flow of communication is).

The problem there is the server app must know how to connect to this new connection.  Since it is sounds like it is the same machine, you could try to use a mechanism like windows sendmsg to user name you get from source application.  You could execute something like that through Runtime.exec.

Am I close to what you are looking for?  I am not sure myself how I would implement that, but maybe the confirmation of this will help another expert happening by thing of something.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22832909
* thing of something
Should be " to think of something".
0
 

Author Comment

by:cdtcol
ID: 22833524
Thank you again mwvisa1.

App1 --> socket --> Server App

Server App receives data from App1 and shows a popup.

The sendmsg to a user could be, but I my Server App displays more than a message.. it is a custom popup.. it shows some info and asks for more information from user and sends an OK or a Cancel.

Is there a way, using Java, to display that popup to a desired Windows Account ?

If not, I will have to keep my Server App and probably develop some Client App that must be executed by each Windows Account in order to keep that socket open and my Server App will hit the one it needs to display the popup.
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22835630
If you have a client app, my original code may work but not sure in this scenario.  The idea was you have a value coming to server app that says user "BobSmith".

If code, you can do this:

String messageUser = "BobSmith";
String currentUser = System.getProperty("user.name");

if (currentUser.equalsIgnoreCase(messageUser) {
    JOptionPane.showMessageDialog(null, "My custom message");
}
0
 

Author Comment

by:cdtcol
ID: 22844699

System.getProperty("user.name") is always returning "Administrator", which is the user that runs my Java-server application.

Thank you very much for your help... I have decided developing a Client app and will take in count your last code.

Thank you.

0
 

Author Closing Comment

by:cdtcol
ID: 31509326
Thank you very much for your help... I have decided developing a Client app and will take in count your last code. I am really sure it will work.

Thank you.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 22845289
Ah, good luck with the client.
0

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Learn about cloud computing and its benefits for small business owners.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question