org.bluesock.bluemud.driver
Class Driver

java.lang.Object
  |
  +--org.bluesock.bluemud.driver.Driver

public class Driver
extends java.lang.Object

The purpose of the driver is to wrap all of the system code, providing a single interface to the mudlib. The driver itself doesn't necessarily do very much work. It primarily delegates to various system components.


Constructor Summary
Driver()
           
 
Method Summary
(package private) static void ()
           
static void addCallout(int secondsDelay, MudEvent event)
          Schedules a callout event.
static void addEvent(MudEvent newEvent)
          Add a MUD event to the event queue.
static void addGroupedInstance(java.lang.String groupName, MudObject instance)
           
static boolean addSecuredUser(java.lang.String username, java.lang.String plaintextPassword)
           
static boolean authenticate(java.lang.String username, java.lang.String plaintextPassword)
           
static boolean createDirectory(java.lang.String dirname)
          Creates a directory on the filesystem.
(package private) static void execute(java.lang.String filename)
           
static java.lang.String[] fstatFile(java.lang.String filename)
          Provides fstats like information on a file and returns it blindly as a set of strings.
static MudObject getActiveObject()
           
static User getActiveUser()
           
static MudObject getAliasedObject(java.lang.String alias, boolean shared)
           
static java.lang.String getBluemudCodeRoot()
           
static java.lang.String getBluemudLogRoot()
           
static java.lang.String getBluemudRoot()
           
static java.lang.String getDriverStatistics()
          Returns a string of a series of stats separated by \n that talk about the current state of the JVM and the engine.
static MudObject[] getGroupedInstances(java.lang.String groupName)
           
(package private) static org.python.util.PythonInterpreter getInterpreter()
           
static MudObject getObject(int objectIdentifier)
           
static MudObject getObject(java.lang.String dottedPath)
           
static MudObject getObject(java.lang.String dottedPath, boolean shared)
           
static MudObject getObject(java.lang.String dottedPath, boolean shared, boolean reload)
           
static java.lang.String getUptime()
          This allows anyone (coders and non-coders) to know what the current uptime of the mud is.
static java.lang.String getWorldDataRoot()
           
static java.lang.String getWorldDomainsRoot()
           
static java.lang.String getWorldHomeRoot()
           
static java.lang.String getWorldRoot()
           
static java.lang.String getWorldSecuredRoot()
           
static boolean hasSharedInstance(java.lang.String dottedPath)
           
static boolean isDirectory(java.lang.String filename)
          Returns a boolean as to whether this file is a directory or not.
static boolean isFile(java.lang.String filename)
          Returns a boolean as to whether this file is a file or not.
static java.lang.String[] listDirectory(java.lang.String dirname)
          Returns the contents of a directory.
static OID nextObjectID()
          Serializes OIDs so that we don't repeat them ever.
static java.lang.String readFile(java.lang.String filename)
          Reads a file from the file system.
static java.lang.String readFile(java.lang.String filename, boolean cachethis)
          Reads a file from the file system.
static void registerAlias(java.lang.String alias, java.lang.String dottedPath)
           
static boolean removeDirectory(java.lang.String dirname)
          Removes a directory from the filesystem.
static boolean removeFile(java.lang.String filename)
          Removes a file off the file system.
static void removeGroupedInstance(java.lang.String groupName, MudObject instance)
           
static void removeObject(MudObject instance)
           
static boolean securedUserExists(java.lang.String username)
           
static void setActiveObject(MudObject o)
           
(package private) static void setActiveUser(User newActiveUser)
           
static void shutdown()
          Shuts down the mud.
static boolean touchFile(java.lang.String filename)
          Touches a file on the filesystem updating it's last modified time.
static boolean writeFile(java.lang.String content, java.lang.String filename)
          Checks permissions and then tells the FileManager to write the file to the filesystem.
static boolean writeFile(java.lang.String content, java.lang.String filename, boolean append)
          Checks permissions and then tells the FileManager to write the file to the filesystem.
static void writeLogEntry(java.lang.String logName, java.lang.String entry)
          Throws something in the logs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Driver

public Driver()
Method Detail

static void ()

nextObjectID

public static OID nextObjectID()
Serializes OIDs so that we don't repeat them ever.
Returns:
OID

addEvent

public static void addEvent(MudEvent newEvent)
Add a MUD event to the event queue. This will be processed by the engine in FIFO order.
Parameters:
newEvent - The event to add to the queue.

addCallout

public static void addCallout(int secondsDelay,
                              MudEvent event)
Schedules a callout event.
Parameters:
secondsDelay - How long from now the callout should happen.
event - The Mud event that executes at (or after) said time.

getObject

public static MudObject getObject(java.lang.String dottedPath)

getObject

public static MudObject getObject(java.lang.String dottedPath,
                                  boolean shared)

getObject

public static MudObject getObject(java.lang.String dottedPath,
                                  boolean shared,
                                  boolean reload)

getObject

public static MudObject getObject(int objectIdentifier)

hasSharedInstance

public static boolean hasSharedInstance(java.lang.String dottedPath)

getAliasedObject

public static MudObject getAliasedObject(java.lang.String alias,
                                         boolean shared)

registerAlias

public static void registerAlias(java.lang.String alias,
                                 java.lang.String dottedPath)

addGroupedInstance

public static void addGroupedInstance(java.lang.String groupName,
                                      MudObject instance)

getGroupedInstances

public static MudObject[] getGroupedInstances(java.lang.String groupName)

removeGroupedInstance

public static void removeGroupedInstance(java.lang.String groupName,
                                         MudObject instance)

removeObject

public static void removeObject(MudObject instance)

writeFile

public static boolean writeFile(java.lang.String content,
                                java.lang.String filename)
Checks permissions and then tells the FileManager to write the file to the filesystem.
Parameters:
content - The file data.
filename - The name and path of the file.
Returns:
Whether the file was written successfully or not.

writeFile

public static boolean writeFile(java.lang.String content,
                                java.lang.String filename,
                                boolean append)
Checks permissions and then tells the FileManager to write the file to the filesystem.
Parameters:
content - The file data.
filename - The name and path of the file.
append - Whether or not to append to the file if it already exists.
Returns:
Whether the file was written successfully or not.

writeLogEntry

public static void writeLogEntry(java.lang.String logName,
                                 java.lang.String entry)
Throws something in the logs.
Parameters:
logName - The log to toss the text in.
entry - The data to log.

touchFile

public static boolean touchFile(java.lang.String filename)
Touches a file on the filesystem updating it's last modified time.
Parameters:
filename - The name of the file to touch.
Returns:
Whether or not we succeeded in touching the file.

readFile

public static java.lang.String readFile(java.lang.String filename,
                                        boolean cachethis)
Reads a file from the file system. And allows us to cache it (for files that we read often).
Parameters:
filename - The name of the file to read.
cachethis - Whether or not to cache the file in memory.
Returns:
the contents of the file as a String.

readFile

public static java.lang.String readFile(java.lang.String filename)
Reads a file from the file system.
Parameters:
filename - The name of the file to read.
Returns:
the contents of the file as a String.

fstatFile

public static java.lang.String[] fstatFile(java.lang.String filename)
Provides fstats like information on a file and returns it blindly as a set of strings. We should probably return an Fstat object with the data in its original form (so we can do things like compare and such). FIXME
Parameters:
filename - The name of the file to fstat.
Returns:
A list of strings with the data.

listDirectory

public static java.lang.String[] listDirectory(java.lang.String dirname)
Returns the contents of a directory.
Parameters:
dirname - The name of the directory to get a listing of.
Returns:
The contents of the directory as a list of strings.

isDirectory

public static boolean isDirectory(java.lang.String filename)
Returns a boolean as to whether this file is a directory or not.
Parameters:
filename - The name of the file in question.
Returns:
whether or not this is a directory.

isFile

public static boolean isFile(java.lang.String filename)
Returns a boolean as to whether this file is a file or not.
Parameters:
filename - The name of the file in question.
Returns:
whether or not this is a file

removeFile

public static boolean removeFile(java.lang.String filename)
Removes a file off the file system.
Parameters:
filename - The name of the file to remove.
Returns:
Whether the file was removed successfully or not.

removeDirectory

public static boolean removeDirectory(java.lang.String dirname)
Removes a directory from the filesystem.
Parameters:
dirname - The name of the directory to remove.
Returns:
Whether the removal was successful.

createDirectory

public static boolean createDirectory(java.lang.String dirname)
Creates a directory on the filesystem.
Parameters:
dirname - The name of the directory to create.
Returns:
Whether the creation was successful.

getActiveObject

public static MudObject getActiveObject()

setActiveObject

public static void setActiveObject(MudObject o)

getActiveUser

public static User getActiveUser()

getBluemudRoot

public static java.lang.String getBluemudRoot()

getBluemudLogRoot

public static java.lang.String getBluemudLogRoot()

getBluemudCodeRoot

public static java.lang.String getBluemudCodeRoot()

getWorldRoot

public static java.lang.String getWorldRoot()

getWorldDomainsRoot

public static java.lang.String getWorldDomainsRoot()

getWorldHomeRoot

public static java.lang.String getWorldHomeRoot()

getWorldDataRoot

public static java.lang.String getWorldDataRoot()

getWorldSecuredRoot

public static java.lang.String getWorldSecuredRoot()

authenticate

public static boolean authenticate(java.lang.String username,
                                   java.lang.String plaintextPassword)

securedUserExists

public static boolean securedUserExists(java.lang.String username)

addSecuredUser

public static boolean addSecuredUser(java.lang.String username,
                                     java.lang.String plaintextPassword)

shutdown

public static void shutdown()
Shuts down the mud.

getDriverStatistics

public static java.lang.String getDriverStatistics()
Returns a string of a series of stats separated by \n that talk about the current state of the JVM and the engine.

getUptime

public static java.lang.String getUptime()
This allows anyone (coders and non-coders) to know what the current uptime of the mud is.

setActiveUser

static void setActiveUser(User newActiveUser)

execute

static void execute(java.lang.String filename)

getInterpreter

static org.python.util.PythonInterpreter getInterpreter()


docs generated on Thu Jan 24 08:57:26 CST 2002