Examples of BSConfigResponse


Examples of org.apache.stonehenge.stocktrader.config.xsd.BSConfigResponse

    BSConfigRequestE configRequestE = new BSConfigRequestE();
    BSConfigRequest param = new BSConfigRequest();
    param.setBS("JAVA_BS");
    configRequestE.setBSConfigRequest(param);
    BSConfigResponseE configResponseE = stub.bSConfigRequest(configRequestE);
    BSConfigResponse configResponse = configResponseE.getBSConfigResponse();
    TradeOrderConfig config = new TradeOrderConfig();
    config.setEndpointURL(configResponse.getOPS().toString());
    config.setSecure(configResponse.getSec());
    return config;
  }
View Full Code Here

Examples of org.apache.stonehenge.stocktrader.config.xsd.BSConfigResponse

        *                If this object is not an element, it is a complex type and the reader is at the event just after the outer start element
        * Postcondition: If this object is an element, the reader is positioned at its end element
        *                If this object is a complex type, the reader is positioned at the end element of its outer element
        */
        public static BSConfigResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
            BSConfigResponse object =
                new BSConfigResponse();

            int event;
            java.lang.String nillableValue = null;
            java.lang.String prefix ="";
            java.lang.String namespaceuri ="";
            try {
               
                while (!reader.isStartElement() && !reader.isEndElement())
                    reader.next();

               
                if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){
                  java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
                        "type");
                  if (fullTypeName!=null){
                    java.lang.String nsPrefix = null;
                    if (fullTypeName.indexOf(":") > -1){
                        nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":"));
                    }
                    nsPrefix = nsPrefix==null?"":nsPrefix;

                    java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1);
                   
                            if (!"BSConfigResponse".equals(type)){
                                //find namespace for the prefix
                                java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix);
                                return (BSConfigResponse)org.apache.stonehenge.stocktrader.config.xsd.ExtensionMapper.getTypeObject(
                                     nsUri,type,reader);
                              }
                       

                  }
               

                }

               

               
                // Note all attributes that were handled. Used to differ normal attributes
                // from anyAttributes.
                java.util.Vector handledAttributes = new java.util.Vector();
               

                
                   
                    reader.next();
               
                                   
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                               
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://apache.org/stonehenge/stocktrader/xsd","DBName").equals(reader.getName())){
                               
                                    java.lang.String content = reader.getElementText();
                                   
                                              object.setDBName(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
                                             
                                        reader.next();
                                   
                              // End of if for expected property start element
                               
                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }
                           
                                   
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                               
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://apache.org/stonehenge/stocktrader/xsd","DBHostName").equals(reader.getName())){
                               
                                    java.lang.String content = reader.getElementText();
                                   
                                              object.setDBHostName(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content));
                                             
                                        reader.next();
                                   
                              // End of if for expected property start element
                               
                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }
                           
                                   
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                               
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://apache.org/stonehenge/stocktrader/xsd","DBPort").equals(reader.getName())){
                               
                                    java.lang.String content = reader.getElementText();
                                   
                                              object.setDBPort(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToUnsignedInt(content));
                                             
                                        reader.next();
                                   
                              // End of if for expected property start element
                               
                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }
                           
                                   
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                               
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://apache.org/stonehenge/stocktrader/xsd","OPS").equals(reader.getName())){
                               
                                    java.lang.String content = reader.getElementText();
                                   
                                              object.setOPS(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToAnyURI(content));
                                             
                                        reader.next();
                                   
                              // End of if for expected property start element
                               
                                else{
                                    // A start element we are not expecting indicates an invalid parameter was passed
                                    throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName());
                                }
                           
                                   
                                    while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
                               
                                    if (reader.isStartElement() && new javax.xml.namespace.QName("http://apache.org/stonehenge/stocktrader/xsd","Sec").equals(reader.getName())){
                               
                                    java.lang.String content = reader.getElementText();
                                   
                                              object.setSec(
                                                    org.apache.axis2.databinding.utils.ConverterUtil.convertToBoolean(content));
                                             
                                        reader.next();
                                   
                              // End of if for expected property start element
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

        GetBSConfig getBSConfig = new GetBSConfig();
        BSConfigRequest configRequest = new BSConfigRequest();
        configRequest.setBSName(bsName);
        getBSConfig.setBs(configRequest);
        GetBSConfigResponse getBSConfigResponse = service.getBSConfig(getBSConfig);
        BSConfigResponse response = getBSConfigResponse.getGetBSConfigResult();

        TradeOrderConfig config = new TradeOrderConfig();
        config.setServiceName(response.getOPSName());
        config.setEndpointURL(response.getOPS());
        config.setSecure(response.isSec());
        return config;
    }
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

    @Test
    public void should_update_bs_to_ops_when_entry_already_exists() {
        assumeThat(getConfigServiceDAO().getBSConfig("JAVA_BS"), notNullValue());
        getConfigServiceDAO().setBSToOPS("JAVA_BS", "PHP_OPS");
        BSConfigResponse response = getConfigServiceDAO().getBSConfig("JAVA_BS");
        assertThat(response.getOPSName(), equalTo("PHP_OPS"));
    }
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

    @Test
    public void should_update_bs_to_ops_when_entry_doesnot_exists() {
        assumeThat(getConfigServiceDAO().getBSConfig("PHP_BS"), nullValue());
        getConfigServiceDAO().setBSToOPS("PHP_BS", "PHP_OPS");
        BSConfigResponse response = getConfigServiceDAO().getBSConfig("PHP_BS");
        assertThat(response.getOPSName(), equalTo("PHP_OPS"));
    }
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

    public void should_update_bs_service() {
        getConfigServiceDAO().setBSToOPS("RUBY_BS", "RUBY_OPS");
        String serviceName = "RUBY_OPS";
        String serviceUrl = "http://localhost/ruby";
        getConfigServiceDAO().setServiceLocation(serviceName, serviceUrl, true);
        BSConfigResponse response = getConfigServiceDAO().getBSConfig("RUBY_BS");
        assertThat(response.getOPS(), equalTo(serviceUrl));
        assertThat(response.getOPSName(), equalTo(serviceName));
        assertThat(response.isSec(), equalTo(true));
    }
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

    public void should_insert_values_into_service() {
         getConfigServiceDAO().setBSToOPS("AA_BS", "AA_OPS");
        String serviceName = "AA_OPS";
        String serviceUrl = "http://localhost/AA_OPS";
        getConfigServiceDAO().setServiceLocation(serviceName, serviceUrl, false);
        BSConfigResponse response = getConfigServiceDAO().getBSConfig("AA_BS");
        assertThat(response.getOPS(), equalTo(serviceUrl));
        assertThat(response.getOPSName(), equalTo(serviceName));
        assertThat(response.isSec(), equalTo(false));
    }
View Full Code Here

Examples of org.datacontract.schemas._2004._07.trade.BSConfigResponse

    }

    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;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.