Changeset 5249 for branches/OKBJavaConnector/HLOKBWebClient/src/main
- Timestamp:
- 01/08/11 13:55:08 (14 years ago)
- 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 36 36 * @throws Exception 37 37 */ 38 public voidinitialize(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; 39 39 40 40 /** … … 43 43 * @throws Exception 44 44 */ 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, 46 46 Object paramFile) throws Exception; 47 47 } -
branches/OKBJavaConnector/HLOKBWebClient/src/main/java/at/hl/okb/wsclient/OKBServiceClient.java
r5248 r5249 3 3 import static at.hl.okb.wsclient.Utilities.createNameFilter; 4 4 5 import java.util.ArrayList; 5 6 import java.util.HashMap; 6 7 import java.util.Iterator; 8 import java.util.List; 7 9 import java.util.Map; 8 10 9 import at.hl.okb.ECJDataTypeEnum;10 11 import at.hl.wsclient.okb.Algorithm; 11 12 import at.hl.wsclient.okb.AlgorithmClass; 12 import at.hl.wsclient.okb.AlgorithmData;13 13 import at.hl.wsclient.okb.AlgorithmParameter; 14 14 import at.hl.wsclient.okb.ArrayOfAlgorithmParameter; … … 38 38 createNameFilter(platformName), null); 39 39 40 return returnValue .getId();40 return returnValue != null ? returnValue.getId() : null; 41 41 } 42 42 43 43 public Long getProblemId(String problemName) { 44 Problem returnValue = Iterables.find( 45 port.getProblems().getProblem(), 44 Problem returnValue = Iterables.find(port.getProblems().getProblem(), 46 45 createNameFilter(problemName), null); 47 46 48 return returnValue .getId();49 } 47 return returnValue != null ? returnValue.getId() : null; 48 } 50 49 51 50 public Long getProblemClassId(String problemClass) { … … 53 52 .getProblemClass(), createNameFilter(problemClass), null); 54 53 55 return returnValue .getId();54 return returnValue != null ? returnValue.getId() : null; 56 55 57 56 } … … 62 61 null); 63 62 64 return returnValue .getId();63 return returnValue != null ? returnValue.getId() : null; 65 64 66 65 } … … 80 79 } 81 80 } 82 return problem .getId();81 return problem != null ? problem.getId() : null; 83 82 } 84 83 85 public Long getAlgorithmId(String algorithmName, /* Long algorithmClassId,*/86 84 public Long getAlgorithmId(String algorithmName, /* Long algorithmClassId, */ 85 Long platformId) { 87 86 Algorithm algorithm = null; 88 87 89 88 Iterator<Algorithm> it = port.getAlgorithms().getAlgorithm().iterator(); 90 89 … … 93 92 if (platformId.equals(tmpAlgo.getPlatformId()) 94 93 && algorithmName.equals(tmpAlgo.getName().getValue()) 95 //&& algorithmClassId.equals(tmpAlgo.getAlgorithmClassId())96 94 // && algorithmClassId.equals(tmpAlgo.getAlgorithmClassId()) 95 ) { 97 96 algorithm = tmpAlgo; 98 97 } 99 98 } 100 101 return algorithm != null ? algorithm.getId() : null;102 99 100 return algorithm != null ? algorithm.getId() : null; 101 103 102 } 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 // } 122 126 123 127 private <T extends NamedOKBItem> T createNamedOKBItem(Class<T> clazz, … … 133 137 } 134 138 } 139 140 public Boolean areAlgoParamsEqual() { 141 Boolean retval = false; 142 143 144 return retval; 145 } 135 146 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 } 136 173 }
Note: See TracChangeset
for help on using the changeset viewer.