Esempio n. 1
0
 public ServerContent SelectPriorityServer(bool cloudletPriority)
 {
     if (cloudletPriority)
     {
         ServerContent server = CheckCloudletServer();
         if (server != null)
         {
             return(server);
         }
         server = CheckSecondaryServer();
         if (server != null)
         {
             return(server);
         }
     }
     else
     {
         ServerContent server = CheckSecondaryServer();
         if (server != null)
         {
             return(server);
         }
         server = CheckCloudletServer();
         if (server != null)
         {
             return(server);
         }
     }
     return(null);
 }
Esempio n. 2
0
		public DeployService(ServerContent server)
		{
			this.server = server;

			appName = MposFramework.Instance.DeviceController.AppName;
			appVersion = MposFramework.Instance.DeviceController.Version;
		}
Esempio n. 3
0
 public void StartDecisionMaker(ServerContent server)
 {
     lock (mutex)
     {
         if (dynamicDecisionSystem == null && decisionMakerActive)
         {
             dynamicDecisionSystem = new DynamicDecisionSystem(server);
             dynamicDecisionSystem.Start();
         }
     }
 }
Esempio n. 4
0
 public void RediscoveryServices(ServerContent server)
 {
     if (server.Type == EndpointType.SECONDARY_SERVER)
     {
         DiscoveryServiceSecondary();
     }
     else if (server.Type == EndpointType.CLOUDLET)
     {
         DiscoveryCloudletMulticast();
     }
 }
Esempio n. 5
0
        public ServerContent NewInstance()
        {
            ServerContent instance = new ServerContent(Type);

            instance.BandwidthPort            = BandwidthPort;
            instance.DeployAppPort            = DeployAppPort;
            instance.Ip                       = Ip;
            instance.JitterRetrieveResultPort = JitterRetrieveResultPort;
            instance.JitterTestPort           = JitterTestPort;
            instance.PingTcpPort              = PingTcpPort;
            instance.PingUdpPort              = PingUdpPort;
            instance.RpcServicePort           = RpcServicePort;
            instance.SaveProfilePort          = SaveProfilePort;

            return(instance);
        }
Esempio n. 6
0
        public EndpointController(string secondaryEndpoint, bool decisionMakerActive, bool discoveryCloudlet)
        {
            this.decisionMakerActive = decisionMakerActive;

            SecondaryServer = new ServerContent(EndpointType.SECONDARY_SERVER);
            CloudletServer  = new ServerContent(EndpointType.CLOUDLET);
            remoteAdvantage = false;

            if (secondaryEndpoint != null)
            {
                SecondaryServerIp(secondaryEndpoint);
                DiscoveryServiceSecondary();
            }
            if (discoveryCloudlet)
            {
                DiscoveryCloudletMulticast();
            }
        }
Esempio n. 7
0
		public EndpointController(string secondaryEndpoint, bool decisionMakerActive, bool discoveryCloudlet)
		{
			this.decisionMakerActive = decisionMakerActive;
			
			SecondaryServer = new ServerContent(EndpointType.SECONDARY_SERVER);
			CloudletServer = new ServerContent(EndpointType.CLOUDLET);
			remoteAdvantage = false;

			if (secondaryEndpoint != null)
			{
				SecondaryServerIp(secondaryEndpoint);
				DiscoveryServiceSecondary();
			}
			if (discoveryCloudlet)
			{
				DiscoveryCloudletMulticast();
			}
		}
Esempio n. 8
0
		public void NetworkAnalysis(ServerContent server, ProfileNetwork profile)
		{
			if (server == null)
			{
				throw new NetworkException("The remote service isn't ready for profile network");
			}

			if (profile == ProfileNetwork.LIGHT)
			{
				taskNetwork = new ProfileNetworkLight(server);
			}
			else if (profile == ProfileNetwork.DEFAULT)
			{
				taskNetwork = new ProfileNetworkDefault(server);
			}
			else if (profile == ProfileNetwork.FULL)
			{
				taskNetwork = new ProfileNetworkFull(server);
			}

			EventIntercept();

			taskNetwork.Execute();
		}
Esempio n. 9
0
		public void RediscoveryServices(ServerContent server)
		{
			if (server.Type == EndpointType.SECONDARY_SERVER)
			{
				DiscoveryServiceSecondary();
			}
			else if (server.Type == EndpointType.CLOUDLET)
			{
				DiscoveryCloudletMulticast();
			}
		}
Esempio n. 10
0
		private void ExecutionCompleted(Network network)
		{
			if (network != null)
			{
				network.GeneratingPingTcpStats();
				Debug.WriteLine("[DecisionMaker]:  -> Ping max: " + network.PingMaxTCP + ", med: " + network.PingMedTCP + ", min: " + network.PingMinTCP);

				MposFramework.Instance.EndpointController.RemoteAdvantage = network.PingMedTCP < PingTolerance;

				//List<Network> lists = profileDao.Last15Results();
				//System.Diagnostics.Debug.WriteLine("[DEBUG]: Network Results!!!");
				//foreach (Network net in lists)
				//{
				//	System.Diagnostics.Debug.WriteLine(net);
				//}
			}
			else
			{
				Server = null;
				MposFramework.Instance.EndpointController.RemoteAdvantage = false;
				Debug.WriteLine("[DecisionMaker]: Any problem in ping test!");
			}
		}
Esempio n. 11
0
		public DynamicDecisionSystem(ServerContent server)
		{
			Server = server;
			profileDao = new ProfileNetworkDao();
		}
Esempio n. 12
0
		private object InvokeRemotable(ServerContent server, bool needProfile, MethodInfo method, object[] methodParams)
		{
			rpc.SetupServer(server);
			object returnMethod = rpc.Call(needProfile, manualSerialization, objOriginal, method.Name, methodParams);

			if (needProfile)
			{
				var profile = rpc.Profile;
				//Debug.WriteLine("[DEBUG]: Results -> " + profile.ToString());
				EndpointController.rpcProfile = profile;
			}

			if (returnMethod != null)
			{
				return returnMethod;
			}
			else
			{
				throw new RpcException("Method (failed): " + method.Name + ", return 'null' value from remotable method");
			}
		}
Esempio n. 13
0
		public void NetworkAnalysis(ServerContent server)
		{
			NetworkAnalysis(server, profileNetwork);
		}
Esempio n. 14
0
		//on UML = updateDdsEndpoint 
		public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
		{
			dynamicDecisionSystem.Server = server;
		}
Esempio n. 15
0
		public void StartDecisionMaker(ServerContent server){
			lock (mutex)
			{
				if (dynamicDecisionSystem == null && decisionMakerActive)
				{
					dynamicDecisionSystem = new DynamicDecisionSystem(server);
					dynamicDecisionSystem.Start();
				}
			}
		}
Esempio n. 16
0
		public void DeployService(ServerContent server)
		{
			new DeployService(server).Start();
		}
Esempio n. 17
0
		public ProfileNetworkDefault(ServerContent server) : base(server, "ProfileDefault Started on endpoint: " + server.Ip) { }
Esempio n. 18
0
		public RpcClient()
		{
			profile = new RpcProfile();
			this.server = null;
		}
Esempio n. 19
0
 //on UML = updateDdsEndpoint
 public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
 {
     dynamicDecisionSystem.Server = server;
 }
Esempio n. 20
0
 public void DeployService(ServerContent server)
 {
     new DeployService(server).Start();
 }
Esempio n. 21
0
		public ServerContent NewInstance()
		{
			ServerContent instance = new ServerContent(Type);
			instance.BandwidthPort = BandwidthPort;
			instance.DeployAppPort = DeployAppPort;
			instance.Ip = Ip;
			instance.JitterRetrieveResultPort = JitterRetrieveResultPort;
			instance.JitterTestPort = JitterTestPort;
			instance.PingTcpPort = PingTcpPort;
			instance.PingUdpPort = PingUdpPort;
			instance.RpcServicePort = RpcServicePort;
			instance.SaveProfilePort = SaveProfilePort;

			return instance;
		}
Esempio n. 22
0
		private byte[] data;//used on uploading...

		public ProfileNetworkFull(ServerContent server) : base(server, "ProfileFull Started on endpoint: " + server.Ip) {
			data = new byte[32 * 1024];
			new Random().NextBytes(data);
		}
Esempio n. 23
0
		public void SetupServer(ServerContent server)
		{
			this.server = server;
		}
Esempio n. 24
0
		public ProfileNetworkLight(ServerContent server) : base(server, "ProfileLight Started on endpoint: " + server.Ip) { }