Package org.datacontract.schemas._2004._07.trade

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


    }

    public ManipulationResponse updateSystemParameters(int timestep, boolean isFirstManipulation, String networkOrManipulationId, List<ManipulatingParameter> sysParamList, List<ManipulatingNode> nodes) {
        long milliseconds = System.currentTimeMillis();
       
        SimpleManipulationRequest smr = new SimpleManipulationRequest();
        smr.setUser(user);
        smr.setBeginingTimestepIdx(timestep);
        if (isFirstManipulation) {
            smr.setNetworkId(networkOrManipulationId);
        } else {
            smr.setManipulationId(networkOrManipulationId);
        }
        smr.setTimestepsToRun(Integer.valueOf(propertiesConfig.getProperty("timestepsToRunDefault")));
        if(sysParamList != null)
            smr.setSysParams(CopySystemParameter(sysParamList));               
        else {
            System.out.println("Error (updateSystemParameters): " + "System parameter is null.");
        }
        smr.setDescription( "updateSystemParameters");
        smr.setSaveLastTimestepOnly(false);
        if(nodes != null)
            smr.setManipulationModelNodes(nodes.toArray(new ManipulatingNode[]{} ));

        ManipulationResponse response = null;
        try {
            response = (ManipulationResponse) svc.executeManipulationRequest(smr);
            //TODO: Write web service call to database
View Full Code Here


        ManipulatingParameter[] sysParams = CopySystemParameter(sysParamList);               
       
       
       
       
        SimpleManipulationRequest smr = new SimpleManipulationRequest();
        smr.setSaveLastTimestepOnly(true);
        smr.setUser(user);
        smr.setBeginingTimestepIdx(timestep);
        if (isFirstManipulation) {
            smr.setNetworkId(networkOrManipulationId);
        } else {
            smr.setManipulationId(networkOrManipulationId);
        }
        smr.setTimestepsToRun(Integer.valueOf(propertiesConfig.getProperty("timestepsToRunDefault")));
        smr.setManipulationModelNodes(nodes);
       
        smr.setSysParams(sysParams);               
//        smr.setSysParams(this.CopySystemParameter(sParams));       
//        smr.setSysParams((ManipulatingParameter[])sParams.toArray());
        smr.setDescription( " " + propertiesConfig.getProperty("increaseCarryingCapacityDescription") + " " + propertiesConfig.getProperty("carryingCapacityDefault"));
        smr.setSaveLastTimestepOnly(false);

        ManipulationResponse response = null;
        try {
            response = (ManipulationResponse) svc.executeManipulationRequest(smr);
            //TODO: Write web service call to database
View Full Code Here

    }

    public ManipulationResponse run(int beginingTimestep, int timestepsToRun, String netId, boolean isNetwork) {
        long milliseconds = System.currentTimeMillis();

        SimpleManipulationRequest smr = new SimpleManipulationRequest();
        smr.setUser(user);
        smr.setBeginingTimestepIdx(beginingTimestep);
        if (isNetwork) {
            smr.setNetworkId(netId);
        } else {
            smr.setManipulationId(netId);
        }

//        smr.setManipulationModelNodes(nodes);
        smr.setTimestepsToRun(timestepsToRun);
        smr.setDescription("Serengetti sub foodweb stability test - netId:" + netId);
        smr.setSaveLastTimestepOnly(false);
//        smr.setSysParams(sysParams);

        ManipulationResponse response = null;
        try {
            response = (ManipulationResponse) svc.executeManipulationRequest(smr);
View Full Code Here

    public void run(int startTimestep, int runTimestep, String manipulationId) {
        long milliseconds = System.currentTimeMillis();
       
        try {
            SimpleManipulationRequest smr = new SimpleManipulationRequest();
            smr.setSaveLastTimestepOnly(true);
            User user = new User();
            user.setUsername("beast");
            smr.setUser(user);
            smr.setBeginingTimestepIdx(startTimestep);
            smr.setTimestepsToRun(runTimestep);
            smr.setManipulationId(manipulationId);
            smr.setSaveLastTimestepOnly(false);

            ManipulationResponse response = (ManipulationResponse) svc.executeManipulationRequest(smr);
            String errMsg = response.getMessage();
            if (errMsg != null) {
                System.out.println("Error (run): " + errMsg);
View Full Code Here

        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

    @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

    @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

    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

    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

    }

    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

Related Classes of org.datacontract.schemas._2004._07.trade.BSConfigResponse

Copyright © 2018 www.massapicom. 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.