mirror of
				https://github.com/Telecominfraproject/wlan-cloud-opensync-controller.git
				synced 2025-10-31 18:47:57 +00:00 
			
		
		
		
	Second Drop of Opensync GW for Cloud, Handling OVSDB and some MQTT messages
This commit is contained in:
		| @@ -20,243 +20,110 @@ | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<artifactId>opensync-ext-interface</artifactId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<artifactId>base-container</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
| 		<dependency> | ||||
| 			<artifactId>base-client</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
| 		<!-- portal services --> | ||||
| 		<dependency> | ||||
| 			<artifactId>webtoken-auth-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<artifactId>opensync-gateway</artifactId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
| 		  <dependency> | ||||
|         <artifactId>base-container</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>portal-services</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>webtoken-auth-service</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency> | ||||
|      | ||||
|       <dependency> | ||||
|         <artifactId>portal-services</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency> | ||||
|        | ||||
|       <dependency> | ||||
|         <artifactId>customer-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>customer-service-local</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>location-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>location-service-local</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>equipment-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>equipment-service-local</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>profile-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|        | ||||
|       <dependency> | ||||
|         <artifactId>portal-user-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>profile-service-local</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>service-metric-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|        | ||||
|       <dependency> | ||||
|         <artifactId>system-event-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|        | ||||
|       <dependency> | ||||
|         <artifactId>alarm-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<!-- prov services --> | ||||
| 		<dependency> | ||||
| 			<artifactId>customer-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>status-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>customer-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>client-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>location-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>routing-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|   | ||||
|        <dependency> | ||||
|         <artifactId>firmware-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>location-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>equipment-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>equipment-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>profile-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>profile-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>portal-user-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>portal-user-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>firmware-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>firmware-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>manufacturer-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>manufacturer-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>cloud-event-dispatcher-interface</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>cloud-metrics</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>single-process-streams</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>service-metric-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>service-metric-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>system-event-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>system-event-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>alarm-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>alarm-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>status-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>status-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>client-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>client-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<artifactId>routing-service</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|  | ||||
| 		<dependency> | ||||
| 			<!-- Use in-memory DS for now, later switch to RDBMS --> | ||||
| 			<artifactId>routing-datastore-inmemory</artifactId> | ||||
| 			<groupId>com.telecominfraproject.wlan</groupId> | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
|       <dependency> | ||||
|         <artifactId>manufacturer-service-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>       | ||||
|   | ||||
|       <dependency> | ||||
|         <artifactId>cloud-event-dispatcher-remote</artifactId> | ||||
|         <groupId>com.telecominfraproject.wlan</groupId> | ||||
|         <version>${tip-wlan-cloud.release.version}</version> | ||||
|       </dependency>      | ||||
|  | ||||
| 	</dependencies> | ||||
| </project> | ||||
|   | ||||
| @@ -1,10 +1,12 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration; | ||||
|  | ||||
| import java.io.IOException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.Collections; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.concurrent.Callable; | ||||
|  | ||||
| import javax.annotation.PostConstruct; | ||||
|  | ||||
| @@ -18,27 +20,22 @@ import org.springframework.context.annotation.Profile; | ||||
| import org.springframework.stereotype.Component; | ||||
|  | ||||
| import com.telecominfraproject.wlan.cloudeventdispatcher.CloudEventDispatcherInterface; | ||||
| import com.telecominfraproject.wlan.core.model.equipment.EquipmentType; | ||||
| import com.telecominfraproject.wlan.core.model.equipment.MacAddress; | ||||
| import com.telecominfraproject.wlan.core.model.equipment.RadioType; | ||||
| import com.telecominfraproject.wlan.customer.models.Customer; | ||||
| import com.telecominfraproject.wlan.customer.service.CustomerServiceInterface; | ||||
| import com.telecominfraproject.wlan.equipment.EquipmentServiceInterface; | ||||
| import com.telecominfraproject.wlan.equipment.models.Equipment; | ||||
| import com.telecominfraproject.wlan.equipment.models.EquipmentDetails; | ||||
| import com.telecominfraproject.wlan.location.service.LocationServiceInterface; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.OpensyncCloudGatewayController; | ||||
| import com.telecominfraproject.wlan.opensync.experiment.OpenSyncConnectusController; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.ConnectNodeInfo; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPConfig; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPInetState; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioConfig; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPRadioState; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPSsidConfig; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAPVIFState; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncAWLANNode; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.models.OpensyncWifiAssociatedClients; | ||||
| import com.telecominfraproject.wlan.profile.ProfileServiceInterface; | ||||
| import com.telecominfraproject.wlan.profile.models.ProfileDetails; | ||||
| import com.telecominfraproject.wlan.servicemetrics.models.ApClientMetrics; | ||||
| import com.telecominfraproject.wlan.servicemetrics.models.ClientMetrics; | ||||
| import com.telecominfraproject.wlan.servicemetrics.models.SingleMetricRecord; | ||||
| @@ -66,45 +63,44 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 	private CloudEventDispatcherInterface equipmentMetricsCollectorInterface; | ||||
| 	@Autowired | ||||
| 	private EquipmentServiceInterface equipmentServiceInterface; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private ProfileServiceInterface profileServiceInterface; | ||||
|  | ||||
| 	@Autowired | ||||
| 	private CacheManager cacheManagerShortLived; | ||||
| 	private OpenSyncConnectusController gatewayController; | ||||
|  | ||||
| 	@Value("${connectus.ovsdb.autoProvisionedCustomerId:2}") | ||||
| 	private int autoProvisionedCustomerId; | ||||
| 	@Value("${connectus.ovsdb.autoProvisionedEquipmentId:0}") | ||||
| 	@Value("${connectus.ovsdb.autoProvisionedEquipmentId:2}") | ||||
| 	private int autoProvisionedEquipmentId; | ||||
| 	@Value("${connectus.ovsdb.autoProvisionedLocationId:5}") | ||||
| 	private int autoProvisionedLocationId; | ||||
| 	@Value("${connectus.ovsdb.autoProvisioned24G:1}") | ||||
| 	private int autoProvisioned24G; | ||||
| 	@Value("${connectus.ovsdb.autoProvisioned5LG:44}") | ||||
| 	private int autoProvisioned5LG; | ||||
| 	@Value("${connectus.ovsdb.autoProvisioned5UG:108}") | ||||
| 	private int autoProvisioned5UG; | ||||
| 	@Value("${connectus.ovsdb.autoProvisionedSsid:Connectus-cloud") | ||||
| 	private String autoProvisionedSsid; | ||||
|  | ||||
| 	private Map<String, OpensyncNode> opensyncNodeMap; | ||||
| 	@Autowired | ||||
| 	private OpensyncCloudGatewayController opensyncCloudGatewayController; | ||||
| 	private CacheManager cacheManagerShortLived; | ||||
| 	private Cache cloudEquipmentRecordCache; | ||||
| 	private Map<String, OpensyncNode> opensyncNodeMap; | ||||
|  | ||||
| 	private Cache equipmentRecordCache; | ||||
| 	@Value("${connectus.ovsdb.configFileName:/Users/mikehansen/git/wlan-cloud-workspace/wlan-cloud-opensync-controller/opensync-ext-cloud/src/main/resources/config_2_ssids.json}") | ||||
| 	private String configFileName; | ||||
|  | ||||
| 	@PostConstruct | ||||
| 	private void postCreate() { | ||||
| 		LOG.info("Using cloud integration"); | ||||
| 		equipmentRecordCache = cacheManagerShortLived.getCache("opensync_equipment_record_cache"); | ||||
| 		LOG.info("Using Cloud integration"); | ||||
| 		cloudEquipmentRecordCache = cacheManagerShortLived.getCache("KDC_equipment_record_cache"); | ||||
| 		opensyncNodeMap = Collections.synchronizedMap(new HashMap<String, OpensyncNode>()); | ||||
| 	} | ||||
|  | ||||
| 	public Equipment getEquipment(Long equipmentId) { | ||||
| 	public Equipment getCustomerEquipment(String apId) { | ||||
| 		Equipment ce = null; | ||||
|  | ||||
| 		try { | ||||
| 			ce = equipmentServiceInterface.getOrNull(equipmentId); | ||||
| 			ce = cloudEquipmentRecordCache.get(apId, new Callable<Equipment>() { | ||||
| 				@Override | ||||
| 				public Equipment call() throws Exception { | ||||
| 					// TODO: need to be able to get Equipment by AP Id | ||||
| 					return equipmentServiceInterface.getOrNull(autoProvisionedEquipmentId); | ||||
| 				} | ||||
| 			}); | ||||
| 		} catch (Exception e) { | ||||
| 			// do nothing | ||||
| 		} | ||||
| @@ -114,16 +110,30 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
|  | ||||
| 	public void apConnected(String apId, ConnectNodeInfo connectNodeInfo) { | ||||
| 		LOG.info("AP {} got connected to the gateway", apId); | ||||
| 		Customer customer = null; | ||||
| 		try { | ||||
| 			customer = customerServiceInterface.get(autoProvisionedCustomerId); | ||||
| 			LOG.debug("Got Customer {} for apId {}", customer.toPrettyString()); | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Caught exception getting customer for Id {} for apId {}", autoProvisionedCustomerId, apId, e); | ||||
| 		} | ||||
|  | ||||
| 		Customer customer = customerServiceInterface.get(autoProvisionedCustomerId); | ||||
| 		Equipment ce = null; | ||||
| 		try { | ||||
| 			ce = getCustomerEquipment(apId); | ||||
| 			LOG.debug("Got Equipment {} for apId {}", ce.toPrettyString()); | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Caught exception getting equipment for Id {} for apId {}", autoProvisionedEquipmentId, apId, e); | ||||
|  | ||||
| 		Equipment customerEquipment = equipmentServiceInterface.get(autoProvisionedEquipmentId); | ||||
| 		} | ||||
|  | ||||
| 		LOG.debug("Customer {} Equipment {}", customer.toPrettyString(), customerEquipment.toPrettyString()); | ||||
|  | ||||
| 		OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); | ||||
| 		ovsdbSession.setEquipmentId(customerEquipment.getId()); | ||||
| 		ovsdbSession.setCustomerId(customerEquipment.getCustomerId()); | ||||
| 		try { | ||||
| 			OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); | ||||
| 			ovsdbSession.setEquipmentId(2); | ||||
| 			ovsdbSession.setCustomerId(2); | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Caught exception getting ovsdbSession for apId {}", apId, e); | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
|  | ||||
| @@ -150,60 +160,23 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 	} | ||||
|  | ||||
| 	public OpensyncAPConfig getApConfig(String apId) { | ||||
| 		LOG.info("Retrieving config for AP {} ", apId); | ||||
|  | ||||
| 		// TODO: connect to Cloud for config | ||||
| 		// for now, take values for initial config from file | ||||
|  | ||||
| 		LOG.info("Retrieving config for AP {} from file {}", apId, configFileName); | ||||
| 		OpensyncAPConfig ret = null; | ||||
|  | ||||
| 		try { | ||||
| 			OvsdbSession ovsdbSession = ovsdbSessionMapInterface.getSession(apId); | ||||
| 			if (ovsdbSession == null) { | ||||
| 				throw new IllegalStateException("AP is not connected " + apId); | ||||
| 			} | ||||
| 			long equipmentId = ovsdbSession.getEquipmentId(); | ||||
|  | ||||
| 			RadioType rt; | ||||
|  | ||||
| 			ret = new OpensyncAPConfig(); | ||||
|  | ||||
| 			// extract country, radio channels from resolvedEqCfg | ||||
| 			String country = "CA"; | ||||
|  | ||||
| 			int radioChannel24G = autoProvisioned24G; | ||||
| 			int radioChannel5LG = autoProvisioned5LG; | ||||
| 			int radioChannel5UG = autoProvisioned5UG; | ||||
|  | ||||
| 			OpensyncAPRadioConfig radioConfig = new OpensyncAPRadioConfig(); | ||||
| 			radioConfig.setCountry(country); | ||||
| 			radioConfig.setRadioChannel24G(radioChannel24G); | ||||
| 			radioConfig.setRadioChannel5LG(radioChannel5LG); | ||||
| 			radioConfig.setRadioChannel5HG(108); | ||||
|  | ||||
| 			ret.setRadioConfig(radioConfig); | ||||
|  | ||||
| 			List<OpensyncAPSsidConfig> ssidConfigs = new ArrayList<>(); | ||||
| 			ret.setSsidConfigs(ssidConfigs); | ||||
|  | ||||
| 			OpensyncAPSsidConfig osSsidCfg = new OpensyncAPSsidConfig(); | ||||
| 			osSsidCfg.setSsid(autoProvisionedSsid); | ||||
| 			osSsidCfg.setRadioType(com.telecominfraproject.wlan.core.model.equipment.RadioType.is5GHz); | ||||
| 			osSsidCfg.setBroadcast(true); | ||||
|  | ||||
| 			osSsidCfg.setEncryption("WPA-PSK"); | ||||
| 			osSsidCfg.setMode("2"); | ||||
|  | ||||
| 			ssidConfigs.add(osSsidCfg); | ||||
|  | ||||
| 			// configure the same ssid on the second radio | ||||
| 			osSsidCfg = osSsidCfg.clone(); | ||||
| 			osSsidCfg.setRadioType(com.telecominfraproject.wlan.core.model.equipment.RadioType.is2dot4GHz); | ||||
| 			ssidConfigs.add(osSsidCfg); | ||||
|  | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Cannot read config for AP {}", apId, e); | ||||
| 			ret = OpensyncAPConfig.fromFile(configFileName, OpensyncAPConfig.class); | ||||
| 		} catch (IOException e) { | ||||
| 			LOG.error("Cannot read config from {}", configFileName, e); | ||||
| 		} | ||||
|  | ||||
| 		LOG.debug("Config content : {}", ret); | ||||
|  | ||||
| 		return ret; | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| @@ -268,9 +241,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 	public void processMqttMessage(String topic, Report report) { | ||||
| 		LOG.info("Received report on topic {} for ap {}", topic, report.getNodeID()); | ||||
| 		int customerId = extractCustomerIdFromTopic(topic); | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} | ||||
|  | ||||
| 		long equipmentId = extractEquipmentIdFromTopic(topic); | ||||
| 		if (equipmentId <= 0 || customerId <= 0) { | ||||
| @@ -396,9 +366,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
|  | ||||
| 		LOG.info("Received report on topic {}", topic); | ||||
| 		int customerId = extractCustomerIdFromTopic(topic); | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} | ||||
|  | ||||
| 		long equipmentId = extractEquipmentIdFromTopic(topic); | ||||
| 		if (equipmentId <= 0 || customerId <= 0) { | ||||
| @@ -422,9 +389,6 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
|  | ||||
| 		LOG.info("Received report on topic {}", topic); | ||||
| 		int customerId = extractCustomerIdFromTopic(topic); | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} | ||||
|  | ||||
| 		long equipmentId = extractEquipmentIdFromTopic(topic); | ||||
| 		if (equipmentId <= 0 || customerId <= 0) { | ||||
| @@ -502,14 +466,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| @@ -546,14 +503,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| @@ -591,14 +541,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| @@ -633,14 +576,7 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| @@ -668,17 +604,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 	@Override | ||||
| 	public void wifiVIFStateDbTableDelete(List<OpensyncAPVIFState> vifStateTables, String apId) { | ||||
| 		OvsdbSession session = ovsdbSessionMapInterface.getSession(apId); | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| @@ -709,17 +637,9 @@ public class OpensyncExternalIntegrationCloud implements OpensyncExternalIntegra | ||||
| 	public void wifiAssociatedClientsDbTableDelete(String deletedClientMac, String apId) { | ||||
|  | ||||
| 		OvsdbSession session = ovsdbSessionMapInterface.getSession(apId); | ||||
| 		int customerId = session.getCustomerId(); | ||||
| 		long equipmentId = session.getEquipmentId(); | ||||
|  | ||||
| 		if (customerId > 0) { | ||||
| 			opensyncCloudGatewayController.updateActiveCustomer(customerId); | ||||
| 		} else { | ||||
| 			LOG.debug("Cannot get customerId {} for session {}", customerId); | ||||
| 			return; | ||||
| 		} | ||||
|  | ||||
| 		if (equipmentId < 1) { | ||||
| 		if (equipmentId < 0L) { | ||||
| 			LOG.debug("Cannot get equipmentId {} for session {}", equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
|   | ||||
| @@ -18,13 +18,13 @@ import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  */ | ||||
| @Configuration | ||||
| @ConditionalOnClass(RestTemplate.class) | ||||
| public class OpensyncCloudRestTemplatePostConfiguration { | ||||
| public class OpensyncCloudTemplatePostConfiguration { | ||||
| 
 | ||||
|     private static final Logger LOG = LoggerFactory | ||||
|             .getLogger(OpensyncCloudRestTemplatePostConfiguration.class); | ||||
|             .getLogger(OpensyncCloudTemplatePostConfiguration.class); | ||||
|      | ||||
|      | ||||
|     public OpensyncCloudRestTemplatePostConfiguration(@Autowired(required=false) AsyncRestTemplate asyncRestTemplate, @Autowired RestTemplate restTemplate) { | ||||
|     public OpensyncCloudTemplatePostConfiguration(@Autowired(required=false) AsyncRestTemplate asyncRestTemplate, @Autowired RestTemplate restTemplate) { | ||||
|         registerModulesWithObjectMappers(restTemplate); | ||||
|         if(asyncRestTemplate!=null) { | ||||
|             registerModulesWithObjectMappers(asyncRestTemplate); | ||||
| @@ -45,7 +45,7 @@ public class OpensyncCloudWebGenericConverter implements GenericConverter { | ||||
|     public OpensyncCloudWebGenericConverter() { | ||||
|     	LOG.info("Registering Object Converter for the KDC models"); | ||||
|         convertiblePairs = new HashSet<>(); | ||||
|         convertiblePairs.add(new ConvertiblePair(String.class, com.telecominfraproject.wlan.core.model.json.BaseJsonModel.class)); | ||||
|         convertiblePairs.add(new ConvertiblePair(String.class, BaseJsonModel.class)); | ||||
|         convertiblePairs.add(new ConvertiblePair(String.class, List.class)); | ||||
|         convertiblePairs.add(new ConvertiblePair(String.class, Set.class)); | ||||
|     } | ||||
|   | ||||
| @@ -1,5 +1,8 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| import java.util.concurrent.ConcurrentHashMap; | ||||
| import java.util.concurrent.ConcurrentMap; | ||||
| import java.util.concurrent.locks.Lock; | ||||
| @@ -7,16 +10,44 @@ import java.util.concurrent.locks.ReadWriteLock; | ||||
| import java.util.concurrent.locks.ReentrantReadWriteLock; | ||||
| import java.util.function.BiFunction; | ||||
|  | ||||
| import javax.servlet.http.HttpServletRequest; | ||||
|  | ||||
| import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.scheduling.annotation.EnableScheduling; | ||||
| import org.springframework.scheduling.annotation.Scheduled; | ||||
| import org.springframework.security.core.userdetails.User; | ||||
| import org.springframework.security.web.bind.annotation.AuthenticationPrincipal; | ||||
| import org.springframework.web.bind.annotation.RequestBody; | ||||
| import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RequestMethod; | ||||
| import org.springframework.web.bind.annotation.RequestParam; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.service.ServiceInstanceInformation; | ||||
| import com.telecominfraproject.wlan.core.server.container.ConnectorProperties; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.ConnectusOvsdbClientInterface; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSession; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSessionMapInterface; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWBaseCommand; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWBlinkRequest; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWCloseSessionRequest; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWCommandResultCode; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWConfigChangeNotification; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWRouteCheck; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CEGWStartDebugEngine; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CustomerEquipmentCommand; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CustomerEquipmentCommandResponse; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.CustomerEquipmentGwRecord; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.EquipmentRoutingRecord; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.GatewayDefaults; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.RoutingRegisterResponse; | ||||
| import com.telecominfraproject.wlan.opensync.external.integration.controller.command.ServiceDeploymentInfo; | ||||
| import com.telecominfraproject.wlan.routing.RoutingServiceInterface; | ||||
| import com.telecominfraproject.wlan.routing.models.Routing; | ||||
| import com.telecominfraproject.wlan.routing.models.RoutingDetails; | ||||
| import com.telecominfraproject.wlan.server.exceptions.ConfigurationException; | ||||
|  | ||||
| /** | ||||
|  * Opensync Gateway Controller - integration code for cloud deployment | ||||
| @@ -29,6 +60,9 @@ import com.telecominfraproject.wlan.opensync.external.integration.OvsdbSessionMa | ||||
| @EnableScheduling | ||||
| public class OpensyncCloudGatewayController { | ||||
|  | ||||
| 	@Autowired | ||||
| 	RoutingServiceInterface eqRoutingSvc; | ||||
|  | ||||
| 	@Autowired | ||||
| 	ConnectorProperties connectorProperties; | ||||
|  | ||||
| @@ -72,51 +106,321 @@ public class OpensyncCloudGatewayController { | ||||
| 			return oldValue; | ||||
| 		} | ||||
| 	}; | ||||
| 	 | ||||
|     /** | ||||
|      * Use connection internal hostname as the gateway name | ||||
|      *  | ||||
|      * @return | ||||
|      */ | ||||
|     private String getGatewayName() { | ||||
|         return connectorProperties.getInternalHostName(); | ||||
|     } | ||||
|  | ||||
| 	private static final Logger LOG = LoggerFactory.getLogger(OpensyncCloudGatewayController.class); | ||||
|  | ||||
| 	public void registerWithRoutingService() { | ||||
|         synchronized (this) { | ||||
|             if (registeredWithRoutingService) { | ||||
|                 return; | ||||
|             } | ||||
| 	@RequestMapping(value = "/connectedClients", method = RequestMethod.GET) | ||||
| 	public List<String> getConnectedClients() { | ||||
| 		List<String> ret = new ArrayList<String>(connectusOvsdbClient.getConnectedClientIds()); | ||||
| 		LOG.info("Returning connected clients {}", ret); | ||||
| 		return ret; | ||||
| 	} | ||||
|  | ||||
| //            CustomerEquipmentGwRecord gwRecord = new CustomerEquipmentGwRecord(); | ||||
| //            gwRecord.setDeploymentId(getDeploymentId()); | ||||
| // | ||||
| //            // Internal facing service | ||||
| //            gwRecord.setGatewayId(getGatewayName()); | ||||
| // | ||||
| //            gwRecord.setIpAddr(connectorProperties.getInternalIpAddress().getHostAddress()); | ||||
| //            gwRecord.setPort(connectorProperties.getInternalPort()); | ||||
|             try { | ||||
| //                CustomerEquipmentGwRecord result = this.eqRoutingSvc.registerGateway(gwRecord); | ||||
| //                this.registeredGwId = result.getId(); | ||||
| //                LOG.info("Successfully registered (name={}, id={}) with Routing Service", result.getGatewayId(), | ||||
| //                        registeredGwId); | ||||
|                 registeredWithRoutingService = true; | ||||
|             } catch (RuntimeException e) { | ||||
|                 // failed | ||||
|                 LOG.error("Failed to register Customer Equipment Gateway (name={}) with Routing Service : {}", | ||||
|                         getGatewayName(), e.getLocalizedMessage()); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 	@RequestMapping(value = "/changeRedirectorAddress", method = RequestMethod.POST) | ||||
| 	public String changeRedirectorAddress(@RequestParam String apId, @RequestParam String newRedirectorAddress) { | ||||
| 		LOG.info("Changing redirector address for AP {} to {}", apId, newRedirectorAddress); | ||||
| 		String ret = connectusOvsdbClient.changeRedirectorAddress(apId, newRedirectorAddress); | ||||
| 		LOG.info("Changed redirector address for AP {} to {}", apId, ret); | ||||
| 		return ret; | ||||
| 	} | ||||
|  | ||||
| 	public void deregisterFromRoutingService() { | ||||
| 		// TODO Auto-generated method stub | ||||
| 	@RequestMapping(value = "/command", method = RequestMethod.POST) | ||||
| 	public CustomerEquipmentCommandResponse sendCommand(@RequestBody CEGWBaseCommand command) { | ||||
| 		LOG.debug("sendCommand({})", command); | ||||
| 		String qrCode = command.getEquipmentQRCode(); | ||||
| 		if (com.telecominfraproject.wlan.core.model.json.BaseJsonModel.hasUnsupportedValue(command)) { | ||||
| 			LOG.error("[{}] Failed to deliver command {}, command contains unsupported value", qrCode, command); | ||||
| 			return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.UnsupportedCommand.ordinal(), | ||||
| 					"Unsupported value in command for " + qrCode); | ||||
| 		} | ||||
| 		OvsdbSession session = ovsdbSessionMapInterface.getSession(qrCode); | ||||
| 		if (session == null) { | ||||
| 			LOG.warn("[{}] Failed to deliver command {}, websocket session not found", qrCode, command); | ||||
| 			return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.NoRouteToCE.ordinal(), | ||||
| 					"No session found for " + qrCode); | ||||
| 		} | ||||
|  | ||||
| 		switch (command.getCommandType()) { | ||||
|  | ||||
| 		default: | ||||
| 			LOG.warn("[{}] Failed to deliver command {}, unsupported command type", qrCode, command); | ||||
| 			return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.UnsupportedCommand.ordinal(), | ||||
| 					"Invalid command type (" + command.getCommandType() + ") for equipment (" + qrCode + ")"); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	@RequestMapping(value = "/defaults", method = RequestMethod.GET) | ||||
| 	public GatewayDefaults retrieveGatewayDefaults() { | ||||
| 		return new GatewayDefaults(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Verify a route to customer equipment | ||||
| 	 *  | ||||
| 	 * @param session | ||||
| 	 * @param command | ||||
| 	 * @param protocolVersion | ||||
| 	 * @return NoRouteToCE if route Id does not match or Success | ||||
| 	 */ | ||||
| 	private CustomerEquipmentCommandResponse checkEquipmentRouting(OvsdbSession session, CEGWRouteCheck command) { | ||||
| 		if (null != command.getRoutingId()) { | ||||
| 			if (!command.getRoutingId().equals(session.getRoutingId())) { | ||||
|  | ||||
| 				LOG.info("[C:{} E:{} R:{}] Stale routing entry ({}) detected", session.getCustomerId(), | ||||
| 						command.getEquipmentQRCode(), session.getRoutingId(), command.getRoutingId()); | ||||
|  | ||||
| 				return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.NoRouteToCE.ordinal(), | ||||
| 						"Inactive Route Identifer"); | ||||
| 			} | ||||
| 		} | ||||
| 		return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.Success.ordinal(), "Route active"); | ||||
| 	} | ||||
|  | ||||
| 	private CustomerEquipmentCommandResponse sendConfigChangeNotification(OvsdbSession session, | ||||
| 			CEGWConfigChangeNotification command) { | ||||
|  | ||||
| 		return sendMessage(session, command.getEquipmentQRCode(), command); | ||||
| 	} | ||||
|  | ||||
| 	private CustomerEquipmentCommandResponse closeSession(OvsdbSession session, CEGWCloseSessionRequest command) { | ||||
| 		try { | ||||
| 			session.getOvsdbClient().shutdown(); | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("[{}] Failed to close session on CE: {}", command.getEquipmentQRCode(), e.getLocalizedMessage()); | ||||
| 			return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.FailedToSend.ordinal(), | ||||
| 					"Failed to send command " + command.getCommandType() + " to " + command.getEquipmentQRCode() + ": " | ||||
| 							+ e.getMessage()); | ||||
| 		} | ||||
| 		LOG.debug("[{}] Closed session to CE", command.getEquipmentQRCode()); | ||||
| 		return new CustomerEquipmentCommandResponse(CEGWCommandResultCode.Success.ordinal(), | ||||
| 				"Closed session to " + command.getEquipmentQRCode()); | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Deliver a message in payload to the CE | ||||
| 	 *  | ||||
| 	 * @param session | ||||
| 	 * @param qrCode | ||||
| 	 * @param command | ||||
| 	 * @param request | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	private CustomerEquipmentCommandResponse sendMessage(OvsdbSession session, String qrCode, | ||||
| 			CustomerEquipmentCommand command) { | ||||
|  | ||||
| 		LOG.debug("Received command {} for {}", command.getCommandType(), qrCode); | ||||
| 		CustomerEquipmentCommandResponse response = new CustomerEquipmentCommandResponse( | ||||
| 				CEGWCommandResultCode.Success.ordinal(), | ||||
| 				"Received Command " + command.getCommandType() + " for " + qrCode); | ||||
|  | ||||
| 		if (command instanceof CEGWConfigChangeNotification) { | ||||
| 			connectusOvsdbClient.processConfigChanged(qrCode); | ||||
| 		} else if (command instanceof CEGWStartDebugEngine) { | ||||
| 			// dtop: we will be using CEGWStartDebugEngine command to deliver request to | ||||
| 			// change redirector | ||||
| 			// TODO: after the demo introduce a specialized command for this! | ||||
| 			String newRedirectorAddress = ((CEGWStartDebugEngine) command).getGatewayHostname(); | ||||
| 			connectusOvsdbClient.changeRedirectorAddress(qrCode, newRedirectorAddress); | ||||
| 		} | ||||
|  | ||||
| 		return response; | ||||
| 	} | ||||
|  | ||||
| 	private CustomerEquipmentCommandResponse processChangeRedirector(OvsdbSession session, | ||||
| 			CEGWStartDebugEngine command) { | ||||
| 		return sendMessage(session, command.getEquipmentQRCode(), command); | ||||
| 	} | ||||
|  | ||||
| 	private CustomerEquipmentCommandResponse processBlinkRequest(OvsdbSession session, CEGWBlinkRequest command) { | ||||
|  | ||||
| 		return sendMessage(session, command.getEquipmentQRCode(), command); | ||||
| 	} | ||||
|  | ||||
| 	@RequestMapping(value = "/commandWithUser", method = RequestMethod.POST) | ||||
| 	public CustomerEquipmentCommandResponse sendCommandWithAuthUser(@RequestBody CustomerEquipmentCommand command, | ||||
| 			@AuthenticationPrincipal Object requestUser, HttpServletRequest httpServletRequest) { | ||||
|  | ||||
| 		// use these properties to get address and port where request has | ||||
| 		// arrived | ||||
| 		httpServletRequest.getLocalAddr(); | ||||
| 		httpServletRequest.getLocalPort(); | ||||
|  | ||||
| 		// requestUser will be instance of | ||||
| 		// org.springframework.security.core.userdetails.User for client auth | ||||
| 		// and digest auth, | ||||
| 		// although other auth providers may return something entirely different | ||||
| 		if (requestUser instanceof User) { | ||||
| 			LOG.debug("calling command with auth principal: {}", ((User) requestUser).getUsername()); | ||||
| 		} else { | ||||
| 			LOG.debug("calling command with auth principal: {}", requestUser); | ||||
| 		} | ||||
|  | ||||
| 		// This is a test method to show how to get access to the auth user | ||||
| 		// object for a given request | ||||
|  | ||||
| 		return sendCommand(command); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Register this controller with Equipment Routing Service | ||||
| 	 */ | ||||
| 	public void registerWithRoutingService() { | ||||
| 		synchronized (this) { | ||||
| 			if (registeredWithRoutingService) { | ||||
| 				return; | ||||
| 			} | ||||
|  | ||||
| 			if (eqRoutingSvc == null) { | ||||
| 				throw new ConfigurationException( | ||||
| 						"Unabled to register gateway with routing service: routing service interface not initialized"); | ||||
| 			} | ||||
| 			CustomerEquipmentGwRecord gwRecord = new CustomerEquipmentGwRecord(); | ||||
| 			gwRecord.setDeploymentId(getDeploymentId()); | ||||
|  | ||||
| 			// Internal facing service | ||||
| 			gwRecord.setGatewayId(getGatewayName()); | ||||
| 			gwRecord.setIpAddr(connectorProperties.getInternalIpAddress().getHostAddress()); | ||||
| 			gwRecord.setPort(connectorProperties.getInternalPort()); | ||||
|  | ||||
| 			try { | ||||
|  | ||||
| 				Routing routing = new Routing(); | ||||
| 				routing.setCustomerId(2); | ||||
| 				routing.setDetails(new RoutingDetails()); | ||||
| 				routing = eqRoutingSvc.create(routing); | ||||
|  | ||||
| 				CustomerEquipmentGwRecord result = new CustomerEquipmentGwRecord(); | ||||
| 				result.setGatewayId(getGatewayName()); | ||||
| 				result.setId(routing.getId()); | ||||
|  | ||||
| //                CustomerEquipmentGwRecord result = this.eqRoutingSvc.registerGateway(gwRecord); | ||||
| 				this.registeredGwId = result.getId(); | ||||
| 				LOG.info("Successfully registered (name={}, id={}) with Routing Service", result.getGatewayId(), | ||||
| 						registeredGwId); | ||||
| 				registeredWithRoutingService = true; | ||||
| 			} catch (RuntimeException e) { | ||||
| 				// failed | ||||
| 				LOG.error("Failed to register Customer Equipment Gateway (name={}) with Routing Service : {}", | ||||
| 						getGatewayName(), e.getLocalizedMessage()); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Return the current deployment identifier | ||||
| 	 *  | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	public int getDeploymentId() { | ||||
| 		return serviceInstanceInfo.getDeploymentId(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * De-register from Routing service | ||||
| 	 */ | ||||
| 	public void deregisterFromRoutingService() { | ||||
| 		if (registeredWithRoutingService) { | ||||
| 			try { | ||||
| 				eqRoutingSvc.delete(registeredGwId); | ||||
| 				LOG.info("Deregistered Customer Equipment Gateway (name={},id={}) with Routing Service", | ||||
| 						getGatewayName(), this.registeredGwId); | ||||
| 			} catch (Exception e) { | ||||
| 				// failed | ||||
| 				LOG.error("Failed to deregister Customer Equipment Gateway (name={},id={}) with Routing Service: {}", | ||||
| 						getGatewayName(), this.registeredGwId, e.getLocalizedMessage()); | ||||
| 			} | ||||
| 			registeredWithRoutingService = false; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	public long getRegisteredGwId() { | ||||
| 		return this.registeredGwId; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Register a customer equipment with this gateway | ||||
| 	 *  | ||||
| 	 * @param equipmentName | ||||
| 	 * @param customerId | ||||
| 	 * @param equipmentId | ||||
| 	 * @return associationId | ||||
| 	 */ | ||||
| 	public RoutingRegisterResponse registerCustomerEquipment(String equipmentName, Integer customerId, | ||||
| 			Long equipmentId) { | ||||
| 		registerWithRoutingService(); | ||||
| 		if (!registeredWithRoutingService) { | ||||
| 			LOG.error("Unable to register customer equipement (name={},id={}): gateway not registered.", equipmentName, | ||||
| 					equipmentId); | ||||
| 			return null; | ||||
| 		} | ||||
| 		EquipmentRoutingRecord routingRecord = new EquipmentRoutingRecord(); | ||||
| 		routingRecord.setCustomerId(customerId); | ||||
| 		routingRecord.setEquipmentId(equipmentId); | ||||
| 		routingRecord.setGatewayRecordId(this.registeredGwId); | ||||
| 		try { | ||||
|  | ||||
| 			ServiceDeploymentInfo targetDeploymentInfo = new ServiceDeploymentInfo(); | ||||
| 			RoutingRegisterResponse result = new RoutingRegisterResponse(routingRecord, targetDeploymentInfo); | ||||
|  | ||||
| 			LOG.debug("Registered customer equipment (name={},id={}) with route id={}", equipmentName, equipmentId, | ||||
| 					result.getRoutingRecord().getId()); | ||||
| 			return result; | ||||
|  | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Failed to register customer equipement (name={},id={}): {}", equipmentName, equipmentId, | ||||
| 					e.getLocalizedMessage()); | ||||
| 		} | ||||
| 		return null; | ||||
| 	} | ||||
|  | ||||
| 	public void deregisterCustomerEquipment(Long routingId, String equipmentName, Long equipmentId) { | ||||
| 		if (!registeredWithRoutingService) { | ||||
| 			LOG.error("Unable to deregister customer equipement (name={},id={}): gateway not registered", equipmentName, | ||||
| 					equipmentId); | ||||
| 			return; | ||||
| 		} | ||||
| 		try { | ||||
| 			LOG.debug("Deregistering customer equipment (name={},id={}) with route id={}", equipmentName, equipmentId, | ||||
| 					routingId); | ||||
|  | ||||
| 			eqRoutingSvc.delete(routingId); | ||||
| 		} catch (Exception e) { | ||||
| 			LOG.error("Failed to deregister customer equipement (name={},id={}) with route id={}: {}", equipmentName, | ||||
| 					equipmentId, routingId, e.getLocalizedMessage()); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Run every 5 minutes | ||||
| 	 */ | ||||
| 	@Scheduled(initialDelay = 5 * 60 * 1000, fixedRate = 5 * 60 * 1000) | ||||
| 	public void updateActiveCustomer() { | ||||
| 		try { | ||||
| 			Map<Integer, Long> activeMap = this.getActiveCustomerMapForUpdate(); | ||||
| 			if (null != activeMap) { | ||||
| 				LOG.info("Updating active customer records, total record size {}", activeMap.size()); | ||||
| //				this.eqRoutingSvc.updateActiveCustomer(activeMap, getDeploymentId()); | ||||
| 			} | ||||
| 		} catch (RuntimeException exp) { | ||||
| 			LOG.error("Failed to update active customer records due to exception {}", exp.getLocalizedMessage()); | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Use connection internal hostname as the gateway name | ||||
| 	 *  | ||||
| 	 * @return | ||||
| 	 */ | ||||
| 	private String getGatewayName() { | ||||
| 		return connectorProperties.getInternalHostName(); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Update the active timestamp for the customer | ||||
| 	 *  | ||||
| 	 * @param customerId | ||||
| 	 */ | ||||
| 	public void updateActiveCustomer(int customerId) { | ||||
| 		this.activeCustomerReadLock.lock(); | ||||
| 		try { | ||||
| @@ -124,7 +428,25 @@ public class OpensyncCloudGatewayController { | ||||
| 		} finally { | ||||
| 			this.activeCustomerReadLock.unlock(); | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Swap the active customer map for reporting if it contains records. | ||||
| 	 *  | ||||
| 	 * @return null if no records. | ||||
| 	 */ | ||||
| 	protected Map<Integer, Long> getActiveCustomerMapForUpdate() { | ||||
| 		this.activeCustomerWriteLock.lock(); | ||||
| 		try { | ||||
| 			Map<Integer, Long> map = null; | ||||
| 			if (!this.activeCustomerMap.isEmpty()) { | ||||
| 				map = this.activeCustomerMap; | ||||
| 				this.activeCustomerMap = new ConcurrentHashMap<>(); | ||||
| 			} | ||||
|  | ||||
| 			return map; | ||||
| 		} finally { | ||||
| 			this.activeCustomerWriteLock.unlock(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -12,18 +12,18 @@ import org.springframework.context.event.ContextClosedEvent; | ||||
|  * | ||||
|  */ | ||||
| public class OpensyncGatewayControllerStopListener implements ApplicationListener<ContextClosedEvent> { | ||||
|     OpensyncCloudGatewayController controller; | ||||
| 	OpensyncCloudGatewayController controller; | ||||
|  | ||||
|     private static final Logger LOG = LoggerFactory.getLogger(OpensyncGatewayControllerStopListener.class); | ||||
|      | ||||
|     public OpensyncGatewayControllerStopListener(OpensyncCloudGatewayController controller) { | ||||
|         this.controller = controller; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public void onApplicationEvent(ContextClosedEvent event) { | ||||
|         LOG.debug("Processing ContextClosedEvent event"); | ||||
|         controller.deregisterFromRoutingService(); | ||||
|     } | ||||
| 	private static final Logger LOG = LoggerFactory.getLogger(OpensyncGatewayControllerStopListener.class); | ||||
|  | ||||
| 	public OpensyncGatewayControllerStopListener(OpensyncCloudGatewayController controller) { | ||||
| 		this.controller = controller; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public void onApplicationEvent(ContextClosedEvent event) { | ||||
| 		LOG.debug("Processing ContextClosedEvent event"); | ||||
| 		controller.deregisterFromRoutingService(); | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1 @@ | ||||
| This package is for development local work only due to legacy migration, and it should not be part of any real deployment. Parts of this will disappear and be replaced by telecominfraproject.wlan routing. | ||||
| @@ -0,0 +1,163 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
| import com.telecominfraproject.wlan.core.model.role.PortalUserRole; | ||||
|  | ||||
| public class CEGWBaseCommand extends BaseJsonModel { | ||||
| 	 /** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 1369966637498613810L; | ||||
|  | ||||
| 	/** | ||||
|      * Command Type | ||||
|      */ | ||||
|     private CEGWCommandType commandType; | ||||
|  | ||||
|     /** | ||||
|      * Equipment Identifier | ||||
|      */ | ||||
|     private long equipmentId; | ||||
|  | ||||
|     /** | ||||
|      * Equipment QR identifier | ||||
|      */ | ||||
|     private String equipmentQRCode; | ||||
|     /** | ||||
|      * Portal user name | ||||
|      */ | ||||
|     private String userName; | ||||
|  | ||||
|     /** | ||||
|      * Portal user role | ||||
|      */ | ||||
|     private PortalUserRole userRole; | ||||
|  | ||||
|     /** | ||||
|      * Only used to JSON decoding | ||||
|      */ | ||||
|     protected CEGWBaseCommand() { | ||||
|         this.commandType = CEGWCommandType.Unknown; | ||||
|     } | ||||
|  | ||||
|     protected CEGWBaseCommand(CEGWCommandType commandType, String equipmentQRCode, long equipmentId) { | ||||
|         this(commandType, equipmentQRCode, equipmentId, null, null); | ||||
|     } | ||||
|  | ||||
|     protected CEGWBaseCommand(CEGWCommandType commandType, String equipmentQRCode, long equipmentId, | ||||
|             PortalUserRole userRole, String userName) { | ||||
|         this.commandType = commandType; | ||||
|         this.equipmentQRCode = equipmentQRCode; | ||||
|         this.equipmentId = equipmentId; | ||||
|         this.userRole = userRole; | ||||
|         this.userName = userName; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CEGWBaseCommand clone() { | ||||
|         return (CEGWBaseCommand) super.clone(); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean equals(Object obj) { | ||||
|         if (this == obj) { | ||||
|             return true; | ||||
|         } | ||||
|         if (obj == null) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!(obj instanceof CEGWBaseCommand)) { | ||||
|             return false; | ||||
|         } | ||||
|         CEGWBaseCommand other = (CEGWBaseCommand) obj; | ||||
|         if (this.commandType != other.commandType) { | ||||
|             return false; | ||||
|         } | ||||
|         if (this.equipmentId != other.equipmentId) { | ||||
|             return false; | ||||
|         } | ||||
|         if (this.equipmentQRCode == null) { | ||||
|             if (other.equipmentQRCode != null) { | ||||
|                 return false; | ||||
|             } | ||||
|         } else if (!this.equipmentQRCode.equals(other.equipmentQRCode)) { | ||||
|             return false; | ||||
|         } | ||||
|         if (this.userRole != other.userRole) { | ||||
|             return false; | ||||
|         } | ||||
|         if (this.userName == null) { | ||||
|             if (other.userName != null) { | ||||
|                 return false; | ||||
|             } | ||||
|         } else if (!this.userName.equals(other.userName)) { | ||||
|             return false; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public CEGWCommandType getCommandType() { | ||||
|         return commandType; | ||||
|     } | ||||
|  | ||||
|     public long getEquipmentId() { | ||||
|         return this.equipmentId; | ||||
|     } | ||||
|  | ||||
|     public String getEquipmentQRCode() { | ||||
|         return equipmentQRCode; | ||||
|     } | ||||
|  | ||||
|     public String getUsername() { | ||||
|         return userName; | ||||
|     } | ||||
|  | ||||
|     public PortalUserRole getUserRole() { | ||||
|         return userRole; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public int hashCode() { | ||||
|         final int prime = 31; | ||||
|         int result = 1; | ||||
|         result = prime * result + ((this.commandType == null) ? 0 : this.commandType.hashCode()); | ||||
|         result = prime * result + (int) (this.equipmentId ^ (this.equipmentId >>> 32)); | ||||
|         result = prime * result + ((this.equipmentQRCode == null) ? 0 : this.equipmentQRCode.hashCode()); | ||||
|         result = prime * result + ((this.userRole == null) ? 0 : this.userRole.hashCode()); | ||||
|         result = prime * result + ((this.userName == null) ? 0 : this.userName.hashCode()); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean hasUnsupportedValue() { | ||||
|         if (super.hasUnsupportedValue()) { | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         if (CEGWCommandType.isUnsupported(commandType) || PortalUserRole.isUnsupported(userRole)) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     public void setCommandType(CEGWCommandType commandType) { | ||||
|         this.commandType = commandType; | ||||
|     } | ||||
|  | ||||
|     public void setEquipmentId(long equipmentId) { | ||||
|         this.equipmentId = equipmentId; | ||||
|     } | ||||
|  | ||||
|     public void setEquipmentQRCode(String equipmentQRCode) { | ||||
|         this.equipmentQRCode = equipmentQRCode; | ||||
|     } | ||||
|  | ||||
|     public void setUsername(String portalUsername) { | ||||
|         this.userName = portalUsername; | ||||
|     } | ||||
|  | ||||
|     public void setUserRole(PortalUserRole portalRole) { | ||||
|         this.userRole = portalRole; | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,83 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.equipment.LEDColour; | ||||
|  | ||||
| public class CEGWBlinkRequest extends CustomerEquipmentCommand { | ||||
| 	 /** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 3464950479960821571L; | ||||
| 	private int numCycles; | ||||
| 	    private int colour1DurationMs; | ||||
| 	    private int colour2DurationMs; | ||||
| 	    private LEDColour colour1; | ||||
| 	    private LEDColour colour2; | ||||
|  | ||||
| 	    /** | ||||
| 	     * Constructor | ||||
| 	     *  | ||||
| 	     * @param equipmentQRCode | ||||
| 	     * @param equipmentId | ||||
| 	     */ | ||||
| 	    public CEGWBlinkRequest(String equipmentQRCode, long equipmentId) { | ||||
| 	        super(CEGWCommandType.BlinkRequest, equipmentQRCode, equipmentId); | ||||
| 	    } | ||||
|  | ||||
| 	    /** | ||||
| 	     * Constructor used by JSON | ||||
| 	     */ | ||||
| 	    public CEGWBlinkRequest() { | ||||
| 	        super(CEGWCommandType.BlinkRequest, null, 0); | ||||
| 	    } | ||||
|  | ||||
| 	    public int getNumCycles() { | ||||
| 	        return numCycles; | ||||
| 	    } | ||||
|  | ||||
| 	    public void setNumCycles(int numCycles) { | ||||
| 	        this.numCycles = numCycles; | ||||
| 	    } | ||||
|  | ||||
| 	    public int getColour1DurationMs() { | ||||
| 	        return colour1DurationMs; | ||||
| 	    } | ||||
|  | ||||
| 	    public void setColour1DurationMs(int colourDurationMs) { | ||||
| 	        this.colour1DurationMs = colourDurationMs; | ||||
| 	    } | ||||
|  | ||||
| 	    public int getColour2DurationMs() { | ||||
| 	        return colour2DurationMs; | ||||
| 	    } | ||||
|  | ||||
| 	    public void setColour2DurationMs(int colourDurationMs) { | ||||
| 	        this.colour2DurationMs = colourDurationMs; | ||||
| 	    } | ||||
|  | ||||
| 	    public LEDColour getColour1() { | ||||
| 	        return colour1; | ||||
| 	    } | ||||
|  | ||||
| 	    public void setColour1(LEDColour colour1) { | ||||
| 	        this.colour1 = colour1; | ||||
| 	    } | ||||
|  | ||||
| 	    public LEDColour getColour2() { | ||||
| 	        return colour2; | ||||
| 	    } | ||||
|  | ||||
| 	    public void setColour2(LEDColour colour2) { | ||||
| 	        this.colour2 = colour2; | ||||
| 	    } | ||||
| 	     | ||||
| 	    @Override | ||||
| 	    public boolean hasUnsupportedValue() { | ||||
| 	        if (super.hasUnsupportedValue()) { | ||||
| 	            return true; | ||||
| 	        } | ||||
| 	        if (LEDColour.isUnsupported(colour1) || LEDColour.isUnsupported(colour2)) { | ||||
| 	            return true; | ||||
| 	        } | ||||
| 	        return false; | ||||
| 	    } | ||||
| } | ||||
| @@ -0,0 +1,27 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public class CEGWCloseSessionRequest extends CEGatewayCommand { | ||||
|  | ||||
|  | ||||
|     /** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = -263965970528271895L; | ||||
|  | ||||
| 	public CEGWCloseSessionRequest(String qrCode, long equipmentId) { | ||||
|         super(CEGWCommandType.CloseSessionRequest, qrCode, equipmentId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Constructor used by JSON | ||||
|      */ | ||||
|     public CEGWCloseSessionRequest() { | ||||
|         super(CEGWCommandType.CloseSessionRequest, null, 0); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CEGWCloseSessionRequest clone() { | ||||
|         return (CEGWCloseSessionRequest) super.clone(); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,30 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public enum CEGWCommandResultCode { | ||||
| 	/** | ||||
| 	 * Successfully delivered to CE | ||||
| 	 */ | ||||
| 	Success, | ||||
| 	/** | ||||
| 	 * No route to CE. | ||||
| 	 */ | ||||
| 	NoRouteToCE, | ||||
| 	/** | ||||
| 	 * Failed to deliver the message to CE. | ||||
| 	 */ | ||||
| 	FailedToSend, | ||||
| 	/** | ||||
| 	 * Timed out waiting for CE to response. CEGW will not return this code because | ||||
| 	 * communication is asynchronous. | ||||
| 	 */ | ||||
| 	TimedOut, | ||||
| 	/** | ||||
| 	 * Failure reported by customer equipment CEGW will not return this code because | ||||
| 	 * communication is asynchronous. | ||||
| 	 */ | ||||
| 	FailedOnCE, | ||||
| 	/** | ||||
| 	 * Command code not supported | ||||
| 	 */ | ||||
| 	UnsupportedCommand; | ||||
| } | ||||
| @@ -0,0 +1,91 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||||
|  | ||||
| public enum CEGWCommandType { | ||||
| 	/** | ||||
| 	 * Notification to CE for configuration change | ||||
| 	 */ | ||||
| 	Unknown, ConfigChangeNotification, FirmwareDownloadRequest, StartDebugEngine, StopDebugEngine, FirmwareFlashRequest, | ||||
| 	RebootRequest, BlinkRequest, CloseSessionRequest, NeighbourhoodReport, ClientDeauthRequest, CellSizeRequest, | ||||
| 	NewChannelRequest, ReportCurrentAPCRequest, FileUpdateRequest, InterferenceThresholdUpdateRequest, | ||||
| 	BestApConfigurationUpdateRequest, | ||||
|  | ||||
| 	/** | ||||
| 	 * Will tell the AP to monitor these macs filters for hardwired traffic (aka: | ||||
| 	 * Rogue AP) | ||||
| 	 */ | ||||
| 	BSSIDToMacMonitoringRequest, | ||||
|  | ||||
| 	// Will tell the AP to dynamically change channels | ||||
| 	ChannelChangeAnnouncementRequest, | ||||
|  | ||||
| 	/** | ||||
| 	 * Start packet capture into file | ||||
| 	 */ | ||||
| 	StartPacketFileCapture, | ||||
| 	/** | ||||
| 	 * Stop packet capture | ||||
| 	 */ | ||||
| 	StopPacketCapture, | ||||
| 	/** | ||||
| 	 * Check for routing record | ||||
| 	 */ | ||||
| 	CheckRouting, ReportCurrentVLANRequest, | ||||
|  | ||||
| 	/** | ||||
| 	 * Log file upload | ||||
| 	 */ | ||||
| 	UploadLogFile, | ||||
|  | ||||
| 	/** | ||||
| 	 * For toggle PoE port on switch. | ||||
| 	 */ | ||||
| 	TogglePoERequest, | ||||
|  | ||||
| 	/** | ||||
| 	 * Reset radio | ||||
| 	 */ | ||||
| 	RadioReset, | ||||
|  | ||||
| 	/** | ||||
| 	 * Clear scan table | ||||
| 	 */ | ||||
| 	ClearScanTable, | ||||
|  | ||||
| 	/** | ||||
| 	 * For commands related to wds link of Mesh. | ||||
| 	 */ | ||||
| 	WdsRequest, | ||||
|  | ||||
| 	UNSUPPORTED; | ||||
|  | ||||
| 	@JsonCreator | ||||
| 	public static CEGWCommandType getByName(String value) { | ||||
| 		return deserializEnum(value, CEGWCommandType.class, UNSUPPORTED); | ||||
| 	} | ||||
|  | ||||
| 	public static boolean isUnsupported(Object value) { | ||||
| 		return UNSUPPORTED.equals(value); | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * Deserialize enumeration with default value when it's unknown. | ||||
| 	 *  | ||||
| 	 * @param jsonValue | ||||
| 	 * @param enumType | ||||
| 	 * @param defaultValue | ||||
| 	 * @return decoded value | ||||
| 	 */ | ||||
| 	public static <E extends Enum<E>> E deserializEnum(String jsonValue, Class<E> enumType, E defaultValue) { | ||||
| 		if (null == jsonValue) { | ||||
| 			return null; | ||||
| 		} | ||||
| 		try { | ||||
| 			E result = E.valueOf(enumType, jsonValue); | ||||
| 			return result; | ||||
| 		} catch (IllegalArgumentException e) { | ||||
| 			return defaultValue; | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,27 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public class CEGWConfigChangeNotification extends CustomerEquipmentCommand { | ||||
|  | ||||
|  | ||||
|     /** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 4401284478686864193L; | ||||
|  | ||||
| 	/** | ||||
|      * Constructor | ||||
|      *  | ||||
|      * @param equipementQRCode | ||||
|      * @param equipmentId | ||||
|      */ | ||||
|     public CEGWConfigChangeNotification(String equipementQRCode, long equipmentId) { | ||||
|         super(CEGWCommandType.ConfigChangeNotification, equipementQRCode, equipmentId); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Constructor used by JSON | ||||
|      */ | ||||
|     protected CEGWConfigChangeNotification() { | ||||
|         super(CEGWCommandType.ConfigChangeNotification, null, 0); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,15 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public class CEGWRouteCheck extends CustomerEquipmentCommand { | ||||
|  | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 8778460868381668813L; | ||||
|  | ||||
| 	public Object getRoutingId() { | ||||
| 		// TODO Auto-generated method stub | ||||
| 		return null; | ||||
| 	} | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,61 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public class CEGWStartDebugEngine extends CustomerEquipmentCommand { | ||||
|     /** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = -6768986657458247552L; | ||||
| 	/** | ||||
|      * Gateway hostname | ||||
|      */ | ||||
|     private String gatewayHostname; | ||||
|     /** | ||||
|      * Gateway port | ||||
|      */ | ||||
|     private Integer gatewayPort; | ||||
|  | ||||
|     /** | ||||
|      * Constructor | ||||
|      *  | ||||
|      * @param equipmentQRCode | ||||
|      * @param equipmentId | ||||
|      * @param gatewayHostname | ||||
|      * @param gatewayPort | ||||
|      */ | ||||
|     public CEGWStartDebugEngine(String equipmentQRCode, long equipmentId, String gatewayHostname, Integer gatewayPort) { | ||||
|         super(CEGWCommandType.StartDebugEngine, equipmentQRCode, equipmentId); | ||||
|         this.setGatewayHostname(gatewayHostname); | ||||
|         this.setGatewayPort(gatewayPort); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Constructor used by JSON | ||||
|      */ | ||||
|     public CEGWStartDebugEngine() { | ||||
|         super(CEGWCommandType.StartDebugEngine, null, 0); | ||||
|     } | ||||
|  | ||||
|     public String getGatewayHostname() { | ||||
|         return gatewayHostname; | ||||
|     } | ||||
|  | ||||
|     public void setGatewayHostname(String gatewayHostname) { | ||||
|         this.gatewayHostname = gatewayHostname; | ||||
|     } | ||||
|  | ||||
|     public Integer getGatewayPort() { | ||||
|         return gatewayPort; | ||||
|     } | ||||
|  | ||||
|     public void setGatewayPort(Integer gatewayPort) { | ||||
|         this.gatewayPort = gatewayPort; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean hasUnsupportedValue() { | ||||
|         if (super.hasUnsupportedValue()) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,15 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| public class CEGatewayCommand extends CEGWBaseCommand { | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 4545056375390115226L; | ||||
|  | ||||
| 	protected CEGatewayCommand() { | ||||
|     } | ||||
|  | ||||
|     protected CEGatewayCommand(CEGWCommandType commandType, String equipmentQRCode, long equipmentId) { | ||||
|         super(commandType, equipmentQRCode, equipmentId); | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,24 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.role.PortalUserRole; | ||||
|  | ||||
| public class CustomerEquipmentCommand extends CEGWBaseCommand { | ||||
|  | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = -1981617366942595011L; | ||||
| 	 | ||||
| 	protected CustomerEquipmentCommand() { | ||||
|     } | ||||
|  | ||||
|     protected CustomerEquipmentCommand(CEGWCommandType commandType, String equipmentQRCode, long equipmentId) { | ||||
|         this(commandType, equipmentQRCode, equipmentId, null, null); | ||||
|     } | ||||
|  | ||||
|     protected CustomerEquipmentCommand(CEGWCommandType commandType, String equipmentQRCode, long equipmentId, | ||||
|             PortalUserRole userRole, final String userName) { | ||||
|         super(commandType, equipmentQRCode, equipmentId, userRole, userName); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,57 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class CustomerEquipmentCommandResponse extends BaseJsonModel { | ||||
|  | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 5977811650122183402L; | ||||
| 	 | ||||
| 	/** | ||||
|      * Constructor  | ||||
|      *  | ||||
|      * @param resultCode | ||||
|      * @param resultDetail | ||||
|      */ | ||||
|     public CustomerEquipmentCommandResponse(int resultCode, String resultDetail) { | ||||
|         this.resultCode = resultCode; | ||||
|         this.resultDetail = resultDetail; | ||||
|     } | ||||
|  | ||||
|     public CustomerEquipmentCommandResponse() { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Result code, use CEGWCommandResultCode to set it | ||||
|      */ | ||||
|     private int resultCode; | ||||
|  | ||||
|     /** | ||||
|      * Detail for the result | ||||
|      */ | ||||
|     private String resultDetail; | ||||
|  | ||||
|     public void setResponseCode(int resulteCode) { | ||||
|         this.resultCode = resulteCode; | ||||
|     } | ||||
|  | ||||
|     public int getResultCode() { | ||||
|         return resultCode; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public CustomerEquipmentCommandResponse clone() { | ||||
|         return (CustomerEquipmentCommandResponse) super.clone(); | ||||
|     } | ||||
|  | ||||
|     public String getResultDetail() { | ||||
|         return resultDetail; | ||||
|     } | ||||
|  | ||||
|     public void setResultDetail(String resultDetail) { | ||||
|         this.resultDetail = resultDetail; | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -0,0 +1,149 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class CustomerEquipmentGwRecord extends BaseJsonModel { | ||||
| 	private long id; | ||||
|  | ||||
| 	//////////////////////////////////////////////////////////////////////////// | ||||
| 	// If more parameters are required in this object, try to maintain the order | ||||
| 	// to match the DAO implementation. | ||||
| 	//////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| 	/** Unique identifier for the CustomerEquipmentGW */ | ||||
| 	private String gatewayId; | ||||
|  | ||||
| 	/** IP Address of the CustomerEquipmentGW */ | ||||
| 	private String ipAddr; | ||||
|  | ||||
| 	/** Port for the CustomerEquipmentGW */ | ||||
| 	private int port; | ||||
|  | ||||
| 	/** | ||||
| 	 * Deployment Id for the gateway | ||||
| 	 */ | ||||
| 	private int deploymentId; | ||||
| 	//////////////////////////////////////////////////////////////////////////// | ||||
|  | ||||
| 	private long createdTimestamp; | ||||
| 	private long lastModifiedTimestamp; | ||||
|  | ||||
| 	public long getId() { | ||||
| 		return id; | ||||
| 	} | ||||
|  | ||||
| 	public void setId(long id) { | ||||
| 		this.id = id; | ||||
| 	} | ||||
|  | ||||
| 	public String getGatewayId() { | ||||
| 		return gatewayId; | ||||
| 	} | ||||
|  | ||||
| 	public void setGatewayId(String gatewayId) { | ||||
| 		this.gatewayId = gatewayId; | ||||
| 	} | ||||
|  | ||||
| 	public String getIpAddr() { | ||||
| 		return ipAddr; | ||||
| 	} | ||||
|  | ||||
| 	public void setIpAddr(String ipAddr) { | ||||
| 		this.ipAddr = ipAddr; | ||||
| 	} | ||||
|  | ||||
| 	public int getPort() { | ||||
| 		return port; | ||||
| 	} | ||||
|  | ||||
| 	public void setPort(int port) { | ||||
| 		this.port = port; | ||||
| 	} | ||||
|  | ||||
| 	public long getCreatedTimestamp() { | ||||
| 		return createdTimestamp; | ||||
| 	} | ||||
|  | ||||
| 	public void setDeploymentId(int deploymentId) { | ||||
| 		this.deploymentId = deploymentId; | ||||
| 	} | ||||
|  | ||||
| 	public int getDeploymentId() { | ||||
| 		return this.deploymentId; | ||||
| 	} | ||||
|  | ||||
| 	public void setCreatedTimestamp(long createdTimestamp) { | ||||
| 		this.createdTimestamp = createdTimestamp; | ||||
| 	} | ||||
|  | ||||
| 	public long getLastModifiedTimestamp() { | ||||
| 		return lastModifiedTimestamp; | ||||
| 	} | ||||
|  | ||||
| 	public void setLastModifiedTimestamp(long lastModifiedTimestamp) { | ||||
| 		this.lastModifiedTimestamp = lastModifiedTimestamp; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public CustomerEquipmentGwRecord clone() { | ||||
| 		return (CustomerEquipmentGwRecord) super.clone(); | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public int hashCode() { | ||||
| 		final int prime = 31; | ||||
| 		int result = 1; | ||||
| 		result = prime * result + (int) (this.createdTimestamp ^ (this.createdTimestamp >>> 32)); | ||||
| 		result = prime * result + this.deploymentId; | ||||
| 		result = prime * result + ((this.gatewayId == null) ? 0 : this.gatewayId.hashCode()); | ||||
| 		result = prime * result + (int) (this.id ^ (this.id >>> 32)); | ||||
| 		result = prime * result + ((this.ipAddr == null) ? 0 : this.ipAddr.hashCode()); | ||||
| 		result = prime * result + (int) (this.lastModifiedTimestamp ^ (this.lastModifiedTimestamp >>> 32)); | ||||
| 		result = prime * result + this.port; | ||||
| 		return result; | ||||
| 	} | ||||
|  | ||||
| 	@Override | ||||
| 	public boolean equals(Object obj) { | ||||
| 		if (this == obj) { | ||||
| 			return true; | ||||
| 		} | ||||
| 		if (obj == null) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (!(obj instanceof CustomerEquipmentGwRecord)) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		CustomerEquipmentGwRecord other = (CustomerEquipmentGwRecord) obj; | ||||
| 		if (this.createdTimestamp != other.createdTimestamp) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.deploymentId != other.deploymentId) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.gatewayId == null) { | ||||
| 			if (other.gatewayId != null) { | ||||
| 				return false; | ||||
| 			} | ||||
| 		} else if (!this.gatewayId.equals(other.gatewayId)) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.id != other.id) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.ipAddr == null) { | ||||
| 			if (other.ipAddr != null) { | ||||
| 				return false; | ||||
| 			} | ||||
| 		} else if (!this.ipAddr.equals(other.ipAddr)) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.lastModifiedTimestamp != other.lastModifiedTimestamp) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		if (this.port != other.port) { | ||||
| 			return false; | ||||
| 		} | ||||
| 		return true; | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,111 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class EquipmentRoutingRecord extends BaseJsonModel { | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 2269183737047459318L; | ||||
|  | ||||
| 	private long id; | ||||
|  | ||||
|     //////////////////////////////////////////////////////////////////////////// | ||||
|     // If more parameters are required in this object, try to maintain the order | ||||
|     // to match the DAO implementation. | ||||
|     //////////////////////////////////////////////////////////////////////////// | ||||
|      | ||||
|     /** Unique identifier for a hardware device. */ | ||||
|     private long equipmentId; | ||||
|      | ||||
|     /** Unique identifier of a customer. */ | ||||
|     private int customerId; | ||||
|      | ||||
|     /** Unique identifier for a CustomerEquipmentGwRecord id. */ | ||||
|     private long gatewayRecordId; | ||||
|      | ||||
|     //////////////////////////////////////////////////////////////////////////// | ||||
|     private long createdTimestamp; | ||||
|     private long lastModifiedTimestamp; | ||||
|      | ||||
|     public long getId() { | ||||
|         return id; | ||||
|     } | ||||
|  | ||||
|     public void setId(long id) { | ||||
|         this.id = id; | ||||
|     } | ||||
|  | ||||
|     public long getCreatedTimestamp() { | ||||
|         return createdTimestamp; | ||||
|     } | ||||
|  | ||||
|     public void setCreatedTimestamp(long createdTimestamp) { | ||||
|         this.createdTimestamp = createdTimestamp; | ||||
|     } | ||||
|  | ||||
|     public long getLastModifiedTimestamp() { | ||||
|         return lastModifiedTimestamp; | ||||
|     } | ||||
|  | ||||
|     public void setLastModifiedTimestamp(long lastModifiedTimestamp) { | ||||
|         this.lastModifiedTimestamp = lastModifiedTimestamp; | ||||
|     } | ||||
|  | ||||
|     public long getEquipmentId() { | ||||
|         return equipmentId; | ||||
|     } | ||||
|  | ||||
|     public void setEquipmentId(long equipmentId) { | ||||
|         this.equipmentId = equipmentId; | ||||
|     } | ||||
|  | ||||
|     public int getCustomerId() { | ||||
|         return customerId; | ||||
|     } | ||||
|  | ||||
|     public void setCustomerId(int customerId) { | ||||
|         this.customerId = customerId; | ||||
|     } | ||||
|  | ||||
|     public long getGatewayRecordId() { | ||||
|         return gatewayRecordId; | ||||
|     } | ||||
|  | ||||
|     public void setGatewayRecordId(long gatewayId) { | ||||
|         this.gatewayRecordId = gatewayId; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public EquipmentRoutingRecord clone() { | ||||
|         return (EquipmentRoutingRecord) super.clone(); | ||||
|     } | ||||
|      | ||||
|     //WARNING: do not use any mutable fields in equals/hashCode - it screws up rule engine | ||||
|     @Override | ||||
|     public int hashCode() { | ||||
|         final int prime = 31; | ||||
|         int result = 1; | ||||
|         result = prime * result + (int) (id ^ (id >>> 32)); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     //WARNING: do not use any mutable fields in equals/hashCode - it screws up rule engine | ||||
|     @Override | ||||
|     public boolean equals(Object obj) { | ||||
|         if (this == obj) { | ||||
|             return true; | ||||
|         } | ||||
|         if (obj == null) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!(obj instanceof EquipmentRoutingRecord)) { | ||||
|             return false; | ||||
|         } | ||||
|         EquipmentRoutingRecord other = (EquipmentRoutingRecord) obj; | ||||
|         if (id != other.id) { | ||||
|             return false; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import java.util.HashMap; | ||||
| import java.util.Map; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.equipment.RadioType; | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class GatewayDefaults extends BaseJsonModel { | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 1781633756875649610L; | ||||
| 	private Map<RadioType, GatewayRadioDefaults> defaults = new HashMap<RadioType, GatewayRadioDefaults>(); | ||||
| 	private Boolean default11w; | ||||
|  | ||||
| 	public GatewayDefaults() { | ||||
|  | ||||
| 	} | ||||
|  | ||||
| 	public Map<RadioType, GatewayRadioDefaults> getDefaults() { | ||||
| 		return defaults; | ||||
| 	} | ||||
|  | ||||
| 	public void setDefaults(Map<RadioType, GatewayRadioDefaults> defaults) { | ||||
| 		this.defaults = defaults; | ||||
| 	} | ||||
|  | ||||
| 	public Boolean getDefault11w() { | ||||
| 		return default11w; | ||||
| 	} | ||||
|  | ||||
| 	public void setDefault11w(Boolean default11w) { | ||||
| 		this.default11w = default11w; | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1,41 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class GatewayRadioDefaults extends BaseJsonModel { | ||||
| 	/** | ||||
| 	*  | ||||
| 	*/ | ||||
| 	private static final long serialVersionUID = 8302320644769648937L; | ||||
| 	private Boolean default11k; | ||||
| 	private Boolean default11v; | ||||
| 	private Boolean default11r; | ||||
|  | ||||
| 	public GatewayRadioDefaults() { | ||||
| 		// | ||||
| 	} | ||||
|  | ||||
| 	public Boolean getDefault11k() { | ||||
| 		return default11k; | ||||
| 	} | ||||
|  | ||||
| 	public void setDefault11k(Boolean default11k) { | ||||
| 		this.default11k = default11k; | ||||
| 	} | ||||
|  | ||||
| 	public Boolean getDefault11v() { | ||||
| 		return default11v; | ||||
| 	} | ||||
|  | ||||
| 	public void setDefault11v(Boolean default11v) { | ||||
| 		this.default11v = default11v; | ||||
| 	} | ||||
|  | ||||
| 	public Boolean getDefault11r() { | ||||
| 		return default11r; | ||||
| 	} | ||||
|  | ||||
| 	public void setDefault11r(Boolean default11r) { | ||||
| 		this.default11r = default11r; | ||||
| 	} | ||||
| } | ||||
| @@ -0,0 +1 @@ | ||||
| This package is for development local work only due to legacy migration, and it should not be part of any real deployment. It will disappear and be replaced by telecominfraproject.wlan routing. | ||||
| @@ -0,0 +1,127 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
|  | ||||
| public class RoutingRegisterResponse extends BaseJsonModel { | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = -5832910847688930093L; | ||||
|  | ||||
| 	/** | ||||
|      * Created record | ||||
|      */ | ||||
|     private EquipmentRoutingRecord routingRecord; | ||||
|  | ||||
|     /** | ||||
|      * Target Service Deployment is optional. If set, getwaye should redirect | ||||
|      * the Equipment. | ||||
|      */ | ||||
|     private ServiceDeploymentInfo targetDeploymentInfo; | ||||
|  | ||||
|     /** | ||||
|      * Constructor | ||||
|      */ | ||||
|     public RoutingRegisterResponse() { | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Constructor | ||||
|      *  | ||||
|      * @param routingRecord | ||||
|      * @param targetDeploymentInfo | ||||
|      */ | ||||
|     public RoutingRegisterResponse(EquipmentRoutingRecord routingRecord, ServiceDeploymentInfo targetDeploymentInfo) { | ||||
|         this.routingRecord = routingRecord; | ||||
|         this.targetDeploymentInfo = targetDeploymentInfo; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public RoutingRegisterResponse clone() { | ||||
|         RoutingRegisterResponse result = (RoutingRegisterResponse) super.clone(); | ||||
|         if (null != this.routingRecord) { | ||||
|             result.routingRecord = this.routingRecord.clone(); | ||||
|         } | ||||
|         if (null != this.targetDeploymentInfo) { | ||||
|             result.targetDeploymentInfo = this.targetDeploymentInfo.clone(); | ||||
|         } | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     /* | ||||
|      * (non-Javadoc) | ||||
|      *  | ||||
|      * @see java.lang.Object#equals(java.lang.Object) | ||||
|      */ | ||||
|     @Override | ||||
|     public boolean equals(Object obj) { | ||||
|         if (this == obj) { | ||||
|             return true; | ||||
|         } | ||||
|         if (obj == null) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!(obj instanceof RoutingRegisterResponse)) { | ||||
|             return false; | ||||
|         } | ||||
|         RoutingRegisterResponse other = (RoutingRegisterResponse) obj; | ||||
|         if (routingRecord == null) { | ||||
|             if (other.routingRecord != null) { | ||||
|                 return false; | ||||
|             } | ||||
|         } else if (!routingRecord.equals(other.routingRecord)) { | ||||
|             return false; | ||||
|         } | ||||
|         if (targetDeploymentInfo == null) { | ||||
|             if (other.targetDeploymentInfo != null) { | ||||
|                 return false; | ||||
|             } | ||||
|         } else if (!targetDeploymentInfo.equals(other.targetDeploymentInfo)) { | ||||
|             return false; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public EquipmentRoutingRecord getRoutingRecord() { | ||||
|         return routingRecord; | ||||
|     } | ||||
|  | ||||
|     public ServiceDeploymentInfo getTargetDeploymentInfo() { | ||||
|         return targetDeploymentInfo; | ||||
|     } | ||||
|  | ||||
|     /* | ||||
|      * (non-Javadoc) | ||||
|      *  | ||||
|      * @see java.lang.Object#hashCode() | ||||
|      */ | ||||
|     @Override | ||||
|     public int hashCode() { | ||||
|         final int prime = 31; | ||||
|         int result = 1; | ||||
|         result = prime * result + ((routingRecord == null) ? 0 : routingRecord.hashCode()); | ||||
|         result = prime * result + ((targetDeploymentInfo == null) ? 0 : targetDeploymentInfo.hashCode()); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     public void setRoutingRecord(EquipmentRoutingRecord routingRecord) { | ||||
|         this.routingRecord = routingRecord; | ||||
|     } | ||||
|  | ||||
|     public void setTargetDeploymentInfo(ServiceDeploymentInfo targetDeploymentInfo) { | ||||
|         this.targetDeploymentInfo = targetDeploymentInfo; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean hasUnsupportedValue() { | ||||
|         if (super.hasUnsupportedValue()) { | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         if (hasUnsupportedValue(routingRecord) || hasUnsupportedValue(targetDeploymentInfo)) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,159 @@ | ||||
| package com.telecominfraproject.wlan.opensync.external.integration.controller.command; | ||||
|  | ||||
| import com.telecominfraproject.wlan.core.model.json.BaseJsonModel; | ||||
| import com.telecominfraproject.wlan.core.model.service.CloudServiceType; | ||||
|  | ||||
| public class ServiceDeploymentInfo extends BaseJsonModel { | ||||
| 	/** | ||||
| 	 *  | ||||
| 	 */ | ||||
| 	private static final long serialVersionUID = 3075868930647536783L; | ||||
|  | ||||
| 	/** | ||||
|      * Deployment Identifier | ||||
|      */ | ||||
|     private int deploymentId; | ||||
|  | ||||
|     /** | ||||
|      * Type of cloud service | ||||
|      */ | ||||
|     private CloudServiceType serviceType; | ||||
|     /** | ||||
|      * External host name | ||||
|      */ | ||||
|     private String serviceHostname; | ||||
|     /** | ||||
|      * External port | ||||
|      */ | ||||
|     private int servicePort; | ||||
|     /** | ||||
|      * Last time record is modified | ||||
|      */ | ||||
|     private long lastModifiedTimestamp; | ||||
|  | ||||
|     public ServiceDeploymentInfo() { | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Constructor | ||||
|      *  | ||||
|      * @param serivceType | ||||
|      * @param deploymentId | ||||
|      * @param serviceHostname | ||||
|      * @param servicePort | ||||
|      */ | ||||
|     public ServiceDeploymentInfo(CloudServiceType serivceType, int deploymentId, String serviceHostname, int servicePort) { | ||||
|         this.serviceType = serivceType; | ||||
|         this.deploymentId = deploymentId; | ||||
|         this.serviceHostname = serviceHostname; | ||||
|         this.servicePort = servicePort; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public ServiceDeploymentInfo clone() { | ||||
|         return (ServiceDeploymentInfo) super.clone(); | ||||
|     } | ||||
|  | ||||
|     /* | ||||
|      * (non-Javadoc) | ||||
|      *  | ||||
|      * @see java.lang.Object#equals(java.lang.Object) | ||||
|      */ | ||||
|     @Override | ||||
|     public boolean equals(Object obj) { | ||||
|         if (this == obj) { | ||||
|             return true; | ||||
|         } | ||||
|         if (obj == null) { | ||||
|             return false; | ||||
|         } | ||||
|         if (!(obj instanceof ServiceDeploymentInfo)) { | ||||
|             return false; | ||||
|         } | ||||
|         ServiceDeploymentInfo other = (ServiceDeploymentInfo) obj; | ||||
|         if (deploymentId != other.deploymentId) { | ||||
|             return false; | ||||
|         } | ||||
|         if (serviceHostname == null) { | ||||
|             if (other.serviceHostname != null) { | ||||
|                 return false; | ||||
|             } | ||||
|         } else if (!serviceHostname.equals(other.serviceHostname)) { | ||||
|             return false; | ||||
|         } | ||||
|         if (servicePort != other.servicePort) { | ||||
|             return false; | ||||
|         } | ||||
|         if (serviceType != other.serviceType) { | ||||
|             return false; | ||||
|         } | ||||
|         return true; | ||||
|     } | ||||
|  | ||||
|     public int getDeploymentId() { | ||||
|         return deploymentId; | ||||
|     } | ||||
|  | ||||
|     public long getLastModifiedTimestamp() { | ||||
|         return lastModifiedTimestamp; | ||||
|     } | ||||
|  | ||||
|     public String getServiceHostname() { | ||||
|         return serviceHostname; | ||||
|     } | ||||
|  | ||||
|     public int getServicePort() { | ||||
|         return servicePort; | ||||
|     } | ||||
|  | ||||
|     public CloudServiceType getServiceType() { | ||||
|         return serviceType; | ||||
|     } | ||||
|  | ||||
|     /* | ||||
|      * (non-Javadoc) | ||||
|      *  | ||||
|      * @see java.lang.Object#hashCode() | ||||
|      */ | ||||
|     @Override | ||||
|     public int hashCode() { | ||||
|         final int prime = 31; | ||||
|         int result = 1; | ||||
|         result = prime * result + deploymentId; | ||||
|         result = prime * result + ((serviceHostname == null) ? 0 : serviceHostname.hashCode()); | ||||
|         result = prime * result + servicePort; | ||||
|         result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode()); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|     public void setDeploymentId(int deploymentId) { | ||||
|         this.deploymentId = deploymentId; | ||||
|     } | ||||
|  | ||||
|     public void setLastModifiedTimestamp(long lastModifiedTimestamp) { | ||||
|         this.lastModifiedTimestamp = lastModifiedTimestamp; | ||||
|     } | ||||
|  | ||||
|     public void setServiceHostname(String serviceHostname) { | ||||
|         this.serviceHostname = serviceHostname; | ||||
|     } | ||||
|  | ||||
|     public void setServicePort(int servicePort) { | ||||
|         this.servicePort = servicePort; | ||||
|     } | ||||
|  | ||||
|     public void setServiceType(CloudServiceType serviceType) { | ||||
|         this.serviceType = serviceType; | ||||
|     } | ||||
|      | ||||
|     @Override | ||||
|     public boolean hasUnsupportedValue() { | ||||
|         if (super.hasUnsupportedValue()) { | ||||
|             return true; | ||||
|         } | ||||
|         if (CloudServiceType.isUnsupported(serviceType)) { | ||||
|             return true; | ||||
|         } | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| @@ -10,7 +10,7 @@ | ||||
|   "ssidConfigs" : [ { | ||||
|     "model_type" : "OpensyncAPSsidConfig", | ||||
|     "radioType" : "is2dot4GHz", | ||||
|     "ssid" : "Connectus-local", | ||||
|     "ssid" : "Connectus-cloud", | ||||
|     "encryption" : "WPA-PSK", | ||||
|     "key" : "12345678", | ||||
|     "mode" : "2", | ||||
| @@ -18,7 +18,7 @@ | ||||
|   }, { | ||||
|     "model_type" : "OpensyncAPSsidConfig", | ||||
|     "radioType" : "is5GHz", | ||||
|     "ssid" : "Connectus-local-5", | ||||
|     "ssid" : "Connectus-cloud", | ||||
|     "encryption" : "WPA-PSK", | ||||
|     "key" : "12345678", | ||||
|     "mode" : "2", | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
| 	<description>Process definition for opensync gateway that uses cloud configuration</description> | ||||
|  | ||||
| 	<properties> | ||||
| 		<start-class>com.telecominfraproject.wlan.opensync.integration.OpensyncGatewayCloudProcess</start-class> | ||||
| 		<start-class>com.telecominfraproject.wlan.opensync.experiment.OpenSyncGatewayCloudProcess</start-class> | ||||
| 	</properties> | ||||
|  | ||||
| 	<dependencies> | ||||
| @@ -26,6 +26,7 @@ | ||||
| 			<version>${tip-wlan-cloud.release.version}</version> | ||||
| 		</dependency> | ||||
| 		 | ||||
| 		 | ||||
|  | ||||
| 	</dependencies> | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| package com.telecominfraproject.wlan.opensync.integration; | ||||
| package com.telecominfraproject.wlan.opensync.experiment; | ||||
| 
 | ||||
| import org.springframework.boot.SpringApplication; | ||||
| import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | ||||
| import org.springframework.context.ConfigurableApplicationContext; | ||||
| import org.springframework.context.annotation.ComponentScan; | ||||
| 
 | ||||
| @ComponentScan(basePackages = { "com.telecominfraproject.wlan" }) | ||||
| @ComponentScan(basePackages={"com.telecominfraproject.wlan", "ai.connectus"}) | ||||
| @EnableAutoConfiguration | ||||
| public class OpenSyncGatewayCloudProcess { | ||||
| 
 | ||||
| @@ -10,4 +10,3 @@ keystoreType=pkcs12 | ||||
| keystoreProvider=SunJSSE | ||||
|  | ||||
| sslProtocol=TLS | ||||
|  | ||||
|   | ||||
| @@ -16,7 +16,7 @@ app.name=OpenSyncManager | ||||
| #	 System property -Dspring.profiles.active=production | ||||
| #	 or specified on the command line using the switch --spring.profiles.active=dev,hsqldb | ||||
| # | ||||
| # This does not work: spring.profiles.active=${telecominfraproject.core.server.security},${telecominfraproject.core.server.auth},Extra_${app.name} | ||||
| # This does not work: spring.profiles.active=${tip.wlan.core.server.security},${tip.wlan.core.server.auth},Extra_${app.name} | ||||
| # Substitution of ${} in application.properties works in general, but not for spring.profiles.active and not for spring.profiles.include properties   | ||||
| # | ||||
| # *** Do not set spring.profiles.active property in this file, or be prepared for the World of Weird. | ||||
| @@ -74,12 +74,13 @@ app.name=OpenSyncManager | ||||
| #spring.profiles.include=use_ssl,http_digest_auth,customer-credential-datastore-inmemory | ||||
| #spring.profiles.include=no_ssl,no_auth | ||||
| #spring.profiles.include=use_ssl,client_certificate_auth | ||||
| #spring.profiles.include=use_ssl_with_client_cert_and_basic_auth,client_certificate_and_basic_auth | ||||
| spring.profiles.include=use_ssl,http_basic_auth,rest-template-single-user-per-service-digest-auth,use_single_ds,opensync_cloud_config | ||||
| spring.profiles.include=use_ssl,use_webtoken_auth,use_single_ds,RestTemplateConfiguration_X509_client_cert_auth,opensync_cloud_config | ||||
| #use_ssl_with_client_cert_and_basic_auth,client_certificate_and_basic_auth,rest-template-single-user-per-service-digest-auth,use_single_ds,opensync_cloud_config | ||||
|  | ||||
| #used by *-remote client classes when they authenticate their requests | ||||
| tip.wlan.httpClientConfig=classpath:httpClientConfig.json | ||||
|  | ||||
| tip.wlan.introspectTokenApi.host=localhost:9096 | ||||
| tip.wlan.introspectTokenApi.clientToken=token_placeholder | ||||
| #this user/password is used together with http_digest_auth and http_basic_auth spring profiles | ||||
| tip.wlan.serviceUser=user | ||||
| tip.wlan.servicePassword=password | ||||
| @@ -88,14 +89,11 @@ spring.main.show-banner=false | ||||
| server.port=9096 | ||||
|  | ||||
| #this port is used by secondary server connector, it is protected by digest authentication, while primary server.port is protected by client certificate auth  | ||||
| #tip.wlan.secondaryPort=7071 | ||||
| tip.wlan.secondaryPort=7071 | ||||
|  | ||||
| #this server only supports REST requests, CSRF would get in the way | ||||
| tip.wlan.csrf-enabled=false | ||||
|  | ||||
| tip.wlan.emailVerificationTokenExpiryMs=600 | ||||
| tip.wlan.passwordResetTokenExpiryMs=3600 | ||||
|  | ||||
| #properties that configure remote interfaces to communicate with cloud | ||||
| tip.wlan.cloudEventDispatcherBaseUrl=https://localhost:9031 | ||||
| tip.wlan.customerServiceBaseUrl=https://localhost:9091 | ||||
| @@ -103,6 +101,7 @@ tip.wlan.locationServiceBaseUrl=https://localhost:9091 | ||||
| tip.wlan.equipmentServiceBaseUrl=https://localhost:9091 | ||||
| tip.wlan.profileServiceBaseUrl=https://localhost:9091 | ||||
|  | ||||
|  | ||||
| #server.session-timeout= # session timeout in seconds | ||||
| #server.tomcat.max-threads = 0 # number of threads in protocol handler | ||||
|  | ||||
| @@ -117,3 +116,7 @@ spring.jackson.serialization.INDENT_OUTPUT=TRUE | ||||
| #http.mappers.json-sort-keys=false  | ||||
|  | ||||
| #spring.jmx.enabled=true # Expose MBeans from Spring | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,24 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||||
|         <listEntry value="/opensync-gateway-cloud-process/src/main/java/com/telecominfraproject/wlan/opensync/experiment/OpenSyncGatewayCloudProcess.java"/> | ||||
|     </listAttribute> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||||
|         <listEntry value="1"/> | ||||
|     </listAttribute> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-13" path="5" type="4"/>
"/> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="5" projectName="opensync-gateway-cloud-process" type="1"/>
"/> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" path="5" type="4"/>
"/> | ||||
|     </listAttribute> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.telecominfraproject.wlan.opensync.experiment.OpenSyncGatewayCloudProcess"/> | ||||
|     <listAttribute key="org.eclipse.jdt.launching.MODULEPATH"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="opensync-gateway-cloud-process"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="--add-opens java.base/java.lang=ALL-UNNAMED

-Dssl.props=file://${project_loc:opensync-gateway-cloud-process}/src/main/resources/app/certs/ssl.properties
-Dtip.wlan.httpClientConfig=file://${project_loc:opensync-gateway-cloud-process}/src/main/resources/app/certs/httpClientConfig.json

-Djavax.net.ssl.keyStore=${connectus_certs}/client_keystore.jks
-Djavax.net.ssl.keyStorePassword=mypassword
-Djavax.net.ssl.trustStore=${connectus_certs}/truststore.jks
-Djavax.net.ssl.trustStorePassword=mypassword

-Dconnectus.ovsdb.managerAddr=${local_server_address}
-Dconnectus.ovsdb.listenPort=6640
-Dconnectus.ovsdb.redirector.listenPort=6643
-Dconnectus.ovsdb.timeoutSec=30
-Dconnectus.ovsdb.trustStore=${connectus_certs}/truststore.jks
-Dconnectus.ovsdb.keyStore=${connectus_certs}/server.pkcs12

-Dconnectus.ovsdb.configFileName=${project_loc:opensync-ext-cloud}/src/main/resources/config_2_ssids.json

-Dconnectus.mqttBroker.address=${local_server_address}
-Dconnectus.mqttBroker.listenPort=1883
-Dtip.wlan.introspectTokenApi.host=localhost:9096
-Dtip.wlan.introspectTokenApi.clientToken=token_placeholder
-Dtip.wlan.serviceUser=user
-Dtip.wlan.servicePassword=password

-Dspring.main.show-banner=false
-Dserver.port=9096

-Dtip.wlan.secondaryPort=7071

-Dtip.wlan.csrf-enabled=false
-Dspring.profiles.include=use_ssl,use_webtoken_auth,use_single_ds,RestTemplateConfiguration_X509_client_cert_auth,opensync_cloud_config,mqtt_receiver,ovsdb_redirector,ovsdb_manager
-Dtip.wlan.cloudEventDispatcherBaseUrl=https://localhost:9031
-Dtip.wlan.customerServiceBaseUrl=https://localhost:9091
-Dtip.wlan.locationServiceBaseUrl=https://localhost:9091
-Dtip.wlan.equipmentServiceBaseUrl=https://localhost:9091
-Dtip.wlan.profileServiceBaseUrl=https://localhost:9091"/> | ||||
| </launchConfiguration> | ||||
| @@ -1,27 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||||
| <launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication"> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> | ||||
|         <listEntry value="/opensync-gateway-cloud-process/src/main/java/com/telecominfraproject/wlan/opensync/integration/OpenSyncGatewayCloudProcess.java"/> | ||||
|     </listAttribute> | ||||
|     <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> | ||||
|         <listEntry value="1"/> | ||||
|     </listAttribute> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_EXCLUDE_TEST_CODE" value="true"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_CLASSPATH_ONLY_JAR" value="false"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/> | ||||
|     <listAttribute key="org.eclipse.jdt.launching.CLASSPATH"> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="5" projectName="cloud-event-dispatcher-remote" type="1"/>
"/> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="5" projectName="opensync-ext-cloud" type="1"/>
"/> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry path="5" projectName="opensync-gateway-cloud-process" type="1"/>
"/> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" path="5" type="4"/>
"/> | ||||
|     </listAttribute> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/> | ||||
|     <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.telecominfraproject.wlan.opensync.integration.OpenSyncGatewayCloudProcess"/> | ||||
|     <listAttribute key="org.eclipse.jdt.launching.MODULEPATH"> | ||||
|         <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11" path="4" type="4"/>
"/> | ||||
|     </listAttribute> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="opensync-gateway-cloud-process"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/> | ||||
|     <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dssl.props=file://${project_loc:opensync-gateway-cloud-process}/src/main/resources/app/certs/ssl.properties

-Dspring.main.show-banner=false
-Dtip.wlan.httpClientConfig=file://${project_loc:opensync-gateway-cloud-process}/src/main/resources/app/certs/httpClientConfig.json
-Djavax.net.ssl.keyStore=${wlan_cloud_certs}/client_keystore.jks
-Djavax.net.ssl.keyStorePassword=mypassword
-Djavax.net.ssl.trustStore=${wlan_cloud_certs}/truststore.jks
-Djavax.net.ssl.trustStorePassword=mypassword

-Dconnectus.ovsdb.managerAddr=${local_server_address}
-Dconnectus.ovsdb.listenPort=6640
-Dconnectus.ovsdb.redirector.listenPort=6643
-Dconnectus.ovsdb.timeoutSec=30
-Dconnectus.ovsdb.trustStore=${wlan_cloud_certs}/truststore.jks
-Dconnectus.ovsdb.keyStore=${wlan_cloud_certs}/server.pkcs12

-Dconnectus.mqttBroker.address=${local_server_address}
-Dconnectus.mqttBroker.listenPort=1883

-Dspring.profiles.include=ovsdb_redirector,ovsdb_manager,mqtt_receiver
-Dtip.wlan.customerServiceBaseUrl=https://localhost:9091
-Dtip.wlan.locationServiceBaseUrl=https://localhost:9091
-Dtip.wlan.equipmentServiceBaseUrl=https://localhost:9091
-Dtip.wlan.profileServiceBaseUrl=https://localhost:9091
-Dtip.wlan.cloudEventDispatcherBaseUrl=https://localhost:9031"/> | ||||
| </launchConfiguration> | ||||
		Reference in New Issue
	
	Block a user
	 Mike Hansen
					Mike Hansen