// // openmapi.org - NMapi C# Mapi API - ProxySession.cs // // Copyright 2008 Topalis AG // // Author: Johannes Roith // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // using System; using System.Collections.Generic; namespace NMapi.Server { /// /// Represents session/connection from a client to the proxy. /// Usually an internal "connection" to a selected backend will /// exist as well. ProxySessions are used to keep track of the /// active Sessions and the resources. /// public abstract class ProxySession : MarshalByRefObject, IProxySession { private CommonRpcService rpc; private ObjectStore objectStore; private DateTime created; private string id; private string loginName; /// /// /// public CommonRpcService Rpc { get { return rpc; } } public ObjectStore ObjectStore { get { return objectStore; } } public ProxySession (CommonRpcService decoratedRpc) { this.rpc = decoratedRpc; this.objectStore = new ObjectStore (this); } /// /// The ID of the connection. This is globally unique. /// public string Id { get { return id; } set { id = value; } } /// /// The user name that has been used for the login. /// public string LoginName { get { return loginName; } set { loginName = value; } } /// /// The DateTime at the time the the Session was created. /// public DateTime InitDate { get { return created; } } /// /// The name of the protcol. Usually the form is "openmapi/somename". /// public abstract string Protocol { get; } /// /// A string describing the source of the connection, e.g. /// a hostname or an ip address (or a jabber jid, etc.). /// public abstract string Source { get; } /// /// /// public abstract string ClientName { get; } /// /// /// public abstract bool IsAuthenticated { get; } /// /// /// public abstract bool IsLocal { get; } /// /// True if the proxy should be able to attach a MapiShell /// to the running connection. /// public abstract bool AllowShellAttachment { get; } /// /// True if the connection is considered to be secure. /// public abstract bool IsSecure { get; } /// /// True if the connection is persistent; Tcp would be an /// example of this. HTTP is a counter-example. /// public abstract bool IsPersistent { get; } /// /// True if the session keeps track of a session key itself to /// map calls on the same instance to the same server-side object. /// public abstract bool RequiresSessionKey { get; } /// /// /// public abstract CommonRpcObjRef CreateRefObj (object obj); public abstract IEventDispatcher EventDispatcher { get; } /* /// /// Attaches a new MapiShell to the running connection. /// public IMapiShell AttachShell () { throw new NotImplementedException ("Not yet implemented."); } */ } }