Class Juno

java.lang.Object
  extended byJuno
All Implemented Interfaces:
Serializable

public class Juno
extends Object
implements Serializable

Juno (Juno's Unix NOt) mimics a command line operating system such as Unix.

A Juno system has a name, a set of Users, a JFile system, a login process and a set of shell commands.

Version:
10
See Also:
User, JFile, ShellCommand, Serialized Form

Constructor Summary
Juno(String hostName, boolean echoInput, boolean isGUI, boolean isRemote)
          Construct a Juno (operating system) object.
 
Method Summary
 User createUser(String userName, Directory home, String password, String realName)
          Create a new User.
 ShellCommandTable getCommandTable()
          The shell command table for this system.
 String getHostName()
          The name of the host computer on which this system is running.
 String getOS()
          The name of this operating system.
 Directory getUserHomes()
          The directory containing all user homes for this system.
 String getVersion()
          The version number for this system.
 User lookupUser(String username)
          Look up a user by user name.
static void main(String[] args)
          The Juno system may be given the following command line arguments: -e: Echo all input (useful for testing).
 void setFileName(String fileName)
          Set the name of file in which system state is kept.
 void shutDown()
          Shut down this Juno system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Juno

public Juno(String hostName,
            boolean echoInput,
            boolean isGUI,
            boolean isRemote)
Construct a Juno (operating system) object.

Parameters:
hostName - the name of the host on which it's running.
echoInput - should all input be echoed as output?
isGUI - graphical user interface?
isRemote - running as a server?
Method Detail

createUser

public User createUser(String userName,
                       Directory home,
                       String password,
                       String realName)
Create a new User.

Parameters:
userName - the User's login name.
home - her home Directory.
password - her password.
realName - her real name.
Returns:
newly created User.

getCommandTable

public ShellCommandTable getCommandTable()
The shell command table for this system.

Returns:
the shell command table.

getHostName

public String getHostName()
The name of the host computer on which this system is running.

Returns:
the host computer name.

getOS

public String getOS()
The name of this operating system.

Returns:
the operating system name.

getUserHomes

public Directory getUserHomes()
The directory containing all user homes for this system.

Returns:
the directory containing user homes.

getVersion

public String getVersion()
The version number for this system.

Returns:
the version number.

lookupUser

public User lookupUser(String username)
Look up a user by user name.

Parameters:
username - the user's name.
Returns:
the appropriate User object.

main

public static void main(String[] args)
The Juno system may be given the following command line arguments: -e: Echo all input (useful for testing). -version: Report the version number and exit. -g: Support a GUI console. -remote Start Juno server. -f filename File to read/write system state from/to [hostname]: The name of the host on which Juno is running (optional).


setFileName

public void setFileName(String fileName)
Set the name of file in which system state is kept.

Parameters:
fileName - the file name.

shutDown

public void shutDown()
Shut down this Juno system. Save state if required.