blob: 0dc6f8e08c77d54e4d41cf52c0b4ddfe987bcf81 [file] [log] [blame]
Ray Milkey140e4782015-04-24 11:25:13 -07001/*
2 * Copyright 2014-2015 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.xosintegration;
17
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070018import com.eclipsesource.json.JsonArray;
19import com.eclipsesource.json.JsonObject;
alshabib60562282015-06-01 16:45:04 -070020import com.google.common.collect.Maps;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070021import com.sun.jersey.api.client.Client;
Jonathan Hartb4558032015-05-20 16:32:04 -070022import com.sun.jersey.api.client.ClientHandlerException;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070023import com.sun.jersey.api.client.ClientResponse;
24import com.sun.jersey.api.client.WebResource;
25import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;
Ray Milkey140e4782015-04-24 11:25:13 -070026import org.apache.felix.scr.annotations.Activate;
27import org.apache.felix.scr.annotations.Component;
28import org.apache.felix.scr.annotations.Deactivate;
29import org.apache.felix.scr.annotations.Modified;
30import org.apache.felix.scr.annotations.Property;
31import org.apache.felix.scr.annotations.Reference;
32import org.apache.felix.scr.annotations.ReferenceCardinality;
33import org.apache.felix.scr.annotations.Service;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070034import org.onlab.packet.VlanId;
Ray Milkey140e4782015-04-24 11:25:13 -070035import org.onlab.util.Tools;
36import org.onosproject.cfg.ComponentConfigService;
37import org.onosproject.core.ApplicationId;
38import org.onosproject.core.CoreService;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070039import org.onosproject.net.ConnectPoint;
40import org.onosproject.net.DeviceId;
41import org.onosproject.net.PortNumber;
42import org.onosproject.net.flow.DefaultTrafficSelector;
43import org.onosproject.net.flow.DefaultTrafficTreatment;
44import org.onosproject.net.flow.TrafficSelector;
45import org.onosproject.net.flow.TrafficTreatment;
46import org.onosproject.net.flowobjective.DefaultForwardingObjective;
47import org.onosproject.net.flowobjective.FlowObjectiveService;
48import org.onosproject.net.flowobjective.ForwardingObjective;
Ray Milkey140e4782015-04-24 11:25:13 -070049import org.osgi.service.component.ComponentContext;
50import org.slf4j.Logger;
51
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070052import java.util.Dictionary;
alshabib60562282015-06-01 16:45:04 -070053import java.util.Map;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070054import java.util.Set;
55import java.util.stream.Collectors;
56import java.util.stream.IntStream;
Ray Milkey140e4782015-04-24 11:25:13 -070057
58import static com.google.common.base.Strings.isNullOrEmpty;
59import static com.google.common.net.MediaType.JSON_UTF_8;
alshabib60562282015-06-01 16:45:04 -070060import static java.net.HttpURLConnection.*;
Ray Milkey140e4782015-04-24 11:25:13 -070061import static org.slf4j.LoggerFactory.getLogger;
62
63
64/**
65 * XOS interface application.
66 */
67@Component(immediate = true)
68@Service
69public class OnosXOSIntegrationManager implements VoltTenantService {
Ray Milkeydea98172015-05-18 10:39:39 -070070 private static final String XOS_SERVER_ADDRESS_PROPERTY_NAME =
71 "xosServerAddress";
72 private static final String XOS_SERVER_PORT_PROPERTY_NAME =
73 "xosServerPort";
74 private static final String XOS_PROVIDER_SERVICE_PROPERTY_NAME =
75 "xosProviderService";
Ray Milkey140e4782015-04-24 11:25:13 -070076
77 private static final String TEST_XOS_SERVER_ADDRESS = "10.254.1.22";
78 private static final int TEST_XOS_SERVER_PORT = 8000;
79 private static final String XOS_TENANT_BASE_URI = "/xoslib/volttenant/";
Ray Milkeydea98172015-05-18 10:39:39 -070080 private static final int TEST_XOS_PROVIDER_SERVICE = 1;
Ray Milkey140e4782015-04-24 11:25:13 -070081
Jonathan Hartb4558032015-05-20 16:32:04 -070082 private static final int PRIORITY = 50000;
Jonathan Hart5e9a63d2015-05-19 16:21:46 -070083 private static final DeviceId FABRIC_DEVICE_ID = DeviceId.deviceId("of:5e3e486e73000187");
84 private static final PortNumber FABRIC_OLT_CONNECT_POINT = PortNumber.portNumber(2);
85 private static final PortNumber FABRIC_VCPE_CONNECT_POINT = PortNumber.portNumber(3);
86 private static final String FABRIC_CONTROLLER_ADDRESS = "10.0.3.136";
87 private static final int FABRIC_SERVER_PORT = 8181;
88 private static final String FABRIC_BASE_URI = "/onos/cordfabric/vlans/add";
89
90 private static final ConnectPoint FABRIC_PORT = new ConnectPoint(
91 DeviceId.deviceId("of:000090e2ba82f974"),
92 PortNumber.portNumber(2));
93
Ray Milkey140e4782015-04-24 11:25:13 -070094 private final Logger log = getLogger(getClass());
95 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
96 protected CoreService coreService;
97 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
98 protected ComponentConfigService cfgService;
Ray Milkeydea98172015-05-18 10:39:39 -070099
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700100 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
101 protected FlowObjectiveService flowObjectiveService;
102
Ray Milkeydea98172015-05-18 10:39:39 -0700103 @Property(name = XOS_SERVER_ADDRESS_PROPERTY_NAME,
Ray Milkey140e4782015-04-24 11:25:13 -0700104 value = TEST_XOS_SERVER_ADDRESS,
105 label = "XOS Server address")
106 protected String xosServerAddress = TEST_XOS_SERVER_ADDRESS;
Ray Milkeydea98172015-05-18 10:39:39 -0700107
108 @Property(name = XOS_SERVER_PORT_PROPERTY_NAME,
Ray Milkey140e4782015-04-24 11:25:13 -0700109 intValue = TEST_XOS_SERVER_PORT,
110 label = "XOS Server port")
111 protected int xosServerPort = TEST_XOS_SERVER_PORT;
Ray Milkeydea98172015-05-18 10:39:39 -0700112
113 @Property(name = XOS_PROVIDER_SERVICE_PROPERTY_NAME,
114 intValue = TEST_XOS_PROVIDER_SERVICE,
115 label = "XOS Provider Service")
116 protected int xosProviderService = TEST_XOS_PROVIDER_SERVICE;
117
Ray Milkey140e4782015-04-24 11:25:13 -0700118 private ApplicationId appId;
alshabib60562282015-06-01 16:45:04 -0700119 private Map<String, ConnectPoint> nodeToPort;
alshabib17cde6d2015-06-05 15:03:51 -0700120 private Map<Long, Short> portToVlan;
Jonathan Hart08ad8232015-06-09 10:51:05 -0700121 private Map<ConnectPoint, String> portToSsid;
Ray Milkey140e4782015-04-24 11:25:13 -0700122
123 @Activate
124 public void activate(ComponentContext context) {
125 log.info("XOS app is starting");
126 cfgService.registerProperties(getClass());
127 appId = coreService.registerApplication("org.onosproject.xosintegration");
alshabib60562282015-06-01 16:45:04 -0700128
129 setupMap();
130
Ray Milkey140e4782015-04-24 11:25:13 -0700131 readComponentConfiguration(context);
132
133 log.info("XOS({}) started", appId.id());
134 }
135
136 @Deactivate
137 public void deactivate() {
138 cfgService.unregisterProperties(getClass(), false);
139 log.info("XOS({}) stopped", appId.id());
140 }
141
142 @Modified
143 public void modified(ComponentContext context) {
144 readComponentConfiguration(context);
145 }
146
alshabib60562282015-06-01 16:45:04 -0700147 private void setupMap() {
148 nodeToPort = Maps.newHashMap();
149
150 nodeToPort.put("cordcompute01.onlab.us", new ConnectPoint(FABRIC_DEVICE_ID,
151 PortNumber.portNumber(4)));
152
153 nodeToPort.put("cordcompute02.onlab.us", new ConnectPoint(FABRIC_DEVICE_ID,
154 PortNumber.portNumber(3)));
alshabib17cde6d2015-06-05 15:03:51 -0700155
Jonathan Hartc02437c2015-06-09 10:05:13 -0700156 portToVlan = Maps.newHashMap();
alshabib17cde6d2015-06-05 15:03:51 -0700157 portToVlan.putIfAbsent(2L, (short) 201);
158 portToVlan.putIfAbsent(6L, (short) 401);
Jonathan Hart08ad8232015-06-09 10:51:05 -0700159
160 portToSsid = Maps.newHashMap();
161 portToSsid.put(new ConnectPoint(FABRIC_DEVICE_ID, PortNumber.portNumber(2)), "0");
162 portToSsid.put(new ConnectPoint(FABRIC_DEVICE_ID, PortNumber.portNumber(6)), "1");
alshabib60562282015-06-01 16:45:04 -0700163 }
164
Ray Milkey140e4782015-04-24 11:25:13 -0700165 /**
166 * Converts a JSON representation of a tenant into a tenant object.
167 *
168 * @param jsonTenant JSON object representing the tenant
169 * @return volt tenant object
170 */
171 private VoltTenant jsonToTenant(JsonObject jsonTenant) {
172 return VoltTenant.builder()
173 .withHumanReadableName(jsonTenant.get("humanReadableName").asString())
174 .withId(jsonTenant.get("id").asInt())
175 .withProviderService(jsonTenant.get("provider_service").asInt())
176 .withServiceSpecificId(jsonTenant.get("service_specific_id").asString())
177 .withVlanId(jsonTenant.get("vlan_id").asString())
178 .build();
179 }
180
181 /**
182 * Converts a tenant object into a JSON string.
183 *
184 * @param tenant volt tenant object to convert
185 * @return JSON string for the tenant
186 */
187 private String tenantToJson(VoltTenant tenant) {
188 return "{"
189 + "\"humanReadableName\": \"" + tenant.humanReadableName() + "\","
190 + "\"id\": \"" + tenant.id() + "\","
191 + "\"provider_service\": \"" + tenant.providerService() + "\","
192 + "\"service_specific_id\": \"" + tenant.serviceSpecificId() + "\","
193 + "\"vlan_id\": \"" + tenant.vlanId() + "\""
194 + "}";
195 }
196
197 /**
198 * Gets a client web resource builder for the base XOS REST API
199 * with no additional URI.
200 *
201 * @return web resource builder
202 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700203 @Deprecated
Ray Milkey140e4782015-04-24 11:25:13 -0700204 private WebResource.Builder getClientBuilder() {
205 return getClientBuilder("");
206 }
207
208 /**
209 * Gets a client web resource builder for the base XOS REST API
210 * with an optional additional URI.
211 *
212 * @return web resource builder
213 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700214 @Deprecated
Ray Milkey140e4782015-04-24 11:25:13 -0700215 private WebResource.Builder getClientBuilder(String uri) {
216 String baseUrl = "http://" + xosServerAddress + ":"
217 + Integer.toString(xosServerPort);
218 Client client = Client.create();
219 client.addFilter(new HTTPBasicAuthFilter("padmin@vicci.org", "letmein"));
220 WebResource resource = client.resource(baseUrl
221 + XOS_TENANT_BASE_URI + uri);
222 return resource.accept(JSON_UTF_8.toString())
223 .type(JSON_UTF_8.toString());
224 }
225
226 /**
227 * Performs a REST GET operation on the base XOS REST URI.
228 *
229 * @return JSON string fetched by the GET operation
230 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700231 @Deprecated
Ray Milkey140e4782015-04-24 11:25:13 -0700232 private String getRest() {
233 return getRest("");
234 }
235
236 /**
237 * Performs a REST GET operation on the base XOS REST URI with
238 * an optional additional URI.
239 *
240 * @return JSON string fetched by the GET operation
241 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700242 @Deprecated
Ray Milkey140e4782015-04-24 11:25:13 -0700243 private String getRest(String uri) {
244 WebResource.Builder builder = getClientBuilder(uri);
245 ClientResponse response = builder.get(ClientResponse.class);
246
247 if (response.getStatus() != HTTP_OK) {
248 log.info("REST GET request returned error code {}",
249 response.getStatus());
250 }
251 String jsonString = response.getEntity(String.class);
252 log.info("JSON read:\n{}", jsonString);
253
254 return jsonString;
255 }
256
257 /**
258 * Performs a REST POST operation of a json string on the base
259 * XOS REST URI with an optional additional URI.
260 *
261 * @param json JSON string to post
262 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700263 @Deprecated
alshabib60562282015-06-01 16:45:04 -0700264 private String postRest(String json) {
Ray Milkey140e4782015-04-24 11:25:13 -0700265 WebResource.Builder builder = getClientBuilder();
Jonathan Hartb4558032015-05-20 16:32:04 -0700266 ClientResponse response;
267
268 try {
269 response = builder.post(ClientResponse.class, json);
270 } catch (ClientHandlerException e) {
271 log.warn("Unable to contact REST server: {}", e.getMessage());
alshabib60562282015-06-01 16:45:04 -0700272 return "{ 'error' : 'oops no one home' }";
Jonathan Hartb4558032015-05-20 16:32:04 -0700273 }
Ray Milkey140e4782015-04-24 11:25:13 -0700274
275 if (response.getStatus() != HTTP_CREATED) {
276 log.info("REST POST request returned error code {}",
277 response.getStatus());
278 }
alshabib60562282015-06-01 16:45:04 -0700279 return response.getEntity(String.class);
Ray Milkey140e4782015-04-24 11:25:13 -0700280 }
281
282 /**
283 * Performs a REST DELETE operation on the base
284 * XOS REST URI with an optional additional URI.
285 *
286 * @param uri optional additional URI
287 */
Simon Hunt8483e9d2015-05-26 18:22:07 -0700288 @Deprecated
Ray Milkey140e4782015-04-24 11:25:13 -0700289 private void deleteRest(String uri) {
290 WebResource.Builder builder = getClientBuilder(uri);
291 ClientResponse response = builder.delete(ClientResponse.class);
292
293 if (response.getStatus() != HTTP_NO_CONTENT) {
294 log.info("REST DELETE request returned error code {}",
295 response.getStatus());
296 }
297 }
298
299 /**
300 * Deletes the tenant with the given ID.
301 *
302 * @param tenantId ID of tenant to delete
303 */
304 private void deleteTenant(long tenantId) {
305 deleteRest(Long.toString(tenantId));
306 }
307
308 @Override
309 public Set<VoltTenant> getAllTenants() {
310 String jsonString = getRest();
311
312 JsonArray voltTenantItems = JsonArray.readFrom(jsonString);
313
314 return IntStream.range(0, voltTenantItems.size())
315 .mapToObj(index -> jsonToTenant(voltTenantItems.get(index).asObject()))
316 .collect(Collectors.toSet());
317 }
318
319 @Override
320 public void removeTenant(long id) {
321 deleteTenant(id);
322 }
323
324 @Override
325 public VoltTenant addTenant(VoltTenant newTenant) {
Ray Milkeydea98172015-05-18 10:39:39 -0700326 long providerServiceId = newTenant.providerService();
327 if (providerServiceId == -1) {
328 providerServiceId = xosProviderService;
329 }
330 VoltTenant tenantToCreate = VoltTenant.builder()
331 .withProviderService(providerServiceId)
Jonathan Hart08ad8232015-06-09 10:51:05 -0700332 .withServiceSpecificId(portToSsid.get(newTenant.port()))
Ray Milkeydea98172015-05-18 10:39:39 -0700333 .withVlanId(newTenant.vlanId())
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700334 .withPort(newTenant.port())
Ray Milkeydea98172015-05-18 10:39:39 -0700335 .build();
336 String json = tenantToJson(tenantToCreate);
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700337
alshabib60562282015-06-01 16:45:04 -0700338 //provisionDataPlane(tenantToCreate);
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700339
alshabib60562282015-06-01 16:45:04 -0700340 String retJson = postRest(json);
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700341
alshabib60562282015-06-01 16:45:04 -0700342 fetchCPELocation(newTenant, retJson);
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700343
Ray Milkey140e4782015-04-24 11:25:13 -0700344 return newTenant;
345 }
346
alshabib60562282015-06-01 16:45:04 -0700347 private void fetchCPELocation(VoltTenant newTenant, String jsonString) {
348 JsonObject json = JsonObject.readFrom(jsonString);
349
350 if (json.get("computeNodeName") != null) {
Jonathan Hart10b98ad2015-06-02 09:53:12 -0700351 ConnectPoint point = nodeToPort.get(json.get("computeNodeName").asString());
alshabib48dd9a12015-06-05 14:45:57 -0700352 ConnectPoint fromPoint = newTenant.port();
alshabib60562282015-06-01 16:45:04 -0700353
354 provisionFabric(VlanId.vlanId(Short.parseShort(newTenant.vlanId())),
alshabib48dd9a12015-06-05 14:45:57 -0700355 point, fromPoint);
alshabib60562282015-06-01 16:45:04 -0700356 }
357
358 }
359
Ray Milkey140e4782015-04-24 11:25:13 -0700360 @Override
361 public VoltTenant getTenant(long id) {
362 String jsonString = getRest(Long.toString(id));
363 JsonObject jsonTenant = JsonObject.readFrom(jsonString);
364 if (jsonTenant.get("id") != null) {
365 return jsonToTenant(jsonTenant);
366 } else {
367 return null;
368 }
369 }
370
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700371 private void provisionDataPlane(VoltTenant tenant) {
372 VlanId vlan = VlanId.vlanId(Short.parseShort(tenant.vlanId()));
373
374 TrafficSelector fromGateway = DefaultTrafficSelector.builder()
375 .matchInPhyPort(tenant.port().port())
376 .build();
377
378 TrafficSelector fromFabric = DefaultTrafficSelector.builder()
379 .matchInPhyPort(FABRIC_PORT.port())
380 .matchVlanId(vlan)
381 .build();
382
383 TrafficTreatment toFabric = DefaultTrafficTreatment.builder()
384 .pushVlan()
385 .setVlanId(vlan)
386 .setOutput(FABRIC_PORT.port())
387 .build();
388
389 TrafficTreatment toGateway = DefaultTrafficTreatment.builder()
390 .popVlan()
391 .setOutput(tenant.port().port())
392 .build();
393
394 ForwardingObjective forwardToFabric = DefaultForwardingObjective.builder()
395 .withFlag(ForwardingObjective.Flag.VERSATILE)
Jonathan Hartb4558032015-05-20 16:32:04 -0700396 .withPriority(PRIORITY)
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700397 .makePermanent()
398 .fromApp(appId)
399 .withSelector(fromGateway)
400 .withTreatment(toFabric)
401 .add();
402
403 ForwardingObjective forwardToGateway = DefaultForwardingObjective.builder()
404 .withFlag(ForwardingObjective.Flag.VERSATILE)
Jonathan Hartb4558032015-05-20 16:32:04 -0700405 .withPriority(PRIORITY)
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700406 .makePermanent()
407 .fromApp(appId)
408 .withSelector(fromFabric)
409 .withTreatment(toGateway)
410 .add();
411
412 flowObjectiveService.forward(FABRIC_PORT.deviceId(), forwardToFabric);
413 flowObjectiveService.forward(FABRIC_PORT.deviceId(), forwardToGateway);
414 }
415
alshabib48dd9a12015-06-05 14:45:57 -0700416 private void provisionFabric(VlanId vlanId, ConnectPoint point, ConnectPoint fromPoint) {
alshabib60562282015-06-01 16:45:04 -0700417 //String json = "{\"vlan\":" + vlanId + ",\"ports\":[";
418 //json += "{\"device\":\"" + FABRIC_DEVICE_ID.toString() + "\",\"port\":\""
419 // + FABRIC_OLT_CONNECT_POINT.toString() + "\"},";
420 //json += "{\"device\":\"" + FABRIC_DEVICE_ID.toString() + "\",\"port\":\""
421 // + FABRIC_VCPE_CONNECT_POINT.toString() + "\"}";
422 //json += "]}";
423
alshabibc4b5d462015-06-08 23:06:24 -0700424 long vlan = portToVlan.get(fromPoint.port().toLong());
425
426
alshabib60562282015-06-01 16:45:04 -0700427 JsonObject node = new JsonObject();
alshabibc4b5d462015-06-08 23:06:24 -0700428 node.add("vlan", vlan);
429 if (vlan == 201) {
430 node.add("iptv", true);
431 } else {
432 node.add("iptv", false);
433 }
alshabib60562282015-06-01 16:45:04 -0700434 JsonArray array = new JsonArray();
435 JsonObject cp1 = new JsonObject();
436 JsonObject cp2 = new JsonObject();
437 cp1.add("device", point.deviceId().toString());
438 cp1.add("port", point.port().toLong());
alshabib48dd9a12015-06-05 14:45:57 -0700439 cp2.add("device", fromPoint.deviceId().toString());
440 cp2.add("port", fromPoint.port().toLong());
alshabib60562282015-06-01 16:45:04 -0700441 array.add(cp1);
442 array.add(cp2);
443 node.add("ports", array);
444
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700445
446 String baseUrl = "http://" + FABRIC_CONTROLLER_ADDRESS + ":"
447 + Integer.toString(FABRIC_SERVER_PORT);
448 Client client = Client.create();
Jonathan Hartb4558032015-05-20 16:32:04 -0700449 WebResource resource = client.resource(baseUrl + FABRIC_BASE_URI);
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700450 WebResource.Builder builder = resource.accept(JSON_UTF_8.toString())
451 .type(JSON_UTF_8.toString());
452
Jonathan Hartb4558032015-05-20 16:32:04 -0700453 try {
Jonathan Hart8e36be52015-06-05 10:54:29 -0700454 builder.post(ClientResponse.class, node.toString());
Jonathan Hartb4558032015-05-20 16:32:04 -0700455 } catch (ClientHandlerException e) {
Jonathan Hart8e36be52015-06-05 10:54:29 -0700456 log.warn("Unable to contact fabric REST server: {}", e.getMessage());
Jonathan Hartb4558032015-05-20 16:32:04 -0700457 return;
458 }
Jonathan Hart5e9a63d2015-05-19 16:21:46 -0700459 }
460
Ray Milkey140e4782015-04-24 11:25:13 -0700461 /**
462 * Extracts properties from the component configuration context.
463 *
464 * @param context the component context
465 */
466 private void readComponentConfiguration(ComponentContext context) {
467 Dictionary<?, ?> properties = context.getProperties();
468
Ray Milkeydea98172015-05-18 10:39:39 -0700469 String newXosServerAddress =
470 Tools.get(properties, XOS_SERVER_ADDRESS_PROPERTY_NAME);
Ray Milkey140e4782015-04-24 11:25:13 -0700471 if (!isNullOrEmpty(newXosServerAddress)) {
472 xosServerAddress = newXosServerAddress;
473 }
474
Ray Milkeydea98172015-05-18 10:39:39 -0700475 String newXosServerPortString =
476 Tools.get(properties, XOS_SERVER_PORT_PROPERTY_NAME);
Ray Milkey140e4782015-04-24 11:25:13 -0700477 if (!isNullOrEmpty(newXosServerPortString)) {
478 xosServerPort = Integer.parseInt(newXosServerPortString);
479 }
Ray Milkeydea98172015-05-18 10:39:39 -0700480
481 String newXosProviderServiceString =
482 Tools.get(properties, XOS_PROVIDER_SERVICE_PROPERTY_NAME);
483 if (!isNullOrEmpty(newXosProviderServiceString)) {
484 xosProviderService = Integer.parseInt(newXosProviderServiceString);
485 }
Ray Milkey140e4782015-04-24 11:25:13 -0700486 }
487}
488
489