incubator-stonehenge-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bende...@apache.org
Subject svn commit: r811675 [4/9] - in /incubator/stonehenge/trunk: ./ stocktrader/metro/ stocktrader/metro/business_service/ stocktrader/metro/business_service/etc/ stocktrader/metro/business_service/src/ stocktrader/metro/business_service/src/org/ stocktrade...
Date Sat, 05 Sep 2009 16:41:19 GMT
Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConfigServiceDAOImpl.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConfigServiceDAOImpl.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConfigServiceDAOImpl.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConfigServiceDAOImpl.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,284 @@
+package org.apache.stonehenge.stocktrader.dal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.datacontract.schemas._2004._07.trade.BSConfigResponse;
+import org.datacontract.schemas._2004._07.trade.ClientConfigResponse;
+import org.datacontract.schemas._2004._07.trade.OPSConfigResponse;
+import org.datacontract.schemas._2004._07.trade.ServiceLocation;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ConfigServiceDAOImpl implements ConfigServiceDAO {
+    private static Log logger = LogFactory.getLog(ConfigServiceDAOImpl.class);
+
+    public ConfigServiceDAOImpl() {
+    }
+
+    public void setConnection(Connection connection) {
+        if (this.connection != null) {
+            this.connection = null;
+        }
+        this.connection = connection;
+    }
+
+    private Connection connection;
+
+    private static final String SQL_SELECT_BSLOCATION_FROM_SERVICE = "SELECT servicename,url FROM [SERVICE] WHERE SERVICENAME LIKE '%_BS'";
+    private static final String SQL_SELECT_OPSLOCATION_FROM_SERVICE = "SELECT servicename,url FROM [SERVICE] WHERE SERVICENAME LIKE '%_OPS%'";
+    private static final String SQL_INSERT_VALUE_INTO_CLIENT_TO_BS = "INSERT INTO CLIENTTOBS (CLIENT , BS) VALUES (?,?);";
+    private static final String SQL_UPDATE_CLIENT_TO_BS = "UPDATE CLIENTTOBS SET BS=? WHERE CLIENT = ?;";
+    private static final String SQL_INSERT_VALUE_INTO_BS_TO_OPS = "INSERT INTO BSTOOPS (BS, OPS) VALUES (?,?);";
+    private static final String SQL_UPDATE_BS_TO_OPS = "UPDATE BSTOOPS SET OPS=? WHERE BS  = ?;";
+    private static final String SQL_SELECT_BSSERVICE_ADDRESS_BY_ClIENTNAME = "SELECT servicename,url,sec FROM [SERVICE] INNER JOIN CLIENTTOBS ON [SERVICE].SERVICENAME = CLIENTTOBS.BS  WHERE CLIENT=?";
+    private static final String SQL_SELECT_OPSSERVICE_ADDRESS_BY_CLIENTNAME = "SELECT servicename,url,sec,DBNAME, HOSTNAME,PORT FROM [SERVICE] INNER JOIN BSTOOPS ON [SERVICE].SERVICENAME = BSTOOPS.OPS CROSS JOIN DBCONFIG WHERE BSTOOPS.BS=?";
+    private static final String SQL_SELECT_FROM_CLIENTTOBS = "SELECT * FROM CLIENTTOBS WHERE CLIENT = ?;";
+    private static final String SQL_SELECT_FROM_BSTOOPS = "SELECT * FROM BSTOOPS WHERE BS = ?;";
+    private static final String SQL_SELECT_OPS_CONFIG = "SELECT * FROM DBCONFIG;";
+
+    public List<ServiceLocation> getBSLocations() {
+        return (List<ServiceLocation>) executeQuery(new SimpleStatementPopulator(SQL_SELECT_BSLOCATION_FROM_SERVICE),
+                new ServiceResultSetExtractor());
+    }
+
+    public List<ServiceLocation> getOPSLocations() {
+        return (List<ServiceLocation>) executeQuery(new SimpleStatementPopulator(SQL_SELECT_OPSLOCATION_FROM_SERVICE),
+                new ServiceResultSetExtractor());
+    }
+
+    public BSConfigResponse getBSConfig(String bsName) {
+        return (BSConfigResponse) executeQuery(
+                new SimpleStatementPopulator(SQL_SELECT_OPSSERVICE_ADDRESS_BY_CLIENTNAME, bsName),
+                new BSConfigResponseResultSetExtractor());
+    }
+
+    public ClientConfigResponse getClientConfig(String clientName) {
+        return (ClientConfigResponse) executeQuery(
+                new SimpleStatementPopulator(SQL_SELECT_BSSERVICE_ADDRESS_BY_ClIENTNAME, clientName),
+                new ClientConfigResponseResultSetExtractor());
+    }
+
+    public boolean setClientToBS(String clientName, String bsName) {
+        return executeTransaction(new SetClientToBSTransactionCallback(clientName, bsName));
+    }
+
+    public boolean setBSToOPS(String bs, String ops) {
+        return executeTransaction(new SetBSToOPSTransactionCallback(bs, ops));
+    }
+
+    public OPSConfigResponse getOPSConfig(String opsName) {
+        return (OPSConfigResponse) executeQuery(new SimpleStatementPopulator(SQL_SELECT_OPS_CONFIG),
+                new OPSConfigResponseResultSetExtractor());
+    }
+
+    abstract class AbstractTransactionCallback implements TransactionCallback {
+        protected final String firstPara;
+        protected final String secondPara;
+
+        AbstractTransactionCallback(
+                String first, String second) {
+            firstPara = first;
+            secondPara = second;
+        }
+
+        protected boolean checkUpdateStatus(Connection connection, String sqlSelectFromClienttobs,
+                                            String clientName) throws SQLException {
+            PreparedStatement statement1 = new SimpleStatementPopulator(sqlSelectFromClienttobs, clientName)
+                    .populateStatement(connection);
+            ResultSet resultSet = statement1.executeQuery();
+            boolean hasEntry = resultSet.next();
+            return hasEntry;
+        }
+
+        protected void executeUpdate(Connection connection, String updateClientToBs, String bsName,
+                                     String clientName) throws SQLException {
+            PreparedStatement statement2 = new SimpleStatementPopulator(updateClientToBs, bsName, clientName)
+                    .populateStatement(connection);
+            statement2.executeUpdate();
+        }
+
+        protected void executeInsert(Connection connection, String insertValueIntoClientToBs, String clientName,
+                                     String bsName) throws SQLException {
+            PreparedStatement statement3 = new SimpleStatementPopulator(insertValueIntoClientToBs,
+                    clientName, bsName).populateStatement(connection);
+            statement3.executeUpdate();
+        }
+    }
+
+    class SetClientToBSTransactionCallback extends AbstractTransactionCallback {
+        SetClientToBSTransactionCallback(String first, String second) {
+            super(first, second);
+        }
+
+        public void executeTransaction(Connection connection) throws SQLException {
+            boolean hasEntry = checkUpdateStatus(connection, SQL_SELECT_FROM_CLIENTTOBS, firstPara);
+            if (hasEntry) {
+                executeUpdate(connection, SQL_UPDATE_CLIENT_TO_BS, secondPara, firstPara);
+            } else {
+                executeInsert(connection, SQL_INSERT_VALUE_INTO_CLIENT_TO_BS, firstPara, secondPara);
+            }
+        }
+    }
+
+    class SetBSToOPSTransactionCallback extends AbstractTransactionCallback {
+
+        SetBSToOPSTransactionCallback(String first, String second) {
+            super(first, second);
+        }
+
+        public void executeTransaction(Connection connection) throws SQLException {
+            boolean hasEntry = checkUpdateStatus(connection, SQL_SELECT_FROM_BSTOOPS, firstPara);
+            if (hasEntry) {
+                executeUpdate(connection, SQL_UPDATE_BS_TO_OPS, secondPara, firstPara);
+            } else {
+                executeInsert(connection, SQL_INSERT_VALUE_INTO_BS_TO_OPS, firstPara, secondPara);
+            }
+        }
+    }
+
+    private class SimpleStatementPopulator {
+        private final String sql;
+        private final Object[] params;
+
+        private SimpleStatementPopulator(String sql, Object... params) {
+            this.sql = sql;
+            this.params = params;
+        }
+
+        public PreparedStatement populateStatement(Connection connection) throws
+                SQLException {
+            PreparedStatement preparedStatement = connection.prepareStatement(sql);
+            int index = 1;
+            for (Object param : params) {
+                preparedStatement.setObject(index++, param);
+            }
+            return preparedStatement;
+        }
+
+    }
+
+    class ServiceResultSetExtractor implements ResultSetExtractor<List<ServiceLocation>> {
+
+        public List<ServiceLocation> extractResultSet(ResultSet rs) throws SQLException {
+            List<ServiceLocation> serviceLocations = new ArrayList<ServiceLocation>();
+            while (rs.next()) {
+                ServiceLocation serviceLocation = new ServiceLocation();
+                serviceLocation.setServiceName(rs.getString("serviceName"));
+                serviceLocation.setServiceURL(rs.getString("url"));
+                serviceLocations.add(serviceLocation);
+            }
+            return serviceLocations;
+        }
+
+    }
+
+    class OPSConfigResponseResultSetExtractor implements ResultSetExtractor<OPSConfigResponse> {
+        public OPSConfigResponse extractResultSet(ResultSet rs) throws SQLException {
+            OPSConfigResponse response = new OPSConfigResponse();
+            while (rs.next()) {
+                response.setDBName(rs.getString("dbname"));
+                response.setDBHostName(rs.getString("hostname"));
+                response.setDBPort(rs.getInt("port"));
+            }
+            return response;
+        }
+    }
+
+    class ClientConfigResponseResultSetExtractor implements ResultSetExtractor<ClientConfigResponse> {
+        public ClientConfigResponse extractResultSet(ResultSet rs) throws SQLException {
+            ClientConfigResponse response = new ClientConfigResponse();
+            while (rs.next()) {
+                response.setBSName(rs.getString("serviceName"));
+                response.setBS(rs.getString("url"));
+                response.setSec(rs.getBoolean("sec"));
+            }
+            return response;
+        }
+    }
+
+    class BSConfigResponseResultSetExtractor implements ResultSetExtractor<BSConfigResponse> {
+
+        public BSConfigResponse extractResultSet(ResultSet rs) throws SQLException {
+            BSConfigResponse response = new BSConfigResponse();
+            while (rs.next()) {
+                response.setOPSName(rs.getString("serviceName"));
+                response.setOPS(rs.getString("url"));
+                response.setSec(rs.getBoolean("sec"));
+                response.setDBName(rs.getString("dbname"));
+                response.setDBHostName(rs.getString("hostname"));
+                response.setDBPort(rs.getInt("port"));
+            }
+            return response;
+        }
+    }
+
+    private interface ResultSetExtractor<T> {
+        T extractResultSet(ResultSet rs) throws SQLException;
+    }
+
+    private Object executeQuery(SimpleStatementPopulator stPopulator, ResultSetExtractor rsExtractor) {
+        Object result = null;
+        ResultSet rs = null;
+        try {
+            PreparedStatement statement = stPopulator.populateStatement(connection);
+            rs = statement.executeQuery();
+            result = rsExtractor.extractResultSet(rs);
+        } catch (SQLException exception) {
+            logger.error(exception, exception);
+        }
+        finally {
+            try {
+                if (rs != null) {
+                    rs.close();
+                }
+                try {
+                    if (connection != null && !connection.isClosed()) {
+                        connection.close();
+                    }
+                } catch (SQLException e) {
+                    e.printStackTrace();
+                }
+            } catch (SQLException exception) {
+                logger.error(exception, exception);
+            }
+        }
+        return result;
+    }
+
+    interface TransactionCallback {
+        void executeTransaction(Connection connection) throws SQLException;
+    }
+
+    private boolean executeTransaction(TransactionCallback transactionCallback) {
+        try {
+            connection.setAutoCommit(false);
+
+            transactionCallback.executeTransaction(connection);
+
+            connection.commit();
+            return true;
+        } catch (SQLException e) {
+            try {
+                connection.rollback();
+            } catch (SQLException e1) {
+                e1.printStackTrace();
+            }
+            logger.error(e, e);
+            return false;
+        } finally {
+            try {
+                connection.setAutoCommit(true);
+                if (connection != null && !connection.isClosed()) {
+                    connection.close();
+                }
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConnectionProvider.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConnectionProvider.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConnectionProvider.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/ConnectionProvider.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,16 @@
+package org.apache.stonehenge.stocktrader.dal;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public interface ConnectionProvider {
+
+    String PROP_DB_HOST = "org.apache.stonehenge.stocktrader.database.host";
+    String PROP_DB_PORT = "org.apache.stonehenge.stocktrader.database.port";
+    String PROP_DB_NAME = "org.apache.stonehenge.stocktrader.database.db";
+    String PROP_DB_USER = "org.apache.stonehenge.stocktrader.database.user";
+    String PROP_DB_PASSWORD = "org.apache.stonehenge.stocktrader.database.password";
+
+    Connection provide(Properties properties) throws SQLException;
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/DAOFactory.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/DAOFactory.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/DAOFactory.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/dal/DAOFactory.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,92 @@
+/*
+ * 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.stonehenge.stocktrader.dal;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stonehenge.stocktrader.mssql.MSSQLConnectionProvider;
+import org.apache.stonehenge.stocktrader.mysql.MySQLConnectionProvider;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public final class DAOFactory {
+    private static final String PROP_DB_TYPE = "org.apache.stonehenge.stocktrader.database.type";
+
+    private static Properties prop = null;
+    private static ConnectionProvider connectionProvider;
+    private static DAOFactory self;
+    private ConfigServiceDAOImpl configServiceDAO;
+
+    private DAOFactory() {
+        configServiceDAO = new ConfigServiceDAOImpl();
+        loadProperties();
+    }
+
+    public static DAOFactory getFacotry() {
+        if (self == null) {
+            self = new DAOFactory();
+        }
+        return self;
+    }
+
+    public ConfigServiceDAO getConfigServiceDAO() {
+        if ("mysql".equals(prop.getProperty(PROP_DB_TYPE))) {
+            connectionProvider = new MySQLConnectionProvider();
+        } else if ("mssql".equals(prop.getProperty(PROP_DB_TYPE))) {
+            connectionProvider = new MSSQLConnectionProvider();
+        } else {
+            throw new IllegalArgumentException("Unknown Database type " + prop.getProperty(PROP_DB_TYPE));
+        }
+        Connection connection;
+        try {
+            connection = connectionProvider.provide(prop);
+        } catch (SQLException e) {
+            e.printStackTrace();
+            throw new RuntimeException(e.getMessage(), e);
+        }
+        configServiceDAO.setConnection(connection);
+        return configServiceDAO;
+    }
+
+    private static void loadProperties() {
+        Log logger = LogFactory.getLog(DAOFactory.class);
+        if (prop == null) {
+            prop = new Properties();
+
+            InputStream is = DAOFactory.class.getClassLoader().getResourceAsStream("db.properties");
+            if (is != null) {
+                try {
+                    prop.load(is);
+                } catch (IOException e) {
+                    logger.debug(
+                            "Unable to load mysql-db properties file and using [jdbc:mysql://localhost/stocktraderdb?user=trade&password=trade] as the default connection",
+                            e);
+                }
+            } else {
+                logger.debug(
+                        "Unable to load mysql-db properties file and using [jdbc:mysql://localhost/stocktraderdb?user=trade&password=trade] as the default connection");
+
+            }
+        }
+    }
+
+}
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mssql/MSSQLConnectionProvider.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mssql/MSSQLConnectionProvider.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mssql/MSSQLConnectionProvider.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mssql/MSSQLConnectionProvider.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,54 @@
+package org.apache.stonehenge.stocktrader.mssql;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.stonehenge.stocktrader.dal.ConnectionProvider;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.Properties;
+
+public class MSSQLConnectionProvider implements ConnectionProvider {
+    private static Log logger = LogFactory.getLog(MSSQLConnectionProvider.class);
+    private Connection sqlConnection = null;
+    private String connection = null;
+
+    static {
+        try {
+            Class.forName("net.sourceforge.jtds.jdbc.Driver");
+        } catch (ClassNotFoundException e) {
+            logger.warn("Unable to load DBDrive class", e);
+        }
+    }
+
+    private String getConnectionString(Properties prop) {
+        if (connection == null) {
+            if (prop == null) {
+                connection = "jdbc:jtds:sqlserver://highlander:1433/StockTraderDB;user=trade;password=trade";
+            } else {
+                StringBuffer buf = new StringBuffer();
+                buf.append("jdbc:jtds:sqlserver://");
+                buf.append(prop.getProperty(PROP_DB_HOST));
+                buf.append(":" + prop.getProperty(PROP_DB_PORT));
+                buf.append("/" + prop.getProperty(PROP_DB_NAME));
+                buf.append(";user=" + prop.getProperty(PROP_DB_USER));
+                buf.append(";password=" + prop.getProperty(PROP_DB_PASSWORD));
+                buf.append(";");
+                connection = buf.toString();
+            }
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("MSSQLDAOFactory.getConnectionString()\nConnection :" + connection);
+        }
+
+        return connection;
+    }
+
+    public Connection provide(Properties properties) throws SQLException {
+        if (sqlConnection == null || sqlConnection.isClosed()) {
+            sqlConnection = DriverManager.getConnection(getConnectionString(properties));
+        }
+        return sqlConnection;
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mysql/MySQLConnectionProvider.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mysql/MySQLConnectionProvider.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mysql/MySQLConnectionProvider.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/mysql/MySQLConnectionProvider.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,54 @@
+package org.apache.stonehenge.stocktrader.mysql;
+
+import org.apache.stonehenge.stocktrader.dal.ConnectionProvider;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.DriverManager;
+import java.util.Properties;
+
+public class MySQLConnectionProvider implements ConnectionProvider{
+
+    private static Log logger = LogFactory.getLog(MySQLConnectionProvider.class);
+    private Connection sqlConnection = null;
+    private String connection = null;
+
+    static {
+        try {
+            Class.forName("com.mysql.jdbc.Driver");
+        } catch (ClassNotFoundException e) {
+            logger.warn("Unable to load DBDrive class", e);
+        }
+    }
+
+    private String getConnectionString(Properties prop) {
+        if (connection == null) {
+			if (prop == null || prop.size()<=0) {
+                connection = "jdbc:mysql://localhost:3306/stocktraderdb?user=trade&password=yyy";
+            } else {
+                StringBuffer buf = new StringBuffer();
+                buf.append("jdbc:mysql://");
+                buf.append(prop.getProperty(PROP_DB_HOST));
+                buf.append(":" + prop.getProperty(PROP_DB_PORT));
+                buf.append("/" + prop.getProperty(PROP_DB_NAME));
+                buf.append("?user=" + prop.getProperty(PROP_DB_USER));
+                buf.append("&password=" + prop.getProperty(PROP_DB_PASSWORD));
+                connection = buf.toString();
+            }
+        }
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("MySQLDAOFactory.getConnectionString()\nConnection :" + connection);
+        }
+        return connection;
+    }
+
+    public Connection provide(Properties prop) throws SQLException {
+        if (sqlConnection == null || sqlConnection.isClosed()) {
+            sqlConnection = DriverManager.getConnection(getConnectionString(prop));
+        }
+        return sqlConnection;
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/services/ConfigServiceServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/services/ConfigServiceServiceImpl.java?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/services/ConfigServiceServiceImpl.java (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/config_service/src/org/apache/stonehenge/stocktrader/services/ConfigServiceServiceImpl.java Sat Sep  5 16:41:14 2009
@@ -0,0 +1,100 @@
+package org.apache.stonehenge.stocktrader.services;
+
+import org.apache.stonehenge.stocktrader.dal.ConfigServiceDAO;
+import org.apache.stonehenge.stocktrader.dal.DAOFactory;
+import org.datacontract.schemas._2004._07.trade.*;
+import org.tempuri.ConfigServiceService;
+import traderconfighost.trade.*;
+
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import java.util.List;
+
+@WebService(endpointInterface = "org.tempuri.ConfigServiceService")
+public class ConfigServiceServiceImpl implements ConfigServiceService {
+    private final DAOFactory facotry;
+
+    public ConfigServiceServiceImpl() {
+        facotry = DAOFactory.getFacotry();
+    }
+
+    public ConfigServiceDAO getConfigServiceDAO() {
+        return facotry.getConfigServiceDAO();
+    }
+
+    public GetClientConfigResponse getClientConfig(
+            @WebParam(name = "GetClientConfig", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") GetClientConfig getClientConfig) {
+        GetClientConfigResponse clientConfigResponse = new GetClientConfigResponse();
+        String clientName = getClientConfig.getClient().getClientName();
+        ClientConfigResponse config = getConfigServiceDAO().getClientConfig(clientName);
+        clientConfigResponse.setGetClientConfigResult(config);
+        return clientConfigResponse;
+    }
+
+    public GetBSConfigResponse getBSConfig(
+            @WebParam(name = "GetBSConfig", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") GetBSConfig getBSConfig) {
+        GetBSConfigResponse bsConfigResponse = new GetBSConfigResponse();
+        BSConfigResponse configResponse = getConfigServiceDAO().getBSConfig(getBSConfig.getBs().getBSName());
+        bsConfigResponse.setGetBSConfigResult(configResponse);
+        return bsConfigResponse;
+    }
+
+    public GetOPSConfigResponse getOPSConfig(
+            @WebParam(name = "GetOPSConfig", targetNamespace = "http://Trade.TraderConfigHost", partName =
+                    "parameters") GetOPSConfig parameters) {
+        OPSConfigResponse opsConfigResponse = getConfigServiceDAO().getOPSConfig(parameters.getOps().getOPSName());
+        GetOPSConfigResponse getOPSConfigResponse = new GetOPSConfigResponse();
+        getOPSConfigResponse.setGetOPSConfigResult(opsConfigResponse);
+        return getOPSConfigResponse;
+    }
+
+    public SetClientToBSResponse setClientToBS(
+            @WebParam(name = "SetClientToBS", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") SetClientToBS setClientToBS) {
+        ClientToBS clientConfig = setClientToBS.getClientConfig();
+        if (getConfigServiceDAO().setClientToBS(clientConfig.getClient(), clientConfig.getBs())) {
+            return new SetClientToBSResponse();
+        }
+        return null;
+    }
+
+    public SetBSToOPSResponse setBSToOPS(
+            @WebParam(name = "SetBSToOPS", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") SetBSToOPS setBSToOPS) {
+        BSToOPS bsConfig = setBSToOPS.getBsConfig();
+        if (getConfigServiceDAO().setBSToOPS(bsConfig.getBs(), bsConfig.getOps())) {
+            return new SetBSToOPSResponse();
+        }
+        return null;
+    }
+
+    public GetBSLocationsResponse getBSLocations(
+            @WebParam(name = "GetBSLocations", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") GetBSLocations getBSLocations) {
+        final List<ServiceLocation> serviceLocations = getConfigServiceDAO().getBSLocations();
+        GetBSLocationsResponse getBSLocationsResponse = new GetBSLocationsResponse();
+        ArrayOfServiceLocation arrayOfServiceLocation = new ArrayOfServiceLocation();
+        arrayOfServiceLocation.getServiceLocation().addAll(serviceLocations);
+        getBSLocationsResponse.setGetBSLocationsResult(arrayOfServiceLocation);
+        return getBSLocationsResponse;
+    }
+
+    public GetOPSLocationsResponse getOPSLocations(
+            @WebParam(name = "GetOPSLocations", targetNamespace = "http://Trade.TraderConfigHost",
+                    partName = "parameters") GetOPSLocations getOPSLocations) {
+        List<ServiceLocation> serviceLocations = getConfigServiceDAO().getOPSLocations();
+        GetOPSLocationsResponse response = new GetOPSLocationsResponse();
+        ArrayOfServiceLocation arrayOfServiceLocation = new ArrayOfServiceLocation();
+        arrayOfServiceLocation.getServiceLocation().addAll(serviceLocations);
+        response.setGetOPSLocationsResult(arrayOfServiceLocation);
+        return response;
+    }
+
+    public SetServiceLocationResponse setServiceLocation(
+            @WebParam(name = "SetServiceLocation", targetNamespace = "http://Trade.TraderConfigHost", partName =
+                    "parameters") SetServiceLocation parameters) {
+        throw new UnsupportedOperationException("method unimplemented");
+    }
+}

Added: incubator/stonehenge/trunk/stocktrader/metro/documents/manual.doc
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/documents/manual.doc?rev=811675&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/stonehenge/trunk/stocktrader/metro/documents/manual.doc
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/App.config
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/App.config?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/App.config (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/App.config Sat Sep  5 16:41:14 2009
@@ -0,0 +1,375 @@
+<?xml version="1.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.
+ -->
+
+<!-- You can change these settings (app.config) before compiling the application, or change
+     these settings in Trade.BusinessServiceHost.Exe.Config before running the application. 
+     Changing Trade.BusinessServiceHost.Exe.Config directly requires no re-compilation of the application, as
+     they are picked up when the application is launched. 
+     
+     Note: As an alternative to hand editing this file you can use the 
+     Visual Studio XML editor admin tool to configure this file for your application. 
+-->
+<configuration>
+	<!---THIS IS A CONFIG SERVICE CUSTOM CONFIG SECTION USED TO SPECIFIY individual ServiceEndpoint Identities, when desired-->
+	<appSettings>
+		<add key="EVENT_LOG" value="Trade Business Services" />
+		<add key="ORDER_PROCESSING_MODE" value="ASync_WSAS_WsHttp_MSecurity" />
+		<!--
+       //Valid Config Values for user-set "OrderMode" config setting.
+        public const string ORDER_STRING_Sync = "Sync_InProcess";
+        public const string ORDER_STRING_ASync_DotNet_Http = "ASync_DotNet_Http";
+        public const string ORDER_STRING_ASync_DotNet_WsHttp_MSec = "ASync_DotNet_WsHttp_MSecurity";
+        public const string ORDER_STRING_ASync_PHP_Http = "ASync_PHP_Http";
+        public const string ORDER_STRING_ASync_PHP_WsHttp_MSec = "ASync_PHP_WsHttp_MSecurity";
+        public const string ORDER_STRING_ASync_WSAS_Http = "ASync_WSAS_Http";
+        public const string ORDER_STRING_ASync_WSAS_WsHttp_MSec = "ASync_WSAS_WsHttp_MSecurity";
+
+    -->
+		<add key="BSL_VALID_USERID" value="bsloperationuser"/>
+		<add key="BSL_VALID_PASSWORD" value="yyy"/>
+		<add key="DBServer" value="localhost" />
+		<add key="Database" value="StockTraderDB" />
+		<add key="UserID" value="trade" />
+		<add key="Password" value="yyy" />
+		<add key="MinDBConnections" value="20" />
+		<add key="MaxDBConnections" value="20" />
+		<add key="DAL" value="Trade.DALSQLServer" />
+		<add key="ENABLE_GLOBAL_SYSTEM_DOT_TRANSACTIONS_CONFIGSTRING" value="true" />
+		<add key="SYSTEMDOTTRANSACTION_TIMEOUT" value="0" />
+		<add key="MAX_QUERY_ORDERS" value="20" />
+		<add key="MAX_QUERY_TOP_ORDERS" value="5" />
+		<add key="DISPLAY_WEBSERVICE_LOGINS" value="true" />
+		<add key="LOGIN_ITERATIONSTO_DISPLAY" value="5" />
+		<!--Can't be ZERO-->
+		<add key="DISPLAYNUMBERORDERITERATIONS" value="3" />
+		<!--Can't be ZERO-->
+		<add key="OPS_DOTNET_ENDPOINT_CONFIG_HTTP" value="OpsClient_DotNet_BasicHttpBinding" />
+		<add key="OPS_DOTNET_ENDPOINT_CONFIG_WSHTTP" value="OpsClient_DotNet_WsHttpBinding_MSec" />
+		<add key="OPS_PHP_ENDPOINT_CONFIG_HTTP" value="OpsClient_PHP_BasicHttpBinding" />
+		<add key="OPS_PHP_ENDPOINT_CONFIG_WSHTTP" value="OpsClient_PHP_WsHttpBinding_MSec" />
+		<add key="OPS_WSAS_ENDPOINT_CONFIG_HTTP" value="OpsClient_WSAS_BasicHttpBinding" />
+		<add key="OPS_WSAS_ENDPOINT_CONFIG_WSHTTP" value="OpsClient_WSAS_WsHttpBinding_MSec" />
+		<add key="ClientSettingsProvider.ServiceUri" value="" />
+	</appSettings>
+	<runtime>
+		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+		</assemblyBinding>
+		<!-- Note: <gcServer enabled ="true"/> configures the .NET CLR garbage collection mode.  
+               this GC mode is used to get the best peak throughput and performance of high-scale
+               .NET Server self-hosted applications. When running in Workstation GC mode (the default), for example
+               .NET StockTrader offers up to 20% less peak throughput. You SHOULD NOT alter the GC mode
+               in Web.Config for ASP.NET Web apps, however, as this setting is set automatically within
+               ASP.NET worker processes for peak throughput based on the computer specifications at .NET install-time.
+    -->
+		<gcServer enabled="true">
+		</gcServer>
+	</runtime>
+	<!-- system.service model: New configuration section added with the release 
+       of .NET 3.0 and Windows Communication Foundation. This section defines the:
+ 
+       a) WCF Web Services, if any, hosted by this application.  
+       b) WCF clients and their endpoints.
+       c) The bindings used by the services and clients: bindings are transports and
+          encoding standards, such as HTTP/Text-XML; TCP/Binary; MSMQ, etc.
+   -->
+	<system.serviceModel>
+		<!--Enables the WCF ServiceModel performance counters for this application.-->
+		<diagnostics performanceCounters="All">
+		</diagnostics>
+		<!--The <services> section configures the WCF services that the .NET Stock Order Processor will host.
+    Note that StockTrader uses the configuration files only to specify base service names and their bindings.
+    Base addresses and Service/Client endpoints are created programmatically at runtime.-->
+		<!--********************************************************
+        
+    Config Service BS Service
+    
+    *********************************************************-->
+		<services>
+			<service name="Trade.BusinessServiceImplementation.TradeServiceWcf"
+					 behaviorConfiguration="BsHost_MSec_ServiceBehavior"></service>
+		</services>
+
+
+		<!--********************************************************
+        
+    Config Service OPS CLIENTS
+    
+    *********************************************************-->
+		<client>
+			<!-- DotNet Endpoints -->
+			<endpoint address="http://localhost:8000/tradeorderprocessor"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
+					  name="OpsClient_DotNet_BasicHttpBinding" />
+
+			<endpoint address="http://localhost:8000/tradeorderprocessor/msec"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="wsHttpBinding" bindingConfiguration="OpsClient_WsHttpBinding_MSec"
+					  behaviorConfiguration="OpsClient_DotNet_CertificateBehavior"
+					  name="OpsClient_DotNet_WsHttpBinding_MSec">
+				<identity>
+					<certificate encodedValue="AwAAAAEAAAAUAAAA+g9Yu2BfpDNp4nno+QiIcv3gmUMgAAAAAQAAAPQBAAAwggHwMIIBWaADAgECAhDUQtaRqC0hpkD6saVDQMH8MA0GCSqGSIb3DQEBBAUAMBIxEDAOBgNVBAMTB09QUy5Db20wHhcNMDgwNTIxMDQ0NTAxWhcNMzkxMjMxMjM1OTU5WjASMRAwDgYDVQQDEwdPUFMuQ29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHCT2agc1venAAV2iWxWs1ELKlr0wAf005uUYlFbpq/3ewLmi5t+NvN8iBRHJxWA5igj/obcBmKMQ0L/+1HwKI27B9zffyPiAYkJhAwoXzR/S/7Cw4KFtYD+NIyZbRd5naa2fbyRTNnAE35q4r6JS6tiZR9mU0IjMuszj0oqotEwIDAQABo0cwRTBDBgNVHQEEPDA6gBAYaG6w3pziP/tZKe+J5ExsoRQwEjEQMA4GA1UEAxMHT1BTLkNvbYIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFAAOBgQBnzFXGKgK8by3yILHlfLsmBTIZWdODFWE/f64wZJxrS7XCqd+g962FeTKQ+QI/lkRhJLlKgEt0IqGfUeogJ1MGRHabR5ujnQKhdPWUDL7kwQt3OVHxIf0pXqeiTAI8BbdFRGTWG5oOLcU7WgUNWbrXjqsAHJmsb8+MN7fD4xRoeA==" />
+				</identity>
+			</endpoint>
+			<!-- PHP Endpoints -->
+			<endpoint address="http://localhost:8080/php_stocktrader/order_processor/order_processor_svc.php"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
+					  name="OpsClient_PHP_BasicHttpBinding" />
+
+			<endpoint address="http://localhost:8080/php_stocktrader/order_processor/order_processor_svc_msec.php"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="customBinding" bindingConfiguration="OpsClient_PHP_WSAS_CustomBinding_MSec"
+					  behaviorConfiguration="OpsClient_PHP_WSAS_CertificateBehavior"
+					  name="OpsClient_PHP_WsHttpBinding_MSec">
+				<identity>
+					<certificate encodedValue="MIIB8DCCAVmgAwIBAgIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFADASMRAwDgYDVQQDEwdPUFMuQ29tMB4XDTA4MDUyMTA0NDUwMVoXDTM5MTIzMTIzNTk1OVowEjEQMA4GA1UEAxMHT1BTLkNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwk9moHNb3pwAFdolsVrNRCypa9MAH9NOblGJRW6av93sC5oubfjbzfIgURycVgOYoI/6G3AZijENC//tR8CiNuwfc338j4gGJCYQMKF80f0v+wsOChbWA/jSMmW0XeZ2mtn28kUzZwBN+auK+iUurYmUfZlNCIzLrM49KKqLRMCAwEAAaNHMEUwQwYDVR0BBDwwOoAQGGhusN6c4j/7WSnvieRMbKEUMBIxEDAOBgNVBAMTB09QUy5Db22CENRC1pGoLSGmQPqxpUNAwfwwDQYJKoZIhvcNAQEEBQADgYEAZ8xVxioCvG8t8iCx5Xy7JgUyGVnTgxVhP3+uMGSca0u1wqnfoPethXkykPkCP5ZEYSS5SoBLdCKhn1HqICdTBkR2m0ebo50CoXT1lAy+5MELdzlR8SH9KV6nokwCPAW3RURk1huaDi3FO1oFDVm6146rAByZrG/PjDe3w+MUaHg=" />
+				</identity>
+			</endpoint>
+
+			<!-- WSAS Endpoints -->
+			<endpoint address="http://localhost:8080/order_processer/OrderProcessor"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="basicHttpBinding" bindingConfiguration="OpsClient_BasicHttpBinding"
+					  name="OpsClient_WSAS_BasicHttpBinding" />
+
+			<endpoint address="http://localhost:8080/order_processer/OrderProcessorSec"
+					  contract="Trade.OrderProcessorContract.IOrderProcessor"
+					  binding="customBinding" bindingConfiguration="OpsClient_PHP_WSAS_CustomBinding_MSec"
+					  behaviorConfiguration="OpsClient_PHP_WSAS_CertificateBehavior"
+					  name="OpsClient_WSAS_WsHttpBinding_MSec">
+				<identity>
+					<certificate encodedValue="MIIB8DCCAVmgAwIBAgIQ1ELWkagtIaZA+rGlQ0DB/DANBgkqhkiG9w0BAQQFADASMRAwDgYDVQQDEwdPUFMuQ29tMB4XDTA4MDUyMTA0NDUwMVoXDTM5MTIzMTIzNTk1OVowEjEQMA4GA1UEAxMHT1BTLkNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAxwk9moHNb3pwAFdolsVrNRCypa9MAH9NOblGJRW6av93sC5oubfjbzfIgURycVgOYoI/6G3AZijENC//tR8CiNuwfc338j4gGJCYQMKF80f0v+wsOChbWA/jSMmW0XeZ2mtn28kUzZwBN+auK+iUurYmUfZlNCIzLrM49KKqLRMCAwEAAaNHMEUwQwYDVR0BBDwwOoAQGGhusN6c4j/7WSnvieRMbKEUMBIxEDAOBgNVBAMTB09QUy5Db22CENRC1pGoLSGmQPqxpUNAwfwwDQYJKoZIhvcNAQEEBQADgYEAZ8xVxioCvG8t8iCx5Xy7JgUyGVnTgxVhP3+uMGSca0u1wqnfoPethXkykPkCP5ZEYSS5SoBLdCKhn1HqICdTBkR2m0ebo50CoXT1lAy+5MELdzlR8SH9KV6nokwCPAW3RURk1huaDi3FO1oFDVm6146rAByZrG/PjDe3w+MUaHg=" />
+				</identity>
+			</endpoint>
+		</client>
+
+
+		<!--********************************************************
+        
+    Config Service BINDINGS
+    
+    *********************************************************-->
+		<bindings>
+
+			<!--BEGIN basicHttpBindings-->
+			<basicHttpBinding>
+
+				<binding name="BsHost_BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard" maxBufferSize="1048576" maxBufferPoolSize="10485768" maxReceivedMessageSize="1048576" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
+					<readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+					<security mode="None">
+						<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+						<message clientCredentialType="Certificate" algorithmSuite="Default" />
+					</security>
+				</binding>
+
+				<binding name="OpsClient_BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard" maxBufferSize="524288" maxBufferPoolSize="524288" maxReceivedMessageSize="524288" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
+					<readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+					<security mode="None">
+						<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+						<message clientCredentialType="Certificate" algorithmSuite="Default" />
+					</security>
+				</binding>
+
+			</basicHttpBinding>
+
+			<!--BEGIN wsHttpBindings-->
+			<wsHttpBinding>
+
+				<!--PRIMARY SERVICE HOST BINDINGS.  TO ADD OTHERS, MAKE SURE TO PREFACE NAME WITH 'Host_'
+        <binding name="BsHost_WsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
+          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+          <reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
+          <security mode="None">
+            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+            <message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" />
+          </security>
+        </binding>
+        -->
+				<binding name="BsHost_WsHttpBinding_MSec" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
+					<readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+					<reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
+					<security mode="Message">
+						<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+						<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" />
+					</security>
+				</binding>
+
+				<!--PRIMARY SERVICE CLIENT BINDINGS.  TO ADD OTHERS, MAKE SURE TO PREFACE NAME WITH 'Client_'
+        <binding name="OpsClient_WsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" maxReceivedMessageSize="65536" hostNameComparisonMode="StrongWildcard" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="true" transactionFlow="false">
+          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144" />
+          <reliableSession enabled="false" ordered="true" inactivityTimeout="00:10:00" />
+          <security mode="None">
+            <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
+            <message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" />
+          </security>
+        </binding>
+        -->
+				<binding name="OpsClient_WsHttpBinding_MSec" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
+					<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+					<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
+					<security mode="Message">
+						<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
+						<message clientCredentialType="Certificate" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
+					</security>
+				</binding>
+			</wsHttpBinding>
+
+			<!--BEGIN CustomBindings-->
+			<customBinding>
+
+				<binding name="OpsClient_PHP_WSAS_CustomBinding_MSec">
+					<!--
+					<security defaultAlgorithmSuite="Basic256" authenticationMode="AnonymousForCertificate" 
+							  requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true" 
+							  keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt" 
+							  messageSecurityVersion="Default" requireSignatureConfirmation="true">
+						<localClientSettings cacheCookies="true" detectReplays="true"
+											 replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="05:05:00" replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00" sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
+						<localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00" maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00" negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00" sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true" maxPendingSessions="128" maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
+						<secureConversationBootstrap />
+					</security>
+					<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16" messageVersion="Soap12" writeEncoding="utf-8">
+						<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+					</textMessageEncoding>
+					<httpTransport />
+					
+					
+						-->
+					<security defaultAlgorithmSuite="Default" authenticationMode="AnonymousForCertificate"
+								requireDerivedKeys="false" securityHeaderLayout="Lax" includeTimestamp="true"
+								keyEntropyMode="CombinedEntropy" messageProtectionOrder="SignBeforeEncrypt"
+								messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
+								requireSignatureConfirmation="true">
+
+						<localClientSettings cacheCookies="true" detectReplays="true"
+							replayCacheSize="900000" maxClockSkew="00:05:00" maxCookieCachingTime="Infinite"
+							replayWindow="00:05:00" sessionKeyRenewalInterval="10:00:00"
+							sessionKeyRolloverInterval="00:05:00" reconnectTransportOnFailure="true"
+							timestampValidityDuration="00:05:00" cookieRenewalThresholdPercentage="60" />
+						<localServiceSettings detectReplays="true" issuedCookieLifetime="10:00:00"
+							maxStatefulNegotiations="128" replayCacheSize="900000" maxClockSkew="00:05:00"
+							negotiationTimeout="00:01:00" replayWindow="00:05:00" inactivityTimeout="00:02:00"
+							sessionKeyRenewalInterval="15:00:00" sessionKeyRolloverInterval="00:05:00"
+							reconnectTransportOnFailure="true" maxPendingSessions="128"
+							maxCachedCookies="1000" timestampValidityDuration="00:05:00" />
+						<secureConversationBootstrap />
+					</security>
+					<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
+						messageVersion="Default" writeEncoding="utf-8">
+						<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
+							maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+					</textMessageEncoding>
+
+					<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
+						maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
+						bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
+						keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
+						realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
+						useDefaultWebProxy="true" />
+				</binding>
+
+			</customBinding>
+		</bindings>
+
+
+		<!--********************************************************
+    
+    Config Service BEHAVIORS
+    
+    *********************************************************-->
+		<behaviors>
+			<serviceBehaviors>
+
+				<!-- Begin the BS Service Behaviors -->
+				<!--
+        <behavior name="BsHost_DefaultBehavior">
+          <serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
+        </behavior>
+        
+        <behavior name="BsHost_DebugServiceBehaviors">
+          <serviceMetadata httpGetEnabled="true" />
+          <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
+          <serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
+        </behavior>
+        -->
+
+				<!-- Default BS Host Behavior -->
+				<behavior name="BsHost_MSec_ServiceBehavior">
+					<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
+					<serviceThrottling maxConcurrentInstances="400" maxConcurrentCalls="400" maxConcurrentSessions="100" />
+					<serviceCredentials>
+						<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Trade.BusinessServiceImplementation.TradeBSLCustomUserNameValidator, Trade.BusinessServiceImplementation" />
+						<serviceCertificate findValue="Trade.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
+					</serviceCredentials>
+				</behavior>
+			</serviceBehaviors>
+
+			<!-- Begin the OPS Client Service Behaviors -->
+			<endpointBehaviors>
+				<!--
+        <behavior name="ClientCertificateBehavior">
+          <clientCredentials>
+            <serviceCertificate>
+              <authentication certificateValidationMode="PeerOrChainTrust" />
+            </serviceCertificate>
+          </clientCredentials>
+        </behavior>
+        
+        <behavior name="BSL_ClientCertificateBehavior">
+          <clientCredentials>
+            <serviceCertificate>
+              <authentication certificateValidationMode="PeerOrChainTrust" />
+            </serviceCertificate>
+          </clientCredentials>
+        </behavior>
+        -->
+
+				<behavior name="OpsClient_DotNet_CertificateBehavior">
+					<clientCredentials>
+						<clientCertificate findValue="BSL.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople" />
+					</clientCredentials>
+				</behavior>
+
+				<!-- This needs to be changed to work with PHP/WSAS Bob/Alice Certs -->
+				<behavior name="OpsClient_PHP_WSAS_CertificateBehavior">
+					<clientCredentials>
+						<serviceCertificate>
+							<authentication certificateValidationMode="PeerOrChainTrust" />
+						</serviceCertificate>
+					</clientCredentials>
+				</behavior>
+
+			</endpointBehaviors>
+
+		</behaviors>
+	</system.serviceModel>
+
+	<system.web>
+		<membership defaultProvider="ClientAuthenticationMembershipProvider">
+			<providers>
+				<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
+			</providers>
+		</membership>
+		<roleManager defaultProvider="ClientRoleProvider" enabled="true">
+			<providers>
+				<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
+			</providers>
+		</roleManager>
+	</system.web>
+</configuration>

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/Web.config
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/Web.config?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/Web.config (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/Web.config Sat Sep  5 16:41:14 2009
@@ -0,0 +1,320 @@
+<?xml version="1.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.
+ -->
+ 
+<!--  
+    Note: As an alternative to hand editing this file you can use the 
+    web admin tool to configure settings for your application. Use
+    the Website->Asp.Net Configuration option in Visual Studio.
+    A full list of settings and comments can be found in 
+    machine.config.comments usually located in 
+    \Windows\Microsoft.Net\Framework\v2.x\Config 
+-->
+<configuration>
+
+  <appSettings>
+    <add key="ACCESS_MODE" value="WSAS_Http_WebService"/>
+    <!-- 
+        //Valid Config Values for user-set "AccessMode" config setting. 
+        public const string ACCESS_STRING_InProcess = "InProcess";
+        public const string ACCESS_STRING_DotNet_Http_WcfService = "DotNet_Http_WcfService";//default
+        public const string ACCESS_STRING_DotNet_WsHttp_WcfService = "DotNet_WsHttp_WcfService";
+        public const string ACCESS_STRING_PHP_Http_WebService = "PHP_Http_WebService";
+        public const string ACCESS_STRING_WSAS_Http_WebService = "WSAS_Http_WebService";
+        -->
+    <add key="EVENT_LOG" value="Trade Web App"/>
+    <add key="MAX_DISPLAY_ORDERS" value="20"/>
+    <add key="MAX_DISPLAY_TOP_ORDERS" value="5"/>
+    <add key="DISPLAY_DUPLICATE_KEY_EXCEPTIONS" value="true"/>
+    <add key="CHECK_ORDER_ALERT_EVERY_REQUEST" value="true"/>
+    <add key="ORDER_ALERT_CHECK_FREQUENCY" value="30"/>
+    <add key="BSL_DOTNET_ENDPOINT_CONFIG_HTTP" value="BsClient_DotNet_BasicHttpBinding"/>
+    <add key="BSL_DOTNET_ENDPOINT_CONFIG_WSHTTP" value="BsClient_DotNet_WsHttpBinding"/>
+    <add key="BSL_PHP_ENDPOINT_CONFIG_HTTP" value="BsClient_PHP_BasicHttpBinding"/>
+    <add key="BSL_WSAS_ENDPOINT_CONFIG_HTTP" value="BsClient_WSAS_BasicHttpBinding"/>
+    <add key="BSL_USERID" value="bsloperationuser"/>
+    <add key="BSL_PASSWORD" value="yyy"/>
+
+    <!-- This is duplicated from Business Service to support ACCESS_MODE=InProcess-->
+    <add key="ORDER_PROCESSING_MODE" value="Sync_InProcess"/>
+
+    <add key="BSL_VALID_USERID" value="bsloperationuser"/>
+    <add key="BSL__VALID_PASSWORD" value="yyy"/>
+    <add key="DBServer" value="localhost"/>
+    <add key="Database" value="StockTraderDB"/>
+    <add key="UserID" value="trade"/>
+    <add key="Password" value="yyy"/>
+    <add key="MinDBConnections" value="20"/>
+    <add key="MaxDBConnections" value="20"/>
+    <add key="DAL" value="Trade.DALSQLServer"/>
+    <add key="ENABLE_GLOBAL_SYSTEM_DOT_TRANSACTIONS_CONFIGSTRING" value="true"/>
+    <add key="SYSTEMDOTTRANSACTION_TIMEOUT" value="0"/>
+    <add key="MAX_QUERY_ORDERS" value="10"/>
+    <add key="MAX_QUERY_TOP_ORDERS" value="10"/>
+    <add key="DISPLAY_WEBSERVICE_LOGINS" value="true"/>
+    <add key="LOGIN_ITERATIONSTO_DISPLAY" value="5"/>
+    <!--Can't be ZERO-->
+    <add key="DISPLAYNUMBERORDERITERATIONS" value="3"/>
+    <!--Can't be ZERO-->
+  </appSettings>
+  <runtime>
+    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+    </assemblyBinding>
+  </runtime>
+  <!-- system.service model: New configuration section added with the release 
+       of .NET 3.0 and Windows Communication Foundation. This section defines the:
+ 
+       a) WCF Web Services, if any, hosted by this application.  
+       b) WCF clients and their endpoints.
+       c) The bindings used by the services and clients: bindings are transports and
+          encoding standards, such as HTTP/Text-XML; TCP/Binary; MSMQ, etc.
+   -->
+  <system.serviceModel>
+    <!--This enables the WCF ServiceModel performance counters for this application.-->
+    <diagnostics performanceCounters="All"></diagnostics>
+
+		<!--********************************************************
+        
+    Config Service BS Clients
+    
+    *********************************************************-->
+    <client>
+      <!-- DotNet Clients  -->
+      <endpoint address="http://localhost:9000/tradebusinessservice"
+                contract="Trade.BusinessServiceContract.ITradeServices" 
+                binding="basicHttpBinding" bindingConfiguration="BsClient_BasicHttpBinding" 
+                name="BsClient_DotNet_BasicHttpBinding"/>
+      
+      <endpoint address="http://localhost:9000/tradebusinessservice/msec" 
+      					contract="Trade.BusinessServiceContract.ITradeServices"
+      					binding="wsHttpBinding" bindingConfiguration="BsClient_WsHttpBinding_MSec"
+                behaviorConfiguration="BsClient_CertificateBehavior"
+                name="BsClient_DotNet_WsHttpBinding">
+        <identity>
+          <dns value="trade.com"/>
+        </identity>
+      </endpoint>
+      
+      <!-- PHP Client  -->
+      <endpoint address="http://localhost:8080/php_stocktrader/business_service/business_svc.php" 
+                contract="Trade.BusinessServiceContract.ITradeServices"
+                binding="basicHttpBinding" bindingConfiguration="BsClient_BasicHttpBinding"
+                name="BsClient_PHP_BasicHttpBinding"/>
+      
+      <!-- WSAS Client  -->
+      <endpoint address="http://localhost:8080/business_service/TradeServiceWsas"
+      					contract="Trade.BusinessServiceContract.ITradeServices"
+      					binding="basicHttpBinding" bindingConfiguration="BsClient_BasicHttpBinding"
+                name="BsClient_WSAS_BasicHttpBinding"/>
+    </client>
+    
+    <!--********************************************************
+        
+    Config Service BINDINGS
+    
+    *********************************************************-->
+    <bindings>
+      <!--BEGIN basicHttpBindings-->
+      <basicHttpBinding>
+        
+        <!--THESE ARE TEMPLATE PRIMARY SERVICE CLIENT BINDINGS.  TO AUGMENT, ADD WITH PREFIX 'Client_'-->
+        <binding name="BsClient_BasicHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:1:00" allowCookies="true" bypassProxyOnLocal="true" hostNameComparisonMode="StrongWildcard" maxBufferSize="524288" maxBufferPoolSize="524288" maxReceivedMessageSize="524288" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
+          <readerQuotas maxDepth="512" maxStringContentLength="262144" maxArrayLength="262144" maxBytesPerRead="65536" maxNameTableCharCount="262144"/>
+          <security mode="None">
+            <transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
+            <message clientCredentialType="Certificate" algorithmSuite="Default"/>
+          </security>
+        </binding>
+      
+      </basicHttpBinding>
+
+
+      <!--BEGIN wsHttpBindings-->
+      <wsHttpBinding>
+       
+        <binding name="BsClient_WsHttpBinding_MSec" closeTimeout="00:01:00"
+                                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
+                                    bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
+                                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
+                                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
+                                    allowCookies="false">
+          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
+          <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
+          <security mode="Message">
+            <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
+            <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" />
+          </security>
+        </binding>
+
+      </wsHttpBinding>
+
+    </bindings>
+    <!--Service Behaviors are applied (at the service level) to services that specify them, hence apply to ALL ENDPOINTS FOR A SERVICE HOST/VHOST -->
+    <behaviors>
+      <!--Endpint Behaviors are applied at the individual endpoint level.-->
+      <endpointBehaviors>
+        <!--
+        <behavior name="ClientCertificateBehavior">
+          <clientCredentials>
+            <serviceCertificate>
+              <authentication certificateValidationMode="PeerOrChainTrust"/>
+            </serviceCertificate>
+          </clientCredentials>
+        </behavior>
+        -->
+        <behavior name="BsClient_CertificateBehavior">
+          <clientCredentials>
+            <serviceCertificate>
+              <authentication certificateValidationMode="PeerOrChainTrust"/>
+            </serviceCertificate>
+          </clientCredentials>
+        </behavior>
+        <!--
+        <behavior name="OPS_ClientCertificateBehavior">
+          <clientCredentials>
+            <clientCertificate findValue="BSL.Com" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="TrustedPeople"/>                     
+          </clientCredentials>
+        </behavior>-->
+      </endpointBehaviors>
+    </behaviors>
+    <!--END CONFIG SERVICE TEMPLATE BEHAVIORS-->
+    
+  </system.serviceModel>
+  <!-- Set identity impersonate to false to make sure ASP.NET runs as its 
+       preferred ASP.NET Machine Account. Note this is also required for the 
+       application by default to run in a Windows Vista/ASP.NET worker process 
+      using the new "integrated pipeline" mode introduced with IIS 7.0, 
+      which is the web server within Vista (and upcoming Windows "Longhorn" Server
+      release.-->
+  <system.web>
+    <identity impersonate="false"/>
+    <trace enabled="false" pageOutput="false"/>
+    <!--A setting for ASMX Web Service Only-->
+    <webServices>
+      <protocols>
+        <add name="AnyHttpSoap"/>
+      </protocols>
+    </webServices>
+    <!-- 
+            Set compilation debug="true" to insert debugging 
+            symbols into the compiled page. Because this 
+            affects performance, set this value to true only 
+            during development.
+        -->
+    <customErrors mode="Off"></customErrors>
+    <pages buffer="true" enableSessionState="false" enableViewState="false" enableViewStateMac="false" smartNavigation="false">
+      <controls>
+        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+      </controls>
+    </pages>
+		<compilation defaultLanguage="c#" debug="true">
+			<assemblies>
+        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
+        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
+        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
+        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
+        <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
+      </assemblies>
+		</compilation>
+    <authentication mode="Forms">
+      <forms name="signinform" loginUrl="login.aspx" protection="None" timeout="15"/>
+    </authentication>
+    <!--
+            The <customErrors> section enables configuration 
+            of what to do if/when an unhandled error occurs 
+            during the execution of a request. Specifically, 
+            it enables developers to configure html error pages 
+            to be displayed in place of a error stack trace.
+
+        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
+            <error statusCode="403" redirect="NoAccess.htm"/>
+            <error statusCode="404" redirect="FileNotFound.htm"/>
+        </customErrors>
+        -->
+    <sessionState mode="Off" cookieless="false" stateConnectionString="" timeout="15"/>
+  </system.web>
+  <system.codedom>
+    <compilers>
+      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+        <providerOption name="CompilerVersion" value="v3.5"/>
+        <providerOption name="WarnAsError" value="false"/>
+      </compiler>
+    </compilers>
+  </system.codedom>
+  <!--These are the restricted pages based on ASP.NET authentication; and require
+      user login before access is granted-->
+  <location path="Account.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="TradeHome.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="Portfolio.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="Order.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="Quotes.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="StockTrade.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <location path="logout.aspx">
+    <system.web>
+      <authorization>
+        <deny users="?"/>
+      </authorization>
+    </system.web>
+  </location>
+  <!--  Note:  Uncomment this section to move .ascx output caching of MarketSummaryto kernel mode
+    <system.webServer>
+        <caching>
+            <profiles>
+                <add extension=".ascx" policy="DontCache" kernelCachePolicy="CacheForTimePeriod" duration="00:01:00" />
+            </profiles>
+        </caching>
+    </system.webServer>
+    -->
+</configuration>

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/as.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/as.xml?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/as.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/as.xml Sat Sep  5 16:41:14 2009
@@ -0,0 +1,64 @@
+<project name="as">
+    <property environment="env"/>
+    <property file="${basedir}/../etc/build.properties"/>
+    <property name="domain" value="domain1"/>
+
+    <property name="resource.dir" value="${basedir}/../etc"/>
+
+    <property name="business.service.binding.dir" value="${resource.dir}/${business.service.name}"/>
+    <property name="business.service.wsdl" value="${business.service.binding.dir}/${business.service.wsdl.name}"/>
+
+    <property name="order.processor.binding.dir" value="${resource.dir}/${order.processor.name}"/>
+    <property name="order.processor.wsdl" value="${order.processor.binding.dir}/${order.processor.wsdl.name}"/>
+
+    <property name="config.service.binding.dir" value="${resource.dir}/${config.service.name}"/>
+    <property name="config.service.wsdl" value="${config.service.binding.dir}/${config.service.wsdl.name}"/>
+
+    <condition property="as.home" value="${env.AS_HOME}">
+        <isset property="env.AS_HOME"/>
+    </condition>
+
+    <fail message="Web container not identified. Require AS_HOME be set">
+        <condition>
+            <not>
+                <isset property="as.home"/>
+            </not>
+        </condition>
+    </fail>
+    
+    <property name="deploy.dir" value="${as.home}/domains/${domain}/autodeploy"/>
+    <property name="keystore.dir" value="${as.home}/domains/${domain}/config"/>
+    <!-- checkPlatform determines which OS is being utilized. -->
+    <target name="checkPlatform">
+        <condition property="isUnixPlatform">
+            <os family="unix"/>
+        </condition>
+        <condition property="isWindowsPlatform">
+            <os family="windows"/>
+        </condition>
+    </target>
+
+    <target name="configForWindow" depends="checkPlatform" if="isWindowsPlatform">
+        <property name="asadmin" value="${as.home}/bin/asadmin.bat"/>
+    </target>
+
+    <target name="configForUnix" depends="checkPlatform" if="isUnixPlatform">
+        <property name="asadmin" value="${as.home}/bin/asadmin"/>
+    </target>
+
+    <target name="configPlatform" depends="configForUnix, configForWindow"/>
+
+    <target name="start-as" depends="configPlatform">
+        <exec executable="${asadmin}">
+            <arg value="start-domain"/>
+        </exec>
+    </target>
+
+    <target name="stop-as" depends="configPlatform">
+        <exec executable="${asadmin}">
+            <arg value="stop-domain"/>
+        </exec>
+    </target>
+    
+    <target name="restart-as" depends="stop-as, start-as"/>
+</project>
\ No newline at end of file

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/build.properties
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/build.properties?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/build.properties (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/build.properties Sat Sep  5 16:41:14 2009
@@ -0,0 +1,15 @@
+debug=false
+keep=true
+verbose=false
+
+business.service.name=business_service
+business.service.binding=custom-*.xml
+business.service.wsdl.name=TradeServiceWsas.wsdl
+
+order.processor.name=order_processor
+order.processor.binding=custom-*.xml
+order.processor.wsdl.name=OrderProcessor.wsdl
+
+config.service.name=config_service
+config.service.binding=custom-*.xml
+config.service.wsdl.name=ConfigService.wsdl

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/TradeServiceWsas.wsdl
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/TradeServiceWsas.wsdl?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/TradeServiceWsas.wsdl (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/TradeServiceWsas.wsdl Sat Sep  5 16:41:14 2009
@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="TradeServiceWsas" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:i0="http://trade.samples.websphere.ibm.com" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract">
+  <wsdl:import namespace="http://trade.samples.websphere.ibm.com" location="wsdl0.wsdl">
+    </wsdl:import>
+  <wsdl:types>
+  </wsdl:types>
+  <wsdl:binding name="BasicHttpBinding_ITradeServices" type="i0:ITradeServices">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="emptyMethodAction">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="isOnline">
+      <soap:operation soapAction="isOnline" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+    </wsdl:operation>
+    <wsdl:operation name="login">
+      <soap:operation soapAction="http://trade.samples.websphere.ibm.com/ITradeServices/login" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getOrders">
+      <soap:operation soapAction="getOrders" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getAccountData">
+      <soap:operation soapAction="getAccountData" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getAccountProfileData">
+      <soap:operation soapAction="getAccountProfileData" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="updateAccountProfile">
+      <soap:operation soapAction="updateAccountProfile" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="logout">
+      <soap:operation soapAction="logout" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="buy">
+      <soap:operation soapAction="buy" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="sell">
+      <soap:operation soapAction="sell" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getHoldings">
+      <soap:operation soapAction="getHoldings" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="register">
+      <soap:operation soapAction="register" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getClosedOrders">
+      <soap:operation soapAction="getClosedOrders" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getMarketSummary">
+      <soap:operation soapAction="getMarketSummary" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getQuote">
+      <soap:operation soapAction="http://trade.samples.websphere.ibm.com/ITradeServices/getQuote" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getHolding">
+      <soap:operation soapAction="getHolding" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="getTopOrders">
+      <soap:operation soapAction="getTopOrders" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="sellEnhanced">
+      <soap:operation soapAction="sellEnhanced" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="TradeServiceWsas">
+    <wsdl:port name="BasicHttpBinding_ITradeServices" binding="tns:BasicHttpBinding_ITradeServices">
+      <soap:address location=""/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-jaxbbean.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-jaxbbean.xml?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-jaxbbean.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-jaxbbean.xml Sat Sep  5 16:41:14 2009
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").  You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code.  If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license."  If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above.  However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+
+<jaxws:bindings
+        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        wsdlLocation="wsdl0.wsdl">
+
+    <jaxws:bindings node="wsdl:definitions">
+        <jaxb:bindings node="//xsd:schema">
+            <jaxb:globalBindings generateElementProperty="false">
+				<jaxb:javaType name="java.util.Calendar" xmlType="xsd:dateTime" parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime" printMethod="javax.xml.bind.DatatypeConverter.printDateTime"/>
+				<jaxb:javaType name="java.util.Calendar" xmlType="xsd:date" parseMethod="javax.xml.bind.DatatypeConverter.parseDate" printMethod="javax.xml.bind.DatatypeConverter.printDate"/>
+			</jaxb:globalBindings>
+        </jaxb:bindings>
+    </jaxws:bindings>
+
+</jaxws:bindings>

Added: incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-sei.xml
URL: http://svn.apache.org/viewvc/incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-sei.xml?rev=811675&view=auto
==============================================================================
--- incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-sei.xml (added)
+++ incubator/stonehenge/trunk/stocktrader/metro/etc/business_service/custom-sei.xml Sat Sep  5 16:41:14 2009
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+ Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
+
+ The contents of this file are subject to the terms of either the GNU
+ General Public License Version 2 only ("GPL") or the Common Development
+ and Distribution License("CDDL") (collectively, the "License").  You
+ may not use this file except in compliance with the License. You can obtain
+ a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
+ or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
+ language governing permissions and limitations under the License.
+
+ When distributing the software, include this License Header Notice in each
+ file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
+ Sun designates this particular file as subject to the "Classpath" exception
+ as provided by Sun in the GPL Version 2 section of the License file that
+ accompanied this code.  If applicable, add the following below the License
+ Header, with the fields enclosed by brackets [] replaced by your own
+ identifying information: "Portions Copyrighted [year]
+ [name of copyright owner]"
+
+ Contributor(s):
+
+ If you wish your version of this file to be governed by only the CDDL or
+ only the GPL Version 2, indicate your decision by adding "[Contributor]
+ elects to include this software in this distribution under the [CDDL or GPL
+ Version 2] license."  If you don't indicate a single choice of license, a
+ recipient has the option to distribute your version of this file under
+ either the CDDL, the GPL Version 2 or to extend the choice of license to
+ its licensees as provided above.  However, if you add GPL Version 2 code
+ and therefore, elected the GPL Version 2 license, then the option applies
+ only if the new code is made subject to such option by the copyright
+ holder.
+-->
+
+
+<bindings
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+        wsdlLocation="TradeServiceWsas.wsdl"
+        xmlns="http://java.sun.com/xml/ns/jaxws">
+    <enableWrapperStyle>false</enableWrapperStyle>
+
+</bindings>



Mime
View raw message