Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5249 for branches


Ignore:
Timestamp:
01/08/11 13:55:08 (13 years ago)
Author:
mholper
Message:

added some changed in Impl #1218

Location:
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/IECJConnector.java

    r5247 r5249  
    3636   * @throws Exception
    3737   */
    38   public void initialize(String algorithm, String platform, String problem) throws Exception; //, Map<String, Object> algoParams, Map<String,Object> problemParams, Object paramFile) throws Exception;
     38  public ECJConnectorState initialize(String algorithm, String platform, String problem) throws Exception; //, Map<String, Object> algoParams, Map<String,Object> problemParams, Object paramFile) throws Exception;
    3939
    4040  /**
     
    4343   * @throws Exception
    4444   */
    45   public void result(List<Object> resultList, Map<String, Object> algoParams, Map<String, Object> problemParams,
     45  public void result(ECJConnectorState state, List<Object> resultList, Map<String, Object> algoParams, Map<String, Object> problemParams,
    4646      Object paramFile) throws Exception;
    4747}
  • branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java

    r5248 r5249  
    33import static at.hl.okb.wsclient.Utilities.createNameFilter;
    44
     5import java.util.ArrayList;
    56import java.util.HashMap;
    67import java.util.Iterator;
     8import java.util.List;
    79import java.util.Map;
    810
    9 import at.hl.okb.ECJDataTypeEnum;
    1011import at.hl.wsclient.okb.Algorithm;
    1112import at.hl.wsclient.okb.AlgorithmClass;
    12 import at.hl.wsclient.okb.AlgorithmData;
    1313import at.hl.wsclient.okb.AlgorithmParameter;
    1414import at.hl.wsclient.okb.ArrayOfAlgorithmParameter;
     
    3838        createNameFilter(platformName), null);
    3939
    40     return returnValue.getId();
     40    return returnValue != null ? returnValue.getId() : null;
    4141  }
    42  
     42
    4343  public Long getProblemId(String problemName) {
    44     Problem returnValue = Iterables.find(
    45         port.getProblems().getProblem(),
     44    Problem returnValue = Iterables.find(port.getProblems().getProblem(),
    4645        createNameFilter(problemName), null);
    4746
    48     return returnValue.getId();
    49   } 
     47    return returnValue != null ? returnValue.getId() : null;
     48  }
    5049
    5150  public Long getProblemClassId(String problemClass) {
     
    5352        .getProblemClass(), createNameFilter(problemClass), null);
    5453
    55     return returnValue.getId();
     54    return returnValue != null ? returnValue.getId() : null;
    5655
    5756  }
     
    6261        null);
    6362
    64     return returnValue.getId();
     63    return returnValue != null ? returnValue.getId() : null;
    6564
    6665  }
     
    8079      }
    8180    }
    82     return problem.getId();
     81    return problem != null ? problem.getId() : null;
    8382  }
    8483
    85   public Long getAlgorithmId(String algorithmName, /*Long algorithmClassId,*/
    86       Long platformId) {
     84  public Long getAlgorithmId(String algorithmName, /* Long algorithmClassId, */
     85  Long platformId) {
    8786    Algorithm algorithm = null;
    88    
     87
    8988    Iterator<Algorithm> it = port.getAlgorithms().getAlgorithm().iterator();
    9089
     
    9392      if (platformId.equals(tmpAlgo.getPlatformId())
    9493          && algorithmName.equals(tmpAlgo.getName().getValue())
    95           //&& algorithmClassId.equals(tmpAlgo.getAlgorithmClassId())
    96           ) {
     94      // && algorithmClassId.equals(tmpAlgo.getAlgorithmClassId())
     95      ) {
    9796        algorithm = tmpAlgo;
    9897      }
    9998    }
    100    
    101     return algorithm != null ?algorithm.getId() : null;
    102      
     99
     100    return algorithm != null ? algorithm.getId() : null;
     101
    103102  }
    104  
    105 //  public Map<String, ECJDataTypeEnum> getAlgorithParameter(Long  algorithmId) {
    106 //    Map<String, AlgorithmParameter> returnMap = new HashMap<String, AlgorithmParameter>();
    107 //   
    108 //    AlgorithmData algoData = port.getAlgorithmData(algorithmId);
    109 // 
    110 //    ArrayOfAlgorithmParameter algoParamList = port.getAlgorithmParameters(algorithmId);
    111 //   
    112 //    for (AlgorithmParameter algoParam:algoParamList.getAlgorithmParameter()) {
    113 //      mapOKBDataTypetoECJDataTypeEnum()
    114 //      port.getDataType(algoParam.getDataTypeId()).getName().getValue()) {
    115 //     
    116 //      }
    117 //      returnMap.put(algoParam.getName().getValue(), port.getDataType(algoParam.getDataTypeId()).getName().getValue());
    118 //    }
    119 //   
    120 //    return returnMap;
    121 //  }
     103
     104  // public Map<String, ECJDataTypeEnum> getAlgorithParameter(Long
     105  // algorithmId) {
     106  // Map<String, AlgorithmParameter> returnMap = new HashMap<String,
     107  // AlgorithmParameter>();
     108  //
     109  // AlgorithmData algoData = port.getAlgorithmData(algorithmId);
     110  //
     111  // ArrayOfAlgorithmParameter algoParamList =
     112  // port.getAlgorithmParameters(algorithmId);
     113  //
     114  // for (AlgorithmParameter algoParam:algoParamList.getAlgorithmParameter())
     115  // {
     116  // mapOKBDataTypetoECJDataTypeEnum()
     117  // port.getDataType(algoParam.getDataTypeId()).getName().getValue()) {
     118  //
     119  // }
     120  // returnMap.put(algoParam.getName().getValue(),
     121  // port.getDataType(algoParam.getDataTypeId()).getName().getValue());
     122  // }
     123  //
     124  // return returnMap;
     125  // }
    122126
    123127  private <T extends NamedOKBItem> T createNamedOKBItem(Class<T> clazz,
     
    133137    }
    134138  }
     139 
     140  public Boolean areAlgoParamsEqual() {
     141    Boolean retval = false;
     142   
     143   
     144    return retval;
     145  }
    135146
     147  public void createMissingAlgoParams(Long algorithmId,
     148      Map<String, Object> ecjAlgoParams) {
     149
     150    List<String> missingParams = new ArrayList<String>();
     151
     152    ArrayOfAlgorithmParameter hlAlgoParams = port
     153        .getAlgorithmParameters(algorithmId);
     154    Map<String, Object> hlAlgoParamMap = new HashMap<String, Object>();
     155
     156    for (AlgorithmParameter algoParam : hlAlgoParams
     157        .getAlgorithmParameter()) {
     158      hlAlgoParamMap.put(algoParam.getName().getValue(), null); // value
     159      // hangs
     160      // on
     161      // Experiments
     162    }
     163
     164    String[] ecjparamNames = (String[]) ecjAlgoParams.keySet().toArray();
     165
     166    for (int i = 0; i < ecjparamNames.length; i++) {
     167      if (!hlAlgoParamMap.containsKey(ecjparamNames[i])) {
     168        missingParams.add(new String(ecjparamNames[i]));
     169      }
     170    }
     171
     172  }
    136173}
Note: See TracChangeset for help on using the changeset viewer.