/// <summary>
		/// Dispatch object request in specified authentication context.
		/// </summary>			
        /// <param name="Session">The client context.</param>
        /// <param name="JSONReader">Reader for data object.</param>
        /// <returns>The response object returned by the corresponding dispatch.</returns>
		public override Goedel.Protocol.JSONObject Dispatch(JPCSession  Session,  
								Goedel.Protocol.JSONReader JSONReader) {

			JSONReader.StartObject ();
			string token = JSONReader.ReadToken ();
			JSONObject Response = null;

			switch (token) {
				case "Hello" : {
					var Request = HelloRequest.FromTagged (JSONReader);
					Response = Service.Hello (Request);
					break;
					}
				case "Set" : {
					var Request = SetRequest.FromTagged (JSONReader);
					Response = Service.Set (Request);
					break;
					}
				case "Get" : {
					var Request = GetRequest.FromTagged (JSONReader);
					Response = Service.Get (Request);
					break;
					}
				case "Delete" : {
					var Request = DeleteRequest.FromTagged (JSONReader);
					Response = Service.Delete (Request);
					break;
					}
				case "Select" : {
					var Request = SearchRequest.FromTagged (JSONReader);
					Response = Service.Select (Request);
					break;
					}
				case "Join" : {
					var Request = JoinRequest.FromTagged (JSONReader);
					Response = Service.Join (Request);
					break;
					}
				case "Leave" : {
					var Request = LeaveRequest.FromTagged (JSONReader);
					Response = Service.Leave (Request);
					break;
					}
				default : {
					throw new Goedel.Protocol.UnknownOperation ();
					}
				}
			JSONReader.EndObject ();
			return Response;
			}
Ejemplo n.º 2
0
		/// <summary>
		/// Dispatch object request in specified authentication context.
		/// </summary>			
        /// <param name="Session">The client context.</param>
        /// <param name="JSONReader">Reader for data object.</param>
        /// <returns>The response object returned by the corresponding dispatch.</returns>
		public override Goedel.Protocol.JSONObject Dispatch(JPCSession  Session,  
								Goedel.Protocol.JSONReader JSONReader) {

			JSONReader.StartObject ();
			string token = JSONReader.ReadToken ();
			JSONObject Response = null;

			switch (token) {
				case "Hello" : {
					var Request = HelloRequest.FromTagged (JSONReader);
					Response = Service.Hello (Request);
					break;
					}
				case "ValidateAccount" : {
					var Request = ValidateRequest.FromTagged (JSONReader);
					Response = Service.ValidateAccount (Request);
					break;
					}
				case "CreateAccount" : {
					var Request = CreateRequest.FromTagged (JSONReader);
					Response = Service.CreateAccount (Request);
					break;
					}
				case "Get" : {
					var Request = GetRequest.FromTagged (JSONReader);
					Response = Service.Get (Request);
					break;
					}
				case "Publish" : {
					var Request = PublishRequest.FromTagged (JSONReader);
					Response = Service.Publish (Request);
					break;
					}
				case "Status" : {
					var Request = StatusRequest.FromTagged (JSONReader);
					Response = Service.Status (Request);
					break;
					}
				case "ConnectStart" : {
					var Request = ConnectStartRequest.FromTagged (JSONReader);
					Response = Service.ConnectStart (Request);
					break;
					}
				case "ConnectStatus" : {
					var Request = ConnectStatusRequest.FromTagged (JSONReader);
					Response = Service.ConnectStatus (Request);
					break;
					}
				case "ConnectPending" : {
					var Request = ConnectPendingRequest.FromTagged (JSONReader);
					Response = Service.ConnectPending (Request);
					break;
					}
				case "ConnectComplete" : {
					var Request = ConnectCompleteRequest.FromTagged (JSONReader);
					Response = Service.ConnectComplete (Request);
					break;
					}
				case "Transfer" : {
					var Request = TransferRequest.FromTagged (JSONReader);
					Response = Service.Transfer (Request);
					break;
					}
				default : {
					throw new Goedel.Protocol.UnknownOperation ();
					}
				}
			JSONReader.EndObject ();
			return Response;
			}