Exemplo n.º 1
0
	private void StartAgent(String[] args)
	{
		this.Initialize();
        NameValueCollection parameters = AdkExamples.parseCL(this, args);
		
        string zoneId = parameters["zone"];
		string url = parameters["url"];
		
		if( zoneId == null || url == null ) {
			Console.WriteLine("The /zone and /url parameters are required");
			Environment.Exit(0);
		}

		// only for SIF_Register and versions in SIF_Request messages...
    // this.Properties.OverrideSifVersions = "2.3,2.*";
		// only for SIF_Message Version attribute in SIF_Request messages
    // this.Properties.OverrideSifMessageVersionForSifRequests = "2.3";
		
		// 1) Get an instance of the zone to connect to
		IZone zone = ZoneFactory.GetInstance(zoneId, url);
		zone.SetQueryResults( this );
		
		// 2) Connect to zones
		zone.Connect( AdkExamples.Reg ? ProvisioningFlags.Register : ProvisioningFlags.None );
		
		
	}
Exemplo n.º 2
0
    /**
     * This method shows how to connect to zones and hook up a basic message handler
     * @param args
     */
    private void startAgent(string[] args)
    {
        this.Initialize();
        NameValueCollection parameters = AdkExamples.parseCL(this, args);

        string zoneId = parameters["zone"];
        string url    = parameters["url"];

        if (zoneId == null || url == null)
        {
            Console.WriteLine("The /zone and /url parameters are required");
            Console.Beep();
            throw new ArgumentException("The /zone and /url parameters are required");
        }

        // 1) Get an instance of the zone to connect to
        IZone zone = ZoneFactory.GetInstance(zoneId, url);

        // 2) Create an instance of the the LearnerPersonalHandler class
        // This class is responsible for dealing with events and responses
        // received that contain LearnerPersonal data objects
        LearnerPersonalHandler sdh = new LearnerPersonalHandler();

        // The LearnerPersonalHandler is allowed to provision itself with the zone
        sdh.provision(zone);

        // Connect
        zone.Connect(AdkExamples.Reg ? ProvisioningFlags.Register : ProvisioningFlags.None);

        // The LearnerPersonalHandler class has a sync() method, which it uses to
        // request data from the SIF zone
        sdh.sync(zone);
    }
Exemplo n.º 3
0
    /**
     * This method shows how to connect to zones and hook up a basic message handler
     * @param args
     */

    private void startAgent(string[] args)
    {
        Initialize();
        NameValueCollection parameters = AdkExamples.parseCL(this, args);

        string zoneId = parameters["zone"];
        string url    = parameters["url"];

        if (zoneId == null || url == null)
        {
            Console.WriteLine("The /zone and /url parameters are required");
            Console.Beep();
            throw new ArgumentException("The /zone and /url parameters are required");
        }


        // 1) Get an instance of the zone to connect to
        IZone zone = ZoneFactory.GetInstance(zoneId, url);

        // 2) Create an instance of the the LearnerPersonalProvider class
        // This class is responsible for publishing LearnerPersonal
        LearnerPersonalProvider lpp = new LearnerPersonalProvider();

        // The LearnerPersonalProvider is allowed to provision itself with the zone
        lpp.provision(zone);

        // 2) Create an instance of the the LearnerPersonalProvider class
        // This class is responsible for publishing LearnerPersonal
        WorkforcePersonalProvider wpp = new WorkforcePersonalProvider();

        // The LearnerPersonalProvider is allowed to provision itself with the zone

        wpp.provision(zone);

        // Connect
        zone.Connect(AdkExamples.Reg ? ProvisioningFlags.Register : ProvisioningFlags.None);

        // The StudentPersonalProvider will periodically send changes to the StudentPersonal
        // objects
        if (parameters["events"] != null)
        {
            lpp.startEventProcessing(zone);
        }
    }
Exemplo n.º 4
0
        private void StartAgent(String[] args)
        {
            this.Initialize();
            NameValueCollection parameters = AdkExamples.parseCL(this, args);

            string zoneId = parameters["zone"];
            string url    = parameters["url"];

            if (zoneId == null || url == null)
            {
                Console.WriteLine("The /zone and /url parameters are required");
                Environment.Exit(0);
            }


            // 1) Get an instance of the zone to connect to
            IZone zone = ZoneFactory.GetInstance(zoneId, url);

            zone.SetQueryResults(this);

            // 2) Connect to zones
            zone.Connect(AdkExamples.Reg ? ProvisioningFlags.Register : ProvisioningFlags.None);
        }
Exemplo n.º 5
0
        /**
         * This method shows how to connect to zones and hook up a basic message handler
         * @param args
         */
        private void StartAgent(String[] args)
        {
            this.Initialize();
            NameValueCollection parameters = AdkExamples.parseCL(this, args);
            //    /url http://127.0.0.1:7080/test /zone test /pull /sourceID SimpleProvider
            String zoneId = parameters["zone"];
            String url    = parameters["url"];

            if (zoneId == null || url == null)
            {
                Console.WriteLine("The /zone and /url parameters are required");
                Environment.Exit(0);
            }


            // 1) Get an instance of the zone to connect to
            IZone zone = ZoneFactory.GetInstance(zoneId, url);

            // 2) Create an instance of the the StudentPersonalProvider class
            // This class is responsible for publishing LearnerPersonal
            StudentPersonalProvider lpp = new StudentPersonalProvider();

            // The StudentPersonalProvider is allowed to provision itself with the zone
            lpp.Provision(zone);


            // 3) Connect to zones

            zone.Connect(AdkExamples.Reg ? ProvisioningFlags.Register : ProvisioningFlags.None);

            // The StudentPersonalProvider will periodically send changes to the StudentPersonal
            // objects
            if (parameters["events"] != null)
            {
                lpp.StartEventProcessing(zone);
            }
        }