Exemple #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);
 }
Exemple #2
0
		public DeployService(ServerContent server)
		{
			this.server = server;

			appName = MposFramework.Instance.DeviceController.AppName;
			appVersion = MposFramework.Instance.DeviceController.Version;
		}
Exemple #3
0
 public void StartDecisionMaker(ServerContent server)
 {
     lock (mutex)
     {
         if (dynamicDecisionSystem == null && decisionMakerActive)
         {
             dynamicDecisionSystem = new DynamicDecisionSystem(server);
             dynamicDecisionSystem.Start();
         }
     }
 }
Exemple #4
0
 public void RediscoveryServices(ServerContent server)
 {
     if (server.Type == EndpointType.SECONDARY_SERVER)
     {
         DiscoveryServiceSecondary();
     }
     else if (server.Type == EndpointType.CLOUDLET)
     {
         DiscoveryCloudletMulticast();
     }
 }
Exemple #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);
        }
Exemple #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();
            }
        }
		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();
			}
		}
		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();
		}
		public void RediscoveryServices(ServerContent server)
		{
			if (server.Type == EndpointType.SECONDARY_SERVER)
			{
				DiscoveryServiceSecondary();
			}
			else if (server.Type == EndpointType.CLOUDLET)
			{
				DiscoveryCloudletMulticast();
			}
		}
Exemple #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!");
			}
		}
Exemple #11
0
		public DynamicDecisionSystem(ServerContent server)
		{
			Server = server;
			profileDao = new ProfileNetworkDao();
		}
Exemple #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");
			}
		}
		public void NetworkAnalysis(ServerContent server)
		{
			NetworkAnalysis(server, profileNetwork);
		}
		//on UML = updateDdsEndpoint 
		public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
		{
			dynamicDecisionSystem.Server = server;
		}
		public void StartDecisionMaker(ServerContent server){
			lock (mutex)
			{
				if (dynamicDecisionSystem == null && decisionMakerActive)
				{
					dynamicDecisionSystem = new DynamicDecisionSystem(server);
					dynamicDecisionSystem.Start();
				}
			}
		}
		public void DeployService(ServerContent server)
		{
			new DeployService(server).Start();
		}
		public ProfileNetworkDefault(ServerContent server) : base(server, "ProfileDefault Started on endpoint: " + server.Ip) { }
Exemple #18
0
		public RpcClient()
		{
			profile = new RpcProfile();
			this.server = null;
		}
Exemple #19
0
 //on UML = updateDdsEndpoint
 public void UpdateDynamicDecisionSystemEndpoint(ServerContent server)
 {
     dynamicDecisionSystem.Server = server;
 }
Exemple #20
0
 public void DeployService(ServerContent server)
 {
     new DeployService(server).Start();
 }
Exemple #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;
		}
		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);
		}
Exemple #23
0
		public void SetupServer(ServerContent server)
		{
			this.server = server;
		}
		public ProfileNetworkLight(ServerContent server) : base(server, "ProfileLight Started on endpoint: " + server.Ip) { }