aspose file tools*
The moose likes Java in General and the fly likes A Software for Internet Cafe Management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "A Software for Internet Cafe Management" Watch "A Software for Internet Cafe Management" New topic
Author

A Software for Internet Cafe Management

Maximus Moothiringus
Ranch Hand

Joined: Jun 07, 2008
Posts: 46

Hey,


My friend is running a cafe and he asked me to help him out with a very simple cafe management software. I thought I will do it in Java.

I had a small idea on how to do it. But I don't know how to do it. I have basic knowledge of Java - and am ready to learn more. Have tried out some GUI programming in NetBeans also.

Here's what I thought I will do.

Server - A java program will be used for monitoring and billing. Will monitor the usage based on the client login and logout time. All of these saved in database and accessed and shown into the server program as and when needed.

Client - The client will be given an operating system with limited access. In the client, when the browser opens, the login for the system will appear. Maybe a JSP based web system.

Questions I had:

1. Is it possible using Java to make sure that no other URLs can be accessed. If typed in, the page should be redirected to the JSP system, stored in the server of the local network?
2. Is it possible to create a Java program which can calculate the amount of download done, say in KB or MB?

If you need more information on anything, I am ready to provide.

Max


-edit - I hope this is the right forum to ask this question. Because this is not featured in any of the very basic Java that I have studied. So in my notion, this is intermediate Java, right?


-- Maximus Moothiringus
Preparing for SCJA!!
Finally figured out that giving <br/> splits the profile biography but not the signature
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
Years ago I have the chance to work on the same type of project. The client/server communication part is simple (I mean doable).

The security and networking track part is not so simple if you do that on client side.
Problems:
- specific to almost each type of OS
- harder on Java, proper for that would be C/C++

Even if you track the traffic on server, you have to integrate a specific tool with your software (depend also on the type of OS).


http://javasign.blogspot.com/
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2596
    
    9

Maheswaran Moothiringode wrote:Questions I had:

1. Is it possible using Java to make sure that no other URLs can be accessed. If typed in, the page should be redirected to the JSP system, stored in the server of the local network?
2. Is it possible to create a Java program which can calculate the amount of download done, say in KB or MB?


Cafe Management Software, I like the idea. If I understand you correctly for Q1 you should able to do that with servlet filtering. And for Q2 sure just need read the directory and its file content.

However, before you get too excited and diving it, this system of yours can be complex and can be very simple. Since you plan to be web-based and database access, your OO design and architecture should be clear. Some questions for you to ponder:
- how data interact with database? use ejb/jpa or servlet/jdbc?
- what features or functions (eg login/logout) are there? list them out
- you mention server, would there be other server other than the database? Or you were thinking of server as in client/server apps?

Anyway doing the planning and design up front is key in systems like yours. Do post your questions in the appropriate forums when you do get to Servlets, JSP or EJB etc. Good luck.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5 OCPBCD5
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18993
    
  40

Also, this sounds like a buy versus build scenario. Isn't it easier (and maybe even cheaper considering labor and time) to buy it?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

I agree with Henry -- probably easy enough to buy a system.

But sometimes it's fun and educational to build something yourself, and if that's what is motivating you, that's OK with me.

Anyhow, I think the key is to do EVERYTHING on the server. Don't try to have any Java code running on the client. Java is a terrible language for making changes to Windows system settings.

Set the PCs up so the browser uses your "cafe server" as a proxy server. Lock down the browser preferences, and use a firewall for the whole cafe, so there's no way for the machines to get to the Internet except through your proxy server. Set the browser home page to be the login screen.

Then the problem reduces to controlling what the proxy server allows based on the client IP address. When the client is not logged in, they can only get to locally-hosted pages -- i.e., the login page. Once they've logged in/paid/whatever, then the proxy server lets them through. When their time's up, it stops letting them through.


[Jess in Action][AskingGoodQuestions]
Maximus Moothiringus
Ranch Hand

Joined: Jun 07, 2008
Posts: 46

K. Tsang wrote:Some questions for you to ponder:
- how data interact with database? use ejb/jpa or servlet/jdbc?


I am comfortable with servlet jdbc as of now because i have worked on it before. I have not worked with ejb much other than maybe reading of it somewhere. So If i am making a web application, it will be using only servlet jdbc.

K. Tsang wrote:Some questions for you to ponder:
- what features or functions (eg login/logout) are there? list them out


Server:
-Admin Login - doable.
-Prepaid Ticket Sale - Ticket gives amount of time to which a particular client can browse, after which the login page is shown with 'no balance' notice. doable - database changes only needed.
-Billing and printing - doable - calculations from database and printing.
- Need to show the bandwidth used by the user - ???

Client
- Login
- Before login, other pages should be redirected to the index page.
- After alloted time, logout - doable if the above is doable, just one extra database access needed.


K. Tsang wrote:Some questions for you to ponder:
- you mention server, would there be other server other than the database? Or you were thinking of server as in client/server apps?


One server, which has the application that manages the clients and the users and the billing. This computer will also have the database and all the things.

All other computers will be clients - I expect this will not go beyond a maximum of 15. But I intend to build a scalable one.

Well, the basic requirement was that he wanted to make a low cost cafe. Its quite a village area. He didn't want to buy any software. He saw me sitting idling waiting for a company to call. He suggested that I make him a software which he can use. Thats how all this cam to be. :-)

Thanks for all the interest in the subject.

The last one seems to be a good option for me.

This means, if I am right, all the clients can be managed through the static IPs which I can use to do things. Adding a new client computer to the system becomes a simpler thing, right?

Can I still find out the transfers made if i know the static IP address of the client??

Max
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Maheswaran Moothiringode wrote:

Can I still find out the transfers made if i know the static IP address of the client??


Yes. You want all requests to go directly through your server, which acts as a proxy server. Do you know what that is?
Maximus Moothiringus
Ranch Hand

Joined: Jun 07, 2008
Posts: 46

I think I do. I had my share of networking classes - so I can do the thing.

Just in case I am wrong, you do it by giving the server's IP as the DNS address, isn't it.

Anyway. My utmost thanks to all of you for clearing all my doubts. Will get back if there are more problems. Let me start the design of the system now.

Max
 
 
subject: A Software for Internet Cafe Management