JSP/Perl page to get data from the client.

V

vermasanjay

Hi Folks,

I m fairly new to programming. The problem that I need to solve this
time is we have BEA Weblogic 8.1 installed on our server here and there
are client installations on about 20 workstations all running on UNIX.
Now, what I need to do is write a java/perl program/script to get the
data from a file from each of these workstations at every 2 minutes
interval and store those data in a temp folder on my server. Now, can
somebody help me find how do i go about programming this ? What
language do i use to do this ? And how will I read the data from the
clients PC ?

Any help will be much appreciated,

thanx in advance to all the repliers,

Sam.
 
B

ByteCoder

(e-mail address removed) wrote in
Hi Folks,

I m fairly new to programming. The problem that I need to solve this
time is we have BEA Weblogic 8.1 installed on our server here and
there are client installations on about 20 workstations all running on
UNIX. Now, what I need to do is write a java/perl program/script to
get the data from a file from each of these workstations at every 2
minutes interval and store those data in a temp folder on my server.
Now, can somebody help me find how do i go about programming this ?
What language do i use to do this ? And how will I read the data from
the clients PC ?

Any help will be much appreciated,

thanx in advance to all the repliers,

Sam.

A JSP page would not work, a normal Java application would. Depending on
the sensitivity of the data you would use normal or SSL sockets.

You say you want to have the server get the files from the client to the
server. It would be much easier to have the application on the client
send the file to the server application.

A good O'Reilly book on network programming I just bought is this:
"Java Network Programming", 3rd edition.
written by Elliotte Rusty Harold.
It does require a basic understanding of Java.

Good luck. :)
 
M

Malte

Hi Folks,

I m fairly new to programming. The problem that I need to solve this
time is we have BEA Weblogic 8.1 installed on our server here and there
are client installations on about 20 workstations all running on UNIX.
Now, what I need to do is write a java/perl program/script to get the
data from a file from each of these workstations at every 2 minutes
interval and store those data in a temp folder on my server. Now, can
somebody help me find how do i go about programming this ? What
language do i use to do this ? And how will I read the data from the
clients PC ?

Any help will be much appreciated,

thanx in advance to all the repliers,

Sam.

I'd just write a simple script to be set up to run as a cron job on each
client, then use either NFS or ftp to push it to the server.

Alas, this may be too simple, but wihout knowing exactly what '2
minutes' means (two minutes on the server, or just 30 times an hour from
each client)...
 
J

Juha Laiho

(e-mail address removed) said:
I m fairly new to programming. The problem that I need to solve this
time is we have BEA Weblogic 8.1 installed on our server here and there
are client installations on about 20 workstations all running on UNIX.
Now, what I need to do is write a java/perl program/script to get the
data from a file from each of these workstations at every 2 minutes
interval and store those data in a temp folder on my server. Now, can
somebody help me find how do i go about programming this ? What
language do i use to do this ? And how will I read the data from the
clients PC ?

Any help will be much appreciated,

Even if the help comes in form of questions?
I hope these questions help you to refine your problem.

- what do you mean by "client installation" -- what client?
- does it matter which end initiates the data transfer - so does it
have to be the server that initiates the data transfer, or is it
enough to trust the clients to push the data to the server at the
required intervals?
- what kind of acucracy do you need for the "every two minutes"?

If it's ok for the clients to push the data, and the timing accuracy
needs are not too strict, you might be able to just write (in a language
of your choice) a small program making an HTTP POST request from the
clients to the server, pushing the data and needed metadata in the
request. You'd also need a small application written on top of your
WebLogic server to process and store the received data according to
your needs. You'd time this with the regular Unix 'cron' subsystem.

Still pushing the data, but if the 'cron' accuracy is not enough (task
starts with cron may be few seconds off), you'd need to create your
own server application to run continuously on the clients, which then
would do the HTTP POSTs with better accuracy than achievable with
just 'cron'. In both cases, I recommend running 'ntp daemon' on the
client machines to synchronise their clocks with some common time
source (even just one of the client machines, or, if possible, with
the server machine).

Then to the worst situation; if you have a requirement that all data
transfers be initiated by the server. If this is the case, you'll need
to write some network-lisetening server application to be continuously
run on all of your client machines. Be careful with security issues,
if this is the case -- it's all too easy to create security problems
when writing network-listening programs. For this requirement (transfers
initiated by the server) there just is no other way: there has to be
something on the clients that co-operate with the data gathering program
running on the server. And yes, you'll have to write also the server
data gathering program from scratch in this case; the WebLogic software
will not help for building this. The timing options here are again
'cron' (with a one-shot/short-running server program), and a long-running
server program doing the timing internally.

Both of the languages you proposed have the necessary tools for building
all this functionality. Mostly the language choice depdends on the
development experience you have available to the project.
 
B

ByteCoder

(e-mail address removed) said:

Even if the help comes in form of questions?
I hope these questions help you to refine your problem.

- what do you mean by "client installation" -- what client?
- does it matter which end initiates the data transfer - so does it
have to be the server that initiates the data transfer, or is it
enough to trust the clients to push the data to the server at the
required intervals?
- what kind of acucracy do you need for the "every two minutes"?

If it's ok for the clients to push the data, and the timing accuracy
needs are not too strict, you might be able to just write (in a
language of your choice) a small program making an HTTP POST request
from the clients to the server, pushing the data and needed metadata
in the request. You'd also need a small application written on top of
your WebLogic server to process and store the received data according
to your needs. You'd time this with the regular Unix 'cron' subsystem.

Still pushing the data, but if the 'cron' accuracy is not enough (task
starts with cron may be few seconds off), you'd need to create your
own server application to run continuously on the clients, which then
would do the HTTP POSTs with better accuracy than achievable with
just 'cron'. In both cases, I recommend running 'ntp daemon' on the
client machines to synchronise their clocks with some common time
source (even just one of the client machines, or, if possible, with
the server machine).

Then to the worst situation; if you have a requirement that all data
transfers be initiated by the server. If this is the case, you'll need
to write some network-lisetening server application to be continuously
run on all of your client machines. Be careful with security issues,
if this is the case -- it's all too easy to create security problems
when writing network-listening programs. For this requirement
(transfers initiated by the server) there just is no other way: there
has to be something on the clients that co-operate with the data
gathering program running on the server. And yes, you'll have to write
also the server data gathering program from scratch in this case; the
WebLogic software will not help for building this. The timing options
here are again 'cron' (with a one-shot/short-running server program),
and a long-running server program doing the timing internally.

Both of the languages you proposed have the necessary tools for
building all this functionality. Mostly the language choice depdends
on the development experience you have available to the project.

Hey thanks! That was helpful to me too. :)
 
S

Sam

Thanx for the time.
Ok i explain more about it.
It's that the BEA Weblogic client is installed on all the machines. And
there is a POS terminal attached to each of those unix machines. Now,
whenever there is a new transaction there is a file created on each
client machine that keeps a record of those transactions. What I need
to do is every few seconds/minutes a program should run to see if there
is any new data in that file and if there is then send that data to the
server so that we have access to real time data with about 15-20
minutes of delay. Now, one more issue is that at present there is only
20 machines like that but v. soon this is going to be about 200-220
mahines as we are thinking of connecting all the nationwide computers
together. So lets take the big scenario. If there are so many machines
then if i do the application to run on the client then all these
machines will be sending data together and would jam the server. Also,
it would be good to have just one application on the server doing the
job of getting data from each such machine and record it in the the log
file or database. I hope I have made the picture more clear now. Any
suggestions.....
 
B

ByteCoder

Thanx for the time.
Ok i explain more about it.
It's that the BEA Weblogic client is installed on all the machines. And
there is a POS terminal attached to each of those unix machines. Now,
whenever there is a new transaction there is a file created on each
client machine that keeps a record of those transactions. What I need
to do is every few seconds/minutes a program should run to see if there
is any new data in that file and if there is then send that data to the
server so that we have access to real time data with about 15-20
minutes of delay. Now, one more issue is that at present there is only
20 machines like that but v. soon this is going to be about 200-220
mahines as we are thinking of connecting all the nationwide computers
together. So lets take the big scenario. If there are so many machines
then if i do the application to run on the client then all these
machines will be sending data together and would jam the server. Also,
it would be good to have just one application on the server doing the
job of getting data from each such machine and record it in the the log
file or database. I hope I have made the picture more clear now. Any
suggestions.....

Yes, you have made yourself clear, but I (and others probably) still
think it is much more secure to let the client send the data to the
server.

Oh, and 220 computers wouldn't jam the server. You could investigate
Non-Blocking I/O. It's also discussed (with examples) in the O'Reilly
book I advised.
Another option would be Thread-Pooling. IMO that is easier to program
that Non-BLocking I/O, but it uses more resources at the server-side.
 
S

Sam

Ok Thanx, I will see the book and find out a way to go about this.
Appreciate your help and time.
 
S

Sam

Ok Thanx, I will see the book and find out a way to go about this.
Apprecite your help and time.
 
S

Sam

Ok Thanx, I will see the book and find out a way to go about this.
Appreciate your help and time.
 
S

Sam

does anybody have any codes to achieve the above. I just need a start
on this. If anybody has done it before and can help me design by
sharing their code ?

Appreciate everybodys help,

Thanx,
 
B

ByteCoder

does anybody have any codes to achieve the above. I just need a start
on this. If anybody has done it before and can help me design by
sharing their code ?

Appreciate everybodys help,

Thanx,

Read a lot and try. 'Classic' client/server programming isn't that hard
to learn once you get the principles.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top