}
Date stTime = new Date(startTime);
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss");
data.setServerStartTime(dateFormatter.format(stTime));
data.setServerUpTime(getTime((System.currentTimeMillis() - startTime) / 1000));
ServerConfiguration serverConfig = dataHolder.getServerConfig();
String registryType = serverConfig.getFirstProperty("Registry.Type");
if (registryType == null) {
registryType = "embedded";
}
data.setRegistryType(registryType);
// Extract DB related data from RegistryContext
if (registryType.equals("embedded")) {
try {
DataAccessManager dataAccessManager =
RegistryContext.getBaseInstance().getDataAccessManager();
if (!(dataAccessManager instanceof JDBCDataAccessManager)) {
String msg = "Failed to obtain DB connection. Invalid data access manager.";
log.error(msg);
throw new AxisFault(msg);
}
DataSource dataSource = ((JDBCDataAccessManager)dataAccessManager).getDataSource();
Connection dbConnection = dataSource.getConnection();
DatabaseMetaData metaData = dbConnection.getMetaData();
if (metaData != null) {
data.setDbName(metaData.getDatabaseProductName());
data.setDbVersion(metaData.getDatabaseProductVersion());
data.setDbDriverName(metaData.getDriverName());
data.setDbDriverVersion(metaData.getDriverVersion());
data.setDbURL(metaData.getURL());
}
dbConnection.close();
} catch (SQLException e) {
String msg = "Cannot create DB connection";
log.error(msg, e);
throw new AxisFault(msg, e);
}
} else if (registryType.equals("remote")) {
data.setRemoteRegistryChroot(serverConfig.getFirstProperty("Registry.Chroot"));
data.setRemoteRegistryURL(serverConfig.getFirstProperty("Registry.Url"));
}
}
try {
data.setServerIp(NetworkUtils.getLocalHostname());
} catch (SocketException e) {