public class ManifoldCF
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ManifoldCF.CachePoll
Class that cleans up expired cache objects on polling.
|
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.OverrideableManifoldCFConfiguration
For local properties (not shared!!), this class allows them to be overridden directly from the command line.
|
protected static class |
ManifoldCF.ShutdownThread
Finisher thread, to be registered with the runtime
|
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
_rcsid |
protected static boolean |
alreadyClosed |
protected static boolean |
alreadyShutdown |
protected static java.lang.String |
applicationName |
static java.lang.String |
ATTRIBUTE_PATH |
static java.lang.String |
authImplementation
Auth implementation class
|
protected static java.util.List<IShutdownHook> |
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 |
databaseConnectionTrackingProperty
Connection tracking debug property
|
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
|
static java.lang.String |
databaseQueryMaxTimeProperty
Elapsed time a query can take before a warning is output to the log, in seconds
|
protected static ManifoldCF.DatabaseShutdown |
dbShutdown
Database handle cleanup
|
static java.lang.String |
fileResourcesProperty
Location of file resources
|
protected static java.lang.Integer |
initializeFlagLock |
protected static int |
initializeLevel |
protected static int |
IV_LENGTH |
static java.lang.String |
lcfConfigFileProperty |
protected static ManifoldCFConfiguration |
localConfiguration |
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
|
protected static java.lang.String |
mcfVersion |
static java.lang.String |
NODE_LIBDIR |
protected static java.util.List<IPollingHook> |
pollingHooks
Array of polling hooks (for managing polling)
|
protected static java.lang.String |
processID
Process ID (no more than 16 characters)
|
static java.lang.String |
processIDProperty
Process ID - cannot exceed 16 characters
|
protected static long |
propertyFilelastMod |
protected static java.lang.String |
propertyFilePath |
protected static ManifoldCFResourceLoader |
resourceLoader
The object that manages ManifoldCF plugin class loading.
|
static java.lang.String |
saltProperty
Encryption salt property
|
protected static java.lang.Thread |
shutdownThread
Shutdown thread
|
protected static ManifoldCF.FileTrack |
tracker
Temporary file collector
|
static java.lang.String |
versionProperty
The current ManifoldCF version string
|
protected static java.io.File |
workingDirectory
This is the working directory file object.
|
| Constructor and Description |
|---|
ManifoldCF() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFile(java.io.File f)
Add a file to the tracking system.
|
static void |
addPollingHook(IPollingHook hook)
Add a polling hook to the list.
|
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.
|
static void |
cleanUpEnvironment()
Deprecated.
|
static void |
cleanUpEnvironment(IThreadContext threadContext)
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 java.io.File |
createTempDir(java.lang.String prefix,
java.lang.String suffix)
Create temporary directory.
|
static java.lang.String |
decrypt(java.lang.String saltValue,
java.lang.String passCode,
java.lang.String input)
Decrypt a string.
|
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 saltValue,
java.lang.String passCode,
java.lang.String input)
Encrypt a string in a reversible encryption.
|
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 boolean |
getBooleanProperty(java.lang.String s,
boolean defaultValue)
Read a boolean property
|
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.
|
protected static javax.crypto.Cipher |
getCipher(IThreadContext threadContext,
int mode,
java.lang.String passCode,
byte[] iv) |
protected static javax.crypto.Cipher |
getCipher(java.lang.String saltValue,
int mode,
java.lang.String passCode,
byte[] iv) |
static ManifoldCFConfiguration |
getConfiguration()
Get current properties.
|
static double |
getDoubleProperty(java.lang.String s,
double defaultValue)
Read a float property, either from the system properties, or from the local configuration file.
|
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 property, either from the system properties, or from the local configuration file.
|
static long |
getLongProperty(java.lang.String s,
long defaultValue)
Read a long property, 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 |
getMcfVersion()
Get the mcf version.
|
static java.lang.String |
getProcessID()
Get process ID
|
static java.lang.String |
getProperty(java.lang.String s)
Read a (string) property, either from the system properties, or from the local configuration file.
|
protected static java.lang.String |
getSaltValue(IThreadContext threadContext) |
protected static byte[] |
getSecureRandom() |
static java.lang.String |
getStringProperty(java.lang.String s,
java.lang.String defaultValue)
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()
Deprecated.
|
static void |
initializeEnvironment(IThreadContext threadContext)
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 void |
pollAll(IThreadContext threadContext)
Poll all the registered polling services.
|
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
|
static void |
recursiveDelete(java.io.File directoryPath)
Recursive delete: for cleaning up company folder.
|
protected static void |
registerConnectorServices()
Register connector services provided in connectors and connector-commons
|
static void |
resetEnvironment()
Deprecated.
|
static void |
resetEnvironment(IThreadContext threadContext)
Reset environment.
|
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 |
systemExit(int rval)
Shutdown the system using a background thread.
|
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
|
public static final java.lang.String _rcsid
public static final java.lang.String NODE_LIBDIR
public static final java.lang.String ATTRIBUTE_PATH
protected static java.lang.String processID
protected static java.io.File workingDirectory
protected static ManifoldCFResourceLoader resourceLoader
protected static ManifoldCF.FileTrack tracker
protected static ManifoldCF.DatabaseShutdown dbShutdown
protected static final java.util.List<IShutdownHook> cleanupHooks
protected static final java.util.List<IPollingHook> pollingHooks
protected static java.lang.Thread shutdownThread
protected static int initializeLevel
protected static boolean alreadyClosed
protected static boolean alreadyShutdown
protected static java.lang.Integer initializeFlagLock
protected static java.lang.String mcfVersion
protected static java.lang.String masterDatabaseName
protected static java.lang.String masterDatabaseUsername
protected static java.lang.String masterDatabasePassword
protected static ManifoldCFConfiguration localConfiguration
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 versionProperty
public static final java.lang.String processIDProperty
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 databaseConnectionTrackingProperty
public static final java.lang.String databaseQueryMaxTimeProperty
public static final java.lang.String logConfigFileProperty
public static final java.lang.String fileResourcesProperty
public static final java.lang.String lockManagerImplementation
public static final java.lang.String databaseImplementation
public static final java.lang.String authImplementation
public static final java.lang.String configSignalCommandProperty
public static final java.lang.String maintenanceFileSignalProperty
public static final java.lang.String saltProperty
protected static final int IV_LENGTH
@Deprecated public static void resetEnvironment()
public static void resetEnvironment(IThreadContext threadContext)
@Deprecated
public static void initializeEnvironment()
throws ManifoldCFException
ManifoldCFExceptionpublic static void initializeEnvironment(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFExceptionprotected static void registerConnectorServices()
throws ManifoldCFException
ManifoldCFExceptionpublic static final java.lang.String getProcessID()
public static final ManifoldCFConfiguration getConfiguration()
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 java.lang.String getStringProperty(java.lang.String s,
java.lang.String defaultValue)
s - is the property name.defaultValue - is the default value for the property.public static boolean getBooleanProperty(java.lang.String s,
boolean defaultValue)
throws ManifoldCFException
ManifoldCFExceptionpublic static int getIntProperty(java.lang.String s,
int defaultValue)
throws ManifoldCFException
ManifoldCFExceptionpublic static long getLongProperty(java.lang.String s,
long defaultValue)
throws ManifoldCFException
ManifoldCFExceptionpublic static double getDoubleProperty(java.lang.String s,
double defaultValue)
throws ManifoldCFException
ManifoldCFExceptionpublic static void ensureFolder(java.lang.String path)
throws ManifoldCFException
path - ManifoldCFExceptionpublic static void deleteFolder(java.lang.String path)
path - is the folder path.public static void recursiveDelete(java.io.File directoryPath)
directoryPath - is the File describing the directory or file 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 void systemExit(int rval)
public static java.lang.String getMcfVersion()
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.ManifoldCFExceptionpublic static java.security.MessageDigest startHash()
throws ManifoldCFException
ManifoldCFExceptionpublic static void addToHash(java.security.MessageDigest digest,
java.lang.String input)
throws ManifoldCFException
ManifoldCFExceptionpublic static java.lang.String getHashValue(java.security.MessageDigest digest)
throws ManifoldCFException
ManifoldCFExceptionprotected static java.lang.String getSaltValue(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFExceptionprotected static javax.crypto.Cipher getCipher(IThreadContext threadContext, int mode, java.lang.String passCode, byte[] iv) throws ManifoldCFException
ManifoldCFExceptionprotected static javax.crypto.Cipher getCipher(java.lang.String saltValue,
int mode,
java.lang.String passCode,
byte[] iv)
throws ManifoldCFException
ManifoldCFExceptionprotected static byte[] getSecureRandom()
public static java.lang.String obfuscate(java.lang.String input)
throws ManifoldCFException
input - is the input string.ManifoldCFExceptionpublic static java.lang.String deobfuscate(java.lang.String input)
throws ManifoldCFException
input - is the input string.ManifoldCFExceptionpublic static java.lang.String encrypt(java.lang.String saltValue,
java.lang.String passCode,
java.lang.String input)
throws ManifoldCFException
saltValue - is the salt value.passCode - is the pass code.input - is the input string.ManifoldCFExceptionpublic static java.lang.String decrypt(java.lang.String saltValue,
java.lang.String passCode,
java.lang.String input)
throws ManifoldCFException
saltValue - is the salt value.passCode - is the pass code.input - is the input string.ManifoldCFExceptionprotected static char writeNibble(int value)
value - is the value to write.protected static int readNibble(char value)
throws ManifoldCFException
value - is the character.ManifoldCFExceptionpublic 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.ManifoldCFExceptionpublic 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 java.io.File createTempDir(java.lang.String prefix,
java.lang.String suffix)
throws ManifoldCFException
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
ManifoldCFExceptionpublic static void sleep(long milliseconds)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic static void writeBytes(java.io.OutputStream os,
byte[] byteArray)
throws java.io.IOException
java.io.IOExceptionpublic static void writeByte(java.io.OutputStream os,
int byteValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeWord(java.io.OutputStream os,
int wordValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeDword(java.io.OutputStream os,
int dwordValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeSdword(java.io.OutputStream os,
int dwordValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeLong(java.io.OutputStream os,
java.lang.Long longValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeString(java.io.OutputStream os,
java.lang.String stringValue)
throws java.io.IOException
java.io.IOExceptionpublic static void writeByteArray(java.io.OutputStream os,
byte[] byteArray)
throws java.io.IOException
java.io.IOExceptionpublic static void writefloat(java.io.OutputStream os,
float floatValue)
throws java.io.IOException
java.io.IOExceptionpublic static void readBytes(java.io.InputStream is,
byte[] byteArray)
throws java.io.IOException
java.io.IOExceptionpublic static int readByte(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static int readWord(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static int readDword(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static int readSdword(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.Long readLong(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readString(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic static byte[] readByteArray(java.io.InputStream is)
throws java.io.IOException
java.io.IOExceptionpublic 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 void addPollingHook(IPollingHook hook)
hook - is the polling hook that needs to be added to the sequence.public static void pollAll(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFExceptionpublic static ManifoldCFResourceLoader createResourceLoader() throws ManifoldCFException
ManifoldCFExceptionpublic static java.lang.Class findClass(java.lang.String cname)
throws java.lang.ClassNotFoundException,
ManifoldCFException
java.lang.ClassNotFoundExceptionManifoldCFException@Deprecated public static void cleanUpEnvironment()
public static void cleanUpEnvironment(IThreadContext threadContext)