public final class MasterDB extends java.lang.Object implements ShutdownListener
Modifier and Type | Field and Description |
---|---|
static int |
APP_SERIES
The app series
|
static java.lang.String |
ASPC_BUILD_DT
The date of this build
|
static java.lang.String |
ASPC_GIT_COMMIT
The git commit of this build
|
static java.lang.String |
BRANCH
The build/branch of this build
|
static java.lang.String |
COLUMN_CONNECT_PROPERTIES
the connection properties
|
static java.lang.String |
COLUMN_REDIRECT_URL
redirect URL
|
static java.lang.String |
DB_VERSION
The current Database version number
|
static java.lang.String |
ENCRYPTION_KEY
The encryption holder
|
MasterMessageServer |
jms
The raw JMS Client
|
static org.apache.commons.logging.Log |
LOGGER_TIMINGS_QUERY
Handle for the query logger.
|
static java.lang.String |
PROPERTY_EMAIL_LIMIT
EMAIL_LIMIT property program name, property name will be the layer id
|
static java.lang.String |
PROPERTY_PRIVATE_DB_DIR
private database directory
|
static java.lang.String |
PROPERTY_PRIVATE_DB_LAYERS
force use of a private database
|
static java.lang.String |
PROPERTY_RECIPIENTS_LIMIT
RECIPIENTS_LIMIT property program name, property name will be the layer id
|
static long |
STARTUP_TIME
When the server started
|
Modifier and Type | Method and Description |
---|---|
void |
clearDefaultDB()
clear the cache of the default DB
|
static void |
closeAllDatabases()
Close all databases
|
void |
closeDatabases()
shutdown the database
|
VirtualDB |
createDB(java.lang.String signature,
java.lang.String parentSignature,
java.lang.String ownerFirstName,
java.lang.String ownerLastName,
java.lang.String ownerLogin,
java.lang.String ownerPassword,
java.lang.String phoneNumber,
java.lang.String email,
java.util.Date suspends)
Creates a new VirtualDB
|
VirtualDB |
createDB(java.lang.String signature,
java.lang.String parentSignature,
java.lang.String ownerFirstName,
java.lang.String ownerLastName,
java.lang.String ownerLogin,
java.lang.String ownerPassword,
java.lang.String phoneNumber,
java.lang.String email,
java.util.Date suspends,
long id,
java.lang.String requiredName)
Creates a new VirtualDB
|
static MasterDB |
currentMasterDB()
get the current master
|
DataBase |
findLayerDB(int id)
The physical database for the layer
|
static MasterDB |
findMasterDB(java.lang.String connectUrl,
java.lang.String name,
java.lang.String connectType,
java.lang.String connectUser,
java.lang.String connectPass)
find the master DB
|
java.lang.String |
getDefaultDB(java.lang.String host)
The default layer for this host
|
java.lang.String |
getProgramProperty(java.lang.String programName,
java.lang.String property)
Get the property stored in the database
|
DataBase |
getRawDB()
The physical Database for this master.
|
java.lang.String |
getRedirectURL(int id)
Should we redirect somewhere else.
|
static boolean |
isShuttingDown()
Are we shutting down ?
|
boolean |
knownHost(java.lang.String host)
Is this a know host ?
|
int[] |
listDataLayers()
The active tmpLayers
|
int[] |
listLayers()
Returns a list of layer ids
|
int[] |
listLiveLayers()
The active tmpLayers
|
java.lang.String[] |
listSignatures(int id)
Returns the signatures that match the database id
|
static java.lang.String |
parseServerURL(java.lang.String url)
Resolves properties enclosed by a $ in the server URL
|
static void |
sendClearCache() |
static void |
setCurrentDBAsMasterDB()
set the current master
|
MasterDB |
setMainLayer(java.lang.String signature)
Override of the main layer.
|
MasterDB |
setProgramProperty(java.lang.String programName,
java.lang.String property,
java.lang.String value)
Permanently store a property for a program into the database
|
MasterDB |
setRedirectURL(int id,
java.lang.String url)
set redirect_url
|
void |
shutdown()
shutdown
|
static void |
shutdownAllDatabases()
Shutdown all databases
|
static void |
shutdownAllJMS()
Close all JMS subscribers
|
void |
shutdownDatabases()
shutdown the database
|
public static final java.lang.String DB_VERSION
public static final int APP_SERIES
public static final java.lang.String BRANCH
public static final java.lang.String ASPC_BUILD_DT
public static final java.lang.String ASPC_GIT_COMMIT
public static final long STARTUP_TIME
public static final org.apache.commons.logging.Log LOGGER_TIMINGS_QUERY
public static final java.lang.String ENCRYPTION_KEY
public static final java.lang.String COLUMN_CONNECT_PROPERTIES
public static final java.lang.String COLUMN_REDIRECT_URL
public static final java.lang.String PROPERTY_PRIVATE_DB_LAYERS
public static final java.lang.String PROPERTY_PRIVATE_DB_DIR
public static final java.lang.String PROPERTY_RECIPIENTS_LIMIT
public static final java.lang.String PROPERTY_EMAIL_LIMIT
public final MasterMessageServer jms
@CheckReturnValue @Nonnull public DataBase getRawDB()
@Nonnull public MasterDB setMainLayer(@Nonnull java.lang.String signature)
signature
- @Nonnull public MasterDB setProgramProperty(@Nonnull java.lang.String programName, @Nonnull java.lang.String property, @Nonnull java.lang.String value) throws java.lang.Exception
programName
- The program nameproperty
- The propertyvalue
- The valuejava.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public java.lang.String getProgramProperty(@Nonnull java.lang.String programName, @Nonnull java.lang.String property)
programName
- The program name or name spaceproperty
- The code@CheckReturnValue @Nonnull public int[] listLayers() throws java.lang.Exception
java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public int[] listDataLayers() throws java.lang.Exception
java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public int[] listLiveLayers() throws java.lang.Exception
java.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public java.lang.String getRedirectURL(int id) throws java.sql.SQLException
id
- virtual IDjava.sql.SQLException
- if a database-access error occurs.@Nonnull public MasterDB setRedirectURL(@Nonnegative int id, @Nullable java.lang.String url) throws java.lang.Exception
id
- layer idurl
- redirect urljava.lang.Exception
- a serious problem.@CheckReturnValue @Nonnull public DataBase findLayerDB(@Nonnegative int id) throws java.sql.SQLException
id
- The idjava.sql.SQLException
- A serious problem@Nonnull public VirtualDB createDB(java.lang.String signature, java.lang.String parentSignature, java.lang.String ownerFirstName, java.lang.String ownerLastName, java.lang.String ownerLogin, java.lang.String ownerPassword, java.lang.String phoneNumber, java.lang.String email, java.util.Date suspends)
suspends
- when suspendedsignature
- The signature for the new VirtualDBparentSignature
- The signature of the VirtualDB this VirtualDB extendsownerFirstName
- The first name of the ownerownerLastName
- The last name of the ownerownerLogin
- The login for the ownerownerPassword
- The password for the ownerphoneNumber
- The phone number for the owneremail
- The email for the owner@Nonnull public VirtualDB createDB(java.lang.String signature, java.lang.String parentSignature, java.lang.String ownerFirstName, java.lang.String ownerLastName, java.lang.String ownerLogin, java.lang.String ownerPassword, java.lang.String phoneNumber, java.lang.String email, java.util.Date suspends, long id, java.lang.String requiredName)
id
- the idrequiredName
- the database namesuspends
- when suspendedsignature
- The signature for the new VirtualDBparentSignature
- The signature of the VirtualDB this VirtualDB extendsownerFirstName
- The first name of the ownerownerLastName
- The last name of the ownerownerLogin
- The login for the ownerownerPassword
- The password for the ownerphoneNumber
- The phone number for the owneremail
- The email for the owner@CheckReturnValue @Nonnull public java.lang.String[] listSignatures(int id) throws java.lang.Exception
id
- the id to searchjava.lang.Exception
- A serious problem@CheckReturnValue @Nonnull public static MasterDB currentMasterDB() throws java.lang.Exception
java.lang.Exception
- A serious problempublic static void setCurrentDBAsMasterDB() throws java.lang.Exception
java.lang.Exception
- A serious problempublic static void shutdownAllJMS()
public static void shutdownAllDatabases()
public void shutdownDatabases()
public static void closeAllDatabases()
public void closeDatabases()
@CheckReturnValue @Nonnull public static MasterDB findMasterDB(java.lang.String connectUrl, java.lang.String name, java.lang.String connectType, java.lang.String connectUser, java.lang.String connectPass) throws java.lang.Exception
connectUrl
- the connection URLname
- the nameconnectType
- the typeconnectUser
- connection userconnectPass
- connection password.java.lang.Exception
- A serious problempublic static void sendClearCache() throws java.lang.Exception
java.lang.Exception
public void clearDefaultDB()
@CheckReturnValue public boolean knownHost(@Nonnull java.lang.String host)
host
- the host@CheckReturnValue @Nonnull public java.lang.String getDefaultDB(@Nullable java.lang.String host)
host
- the hostpublic void shutdown()
shutdown
in interface ShutdownListener
@CheckReturnValue public static boolean isShuttingDown()
@CheckReturnValue @Nonnull public static java.lang.String parseServerURL(@Nonnull java.lang.String url)
url
- stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.