protected internal string[] AuthenticateInternal(AuthenticatedTicket authenticatedTicket) { var ret = new string[4]; ret[0] = authenticatedTicket.Ticket; ret[2] = string.Empty; ret[3] = string.Empty; // Not used if (authenticatedTicket.Authenticated == false) { ret[1] = "nvu"; // Invalid user } else { var waitTime = GetWaitTime(authenticatedTicket); if (waitTime == 0) { ret[1] = GetCompanyFile(authenticatedTicket); } else { ret[1] = "none"; // No work is necessary ret[2] = waitTime.ToString(); } } return(ret); }
/// <summary> /// Gets the options for the SyncManager. /// </summary> /// <param name="authenticatedTicket">The ticket.</param> /// <returns>Options.</returns> protected internal virtual QbXmlResponseOptions GetOptions(AuthenticatedTicket authenticatedTicket) { return(null); }
/// <summary> /// Process the response sent for the first time by the WebConnector. /// </summary> /// <param name="authenticatedTicket">The ticket.</param> /// <param name="response">First Message.</param> protected virtual void ProcessClientInformation(AuthenticatedTicket authenticatedTicket, string response) { }
/// <summary> /// Logs messages to a database. /// </summary> /// <param name="authenticatedTicket">The ticket which has the ticket string. The ticket could also be not authenticated if an error happened.</param> /// <param name="messageType">Type of message.</param> /// <param name="direction">Direction of the message (In the WebService, or Out the WebService).</param> /// <param name="arguments">Other arguments to save.</param> protected internal virtual void LogMessage(AuthenticatedTicket authenticatedTicket, LogMessageType messageType, LogDirection direction, string ticket, params string[] arguments) { }
/// <summary> /// Indicates if there is anything to be done with the current ticket. /// Return 0 if you have work to do immediately. Otherwise return the number of seconds /// when you want the Web Connector to come back. /// </summary> /// <returns>Number of seconds to wait before the Web Connector comes back, or 0 to do some work right now.</returns> protected internal virtual int GetWaitTime(AuthenticatedTicket authenticatedTicket) { return(0); }
/// <summary> /// Called when an exception occurs. /// </summary> /// <param name="ticket">The ticket if found. It might be null if no ticket has been provided or if the code failed when trying to create the authenticated ticket.</param> /// <param name="exception">Exception.</param> protected internal virtual void OnException(AuthenticatedTicket ticket, Exception exception) { }
/// <summary> /// Returns the path where the client company file is located. /// Override this method if you wish to open a different file than the current one open on the client. /// </summary> /// <param name="authenticatedTicket">The ticket.</param> /// <returns>Path where company file is located.</returns> protected internal virtual string GetCompanyFile(AuthenticatedTicket authenticatedTicket) { return(string.Empty); // Use the company that is opened on the client. }
public QbSyncException(AuthenticatedTicket ticket, Exception innerException) : base(null, innerException) { this.Ticket = ticket; }
/// <summary> /// Indicates if there is anything to be done with the current ticket. /// Return 0 if you have work to do immediately. Otherwise return the number of seconds /// when you want the Web Connector to come back. /// </summary> /// <returns>Number of seconds to wait before the Web Connector comes back, or 0 to do some work right now.</returns> protected internal virtual int GetWaitTime(AuthenticatedTicket authenticatedTicket) { return 0; }
/// <summary> /// Gets the options for the SyncManager. /// </summary> /// <param name="authenticatedTicket">The ticket.</param> /// <returns>Options.</returns> protected internal virtual QbXmlResponseOptions GetOptions(AuthenticatedTicket authenticatedTicket) { return null; }
/// <summary> /// Returns the path where the client company file is located. /// Override this method if you wish to open a different file than the current one open on the client. /// </summary> /// <param name="authenticatedTicket">The ticket.</param> /// <returns>Path where company file is located.</returns> protected internal virtual string GetCompanyFile(AuthenticatedTicket authenticatedTicket) { return string.Empty; // Use the company that is opened on the client. }