Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Listener

 
Alan So
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I need some help. I am writing a program to listen an alert from a server after that the alert will be do something.

May I know how can I start to do it or is there an example on alert listener for server?

Because I google and all I find is regards to event listener.

So any kind soul can help me out. Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15203
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

You first have to find out how exactly the server sends the alert.
 
Alan So
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper de Jong wrote:Welcome to the Ranch.

You first have to find out how exactly the server sends the alert.


Thanks.

The alerts are send by the APIs according to what I have been told. And listen to a TCP/IP port example 0080. the server will send a XML data which is the alert.

So I not sure how can I start or integrate it.

I understand that the ClientListener should be a jar file which is a class file i suppose, so that I can create a new instance. And this clientlistener file it should be provided, am I right?

And this is what I have from them..



Please advice and help again. Thanks.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15203
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, you have a special API to receive those alerts? It's not part of standard Java, so I don't know that API. Ask the people who gave you the API for documentation.
 
Campbell Ritchie
Sheriff
Posts: 48363
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for "beginning". Moving discussion.
 
Alan So
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I have requested for the API.

But in the mean time, should I do the codes for listening to the port and event/alert listener too not wasting time on waiting.

So is there any direction that I can look into it because I have google quite a lot but I cant find an alert listener example to listen to a tcp/ip port.

Please advice thanks.
 
Alan So
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The coding is done in java just that I need some help on how can I add an alert listener to a tcp/ip port.

I have try finding but all exampls mention only on listening to tcp/ip port.

Or am I in the wrong direction?? or the alert listener should done on the server side instead?

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15203
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need to use the API that you get from someone, then you'll need the documentation etc. and do it as is described there. It doesn't help much to try to build something that listens to a TCP/IP port, not really knowing what you are doing or if this is going to work with the specific server that you're using.

It's like you're going to build a house, but you don't have a plan yet and you want to start building immediately while not knowing at all what the house should look like.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic