C# Class FwRemoteDatabaseConnector.Db4oServerInfo

Singlton object that get created by .NET remoting.
Inheritance: System.MarshalByRefObject
Mostrar archivo Open project: sillsdev/FieldWorks Class Usage Examples

Protected Properties

Property Type Description
m_allServers List
m_runningServers RunningServerInfo>.Dictionary

Private Properties

Property Type Description
EnsureClientIsLocalHost void
GetCmObjectSurrogates byte[]
ListConnectedClients string[]
ListConnectedClients string[]
ListUniqueAddressConnectedToPort string[]
ListUniqueAddressConnectedToPorts string[]
PopulateServerList void
ShutdownAllServers void
StopServer bool

Public Methods

Method Description
AreProjectShared ( ) : bool

Gets a value indicating whether projects are shared. (Should only be called on local machine.)

CreateServerFile ( string projectName ) : void

Create a db4o database file of given name.

Db4oServerInfo ( ) : System

IsLocalHost ( string hostname ) : bool

Determine if a given host is local host or not.

ListRunningServers ( ) : string[]

TODO make this thread safe

ListServers ( ) : string[]

TODO make this thread safe

RefreshServerList ( ) : void

Reload the list of servers.

ShareProjects ( bool enableSharingOfProjects ) : void

Enables/disables sharing of projects from this machine.

StartServer ( string projectName, int &port, Exception &errorinfo ) : bool

Instruct the Service to start a db4o server.

Private Methods

Method Description
EnsureClientIsLocalHost ( ) : void

If the connected client isn't localhost throws SecurityException

GetCmObjectSurrogates ( string projectName ) : byte[]
ListConnectedClients ( ) : string[]
ListConnectedClients ( string projectName ) : string[]
ListUniqueAddressConnectedToPort ( int port ) : string[]
ListUniqueAddressConnectedToPorts ( IEnumerable ports ) : string[]
PopulateServerList ( ) : void
ShutdownAllServers ( ) : void

reset back to initial state. This is only used by unittests.

StopServer ( string projectName ) : bool

Method Details

AreProjectShared() public method

Gets a value indicating whether projects are shared. (Should only be called on local machine.)
If called from a remote machine.
public AreProjectShared ( ) : bool
return bool

CreateServerFile() public method

Create a db4o database file of given name.
public CreateServerFile ( string projectName ) : void
projectName string the desired name.
return void

Db4oServerInfo() public method

public Db4oServerInfo ( ) : System
return System

IsLocalHost() public method

Determine if a given host is local host or not.
public IsLocalHost ( string hostname ) : bool
hostname string host name or ipaddress
return bool

ListRunningServers() public method

TODO make this thread safe
public ListRunningServers ( ) : string[]
return string[]

ListServers() public method

TODO make this thread safe
public ListServers ( ) : string[]
return string[]

RefreshServerList() public method

Reload the list of servers.
public RefreshServerList ( ) : void
return void

ShareProjects() public method

Enables/disables sharing of projects from this machine.
if called from a remote machine or if current /// user does not have permission to write to HKLM
public ShareProjects ( bool enableSharingOfProjects ) : void
enableSharingOfProjects bool if set to true enable sharing of /// projects; otherwise, disable sharing.
return void

StartServer() public method

Instruct the Service to start a db4o server.
public StartServer ( string projectName, int &port, Exception &errorinfo ) : bool
projectName string Name of the project to start
port int If succesfully started then set to the port number of the running /// database
errorinfo System.Exception Will be set to the exception if server failed to start
return bool

Property Details

m_allServers protected_oe property

Stores the filenames of all the db40 Servers
protected List m_allServers
return List

m_runningServers protected_oe property

Maps db4o project name (not filename!) to port it is listening on
protected Dictionary m_runningServers
return RunningServerInfo>.Dictionary