• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Is this program concept even possible with java?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Right guys n girls, bear in mind that I am only just starting to learn java, I've got as far as "Hello World!"

I am wondering if this concept I have come up with is even possible with java or whether I'd be better off looking into another language to complete this project.

I know there's a whole lot to read, but I started off wanting to make a really simple shutdown timer.

This idea quickly evolved into something that I could spend years learning how to do, but I've got lots and lots of time to sit here and plod my way through the
Java programming books and then sit and create the code.

All I want to know is whether this concept is even possible with java???
sorry for this, this is how I've tried to explain the concept to myself so that I dont miss anything out once I start to work out the code.....


System Event Timer / Shutdown Timer Program, What I need the code to be able to do:

I want to create a program that does the following:-

1) I need to let the user choose whether he wants the specified action or actions to be executed at a specific time or after a certain amount of time, so either after x hrs y mins and z seconds or at a specific time which will be read from the system clock. So either a countdown timer or specified system time.

2)I need to let the user input either the system time at which the action is to be carried out or the number of hours minutes an seconds after which the actions are to carried out.

3) depending up which option has been chosen either countdown and execute the specified action or actions, or code needs to keep checking the system time until it matches the user inputted time and then execute the specified actions.

4) I need to have a list of actions which can be carried out by the program (macro's) without the user having to program a macro, so default macro's if you like and the user needs to be able to add his own actions or define macros to be executed. I want the actions that will be executed to be linux shell commands, that way almost any system action is possible. Shutdown, log off user, launch a program etc.

5)I need to have a GUI where the user can select the timing method to be used, countdown or specific system time, where they can view default macros and select one of them to be executed or where the user can program a macro to be executed. These macros will need to be able to be saved into a database of macro's and the database must be able to be exported and imported if need be (maybe a CSV file, XML Or simillar??), so that one systems operator can program a list of macro shell commands and another can import that database to use on their system.

6) it would be really nice if this program could be remotely administrated, either by sending a CSV file to an email address which would probably be the most secure, or by a remote over a WAN or LAN connection. A dedicated email address would probably be the most secure as it removes any threat of remote intrusion, however I am unsure that this will be possible due to the program needing to be able to receive a config file so basically download an email attachment, CSV file or XML or simillar, maybe I could set up a secure website which users would be able to upload their config files to and then the program would have an option to check for updated config files from a specific server? If this option was used then the config files would have to be encrypted in some way using an encryption key that only the specific systems admin knows and is kind of like a WPA/WEP key?? This option would also remove any security issues with remote hijacking of a machine.
 
Marshal
Posts: 28296
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Adam, welcome to the Ranch!

I moved your post out of the Swing/SWT forum because it isn't about writing a GUI. Not yet, anyway. It's more about how to do things in general.

Anyway, about the question. Most of what you described is doable, as far as I can see. I don't know what you want these macros to do, though, so it's really hard to say. I'm pretty sure that Windows, for example, has security built into it so that you can't shut down the system unless you're logged in as an administrator. What I would suggest is this: You've got a long list of requirements, but don't start out trying to implement them all at once. Pick one (e.g. having trivial things happen based on a schedule) and start with that. Once you've got that running, start working in another one of the requirements.

As for security, I'd think that allowing anybody in the world to send commands to a specific e-mail address would be the least secure possible method. If you want remote administration, I would go with your other suggestion and run an HTTP server which accepted commands in a secure way. But that's one of the later requirements which you should be working on.
 
Adam Cartwright
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Macro's will contain Linux Shell commands, this will enable more or less any system action to be scheduled.

I realise that I need to approach this project in manageable chunks and this is why the requirements of what I want the program
to do are in the order they are. I might only be at the "Hello World" stage of learning java, but I have had many many
years of programming in BASIC when I wan about 5 years old, kinda between 5 & 7 years old really, so I do understand the nuances
of writing code and getting it to do what I actually want it to do.
Admittedly that was over 25 years ago now but I still remember the fundamentals.

So you think that this is all possible with Java then.

That's all I really needed to know.
Thanks for the advice though I do appreciate everything you've said, especially the e-mail being completely unsecure
I hadn't thought that absolutely anyone could send mail I was simply thinking that nobody buy the sys op would know the email address
but evidently it wouldn't be very difficult for someone to find out and be able to complete screw up the machine my system event timer was running on.
They'd be able to wipe the entire system if they wanted to and that is something which I hadn't thought of.

The idea is still in its infancy, I just wrote all that down as a progression to the idea of a shutdown timer, which is what i actually wanted to create.
So after just ten minutes of conception I'd cum up the program idea above.

Thanks for the input and if anuyone has any tips or hints on how to be able to do certain aspects of this program then please please let me know.

I'm now onto lessons 2 & 3 in my book, but I can see that this will take me some time.

Does anyone know anything about the Python language?
Is it difficult to learn?

Thanks guys

Adam Cartwright

A TOTAL NOOB WITH JAVA!!!
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Adam Cartwright wrote:The Macro's will contain Linux Shell commands, this will enable more or less any system action to be scheduled.


The main thing I'd worry about is that you're re-inventing the wheel.

Linux already contains part of what you want through its cron system, which is exceedingly simple to use and administer; so the only thing I see your system adding is the ability to schedule actions in n hours/minutes/seconds "from now" (which, by definition, aren't likely to need much administration anyway; and in Linux, there's the at command for that too).

There are also already several Java-based schedulers around (and also some native Java classes), so personally, I'd look around for one that fits my needs before I started spending a lot of time rolling my own.

HIH

Winston
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic