|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.installer.ServerInformation
public class ServerInformation
Finds out information about the RHQ Server and the JBossAS server it is running in. It can also be used to modify things about the RHQ Server, such as the names of the deployment artifacts.
| Nested Class Summary | |
|---|---|
static class |
ServerInformation.Product
|
static class |
ServerInformation.Server
|
| Constructor Summary | |
|---|---|
ServerInformation()
|
|
| Method Summary | |
|---|---|
void |
cleanJmsTables(Properties props)
Clean up messages in the JMS message table. |
void |
createKeystore(ServerInformation.Server haServer)
|
void |
createNewDatabaseSchema(Properties props)
This will create the database schema in the database. |
void |
ensureDatabaseIsSupported(Properties props)
Call this when you need to confirm that the database is supported. |
String |
getAffinityGroupForServer(Properties props,
String serverName)
|
Connection |
getDatabaseConnection(Properties props)
Returns a database connection with the given set of properties providing the settings that allow for a successful database connection. |
File |
getDataDirectory()
|
ServerInformation.Product |
getProduct()
|
ServerInformation.Server |
getServerDetail(Properties props,
String serverName)
|
List<String> |
getServerNames(Properties props)
Get the list of existing servers from an existing RHQ schema. |
Properties |
getServerProperties()
Gets the current set of properties currently configured for the RHQ Server. |
boolean |
isDatabaseConnectionValid(Properties props)
Returns true if the given set of properties provides settings that allow for a successful database
connection. |
boolean |
isDatabaseSchemaExist(Properties props)
Returns true if the database already has the database schema created for it. |
boolean |
isFullyDeployed()
Returns true if the RHQ Server deployment artifacts are fully deployed. |
boolean |
isUnsupportedJonFeaturesEnabled()
|
void |
moveDeploymentArtifacts(boolean deploy)
This will move the RHQ Server deployment artifacts such that they either get hot-deployed or hot-undeployed in the JBossAS server. |
void |
restartLoginConfig()
|
void |
setServerProperties(Properties props)
Writes the given properties to the RHQ Server properties file and also sets them as system properties. |
void |
storeServer(Properties props,
ServerInformation.Server server)
|
void |
upgradeExistingDatabaseSchema(Properties props)
This will update an existing database schema so it can be upgraded to the latest schema version. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServerInformation()
| Method Detail |
|---|
public boolean isDatabaseConnectionValid(Properties props)
true if the given set of properties provides settings that allow for a successful database
connection. If props is null, it will use the server properties from
getServerProperties().
props - set of properties where the connection information is found
true if the database can be connected to
public void ensureDatabaseIsSupported(Properties props)
throws Exception
props - set of properties where the connection information is found
Exception - if the database is not supported
public boolean isDatabaseSchemaExist(Properties props)
throws Exception
true if the database already has the database schema created for it. It will not be known
what version of schema or if its the latest, all this method tells you is that some RHQ database schema exists.
The given set of properties provides settings that allow for a successful database connection. If
props is null, it will use the server properties from getServerProperties().
Do not call this method unless isDatabaseConnectionValid(Properties) is true.
props - set of properties where the connection information is found
true if the database can be connected to
Exception - if failed to communicate with the database
public void createNewDatabaseSchema(Properties props)
throws Exception
props define the connection to the database -
see isDatabaseConnectionValid(Properties).
Note that if the schema already exists, it will be purged of all
data/tables and recreated.
props -
Exception - if failed to create the new schema for some reason
public void upgradeExistingDatabaseSchema(Properties props)
throws Exception
props define the connection to the database - see isDatabaseConnectionValid(Properties).
Note that if the schema does not already exist, errors will
occur.
props -
Exception - if the upgrade failed for some reasonpublic Properties getServerProperties()
RuntimeException - if failed to read the properties filepublic void setServerProperties(Properties props)
props - the new properties
RuntimeException - if failed to write the filepublic void moveDeploymentArtifacts(boolean deploy)
deploy is true, this ensures the RHQ Server deployment artifacts
(e.g. the EAR and its data source) are deployed so they can run. If deploy is false,
the caller is saying he wants the RHQ Server to be undeployed so it doesn't run anymore.
deploy - true means the RHQ Server should be deployed; otherwise, its deployment artifacts
should be undeployed
RuntimeException - if failed to move one or more artifactspublic boolean isFullyDeployed()
true if the RHQ Server deployment artifacts are fully deployed. false if the
installer needs to perform some work to finish the installation.
public File getDataDirectory()
public Connection getDatabaseConnection(Properties props)
throws SQLException
props is null, it will use the server properties from
getServerProperties().
props - set of properties where the connection information is found
SQLException - if cannot successfully connect to the databasepublic void cleanJmsTables(Properties props)
props -
public void restartLoginConfig()
throws Exception
Exception
public List<String> getServerNames(Properties props)
throws Exception
The given set of properties provides settings that allow for a successful database connection. If
props is null, it will use the server properties from getServerProperties().
Do not call this method unless isDatabaseConnectionValid(Properties) is true.
props - set of properties where the connection information is found
Exception - if failed to communicate with the databasepublic ServerInformation.Product getProduct()
public boolean isUnsupportedJonFeaturesEnabled()
public String getAffinityGroupForServer(Properties props,
String serverName)
public ServerInformation.Server getServerDetail(Properties props,
String serverName)
public void storeServer(Properties props,
ServerInformation.Server server)
throws Exception
Exceptionpublic void createKeystore(ServerInformation.Server haServer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||