http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.agent/src/main/java/org/apache/stratos/status/monitor/agent/internal/core/MySQLConnector.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.agent/src/main/java/org/apache/stratos/status/monitor/agent/internal/core/MySQLConnector.java b/components/org.apache.stratos.status.monitor.agent/src/main/java/org/apache/stratos/status/monitor/agent/internal/core/MySQLConnector.java deleted file mode 100644 index 099ea14..0000000 --- a/components/org.apache.stratos.status.monitor.agent/src/main/java/org/apache/stratos/status/monitor/agent/internal/core/MySQLConnector.java +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.stratos.status.monitor.agent.internal.core; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.stratos.status.monitor.core.constants.StatusMonitorConstants; -import org.apache.stratos.status.monitor.core.jdbc.MySQLConnectionInitializer; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -/** - * The class connecting with the mysql database for the Status Monitor Agent - */ -public class MySQLConnector { - private static Connection conn; - private static final Log log = LogFactory.getLog(MySQLConnector.class); - - private static List<String> serviceList = new ArrayList<String>(); - private static List<String> statusList = new ArrayList<String>(); - - private static int resolvedNotFixed = 0; - private static int resolvedWSLID; - - /** - * gets the sql connection and initializes the MySQLConnectionInitializer. - * - * @return Static Connection - * @throws Exception, throws exception - */ - public static Connection initialize() throws Exception { - //gets the sql connection. - conn = MySQLConnectionInitializer.initialize(); - - //initializes the service and state lists. - serviceList = MySQLConnectionInitializer.getServiceList(); - statusList = MySQLConnectionInitializer.getStatusList(); - - if (log.isDebugEnabled()) { - log.debug("Connection to the status database is initialized from status.monitor"); - } - - return conn; - } - - /** - * Inserts into the heartbeats table - * - * @param serviceID serviceId - * @param status - status of the service - * @throws SQLException, if inserting the stats failed - */ - public static void insertStats(int serviceID, Boolean status) throws SQLException { - String sql = StatusMonitorConstants.INSERT_STAT_SQL; - PreparedStatement pstmt = conn.prepareStatement(sql); - try { - pstmt.setString(1, null); - pstmt.setInt(2, serviceID); - pstmt.setBoolean(3, status); - pstmt.setString(4, null); - pstmt.executeUpdate(); - } catch (SQLException e) { - String msg = "Inserting stats failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - pstmt.close(); - } - } - - /** - * Inserting state into the state table. - * - * @param serviceID, service id - * @param status, status of the service {"Up & Running", "Broken", "Down", and "Fixed"} - * @param details, the service state details. - * @throws SQLException, if writing to the database failed. - */ - public static void insertState(int serviceID, Boolean status, String details) throws SQLException { - - int stateID = MySQLConnectionInitializer.getServiceStateID(serviceID); - if (!status) { - insertStateDetails(stateID, status, details); - } - - // boolean insertStatus = getInsertStatus(serviceID); - if (/*insertStatus & */(resolvedNotFixed == 0 || resolvedNotFixed == 1)) { - if (log.isDebugEnabled()) { - log.debug("Inserting data into the state database"); - } - String sql = StatusMonitorConstants.INSERT_STATE_SQL; - PreparedStatement pstmt = conn.prepareStatement(sql); - try { - - pstmt.setString(1, null); - pstmt.setInt(2, serviceID); - if (status) { - pstmt.setInt(3, 1); - } else { - pstmt.setInt(3, 2); - } - pstmt.setString(4, null); - pstmt.executeUpdate(); - } catch (SQLException e) { - String msg = "Inserting state failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - resolvedWSLID = 0; - resolvedNotFixed = 0; - pstmt.close(); - } - } - - if (/*insertStatus & */resolvedNotFixed == 2) { - String sql = StatusMonitorConstants.UPDATE_STATE_SQL; - PreparedStatement pstmtUpdate = conn.prepareStatement(sql); - try { - if (status) { - pstmtUpdate.setInt(1, 1); - } else { - pstmtUpdate.setInt(1, 2); - } - pstmtUpdate.setInt(2, resolvedWSLID); - pstmtUpdate.executeUpdate(); - } catch (SQLException e) { - String msg = "Inserting state failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - resolvedNotFixed = 0; - resolvedWSLID = 0; - pstmtUpdate.close(); - } - } - } - - /** - * Inserts the state details into the - * - * @param serviceStateID, service state ID - * @param status, boolean: status of the service - * @param detail, service state detail - * @throws SQLException, if writing to the database failed. - */ - public static void insertStateDetails(int serviceStateID, boolean status, String detail) throws SQLException { - - String sql = StatusMonitorConstants.INSERT_STATE_DETAIL_SQL; - PreparedStatement pstmt = conn.prepareStatement(sql); - - try { - pstmt.setString(1, null); - pstmt.setInt(2, serviceStateID); - if (!status) { - pstmt.setString(3, detail); - } - pstmt.setString(4, null); - pstmt.executeUpdate(); - } catch (SQLException e) { - String msg = "Inserting state details failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - pstmt.close(); - } - } - - /** - * Gets the insert status - * - * @param ServiceID, id of the service - * @return true, if insert status was successful - * @throws SQLException, if writing to the database failed. - */ - public static boolean getInsertStatus(int ServiceID) throws SQLException { - - ResultSet rs = null; - Statement stmtCon = null; - boolean currentStatus = false; - String sqlGetStateID = StatusMonitorConstants.SELECT_ALL_FROM_WSL_SERVICE_STATE_SQL + ServiceID + - StatusMonitorConstants.ORDER_BY_TIMESTAMP_SQL_DESC_LIMIT_01_SQL; - - DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); - Date SystemDate = new Date(); - dateFormat.format(SystemDate); - - int state_id; - Date date; - try { - stmtCon = conn.createStatement(); - stmtCon.executeQuery(sqlGetStateID); - rs = stmtCon.getResultSet(); - if (rs != null) { - - while (rs.next()) { - state_id = rs.getInt(StatusMonitorConstants.STATE_ID); - - if (state_id == 1) { - if (log.isDebugEnabled()) { - log.debug("Up and Running :" + state_id); - } - currentStatus = true; - } - - if (state_id == 2) { - if (log.isDebugEnabled()) { - log.debug("Broken :" + state_id); - } - currentStatus = true; - } - - if (state_id == 4) { - currentStatus = true; - date = rs.getTimestamp(StatusMonitorConstants.TIMESTAMP); - resolvedWSLID = rs.getInt(StatusMonitorConstants.ID); - - long currentTimeMs = SystemDate.getTime(); - long resolvedTimeMs = date.getTime(); - - double time_diff = ((currentTimeMs - resolvedTimeMs) / (double) StatusMonitorConstants.HOUR_IN_MILLIS); - if (log.isDebugEnabled()) { - log.debug("State ID: " + state_id); - } - if (time_diff >= 1.0) { - resolvedNotFixed = 1; - } else { - resolvedNotFixed = 2; - } - } - } - - } else { - currentStatus = true; - } - } catch (SQLException e) { - String msg = "Getting Insert state failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - if (rs != null) { - rs.close(); - } - if (stmtCon != null) { - stmtCon.close(); - } - } - return currentStatus; - } -} - -
http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/pom.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/pom.xml b/components/org.apache.stratos.status.monitor.core/pom.xml deleted file mode 100644 index 590a294..0000000 --- a/components/org.apache.stratos.status.monitor.core/pom.xml +++ /dev/null @@ -1,79 +0,0 @@ -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>org.apache.stratos</groupId> - <artifactId>stratos-components-parent</artifactId> - <version>4.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>org.apache.stratos.status.monitor.core</artifactId> - <packaging>bundle</packaging> - <name>Apache Stratos - Status Monitor Core</name> - - <build> - - <plugins> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-scr-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <extensions>true</extensions> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Name>${project.artifactId}</Bundle-Name> - <Export-Package> - org.apache.stratos.status.monitor.core.*, - </Export-Package> - <Private-Package> - org.apache.stratos.status.monitor.core.internal.*, - </Private-Package> - <Import-Package> - org.wso2.carbon.registry.core.*;version=1.0.1, - javax.xml.namespace; version=0.0.0, - javax.servlet;version="${imp.pkg.version.javax.servlet}", - javax.servlet.http;version="${imp.pkg.version.javax.servlet}", - *;resolution:=optional - </Import-Package> - <DynamicImport-Package>*</DynamicImport-Package> - </instructions> - </configuration> - </plugin> - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.registry.core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.stratos</groupId> - <artifactId>org.apache.stratos.common</artifactId> - <version>${project.version}</version> - </dependency> - </dependencies> - -</project> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/StatusMonitorConfigurationBuilder.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/StatusMonitorConfigurationBuilder.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/StatusMonitorConfigurationBuilder.java deleted file mode 100644 index 071d995..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/StatusMonitorConfigurationBuilder.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core; - -import org.apache.axiom.om.OMElement; -import org.apache.axiom.om.impl.builder.StAXOMBuilder; -import org.apache.stratos.status.monitor.core.beans.AuthConfigBean; -import org.apache.stratos.status.monitor.core.beans.SampleTenantConfigBean; -import org.apache.stratos.status.monitor.core.constants.StatusMonitorConstants; -import org.apache.stratos.status.monitor.core.exception.StatusMonitorException; -import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.xml.namespace.QName; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamReader; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; -import java.util.Iterator; - -/** - * Builds the status monitor configurations from the configuration file, status-monitor-config.xml. - */ -public class StatusMonitorConfigurationBuilder { - private static final Log log = LogFactory.getLog(StatusMonitorConfigurationBuilder.class); - private static BasicDataSource dataSource; - private static AuthConfigBean authConfigBean; - private static SampleTenantConfigBean sampleTenantConfigBean; - - - public StatusMonitorConfigurationBuilder(String statusConfigFile) throws StatusMonitorException { - try { - OMElement statusConfig = buildOMElement(new FileInputStream(statusConfigFile)); - deserialize(statusConfig); - if (log.isDebugEnabled()) { - log.debug("********Status Monitor Configuration Builder**********" + statusConfigFile); - } - } catch (FileNotFoundException e) { - String msg = "Unable to find the file responsible for status monitor configs: " - + statusConfigFile; - log.error(msg, e); - throw new StatusMonitorException(msg, e); - } - } - - private OMElement buildOMElement(InputStream inputStream) throws StatusMonitorException { - XMLStreamReader parser; - try { - parser = XMLInputFactory.newInstance().createXMLStreamReader(inputStream); - } catch (XMLStreamException e) { - String msg = "Error in initializing the parser to build the OMElement."; - log.error(msg, e); - throw new StatusMonitorException(msg, e); - } - - StAXOMBuilder builder = new StAXOMBuilder(parser); - return builder.getDocumentElement(); - } - - /* - Deserialize the following - <billingConfig xmlns="http://wso2.com/carbon/status.monitor.config"> - <dbConfig> - ... - </dbConfig> - </billingConfig> - */ - private void deserialize(OMElement statusMonitorConfigEle) throws StatusMonitorException { - Iterator statusMonitorConfigChildIt = statusMonitorConfigEle.getChildElements(); - - while (statusMonitorConfigChildIt.hasNext()) { - OMElement statusMonitorConfigChildEle = (OMElement) statusMonitorConfigChildIt.next(); - - if (new QName(StatusMonitorConstants.CONFIG_NS, StatusMonitorConstants.DB_CONFIG, - StatusMonitorConstants.NS_PREFIX).equals(statusMonitorConfigChildEle.getQName())) { - //element is "dbConfig" - initDataSource(statusMonitorConfigChildEle); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.AUTH_CONFIG, - StatusMonitorConstants.NS_PREFIX).equals(statusMonitorConfigChildEle.getQName())) { - //element is "authConfig" - initAuthentication(statusMonitorConfigChildEle); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, StatusMonitorConstants.PS_CONFIG, - StatusMonitorConstants.NS_PREFIX).equals(statusMonitorConfigChildEle.getQName())) { - //element is "psConfig" - initSampleServicesMonitoring(statusMonitorConfigChildEle); - } else { - String msg = "Unknown element in Status Monitor Configuration: " + - statusMonitorConfigChildEle.getQName().getLocalPart(); - log.warn(msg); - } - } - } - - /* - * Deserialise dbConfigElement (Given below) and initialize data source - <dbConfig> - <url>jdbc:mysql://localhost:3306/stratos_stat</url> - <userName>monitor</userName> - <password>monitor</password> - <driverName>com.mysql.jdbc.Driver</driverName> - <maxActive>80</maxActive> - <maxWait>60000</maxWait> - <minIdle>5</minIdle> - <validationQuery>SELECT 1</validationQuery> - </dbConfig> - */ - private void initDataSource(OMElement dbConfigEle) throws StatusMonitorException { - // initializing the data source and load the database configurations - Iterator dbConfigChildIt = dbConfigEle.getChildElements(); - dataSource = new BasicDataSource(); - - while (dbConfigChildIt.hasNext()) { - - OMElement dbConfigChildEle = (OMElement) dbConfigChildIt.next(); - if (new QName(StatusMonitorConstants.CONFIG_NS, StatusMonitorConstants.DBCONFIG_URL, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setUrl(dbConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_USER_NAME, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setUsername(dbConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_PASSWORD, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setPassword(dbConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_DRIVER_NAME, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setDriverClassName(dbConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_MAX_ACTIVE, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setMaxActive(Integer.parseInt(dbConfigChildEle.getText())); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_MAX_WAIT, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setMaxWait(Integer.parseInt(dbConfigChildEle.getText())); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_MIN_IDLE, - StatusMonitorConstants.NS_PREFIX).equals(dbConfigChildEle.getQName())) { - dataSource.setMinIdle(Integer.parseInt(dbConfigChildEle.getText())); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.DBCONFIG_VALIDATION_QUERY, - StatusMonitorConstants.NS_PREFIX) - .equals(dbConfigChildEle.getQName())) { - dataSource.setValidationQuery(dbConfigChildEle.getText()); - } else { - String msg = "Unknown element in DBConfig of Status Monitor Configuration: " + - dbConfigChildEle.getQName().getLocalPart(); - log.warn(msg); - } - } - } - - /* - * Deserialise authConfigElement (Given below) and initializes authConfigBean - <authConfig> - <jksLocation>/home/carbon/automation/projects/src/resources/wso2carbon.jks</jksLocation> - <userName>[email protected]</userName> - <password>password123</password> - </authConfig> - */ - private void initAuthentication(OMElement authConfigEle) throws StatusMonitorException { - // initializing the and loading the authentication configurations - Iterator authConfigChildIt = authConfigEle.getChildElements(); - authConfigBean = new AuthConfigBean(); - - while (authConfigChildIt.hasNext()) { - OMElement authConfigChildEle = (OMElement) authConfigChildIt.next(); - if (new QName(StatusMonitorConstants.CONFIG_NS, StatusMonitorConstants.JKS_LOCATION, - StatusMonitorConstants.NS_PREFIX).equals(authConfigChildEle.getQName())) { - authConfigBean.setJksLocation(authConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.AUTHCONFIG_USER_NAME, - StatusMonitorConstants.NS_PREFIX).equals(authConfigChildEle.getQName())) { - authConfigBean.setUserName(authConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.AUTHCONFIG_PASSWORD, - StatusMonitorConstants.NS_PREFIX).equals(authConfigChildEle.getQName())) { - authConfigBean.setPassword(authConfigChildEle.getText()); - } else if (new QName(StatusMonitorConstants.CONFIG_NS, - StatusMonitorConstants.AUTHCONFIG_TENANT, - StatusMonitorConstants.NS_PREFIX).equals(authConfigChildEle.getQName())) { - authConfigBean.setTenant(authConfigChildEle.getText()); - } else { - String msg = "Unknown element in AuthConfig of Status Monitor Configuration: " + - authConfigChildEle.getQName().getLocalPart(); - log.warn(msg); - } - } - } - - /** - <platformSample> - <tenantDomain>wso2.org</tenantDomain> - </platformSample> - */ - private void initSampleServicesMonitoring (OMElement psConfigEle) throws StatusMonitorException { - // initializing the and loading the authentication configurations - Iterator psConfigChildIt = psConfigEle.getChildElements(); - sampleTenantConfigBean = new SampleTenantConfigBean(); - - while (psConfigChildIt.hasNext()) { - OMElement psConfigChildEle = (OMElement) psConfigChildIt.next(); - if (new QName(StatusMonitorConstants.CONFIG_NS, StatusMonitorConstants.PSCONFIG_TENANT, - StatusMonitorConstants.NS_PREFIX).equals(psConfigChildEle.getQName())) { - sampleTenantConfigBean.setTenant(psConfigChildEle.getText()); - } else { - String msg = "Unknown element in PSConfig of Status Monitor Configuration: " + - psConfigChildEle.getQName().getLocalPart(); - log.warn(msg); - } - } - } - - public static BasicDataSource getDataSource() { - return dataSource; - } - - public static AuthConfigBean getAuthConfigBean() { - return authConfigBean; - } - - public static SampleTenantConfigBean getSampleTenantConfigBean() { - return sampleTenantConfigBean; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/AuthConfigBean.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/AuthConfigBean.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/AuthConfigBean.java deleted file mode 100644 index a98d94a..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/AuthConfigBean.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.beans; - -/** - * Authentication Configuration object that is read from the startus-monitor-config.xml. - */ -public class AuthConfigBean { - private String jksLocation; - private String userName; - private String password; - private String tenant; - - public String getTenant() { - return tenant; - } - - public void setTenant(String tenant) { - this.tenant = tenant; - } - - public String getJksLocation() { - return jksLocation; - } - - public void setJksLocation(String jksLocation) { - this.jksLocation = jksLocation; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/SampleTenantConfigBean.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/SampleTenantConfigBean.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/SampleTenantConfigBean.java deleted file mode 100644 index 5c25e0c..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/beans/SampleTenantConfigBean.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.beans; - -/** - * The tenant with the sample services installed. - */ -public class SampleTenantConfigBean { - private String tenant; - - public String getTenant() { - return tenant; - } - - public void setTenant(String tenant) { - this.tenant = tenant; - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/constants/StatusMonitorConstants.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/constants/StatusMonitorConstants.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/constants/StatusMonitorConstants.java deleted file mode 100644 index ff54b72..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/constants/StatusMonitorConstants.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.constants; - -/** - * Constants common to the stratos status monitor - */ -public class StatusMonitorConstants { - - /*Status Monitor Configuration File*/ - public static final String STATUS_MONITOR_CONFIG = "status-monitor-config.xml"; - public static final String CONFIG_NS = "http://wso2.com/carbon/status/monitor/config"; - - /*Authentication Configurations*/ - public static final String AUTH_CONFIG = "authConfig"; - public static final String JKS_LOCATION = "jksLocation"; - public static final String AUTHCONFIG_USER_NAME = "userName"; - public static final String AUTHCONFIG_PASSWORD = "password"; - public static final String AUTHCONFIG_TENANT = "tenantDomain"; - - /*The tenant with the service samples*/ - public static final String PS_CONFIG = "platformSample"; - public static final String PSCONFIG_TENANT = "tenantDomain"; - - /*Database configurations*/ - public static final String DB_CONFIG = "dbConfig"; - public static final String NS_PREFIX = ""; - public static final String DBCONFIG_VALIDATION_QUERY = "validationQuery"; - public static final String DBCONFIG_MAX_WAIT = "maxWait"; - public static final String DBCONFIG_MIN_IDLE = "minIdle"; - public static final String DBCONFIG_MAX_ACTIVE = "maxActive"; - public static final String DBCONFIG_DRIVER_NAME = "driverName"; - public static final String DBCONFIG_PASSWORD = "password"; - public static final String DBCONFIG_USER_NAME = "userName"; - public static final String DBCONFIG_URL = "url"; - - public static final long HOUR_IN_MILLIS = 3600000; - - /*Services List*/ - public static final String MANAGER = "StratosLive Manager"; - public static final String ESB = "StratosLive Enterprise Service Bus"; - public static final String APPSERVER = "StratosLive Application Server"; - public static final String DATA = "StratosLive Data Services Server"; - public static final String GOVERNANCE = "StratosLive Governance Registry"; - public static final String IDENTITY = "StratosLive Identity Server"; - public static final String MONITOR = "StratosLive Business Activity Monitor"; - public static final String PROCESS = "StratosLive Business Process Server"; - public static final String RULE = "StratosLive Business Rules Server"; - public static final String MASHUP = "StratosLive Mashup Server"; - public static final String GADGET = "StratosLive Gadget Server"; - public static final String CEP = "StratosLive Complex Event Processing Server"; - public static final String MESSAGING = "StratosLive Message Broker"; - - public static final String CARBON_OM_NAMESPACE = "http://service.carbon.wso2.org"; - - /*Hosts list*/ - public static final String APPSERVER_HOST = "appserver.stratoslive.wso2.com"; - public static final String APPSERVER_HTTP = "http://appserver.stratoslive.wso2.com"; - public static final String MONITOR_HOST = "monitor.stratoslive.wso2.com"; - - public static final String MESSAGING_HOST = "messaging.stratoslive.wso2.com"; - public static final String MESSAGING_DEFAULT_PORT = "5675"; - - public static final String MASHUP_HOST = "mashup.stratoslive.wso2.com"; - public static final String MASHUP_HTTP = "http://mashup.stratoslive.wso2.com"; - - public static final String PROCESS_HOST = "process.stratoslive.wso2.com"; - public static final String PROCESS_HTTP = "http://process.stratoslive.wso2.com"; - - public static final String RULE_HOST = "rule.stratoslive.wso2.com"; - public static final String RULE_HTTP = "http://rule.stratoslive.wso2.com"; - - public static final String CEP_HOST = "cep.stratoslive.wso2.com"; - - public static final String ESB_HOST = "esb.stratoslive.wso2.com"; - public static final String ESB_HTTP = "http://esb.stratoslive.wso2.com"; - public static final String ESB_NHTTP_PORT = "8280"; - - public static final String GOVERNANCE_HOST = "governance.stratoslive.wso2.com"; - public static final String GOVERNANCE_HTTP = "http://governance.stratoslive.wso2.com"; - - public static final String GADGETS_HOST = "gadget.stratoslive.wso2.com"; - public static final String GADGETS_HTTP = "http://gadget.stratoslive.wso2.com"; - - public static final String DATA_HOST = "data.stratoslive.wso2.com"; - public static final String DATA_HTTP = "http://data.stratoslive.wso2.com"; - - public static final String IDENTITY_HOST = "identity.stratoslive.wso2.com"; - public static final String IDENTITY_HTTPS = "https://identity.stratoslive.wso2.com"; - - public static final String MANAGER_HOST = "stratoslive.wso2.com"; - public static final String MANAGER_HTTPS = "https://stratoslive.wso2.com"; - - public static final long SLEEP_TIME = 15 * 60 * 1000; - - - /*SQL Statements - Status Monitor Core and Common*/ - public static final String GET_SERVICE_ID_SQL_WSL_NAME_LIKE_SQL = - "SELECT WSL_ID FROM WSL_SERVICE WHERE WSL_NAME LIKE "; - public static final String GET_SERVICE_STATE_ID_SQL = - "SELECT WSL_ID FROM WSL_SERVICE_STATE WHERE WSL_SERVICE_ID = "; - public static final String ID = "WSL_ID"; - public static final String STATE_ID = "WSL_STATE_ID"; - public static final String TIMESTAMP = "WSL_TIMESTAMP"; - public static final String NAME = "WSL_NAME"; - public static final String ORDER_BY_TIMESTAMP_SQL = " ORDER BY WSL_TIMESTAMP DESC LIMIT 1"; - public static final String ORDER_BY_TIMESTAMP_SQL_DESC_LIMIT_01_SQL = - " ORDER BY WSL_TIMESTAMP DESC LIMIT 0,1"; - public static final String SELECT_ALL_FROM_WSL_SERVICE_STATE_SQL = - "SELECT * FROM WSL_SERVICE_STATE WHERE WSL_SERVICE_ID ="; - - /*SQL Statements - Status Monitor Back End*/ - public static final String GET_STATE_NAME_SQL = "SELECT WSL_NAME FROM WSL_STATE"; - public static final String GET_SERVICE_NAME_SQL = "SELECT WSL_NAME FROM WSL_SERVICE"; - public static final String GET_ALL_STATE_DETAIL_SQL = "select s.WSL_NAME, ss.WSL_TIMESTAMP, " + - "ssd.WSL_DETAIL, ssd.WSL_TIMESTAMP " + - "from WSL_SERVICE as s, WSL_SERVICE_STATE as ss, WSL_SERVICE_STATE_DETAIL as " + - "ssd where s.WSL_ID = ss.WSL_SERVICE_ID AND ss.WSL_ID = ssd.WSL_SERVICE_STATE_ID " + - "AND (ss.WSL_STATE_ID=2 OR ss.WSL_STATE_ID=3) order by ss.WSL_TIMESTAMP DESC"; - public static final String SERVICE_WSL_NAME = "s.WSL_NAME"; - public static final String SERVICE_STATE_WSL_TIMESTAMP = "ss.WSL_TIMESTAMP"; - public static final String SERVICE_STATE_DETAIL_WSL_TIMESTAMP = "ssd.WSL_TIMESTAMP"; - public static final String SERVICE_STATE_DETAIL = "ssd.WSL_DETAIL"; - public static final String GET_SERVICE_STATE_SQL = - "SELECT * FROM WSL_SERVICE_STATE WHERE WSL_SERVICE_ID="; - - /*SQL statements - Status Monitor Agent*/ - public static final String INSERT_STAT_SQL = "INSERT INTO WSL_SERVICE_HEARTBEAT VALUES (?,?,?,?)"; - public static final String INSERT_STATE_SQL = "INSERT INTO WSL_SERVICE_STATE VALUES (?,?,?,?)"; - public static final String UPDATE_STATE_SQL = - "UPDATE WSL_SERVICE_STATE SET WSL_STATE_ID=? WHERE WSL_ID= ?"; - public static final String INSERT_STATE_DETAIL_SQL = - "INSERT INTO WSL_SERVICE_STATE_DETAIL VALUES (?,?,?,?)"; - -} - http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/exception/StatusMonitorException.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/exception/StatusMonitorException.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/exception/StatusMonitorException.java deleted file mode 100644 index 1a1958a..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/exception/StatusMonitorException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.exception; - -/** - * StatusMonitor specific exceptions - */ -public class StatusMonitorException extends Exception{ - - public StatusMonitorException(String msg, Exception e) { - super(msg, e); - } - - public StatusMonitorException(String msg) { - super(msg); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/internal/StatusMonitorCoreComponent.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/internal/StatusMonitorCoreComponent.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/internal/StatusMonitorCoreComponent.java deleted file mode 100644 index 1aa0d74..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/internal/StatusMonitorCoreComponent.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.internal; - -import org.apache.axis2.context.ConfigurationContext; -import org.apache.stratos.status.monitor.core.util.StatusMonitorUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.utils.ConfigurationContextService; - -/** - * @scr.component name="org.wso2.carbon.status.monitor" immediate="true" - * @scr.reference name="configuration.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="1..1" policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - */ -public class StatusMonitorCoreComponent { - private static Log log = LogFactory.getLog( - StatusMonitorCoreComponent.class); - - private static BundleContext bundleContext; - private static ConfigurationContextService configurationContextService; - - protected void activate(ComponentContext context) { - try { - bundleContext = context.getBundleContext(); - if (StatusMonitorUtil.getStatusMonitorConfiguration() == null) { - StatusMonitorUtil.initStatusMonitor(context.getBundleContext()); - if (log.isDebugEnabled()) { - log.debug("Status Monitor Agent initialized"); - } - } - if (log.isDebugEnabled()) { - log.debug("******* Status Monitor core bundle is activated ******* "); - } - } catch (Exception e) { - log.error("******* Status Monitor Core bundle failed activating ****", e); - } - } - - protected void deactivate(ComponentContext context) { - log.debug("******* Status Monitor core bundle is deactivated ******* "); - } - - protected void setConfigurationContextService( - ConfigurationContextService configurationContextService) { - log.debug("Receiving ConfigurationContext Service"); - StatusMonitorCoreComponent. - configurationContextService = configurationContextService; - } - - protected void unsetConfigurationContextService( - ConfigurationContextService configurationContextService) { - log.debug("Unsetting ConfigurationContext Service"); - setConfigurationContextService(null); - } - - public static BundleContext getBundleContext() { - return bundleContext; - } - - public static ConfigurationContextService getConfigurationContextService() { - return configurationContextService; - } - - public static ConfigurationContext getConfigurationContext() { - if (configurationContextService.getServerConfigContext() == null) { - return null; - } - return configurationContextService.getServerConfigContext(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/jdbc/MySQLConnectionInitializer.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/jdbc/MySQLConnectionInitializer.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/jdbc/MySQLConnectionInitializer.java deleted file mode 100644 index dd13232..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/jdbc/MySQLConnectionInitializer.java +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.stratos.status.monitor.core.jdbc; - -import org.apache.stratos.status.monitor.core.StatusMonitorConfigurationBuilder; -import org.apache.stratos.status.monitor.core.constants.StatusMonitorConstants; -import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.util.ArrayList; - -import java.util.Collections; -import java.util.List; - -/** - * The class connecting with the mysql database - */ -public class MySQLConnectionInitializer { - private static Connection conn = null; - private static BasicDataSource dataSource; - private static final Log log = LogFactory.getLog(StatusMonitorConfigurationBuilder.class); - - private static List<String> serviceList = new ArrayList<String>(); - private static List<String> statusList = new ArrayList<String>(); - - /** - * gets a copy of services list - * - * @return an unmodifiable list. - */ - public static List<String> getServiceList() { - return Collections.unmodifiableList(serviceList); - } - - /** - * gets a copy of statuses list - * - * @return an unmodifiable list. - */ - public static List<String> getStatusList() { - return Collections.unmodifiableList(statusList); - } - - /** - * gets the sql connection and initializes the MySQLConnectionInitializer. - * - * @return Static Connection - * @throws Exception, throws exception MySQLConnectionInitializer - */ - public static Connection initialize() throws Exception { - //gets the data source from the configuration builder. - dataSource = StatusMonitorConfigurationBuilder.getDataSource(); - - //gets the sql connection. - getConnection(); - - //initializes the service and state lists. - serviceList = getServiceNamesList(); - statusList = getStateNameList(); - - if (log.isDebugEnabled()) { - log.debug("Successfully initialized the mysql connection"); - } - return conn; - } - - /** - * Gets the SQL Connection to the status monitor database - * - * @return a Connection object - * @throws Exception, if getting the connection failed. - */ - private static Connection getConnection() throws Exception { - try { - String userName = dataSource.getUsername(); //monitor - String password = dataSource.getPassword(); //monitor - String url = dataSource.getUrl(); //jdbc:mysql://localhost:3306/stratos_status - String driverName = dataSource.getDriverClassName(); - - Class.forName(driverName).newInstance(); - conn = DriverManager.getConnection(url, userName, password); - - if (conn != null) { - if (log.isDebugEnabled()) { - log.debug("Connection Successful"); - } - } - } catch (SQLException e) { - String msg = "SQL connection to the health monitor database instance failed"; - log.error(msg, e); - throw new Exception(msg, e); - } catch (Exception e) { - String msg = "Connection to the health monitor database instance failed"; - log.error(msg, e); - throw new Exception(msg, e); - } - return conn; - } - - /** - * Gets the list of available services - * - * @return List of services - * @throws SQLException, if getting the service name failed. - */ - private static List<String> getServiceNamesList() throws SQLException { - List<String> serviceList = new ArrayList<String>(); - ResultSet rs; - Statement stmtCon = conn.createStatement(); - String sql = StatusMonitorConstants.GET_SERVICE_NAME_SQL; - - stmtCon.executeQuery(sql); - rs = stmtCon.getResultSet(); - String serviceName; - try { - while (rs.next()) { - serviceName = rs.getString(StatusMonitorConstants.NAME); - serviceList.add(serviceName); - } - } catch (SQLException e) { - String msg = "Getting the service name list failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - rs.close(); - stmtCon.close(); - } - return serviceList; - } - - /** - * Gets state name with the given state id - * - * @return state name - * {Up & Running, Broken, Down, Fixed. } - * @throws java.sql.SQLException, if the retrieval of the list of states failed. - */ - private static List<String> getStateNameList() throws SQLException { - List<String> stateList = new ArrayList<String>(); - ResultSet rs; - Statement stmtCon = conn.createStatement(); - String sql = StatusMonitorConstants.GET_STATE_NAME_SQL; - - stmtCon.executeQuery(sql); - rs = stmtCon.getResultSet(); - String stateName; - try { - while (rs.next()) { - stateName = rs.getString(StatusMonitorConstants.NAME); - stateList.add(stateName); - } - } catch (SQLException e) { - String msg = "Getting the serviceID failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - rs.close(); - stmtCon.close(); - } - return stateList; - } - - /** - * Gets the ServiceID, for the given product. - * - * @param product, name of the service/product - * @return serviceID: int - * @throws SQLException, if retrieving the service id failed. - */ - public static int getServiceID(String product) throws SQLException { - Statement stmtCon = conn.createStatement(); - String sql = StatusMonitorConstants.GET_SERVICE_ID_SQL_WSL_NAME_LIKE_SQL + "\"" + product + "\""; - int serviceId = 0; - ResultSet rs = stmtCon.getResultSet(); - - try { - stmtCon.executeQuery(sql); - while (rs.next()) { - serviceId = rs.getInt(StatusMonitorConstants.ID); - } - } catch (SQLException e) { - String msg = "Getting the serviceID failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - rs.close(); - stmtCon.close(); - } - return serviceId; - } - - /** - * Gets the ServiceStateID, for the given product/service. - * - * @param serviceID: int; ID of the service/product - * @return serviceStateID: int - * @throws SQLException, if retrieving the service id failed. - */ - public static int getServiceStateID(int serviceID) throws SQLException { - ResultSet rs; - Statement stmtCon = conn.createStatement(); - String sql = StatusMonitorConstants.GET_SERVICE_STATE_ID_SQL + serviceID + - StatusMonitorConstants.ORDER_BY_TIMESTAMP_SQL; - - stmtCon.executeQuery(sql); - rs = stmtCon.getResultSet(); - int stateID = 0; - try { - while (rs.next()) { - stateID = rs.getInt(StatusMonitorConstants.ID); - } - } catch (SQLException e) { - String msg = "Getting the service state ID failed"; - log.error(msg, e); - throw new SQLException(msg, e); - } finally { - rs.close(); - stmtCon.close(); - } - return stateID; - } -} - - http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/util/StatusMonitorUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/util/StatusMonitorUtil.java b/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/util/StatusMonitorUtil.java deleted file mode 100644 index 9d70386..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/java/org/apache/stratos/status/monitor/core/util/StatusMonitorUtil.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.core.util; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.apache.stratos.status.monitor.core.StatusMonitorConfigurationBuilder; -import org.apache.stratos.status.monitor.core.constants.StatusMonitorConstants; -import org.apache.stratos.status.monitor.core.exception.StatusMonitorException; -import org.apache.stratos.status.monitor.core.jdbc.MySQLConnectionInitializer; -import org.wso2.carbon.utils.CarbonUtils; - -import java.io.File; - -/** - * Utility methods for Status monitor core. - */ -public class StatusMonitorUtil { - - private static final Log log = - LogFactory.getLog(StatusMonitorUtil.class); - private static StatusMonitorConfigurationBuilder statusMonitorConfiguration; - - public static StatusMonitorConfigurationBuilder getStatusMonitorConfiguration() { - return statusMonitorConfiguration; - } - - /** - * load the configuration for the status monitoring - * @param bundleContext, BundleContext - * @throws org.apache.stratos.status.monitor.core.exception.StatusMonitorException, - * if the status monitoring failed. - */ - public static void initStatusMonitor( - BundleContext bundleContext) throws StatusMonitorException { - String configFile = - CarbonUtils.getCarbonConfigDirPath() + File.separator + - StatusMonitorConstants.STATUS_MONITOR_CONFIG; - try { - statusMonitorConfiguration = new StatusMonitorConfigurationBuilder(configFile); - } catch (Exception e) { - String msg = "The Status Monitor Configuration file not found"; - log.error(msg, e); - throw new StatusMonitorException (msg, e); - } - try { - MySQLConnectionInitializer.initialize(); - } catch (Exception e) { - String msg = "Error in initializing the mysql connection for the health monitoring"; - log.error(msg, e); - throw new StatusMonitorException (msg, e); - } - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.core/src/main/resources/META-INF/component.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.core/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.status.monitor.core/src/main/resources/META-INF/component.xml deleted file mode 100755 index e396e5b..0000000 --- a/components/org.apache.stratos.status.monitor.core/src/main/resources/META-INF/component.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> - -<component xmlns="http://products.wso2.org/carbon"> - <ManagementPermissions> - <ManagementPermission> - <DisplayName>Manage</DisplayName> - <ResourceId>/permission/protected/manage</ResourceId> - </ManagementPermission> - <ManagementPermission> - <DisplayName>Monitor</DisplayName> - <ResourceId>/permission/protected/manage/monitor</ResourceId> - </ManagementPermission> - <ManagementPermission> - <DisplayName>Tenants</DisplayName> - <ResourceId>/permission/protected/manage/monitor/tenants</ResourceId> - </ManagementPermission> - <ManagementPermission> - <DisplayName>Modify</DisplayName> - <ResourceId>/permission/protected/manage/modify</ResourceId> - </ManagementPermission> - <ManagementPermission> - <DisplayName>Tenants</DisplayName> - <ResourceId>/permission/protected/manage/modify/tenants</ResourceId> - </ManagementPermission> - </ManagementPermissions> -</component> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/pom.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/pom.xml b/components/org.apache.stratos.status.monitor.ui/pom.xml deleted file mode 100644 index 882f6b5..0000000 --- a/components/org.apache.stratos.status.monitor.ui/pom.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - # Licensed to the Apache Software Foundation (ASF) under one - # or more contributor license agreements. See the NOTICE file - # distributed with this work for additional information - # regarding copyright ownership. The ASF licenses this file - # to you under the Apache License, Version 2.0 (the - # "License"); you may not use this file except in compliance - # with the License. You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, - # software distributed under the License is distributed on an - # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - # KIND, either express or implied. See the License for the - # specific language governing permissions and limitations - # under the License. - --> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <parent> - <groupId>org.apache.stratos</groupId> - <artifactId>stratos-components-parent</artifactId> - <version>4.1.0-SNAPSHOT</version> - </parent> - - <modelVersion>4.0.0</modelVersion> - <artifactId>org.apache.stratos.status.monitor.ui</artifactId> - <packaging>bundle</packaging> - <name>Apache Stratos - Status Monitor - User Interface</name> - - <build> - - <plugins> - - <plugin> - <groupId>org.apache.felix</groupId> - <artifactId>maven-bundle-plugin</artifactId> - - <extensions>true</extensions> - <configuration> - <instructions> - <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> - <Bundle-Name>${project.artifactId}</Bundle-Name> - <Export-Package> - org.apache.stratos.status.monitor.ui.*, - </Export-Package> - <Import-Package> - javax.servlet;version="${imp.pkg.version.javax.servlet}", - javax.servlet.http;version="${imp.pkg.version.javax.servlet}", - org.apache.stratos.monitor.stub.*; version="${carbon.platform.package.import.version.range}", - *;resolution:=optional - </Import-Package> - <Carbon-Component>UIBundle</Carbon-Component> - </instructions> - </configuration> - </plugin> - - </plugins> - </build> - - <dependencies> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.ui</artifactId> - <version>4.2.0</version> - </dependency> - <dependency> - <groupId>org.wso2.carbon</groupId> - <artifactId>org.wso2.carbon.status.monitor.stub</artifactId> - <version>4.2.0</version> - </dependency> - <dependency> - <groupId>org.apache.stratos</groupId> - <artifactId>org.apache.stratos.common</artifactId> - <version>${project.version}</version> - </dependency> - <dependency> - <groupId>org.json.wso2</groupId> - <artifactId>json</artifactId> - <version>1.0.0.wso2v1</version> - </dependency> - </dependencies> -</project> http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/clients/HealthMonitorServiceClient.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/clients/HealthMonitorServiceClient.java b/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/clients/HealthMonitorServiceClient.java deleted file mode 100755 index 6090f6c..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/clients/HealthMonitorServiceClient.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.ui.clients; - -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.registry.core.exceptions.RegistryException; - -import org.wso2.carbon.status.monitor.stub.HealthMonitorServiceStub; -import org.wso2.carbon.status.monitor.stub.beans.xsd.ServiceStateDetailInfoBean; -import org.wso2.carbon.status.monitor.stub.beans.xsd.ServiceStateInfoBean; - -import org.wso2.carbon.ui.CarbonUIUtil; -import org.wso2.carbon.utils.ServerConstants; - -import javax.servlet.ServletConfig; -import javax.servlet.http.HttpSession; - -/** - * HealthMonitorService Client of status.monitor.ui - */ -public class HealthMonitorServiceClient { - private static final Log log = LogFactory.getLog( - HealthMonitorServiceClient.class); - - private HealthMonitorServiceStub stub; - - public HealthMonitorServiceClient(String cookie, String backendServerURL, - ConfigurationContext configContext) throws RegistryException { - - String epr = backendServerURL + "HealthMonitorService"; - - try { - stub = new HealthMonitorServiceStub(configContext, epr); - - ServiceClient client = stub._getServiceClient(); - Options option = client.getOptions(); - option.setManageSession(true); - option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); - - } catch (AxisFault axisFault) { - String msg = "Failed to initiate HealthMonitor service client. " + axisFault.getMessage(); - log.error(msg, axisFault); - throw new RegistryException(msg, axisFault); - } - } - - public HealthMonitorServiceClient(ServletConfig config, HttpSession session) - throws RegistryException { - - String cookie = (String)session.getAttribute(ServerConstants.ADMIN_SERVICE_COOKIE); - String backendServerURL = CarbonUIUtil.getServerURL(config.getServletContext(), session); - ConfigurationContext configContext = (ConfigurationContext) config. - getServletContext().getAttribute(CarbonConstants.CONFIGURATION_CONTEXT); - String epr = backendServerURL + "HealthMonitorService"; - - try { - stub = new HealthMonitorServiceStub(configContext, epr); - - ServiceClient client = stub._getServiceClient(); - Options option = client.getOptions(); - option.setManageSession(true); - option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie); - - } catch (AxisFault axisFault) { - String msg = "Failed to initiate HealthMonitor Services service client. " + - axisFault.getMessage(); - log.error(msg, axisFault); - throw new RegistryException(msg, axisFault); - } - } - - public ServiceStateInfoBean[] retrieveStatuses() throws Exception { - return stub.getAllServiceStatus(); - } - - public ServiceStateInfoBean getServiceStatus(String serviceName) throws Exception { - return stub.getServiceStatus(serviceName); - } - - public ServiceStateDetailInfoBean[] retrieveStateDetails() throws Exception { - return stub.getAllServiceStateDetail(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/utils/StatusMonitorUtil.java ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/utils/StatusMonitorUtil.java b/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/utils/StatusMonitorUtil.java deleted file mode 100755 index 5534b2c..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/java/org/apache/stratos/status/monitor/ui/utils/StatusMonitorUtil.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.stratos.status.monitor.ui.utils; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.status.monitor.stub.beans.xsd.ServiceStateDetailInfoBean; -import org.wso2.carbon.status.monitor.stub.beans.xsd.ServiceStateInfoBean; -import org.apache.stratos.status.monitor.ui.clients.HealthMonitorServiceClient; - -import javax.servlet.ServletConfig; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; - -/** - * Utility methods for status.monitor.ui - */ -public class StatusMonitorUtil { - private static final Log log = LogFactory.getLog( - StatusMonitorUtil.class); - - /** - * Get all the service statuses - * - * @param request HttpServletRequest - * @param config ServletConfig - * @param session HttpSession - * @return ServiceStateInfoBean[] - Array of service states - * @throws Exception , if getting the service status information failed. - */ - public static ServiceStateInfoBean[] retrieveStatuses( - HttpServletRequest request, ServletConfig config, - HttpSession session) throws Exception { - - try { - HealthMonitorServiceClient serviceClient = - new HealthMonitorServiceClient(config, session); - return serviceClient.retrieveStatuses(); - } catch (Exception e) { - String msg = "Failed to get the service status info beans"; - log.error(msg, e); - throw new Exception(msg, e); - } - } - - /** - * Get all the service statuses - * @param request HttpServletRequest - * @param config ServletConfig - * @param session HttpSession - * @return ServiceStateDetailInfoBean[] - Array of service state details - * @throws Exception , if getting the service state detail information failed. - */ - public static ServiceStateDetailInfoBean[] retrieveStateDetails( - HttpServletRequest request, ServletConfig config, - HttpSession session) throws Exception { - try { - HealthMonitorServiceClient serviceClient = - new HealthMonitorServiceClient(config, session); - return serviceClient.retrieveStateDetails(); - } catch (Exception e) { - String msg = "Failed to get the service state details info beans"; - log.error(msg, e); - throw new Exception(msg, e); - } - } - - /** - * Get the status of a particular service - * - * @param request HttpServletRequest - * @param config ServletConfig - * @param session HttpSession - * @return ServiceStateInfoBean - State details of the service - * @throws Exception, if error in getting the service state information - */ - public static ServiceStateInfoBean getStatus(HttpServletRequest request, ServletConfig config, - HttpSession session) throws Exception { - String serviceName = ""; - try { - serviceName = request.getParameter("service"); - HealthMonitorServiceClient serviceClient = - new HealthMonitorServiceClient(config, session); - return serviceClient.getServiceStatus(serviceName); - } catch (Exception e) { - String msg = "Failed to get the status details of the service:" + serviceName; - log.error(msg, e); - throw new Exception(msg, e); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/META-INF/component.xml ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/META-INF/component.xml b/components/org.apache.stratos.status.monitor.ui/src/main/resources/META-INF/component.xml deleted file mode 100755 index 70d4780..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/resources/META-INF/component.xml +++ /dev/null @@ -1,49 +0,0 @@ -<!-- - ~ Licensed to the Apache Software Foundation (ASF) under one - ~ or more contributor license agreements. See the NOTICE file - ~ distributed with this work for additional information - ~ regarding copyright ownership. The ASF licenses this file - ~ to you under the Apache License, Version 2.0 (the - ~ "License"); you may not use this file except in compliance - ~ with the License. You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, - ~ software distributed under the License is distributed on an - ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - ~ KIND, either express or implied. See the License for the - ~ specific language governing permissions and limitations - ~ under the License. - --> -<component xmlns="http://products.wso2.org/carbon"> - <!-- sample menu configuration --> - <menus> - <menu> - <id>status_monitor_menu</id> - <i18n-key>monitor.service.status</i18n-key> - <i18n-bundle>org.apache.stratos.status.monitor.ui.i18n.Resources</i18n-bundle> - <parent-menu>monitor_menu</parent-menu> - <link>../status-monitor/service-status.jsp</link> - <region>region4</region> - <order>51</order> - <style-class>manage</style-class> - <icon>../status-monitor/images/services.gif</icon> - <require-permission>/permission/protected/manage/monitor/tenants</require-permission> - <require-super-tenant>true</require-super-tenant> - </menu> - <menu> - <id>status_details_menu</id> - <i18n-key>services.state.details</i18n-key> - <i18n-bundle>org.apache.stratos.status.monitor.ui.i18n.Resources</i18n-bundle> - <parent-menu>monitor_menu</parent-menu> - <link>../status-monitor/status-details.jsp</link> - <region>region4</region> - <order>52</order> - <style-class>manage</style-class> - <icon>../status-monitor/images/services1.gif</icon> - <require-permission>/permission/protected/manage/monitor/tenants</require-permission> - <require-super-tenant>true</require-super-tenant> - </menu> - </menus> -</component> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/JSResources.properties ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/JSResources.properties b/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/JSResources.properties deleted file mode 100755 index 7e29978..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/JSResources.properties +++ /dev/null @@ -1,16 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/Resources.properties ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/Resources.properties b/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/Resources.properties deleted file mode 100755 index ddb7fcd..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/resources/org/apache/carbon/status/monitor/ui/i18n/Resources.properties +++ /dev/null @@ -1,29 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -monitor.service.status=Services Status -services.state.details=Services State Details -monitor.service_status.menu=Stratos Service Status -monitor.status_details.menu=Service Status Details -services.list=List of Services -service.id=# -service.name=Service Name -service.state=Service State -logged.time=Logged Time -state.logged.time=State Logged Time -service.state.details=Service State Details -details.logged.time=Details Logged Time \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/css/status.css ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/css/status.css b/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/css/status.css deleted file mode 100755 index ecd3ca9..0000000 --- a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/css/status.css +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -/*css editor styles */ -.csseditor-top-line{ - background-color:black; - height:5px; -} -.csseditor-leftbox{ - background-color:#9a9a9a; - padding-left:5px; - padding-right:5px; - padding-bottom:5px; - padding-top:15px; - height:380px; -} -.csseditor-leftbox-top{ - color:#ffffff; - font-size:18px; - height:30px; -} -.csseditor-textbox{ - background-color:#dfe7ed; - border:solid 1px #ffffff; - width:100%; -} -.csseditor-rightbox{ - background-color:#c9c9c9; - border:solid 1px #ffffff; - height:400px; -} -.csseditor-rightbox-title{ - background-color:#9a9a9a; - height:25px; - color:#ffffff; - padding-left:10px; - padding-top:5px; -} -.csseditor-searchbox{ - padding-left:10px; - padding-top:10px; -} -#flickr_results{ - height:300px; - overflow-y:auto; - overflow-x:hidden; - margin-left:5px; - margin-right:5px; - border:solid 1px #ffffff; -} -.imageList{ -} -.imageList li { - padding-top: 3px !important; - padding-left: 5px !important; - background-color: #e1e9ec; - border: solid 1px #b5bdc1; -} - -.imageList li a { - background-image: url(../images/images.gif); - background-repeat: no-repeat; - padding-left: 20px; - text-indent: 50px; -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-details.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-details.png b/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-details.png deleted file mode 100644 index 260c203..0000000 Binary files a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-details.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/stratos/blob/ee5e9639/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-status.png ---------------------------------------------------------------------- diff --git a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-status.png b/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-status.png deleted file mode 100644 index 9f5143e..0000000 Binary files a/components/org.apache.stratos.status.monitor.ui/src/main/resources/web/status-monitor/docs/images/view-status.png and /dev/null differ
