Changeset 166
- Timestamp:
- 05/08/08 12:41:58 (7 months ago)
- Files:
-
- branches/routingservice/src/jp/co/orkney/restlet/util/Configuration.java (modified) (6 diffs)
- branches/routingservice/src/jp/co/orkney/restlet/util/Limit.java (added)
- branches/routingservice/src/jp/co/orkney/restlet/util/LimitsHelper.java (added)
- branches/routingservice/src/jp/co/orkney/restlet/WebRouting.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/routingservice/src/jp/co/orkney/restlet/util/Configuration.java
r164 r166 59 59 { 60 60 public static final String API_KEY = "api_key"; 61 62 61 public static final String SIGNATURE = "signature"; 63 64 62 public static final String CLIENT_ID = "id"; 65 63 66 64 private String urlConfigurationFile = "./configuration.xml"; 67 68 65 private String urlXMLTemplateQuery = "./pool.xml"; 69 70 66 private String commandCapabilities = "capabilities"; 71 72 67 private String versionNumber = "1.0.0"; 73 74 68 private String port; 75 76 69 private String urlLog; 77 78 70 private int modeLog; 79 80 71 private String localhost; 81 82 72 private String urlCss; 83 84 73 public Vector<Provider> providers; 85 86 74 private int askCapabilities; // -1 by default, 0 host capabilities, 1 87 75 … … 89 77 90 78 private Provider provider; 91 92 79 private Service service; 93 94 80 private Format formatIn; 95 96 81 private Format formatOut; 97 98 82 private int iProvider = 0; 99 100 83 private int iService = 0; 101 102 84 private int iFormat = 0; 103 85 … … 171 153 Vector<Service> services = new Vector<Service>(); 172 154 173 // TODO Replace it with proper constructor174 155 while (itService.hasNext()) 175 156 { … … 189 170 service.setDataProjection(currentService.getChild("projection") 190 171 .getAttributeValue("srid")); 172 191 173 // TODO read units from the configuration 192 // probably it is better to create Projection class 174 // probably it is better to create Projection class 193 175 try 194 176 { … … 338 320 if ((iService = isService(urlSplit[3].split("\\.")[0])) != -1) 339 321 { 340 // TODO Why not just assign service = 341 // provider.getServices().get(iService) ? 322 /* 342 323 Service tmpService = provider.getServices().get(iService); 343 324 service = new Service(tmpService.getName(), tmpService … … 345 326 .isEnable(), tmpService.getParameters(), null, tmpService 346 327 .getDatabaseConfiguration(), tmpService.getLimit()); 328 */ 329 service = provider.getServices().get(iService); 347 330 } 348 331 else branches/routingservice/src/jp/co/orkney/restlet/WebRouting.java
r149 r166 74 74 public class WebRouting 75 75 { 76 private String result = ""; 76 static final String CLOSEST_EDGE = "closest_edge"; 77 static final String SHORTEST_PATH = "shortest_path"; 78 static final String DRIVING_DISTANCE = "driving_distance"; 79 static final String TSP = "traveling_sales_person"; 80 81 private String result = ""; 77 82 private MediaType resultFormat; 78 83 private Log log; … … 224 229 GeoAction action = null; 225 230 226 // APPEL DES FONCTIONS-->227 if (configuration.getService().getName().equals( "closest_edge"))231 // Choosing an action --> 232 if (configuration.getService().getName().equals(CLOSEST_EDGE)) 228 233 action = new ClosestEdge(configuration, connection, ioHelper, log); 229 else if (configuration.getService().getName().equals( "shortest_path"))234 else if (configuration.getService().getName().equals(SHORTEST_PATH)) 230 235 action = new ShortestPath(configuration, connection, ioHelper, log); 231 else if (configuration.getService().getName().equals( "driving_distance"))236 else if (configuration.getService().getName().equals(DRIVING_DISTANCE)) 232 237 action = new DrivingDistance(configuration, connection, ioHelper, log); 233 else if (configuration.getService().getName().equals( "traveling_sales_person"))238 else if (configuration.getService().getName().equals(TSP)) 234 239 action = new TravelingSalesPerson(configuration, connection, ioHelper, log); 235 240 try

