public ServerBuilder(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity, bool isSecured) { try { _httpsAddress = httpsAddress; _controllerHandlers = controllerHandlers; _identity = identity; _isSecured = isSecured; } catch (Exception ex) { Tools.Instance.Logger.LogError(ex.ToString()); } }
/// <summary> /// method used to initialize the Model module /// </summary> /// <param name="handlers"></param> public void IntializeModel(ControllerEventHandlers handlers) { try { _identity = new Identity(SystemConfiguration.Instance.FriendlyName); SystemConfiguration.Instance.MyIdentity = _identity.GenerateIdentity(SystemConfiguration.Instance.MyAddress, SystemConfiguration.Instance.Port, SystemConfiguration.Instance.ServicePath); //_dvContacts = _contactsDAL.LoadContacts(SystemConfiguration.Instance.DataBasePath); _contactsDAL.LoadContacts(SystemConfiguration.Instance.DataBasePath); ContactEndpoint myEndpoint = IdentityResolver.ResolveIdentity(((Identity)Identity).MyIdentity ); _serverController = new ServerController(myEndpoint, ((Identity)Identity).MyIdentity, handlers, _useSecurity); } catch (Exception ex) { Tools.Instance.Logger.LogError(ex.ToString()); } }
public ServerController(ContactEndpoint endpoint, string identity, ControllerEventHandlers handlers, bool isSecured) { try { _isSecured = isSecured; _myEndpoint = endpoint; if (endpoint.Port != 0) { _address = "https://" + endpoint.Address + ":" + (endpoint.Port + 1).ToString() + endpoint.Path; } else { _address = "https://" + endpoint.Address + endpoint.Path; } Builder serverBuilder = new ServerBuilder(_address, handlers, identity, isSecured); Director.Instance.Construct(serverBuilder); _server = (ServiceHost)serverBuilder.GetResult(); } catch (Exception ex) { Tools.Instance.Logger.LogError(ex.ToString()); } }
public MViewerServer(ControllerEventHandlers controllerHandlers, string identity) { _identity = identity; _controllerHandlers = controllerHandlers; }
public override void BuildUri(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity) { try { _httpsAddress = httpsAddress; _httpURI = new Uri(httpsAddress.Replace("https", "http"), UriKind.Absolute); int httpPort = _httpURI.Port - 1; string httpAddress = _httpURI.ToString().Replace(_httpURI.Port.ToString(), httpPort.ToString()); _httpURI = new Uri(httpAddress, UriKind.Absolute); } catch (Exception ex) { Tools.Instance.Logger.LogError(ex.ToString()); } }
public virtual void BuildUri(string httpsAddress, ControllerEventHandlers controllerHandlers, string identity) { }