public class ManifoldCF extends 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
|
protected static class |
ManifoldCF.ThrottlerPoll
Class that polls throttler
|
protected static class |
ManifoldCF.ThrottlerShutdown
Class that cleans up throttler on exit
|
Modifier and Type | Field and Description |
---|---|
static String |
_rcsid |
protected static boolean |
alreadyClosed |
protected static boolean |
alreadyShutdown |
protected static String |
apiLoginPassword |
static String |
apiLoginPasswordProperty
API login password
|
protected static String |
apiLoginUserName |
static String |
apiLoginUserNameProperty
API login user name
|
protected static String |
applicationName |
static String |
ATTRIBUTE_PATH |
protected static List<IShutdownHook> |
cleanupHooks
Array of cleanup hooks (for managing shutdown)
|
static String |
configSignalCommandProperty
Script to invoke when configuration changes, if any
|
static String |
databaseConnectionTrackingProperty
Connection tracking debug property
|
static String |
databaseHandleMaxcountProperty
Maximum open database handles property
|
static String |
databaseHandleTimeoutProperty
Database handle timeout property
|
static String |
databaseImplementation
Database implementation class
|
static 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
|
protected static Integer |
initializeFlagLock |
protected static int |
initializeLevel |
static String |
lcfConfigFileProperty |
protected static ManifoldCFConfiguration |
localConfiguration |
static String |
lockManagerImplementation
Lock manager implementation class
|
static String |
logConfigFileProperty
Location of log configuration file
|
protected static String |
loginPassword |
static String |
loginPasswordProperty
UI login password
|
protected static String |
loginUserName |
static String |
loginUserNameProperty
UI login user name
|
static String |
maintenanceFileSignalProperty
File to look for to block access to UI during database maintenance
|
protected static String |
masterDatabaseName |
static String |
masterDatabaseNameProperty
Database name property
|
protected static String |
masterDatabasePassword |
static String |
masterDatabasePasswordProperty
Database password property
|
protected static String |
masterDatabaseUsername |
static String |
masterDatabaseUsernameProperty
Database user name property
|
static String |
NODE_LIBDIR |
protected static List<IPollingHook> |
pollingHooks
Array of polling hooks (for managing polling)
|
protected static String |
processID
Process ID (no more than 16 characters)
|
static String |
processIDProperty
Process ID - cannot exceed 16 characters
|
protected static long |
propertyFilelastMod |
protected static String |
propertyFilePath |
protected static ManifoldCFResourceLoader |
resourceLoader
The object that manages ManifoldCF plugin class loading.
|
protected static Thread |
shutdownThread
Shutdown thread
|
protected static ManifoldCF.FileTrack |
tracker
Temporary file collector
|
protected static File |
workingDirectory
This is the working directory file object.
|
Constructor and Description |
---|
ManifoldCF() |
Modifier and Type | Method and Description |
---|---|
static void |
addFile(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(MessageDigest digest,
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,
String masterUsername,
String masterPassword)
Install system database.
|
static File |
createTempDir(String prefix,
String suffix)
Create temporary directory.
|
static void |
deleteFile(File f)
Use the tracking system to delete a file.
|
static void |
deleteFolder(String path)
Delete a folder path.
|
static String |
deobfuscate(String input)
Decode a string encoded using the obfuscation
technique.
|
static void |
dropSystemDatabase(IThreadContext threadcontext,
String masterUsername,
String masterPassword)
Drop system database.
|
static String |
encrypt(String input)
Perform standard one-way encryption of a string.
|
static void |
ensureFolder(String path)
Attempt to make sure a path is a folder
|
static Class |
findClass(String cname)
Locate a class in the configuration-determined class path.
|
static boolean |
getBooleanProperty(String s,
boolean defaultValue)
Read a boolean property
|
static String |
getChildDatabaseName(IDBInterface companyDatabase,
String childDBIdentifier)
Find a child database name given a company database instance and the child
database identifier.
|
static ManifoldCFConfiguration |
getConfiguration()
Get current properties.
|
static double |
getDoubleProperty(String s,
double defaultValue)
Read a float property, either from the system properties, or from the local configuration file.
|
static File |
getFileProperty(String s)
Read a File property, either from the system properties, or from the local configuration file.
|
static String |
getHashValue(MessageDigest digest)
Calculate final hash value
|
static int |
getIntProperty(String s,
int defaultValue)
Read an integer property, either from the system properties, or from the local configuration file.
|
static long |
getLongProperty(String s,
long defaultValue)
Read a long property, either from the system properties, or from the local configuration file.
|
static String |
getMasterDatabaseName()
Get the master database name.
|
static String |
getMasterDatabasePassword()
Get the master database password.
|
static String |
getMasterDatabaseUsername()
Get the master database username.
|
static String |
getProcessID()
Get process ID
|
static String |
getProperty(String s)
Read a (string) property, either from the system properties, or from the local configuration file.
|
static String |
getStringProperty(String s,
String defaultValue)
Read a (string) property, either from the system properties, or from the local configuration file.
|
static String |
hash(String input)
Perform standard hashing of a string
|
static void |
initializeEnvironment()
Deprecated.
|
static void |
initializeEnvironment(IThreadContext threadContext)
Initialize environment.
|
static boolean |
isFolder(String path)
Discover if a path is a folder
|
static void |
noteConfigurationChange()
Note configuration change.
|
static String |
obfuscate(String input)
Encode a string in a reversible obfuscation.
|
static void |
pollAll(IThreadContext threadContext)
Poll all the registered polling services.
|
static int |
readByte(InputStream is)
Read a byte from an input stream
|
static byte[] |
readByteArray(InputStream is)
Read a byte array from an input stream
|
static void |
readBytes(InputStream is,
byte[] byteArray)
Read bytes from the input stream into specified array.
|
static int |
readDword(InputStream is)
Read a dword from an input stream
|
static float |
readfloat(InputStream os)
Read a float value from an input stream
|
static Long |
readLong(InputStream is)
Read a Long from an input stream
|
protected static int |
readNibble(char value)
Read a hex nibble.
|
static int |
readSdword(InputStream is)
Read a signed dword from an input stream
|
static String |
readString(InputStream is)
Read a String from an input stream
|
static int |
readWord(InputStream is)
Read a word from an input stream
|
static void |
recursiveDelete(File directoryPath)
Recursive delete: for cleaning up company folder.
|
static void |
resetEnvironment()
Deprecated.
|
static void |
resetEnvironment(IThreadContext threadContext)
Reset environment.
|
static File |
resolvePath(String path)
Resolve a file path, possibly relative to ManifoldCF's concept of its "working directory".
|
static String |
safeFileName(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 MessageDigest |
startHash()
Start creating a hash
|
static boolean |
verifyAPILogin(IThreadContext threadContext,
String userID,
String userPassword)
Verify API login.
|
static boolean |
verifyLogin(IThreadContext threadContext,
String userID,
String userPassword)
Verify login.
|
static void |
writeByte(OutputStream os,
int byteValue)
Write a byte to an output stream
|
static void |
writeByteArray(OutputStream os,
byte[] byteArray)
Write a byte array to an output stream
|
static void |
writeBytes(OutputStream os,
byte[] byteArray)
Write a bunch of bytes to the output stream
|
static void |
writeDword(OutputStream os,
int dwordValue)
Write a dword to an output stream
|
static void |
writefloat(OutputStream os,
float floatValue)
Write a float value to an output stream
|
static void |
writeLong(OutputStream os,
Long longValue)
Write a Long to an output stream
|
protected static char |
writeNibble(int value)
Write a hex nibble.
|
static void |
writeSdword(OutputStream os,
int dwordValue)
Write a signed dword to an output stream
|
static void |
writeString(OutputStream os,
String stringValue)
Write a String to an output stream
|
static void |
writeWord(OutputStream os,
int wordValue)
Write a word to an output stream
|
public static final String _rcsid
public static final String NODE_LIBDIR
public static final String ATTRIBUTE_PATH
protected static String processID
protected static File workingDirectory
protected static ManifoldCFResourceLoader resourceLoader
protected static ManifoldCF.FileTrack tracker
protected static ManifoldCF.DatabaseShutdown dbShutdown
protected static final List<IShutdownHook> cleanupHooks
protected static final List<IPollingHook> pollingHooks
protected static Thread shutdownThread
protected static int initializeLevel
protected static boolean alreadyClosed
protected static boolean alreadyShutdown
protected static Integer initializeFlagLock
protected static String loginUserName
protected static String loginPassword
protected static String apiLoginUserName
protected static String apiLoginPassword
protected static String masterDatabaseName
protected static String masterDatabaseUsername
protected static String masterDatabasePassword
protected static ManifoldCFConfiguration localConfiguration
protected static long propertyFilelastMod
protected static String propertyFilePath
protected static final String applicationName
public static final String lcfConfigFileProperty
public static final String processIDProperty
public static final String loginUserNameProperty
public static final String loginPasswordProperty
public static final String apiLoginUserNameProperty
public static final String apiLoginPasswordProperty
public static final String masterDatabaseNameProperty
public static final String masterDatabaseUsernameProperty
public static final String masterDatabasePasswordProperty
public static final String databaseHandleMaxcountProperty
public static final String databaseHandleTimeoutProperty
public static final String databaseConnectionTrackingProperty
public static final String databaseQueryMaxTimeProperty
public static final String logConfigFileProperty
public static final String lockManagerImplementation
public static final String databaseImplementation
public static final String configSignalCommandProperty
public static final String maintenanceFileSignalProperty
@Deprecated public static void resetEnvironment()
public static void resetEnvironment(IThreadContext threadContext)
@Deprecated public static void initializeEnvironment() throws ManifoldCFException
ManifoldCFException
public static void initializeEnvironment(IThreadContext threadContext) throws ManifoldCFException
ManifoldCFException
public static final String getProcessID()
public static final ManifoldCFConfiguration getConfiguration()
public static final void checkProperties() throws ManifoldCFException
ManifoldCFException
public static File resolvePath(String path)
path
- is the path, to be calculated relative to the ManifoldCF "working directory".public static String getProperty(String s)
s
- is the property name.public static File getFileProperty(String s)
public static String getStringProperty(String s, String defaultValue)
s
- is the property name.defaultValue
- is the default value for the property.public static boolean getBooleanProperty(String s, boolean defaultValue) throws ManifoldCFException
ManifoldCFException
public static int getIntProperty(String s, int defaultValue) throws ManifoldCFException
ManifoldCFException
public static long getLongProperty(String s, long defaultValue) throws ManifoldCFException
ManifoldCFException
public static double getDoubleProperty(String s, double defaultValue) throws ManifoldCFException
ManifoldCFException
public static void ensureFolder(String path) throws ManifoldCFException
path
- ManifoldCFException
public static void deleteFolder(String path)
path
- is the folder path.public static void recursiveDelete(File directoryPath)
directoryPath
- is the File describing the directory or file to be removed.public static boolean isFolder(String path)
path
- spec, 'unix' form mostlypublic static String safeFileName(String value)
value
- is the string.public static String getMasterDatabaseName()
public static String getMasterDatabaseUsername()
public static String getMasterDatabasePassword()
public static String getChildDatabaseName(IDBInterface companyDatabase, String childDBIdentifier)
companyDatabase
- is the company database.childDBIdentifier
- is the identifier.public static String hash(String input) throws ManifoldCFException
input
- is the string to hash.ManifoldCFException
public static MessageDigest startHash() throws ManifoldCFException
ManifoldCFException
public static void addToHash(MessageDigest digest, String input) throws ManifoldCFException
ManifoldCFException
public static String getHashValue(MessageDigest digest) throws ManifoldCFException
ManifoldCFException
public static boolean verifyAPILogin(IThreadContext threadContext, String userID, String userPassword) throws ManifoldCFException
ManifoldCFException
public static boolean verifyLogin(IThreadContext threadContext, String userID, String userPassword) throws ManifoldCFException
ManifoldCFException
public static String encrypt(String input) throws ManifoldCFException
input
- is the string to encrypt.ManifoldCFException
public static String obfuscate(String input) throws ManifoldCFException
input
- is the input string.ManifoldCFException
protected static char writeNibble(int value)
value
- is the value to write.public static String deobfuscate(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, String masterUsername, 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, String masterUsername, 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 File createTempDir(String prefix, String suffix) throws ManifoldCFException
ManifoldCFException
public static void addFile(File f)
public static void deleteFile(File f)
public static boolean checkMaintenanceUnderway()
public static void noteConfigurationChange() throws ManifoldCFException
ManifoldCFException
public static void sleep(long milliseconds) throws InterruptedException
InterruptedException
public static void writeBytes(OutputStream os, byte[] byteArray) throws IOException
IOException
public static void writeByte(OutputStream os, int byteValue) throws IOException
IOException
public static void writeWord(OutputStream os, int wordValue) throws IOException
IOException
public static void writeDword(OutputStream os, int dwordValue) throws IOException
IOException
public static void writeSdword(OutputStream os, int dwordValue) throws IOException
IOException
public static void writeLong(OutputStream os, Long longValue) throws IOException
IOException
public static void writeString(OutputStream os, String stringValue) throws IOException
IOException
public static void writeByteArray(OutputStream os, byte[] byteArray) throws IOException
IOException
public static void writefloat(OutputStream os, float floatValue) throws IOException
IOException
public static void readBytes(InputStream is, byte[] byteArray) throws IOException
IOException
public static int readByte(InputStream is) throws IOException
IOException
public static int readWord(InputStream is) throws IOException
IOException
public static int readDword(InputStream is) throws IOException
IOException
public static int readSdword(InputStream is) throws IOException
IOException
public static Long readLong(InputStream is) throws IOException
IOException
public static String readString(InputStream is) throws IOException
IOException
public static byte[] readByteArray(InputStream is) throws IOException
IOException
public static float readfloat(InputStream os) throws IOException
IOException
public 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
ManifoldCFException
public static ManifoldCFResourceLoader createResourceLoader() throws ManifoldCFException
ManifoldCFException
public static Class findClass(String cname) throws ClassNotFoundException, ManifoldCFException
@Deprecated public static void cleanUpEnvironment()
public static void cleanUpEnvironment(IThreadContext threadContext)