C# Class FwRemoteDatabaseConnector.Db4oServerInfo

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

Protected Properties

Свойство Type Description
m_allServers List
m_runningServers RunningServerInfo>.Dictionary

Private Properties

Свойство Type Description
EnsureClientIsLocalHost void
GetCmObjectSurrogates byte[]
ListConnectedClients string[]
ListConnectedClients string[]
ListUniqueAddressConnectedToPort string[]
ListUniqueAddressConnectedToPorts string[]
PopulateServerList void
ShutdownAllServers void
StopServer bool

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

CreateServerFile() public méthode

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

Db4oServerInfo() public méthode

public Db4oServerInfo ( ) : System
Résultat System

IsLocalHost() public méthode

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

ListRunningServers() public méthode

TODO make this thread safe
public ListRunningServers ( ) : string[]
Résultat string[]

ListServers() public méthode

TODO make this thread safe
public ListServers ( ) : string[]
Résultat string[]

RefreshServerList() public méthode

Reload the list of servers.
public RefreshServerList ( ) : void
Résultat void

ShareProjects() public méthode

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.
Résultat void

StartServer() public méthode

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
Résultat bool

Property Details

m_allServers protected_oe property

Stores the filenames of all the db40 Servers
protected List m_allServers
Résultat List

m_runningServers protected_oe property

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