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

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


    node.setNodeIdx(species.getNodeIndex());
    node.setHasLinks(false);
                ManipulatingNode[] nodes = new ManipulatingNode[1];
                nodes[0] = node;               

    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.setDescription(species.getName() + " " + propertiesConfig.getProperty("removeSpeciesTypeDescription"));

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


        node.setTimestepIdx(timestep);
        node.setManipulationActionType(ManipulationActionType.MULTIPLE_BIOMASS_UPDATE.getManipulationActionType());
        ManipulatingNode[] nodes = new ManipulatingNode[1];
        nodes[0] = node;
       
        SimpleManipulationRequest smr = new SimpleManipulationRequest();
        smr.setUser(user);
        smr.setBeginingTimestepIdx(timestep);
        smr.setManipulationId(manipulationId);
        smr.setTimestepsToRun(Integer.valueOf(propertiesConfig.getProperty("timestepsToRunDefault")));
        smr.setManipulationModelNodes(nodes);
        NodeBiomass nba[] = (NodeBiomass[]) lNodeBiomass.toArray(new NodeBiomass[0]);
        smr.setNodeBiomasses(nba);
        smr.setDescription(propertiesConfig.getProperty("updateBiomassDescription"));
        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 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

        GetClientConfig getClientConfig = new GetClientConfig();
        ClientConfigRequest clientconfigRequest = new ClientConfigRequest();
        clientconfigRequest.setClientName("METRO_CLIENT");
        getClientConfig.setClient(clientconfigRequest);
        GetClientConfigResponse clientConfigResponse = service.getClientConfig(getClientConfig);
        ClientConfigResponse clientresponse = clientConfigResponse.getGetClientConfigResult();
        String bsName = clientresponse.getBSName();

        GetBSConfig getBSConfig = new GetBSConfig();
        BSConfigRequest configRequest = new BSConfigRequest();
        configRequest.setBSName(bsName);
        getBSConfig.setBs(configRequest);
View Full Code Here

   
    @Test
    public void should_update_client_to_bs_when_entry_already_exists() {
        assumeThat(getConfigServiceDAO().getClientConfig("JAVA_CLIENT"), notNullValue());
        getConfigServiceDAO().setClientToBS("JAVA_CLIENT", "JAVA_BS");
        ClientConfigResponse response = getConfigServiceDAO().getClientConfig("JAVA_CLIENT");
        assertThat(response.getBSName(), equalTo("JAVA_BS"));
    }
View Full Code Here

    @Test
    public void should_insert_value_into_client_to_bs_when_entry_doesnot_exists() {
        assumeThat(getConfigServiceDAO().getClientConfig("RUBY_CLIENT").getBSName(), nullValue());
        getConfigServiceDAO().setClientToBS("RUBY_CLIENT", "JAVA_BS");
        ClientConfigResponse response = getConfigServiceDAO().getClientConfig("RUBY_CLIENT");
        assertThat(response.getBSName(), equalTo("JAVA_BS"));
    }
View Full Code Here

        }
    }

    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;
        }
View Full Code Here

TOP

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

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.