Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2005

Tip: Looking for answers? Try searching our database.

JSP/Perl page to get data from the client.

Thread view: 
vermasanjay@gmail.com - 16 May 2005 17:25 GMT
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.
ByteCoder - 16 May 2005 17:49 GMT
> Hi Folks,
>
[quoted text clipped - 13 lines]
>
> 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. :)

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat

Malte - 16 May 2005 18:10 GMT
> Hi Folks,
>
[quoted text clipped - 13 lines]
>
> 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)...
Juha Laiho - 16 May 2005 18:17 GMT
vermasanjay@gmail.com 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
[quoted text clipped - 7 lines]
>
>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.
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)

ByteCoder - 16 May 2005 18:33 GMT
> vermasanjay@gmail.com said:
>>I m fairly new to programming. The problem that I need to solve this
[quoted text clipped - 53 lines]
> 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. :)

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat

Sam - 16 May 2005 19:57 GMT
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.....
ByteCoder - 16 May 2005 20:21 GMT
"Sam" <vermasanjay@gmail.com> wrote in news:1116269865.561688.79920
@g14g2000cwa.googlegroups.com:

> Thanx for the time.
> Ok i explain more about it.
[quoted text clipped - 15 lines]
> 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.

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat

Sam - 16 May 2005 21:25 GMT
Ok Thanx, I will see the book and find out a way to go about this.
Appreciate your help and time.
Sam - 16 May 2005 21:25 GMT
Ok Thanx, I will see the book and find out a way to go about this.
Apprecite your help and time.
Sam - 16 May 2005 21:25 GMT
Ok Thanx, I will see the book and find out a way to go about this.
Appreciate your help and time.
Sam - 17 May 2005 18:48 GMT
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,
ByteCoder - 18 May 2005 20:03 GMT
"Sam" <vermasanjay@gmail.com> wrote in news:1116352100.244271.60140
@g44g2000cwa.googlegroups.com:

> 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
[quoted text clipped - 3 lines]
>
> Thanx,

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

Signature

-------------
- ByteCoder -           ...I see stupid people
-------------
                  Curiosity *Skilled* the cat



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.