|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.manifoldcf.core.system.ManifoldCF
public class ManifoldCF
| Nested Class Summary | |
|---|---|
protected static class |
ManifoldCF.DatabaseConnectionReleaseThread
The thread that actually releases database connections |
protected static class |
ManifoldCF.DatabaseShutdown
Class that cleans up database handles on exit |
protected static class |
ManifoldCF.FileTrack
Class that tracks files that need to be cleaned up on exit |
protected static class |
ManifoldCF.ShutdownThread
Finisher thread, to be registered with the runtime |
| Field Summary | |
|---|---|
static java.lang.String |
_rcsid
|
protected static boolean |
alreadyClosed
|
protected static java.lang.String |
applicationName
|
static java.lang.String |
ATTRIBUTE_NAME
|
static java.lang.String |
ATTRIBUTE_PATH
|
static java.lang.String |
ATTRIBUTE_VALUE
|
protected static java.util.ArrayList |
cleanupHooks
Array of cleanup hooks (for managing shutdown) |
static java.lang.String |
configSignalCommandProperty
Script to invoke when configuration changes, if any |
static java.lang.String |
databaseHandleMaxcountProperty
Maximum open database handles property |
static java.lang.String |
databaseHandleTimeoutProperty
Database handle timeout property |
static java.lang.String |
databaseImplementation
Database implementation class |
protected static ManifoldCF.DatabaseShutdown |
dbShutdown
Database handle cleanup |
protected static java.lang.Integer |
initializeFlagLock
|
protected static boolean |
isInitialized
|
static java.lang.String |
lcfConfigFileProperty
|
protected static ManifoldCFConfiguration |
localConfiguration
|
protected static java.util.Map |
localProperties
|
static java.lang.String |
lockManagerImplementation
Lock manager implementation class |
static java.lang.String |
logConfigFileProperty
Location of log configuration file |
static java.lang.String |
maintenanceFileSignalProperty
File to look for to block access to UI during database maintenance |
protected static java.lang.String |
masterDatabaseName
|
static java.lang.String |
masterDatabaseNameProperty
Database name property |
protected static java.lang.String |
masterDatabasePassword
|
static java.lang.String |
masterDatabasePasswordProperty
Database password property |
protected static java.lang.String |
masterDatabaseUsername
|
static java.lang.String |
masterDatabaseUsernameProperty
Database user name property |
static java.lang.String |
NODE_LIBDIR
|
static java.lang.String |
NODE_PROPERTY
|
protected static long |
propertyFilelastMod
|
protected static java.lang.String |
propertyFilePath
|
protected static ManifoldCFResourceLoader |
resourceLoader
The object that manages ManifoldCF plugin class loading. |
protected static java.lang.Thread |
shutdownThread
Shutdown thread |
protected static ManifoldCF.FileTrack |
tracker
Temporary file collector |
protected static java.io.File |
workingDirectory
This is the working directory file object. |
| Constructor Summary | |
|---|---|
ManifoldCF()
|
|
| Method Summary | |
|---|---|
static void |
addFile(java.io.File f)
Add a file to the tracking system. |
static void |
addShutdownHook(IShutdownHook hook)
Add a cleanup hook to the list. |
static void |
addToHash(java.security.MessageDigest digest,
java.lang.String input)
Add to hash |
static boolean |
checkMaintenanceUnderway()
Check if maintenance is underway. |
static void |
checkProperties()
Reloads properties as needed. |
protected static void |
cleanUpSystem()
Perform system shutdown, using the registered shutdown hooks. |
static ManifoldCFResourceLoader |
createResourceLoader()
Create a new resource loader based on the default one. |
static void |
createSystemDatabase(IThreadContext threadcontext,
java.lang.String masterUsername,
java.lang.String masterPassword)
Install system database. |
static void |
deleteFile(java.io.File f)
Use the tracking system to delete a file. |
static void |
deleteFolder(java.lang.String path)
Delete a folder path. |
static java.lang.String |
deobfuscate(java.lang.String input)
Decode a string encoded using the obfuscation technique. |
static void |
dropSystemDatabase(IThreadContext threadcontext,
java.lang.String masterUsername,
java.lang.String masterPassword)
Drop system database. |
static java.lang.String |
encrypt(java.lang.String input)
Perform standard one-way encryption of a string. |
static void |
ensureFolder(java.lang.String path)
Attempt to make sure a path is a folder |
static java.lang.Class |
findClass(java.lang.String cname)
Locate a class in the configuration-determined class path. |
static java.lang.String |
getChildDatabaseName(IDBInterface companyDatabase,
java.lang.String childDBIdentifier)
Find a child database name given a company database instance and the child database identifier. |
static java.io.File |
getFileProperty(java.lang.String s)
Read a File property, either from the system properties, or from the local configuration file. |
static java.lang.String |
getHashValue(java.security.MessageDigest digest)
Calculate final hash value |
static int |
getIntProperty(java.lang.String s,
int defaultValue)
Read an integer propert, either from the system properties, or from the local configuration file. |
static java.lang.String |
getMasterDatabaseName()
Get the master database name. |
static java.lang.String |
getMasterDatabasePassword()
Get the master database password. |
static java.lang.String |
getMasterDatabaseUsername()
Get the master database username. |
static java.lang.String |
getProperty(java.lang.String s)
Read a (string) property, either from the system properties, or from the local configuration file. |
static java.lang.String |
hash(java.lang.String input)
Perform standard hashing of a string |
static void |
initializeEnvironment()
Initialize environment. |
static boolean |
isFolder(java.lang.String path)
Discover if a path is a folder |
static void |
noteConfigurationChange()
Note configuration change. |
static java.lang.String |
obfuscate(java.lang.String input)
Encode a string in a reversible obfuscation. |
static int |
readByte(java.io.InputStream is)
Read a byte from an input stream |
static byte[] |
readByteArray(java.io.InputStream is)
Read a byte array from an input stream |
static void |
readBytes(java.io.InputStream is,
byte[] byteArray)
Read bytes from the input stream into specified array. |
static int |
readDword(java.io.InputStream is)
Read a dword from an input stream |
static float |
readfloat(java.io.InputStream os)
Read a float value from an input stream |
static java.lang.Long |
readLong(java.io.InputStream is)
Read a Long from an input stream |
protected static int |
readNibble(char value)
Read a hex nibble. |
static int |
readSdword(java.io.InputStream is)
Read a signed dword from an input stream |
static java.lang.String |
readString(java.io.InputStream is)
Read a String from an input stream |
static int |
readWord(java.io.InputStream is)
Read a word from an input stream |
protected static void |
recursiveDelete(java.io.File directoryPath)
Recursive delete: for cleaning up company folder. |
static java.io.File |
resolvePath(java.lang.String path)
Resolve a file path, possibly relative to ManifoldCF's concept of its "working directory". |
static java.lang.String |
safeFileName(java.lang.String value)
Convert a string into a safe, unique filename. |
static void |
sleep(long milliseconds)
Use this method to sleep instead of Thread.sleep(). |
static java.security.MessageDigest |
startHash()
Start creating a hash |
static void |
writeByte(java.io.OutputStream os,
int byteValue)
Write a byte to an output stream |
static void |
writeByteArray(java.io.OutputStream os,
byte[] byteArray)
Write a byte array to an output stream |
static void |
writeBytes(java.io.OutputStream os,
byte[] byteArray)
Write a bunch of bytes to the output stream |
static void |
writeDword(java.io.OutputStream os,
int dwordValue)
Write a dword to an output stream |
static void |
writefloat(java.io.OutputStream os,
float floatValue)
Write a float value to an output stream |
static void |
writeLong(java.io.OutputStream os,
java.lang.Long longValue)
Write a Long to an output stream |
protected static char |
writeNibble(int value)
Write a hex nibble. |
static void |
writeSdword(java.io.OutputStream os,
int dwordValue)
Write a signed dword to an output stream |
static void |
writeString(java.io.OutputStream os,
java.lang.String stringValue)
Write a String to an output stream |
static void |
writeWord(java.io.OutputStream os,
int wordValue)
Write a word to an output stream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String _rcsid
public static final java.lang.String NODE_PROPERTY
public static final java.lang.String ATTRIBUTE_NAME
public static final java.lang.String ATTRIBUTE_VALUE
public static final java.lang.String NODE_LIBDIR
public static final java.lang.String ATTRIBUTE_PATH
protected static java.io.File workingDirectory
protected static ManifoldCFResourceLoader resourceLoader
protected static ManifoldCF.FileTrack tracker
protected static ManifoldCF.DatabaseShutdown dbShutdown
protected static java.util.ArrayList cleanupHooks
protected static java.lang.Thread shutdownThread
protected static boolean isInitialized
protected static boolean alreadyClosed
protected static java.lang.Integer initializeFlagLock
protected static java.lang.String masterDatabaseName
protected static java.lang.String masterDatabaseUsername
protected static java.lang.String masterDatabasePassword
protected static ManifoldCFConfiguration localConfiguration
protected static java.util.Map localProperties
protected static long propertyFilelastMod
protected static java.lang.String propertyFilePath
protected static final java.lang.String applicationName
public static final java.lang.String lcfConfigFileProperty
public static final java.lang.String masterDatabaseNameProperty
public static final java.lang.String masterDatabaseUsernameProperty
public static final java.lang.String masterDatabasePasswordProperty
public static final java.lang.String databaseHandleMaxcountProperty
public static final java.lang.String databaseHandleTimeoutProperty
public static final java.lang.String logConfigFileProperty
public static final java.lang.String lockManagerImplementation
public static final java.lang.String databaseImplementation
public static final java.lang.String configSignalCommandProperty
public static final java.lang.String maintenanceFileSignalProperty
| Constructor Detail |
|---|
public ManifoldCF()
| Method Detail |
|---|
public static void initializeEnvironment()
throws ManifoldCFException
ManifoldCFException
public static final void checkProperties()
throws ManifoldCFException
ManifoldCFExceptionpublic static java.io.File resolvePath(java.lang.String path)
path - is the path, to be calculated relative to the ManifoldCF "working directory".
public static java.lang.String getProperty(java.lang.String s)
s - is the property name.
public static java.io.File getFileProperty(java.lang.String s)
public static int getIntProperty(java.lang.String s,
int defaultValue)
throws ManifoldCFException
ManifoldCFException
public static void ensureFolder(java.lang.String path)
throws ManifoldCFException
path -
ManifoldCFExceptionpublic static void deleteFolder(java.lang.String path)
path - is the folder path.protected static void recursiveDelete(java.io.File directoryPath)
directoryPath - is the File describing the directory to be removed.public static boolean isFolder(java.lang.String path)
path - spec, 'unix' form mostlypublic static java.lang.String safeFileName(java.lang.String value)
value - is the string.
public static java.lang.String getMasterDatabaseName()
public static java.lang.String getMasterDatabaseUsername()
public static java.lang.String getMasterDatabasePassword()
public static java.lang.String getChildDatabaseName(IDBInterface companyDatabase,
java.lang.String childDBIdentifier)
companyDatabase - is the company database.childDBIdentifier - is the identifier.
public static java.lang.String hash(java.lang.String input)
throws ManifoldCFException
input - is the string to hash.
ManifoldCFException
public static java.security.MessageDigest startHash()
throws ManifoldCFException
ManifoldCFException
public static void addToHash(java.security.MessageDigest digest,
java.lang.String input)
throws ManifoldCFException
ManifoldCFException
public static java.lang.String getHashValue(java.security.MessageDigest digest)
throws ManifoldCFException
ManifoldCFException
public static java.lang.String encrypt(java.lang.String input)
throws ManifoldCFException
input - is the string to encrypt.
ManifoldCFException
public static java.lang.String obfuscate(java.lang.String input)
throws ManifoldCFException
input - is the input string.
ManifoldCFExceptionprotected static char writeNibble(int value)
value - is the value to write.
public static java.lang.String deobfuscate(java.lang.String input)
throws ManifoldCFException
input - is the input string.
ManifoldCFException
protected static int readNibble(char value)
throws ManifoldCFException
value - is the character.
ManifoldCFException
public static void createSystemDatabase(IThreadContext threadcontext,
java.lang.String masterUsername,
java.lang.String masterPassword)
throws ManifoldCFException
threadcontext - is the thread context.masterUsername - is the master database user name.masterPassword - is the master database password.
ManifoldCFException
public static void dropSystemDatabase(IThreadContext threadcontext,
java.lang.String masterUsername,
java.lang.String masterPassword)
throws ManifoldCFException
threadcontext - is the thread context.masterUsername - is the master database user name.masterPassword - is the master database password.
ManifoldCFExceptionpublic static void addFile(java.io.File f)
public static void deleteFile(java.io.File f)
public static boolean checkMaintenanceUnderway()
public static void noteConfigurationChange()
throws ManifoldCFException
ManifoldCFException
public static void sleep(long milliseconds)
throws java.lang.InterruptedException
java.lang.InterruptedException
public static void writeBytes(java.io.OutputStream os,
byte[] byteArray)
throws java.io.IOException
java.io.IOException
public static void writeByte(java.io.OutputStream os,
int byteValue)
throws java.io.IOException
java.io.IOException
public static void writeWord(java.io.OutputStream os,
int wordValue)
throws java.io.IOException
java.io.IOException
public static void writeDword(java.io.OutputStream os,
int dwordValue)
throws java.io.IOException
java.io.IOException
public static void writeSdword(java.io.OutputStream os,
int dwordValue)
throws java.io.IOException
java.io.IOException
public static void writeLong(java.io.OutputStream os,
java.lang.Long longValue)
throws java.io.IOException
java.io.IOException
public static void writeString(java.io.OutputStream os,
java.lang.String stringValue)
throws java.io.IOException
java.io.IOException
public static void writeByteArray(java.io.OutputStream os,
byte[] byteArray)
throws java.io.IOException
java.io.IOException
public static void writefloat(java.io.OutputStream os,
float floatValue)
throws java.io.IOException
java.io.IOException
public static void readBytes(java.io.InputStream is,
byte[] byteArray)
throws java.io.IOException
java.io.IOException
public static int readByte(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static int readWord(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static int readDword(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static int readSdword(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static java.lang.Long readLong(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static java.lang.String readString(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static byte[] readByteArray(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public static float readfloat(java.io.InputStream os)
throws java.io.IOException
java.io.IOExceptionpublic static void addShutdownHook(IShutdownHook hook)
hook - is the shutdown hook that needs to be added to the sequence.
public static ManifoldCFResourceLoader createResourceLoader()
throws ManifoldCFException
ManifoldCFException
public static java.lang.Class findClass(java.lang.String cname)
throws java.lang.ClassNotFoundException,
ManifoldCFException
java.lang.ClassNotFoundException
ManifoldCFExceptionprotected static void cleanUpSystem()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||