C# Class LogStreamer.Program

Datei anzeigen Open project: StarcounterPrefabs/LogStreamer

Public Methods

Method Description
ConfigToJson ( ILogStreamerConfiguration cfg ) : string
Connect ( ) : void
Disconnect ( ) : void
GetConfigDirectory ( ) : string
GetDefaultFilePath ( ) : string
StrFormatByteSize ( long filesize ) : string

Converts a numeric value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, or gigabytes, depending on the size.

Private Methods

Method Description
BuildWhitelistResponse ( int>.Dictionary whitelist ) : Response
GetWhitelistViewUrl ( int>.Dictionary whitelist, string accessUri ) : string
HandleGETConfig ( ) : Response
HandleGETDefaultConfigFile ( ) : Response
HandleGETDownstreamWhitelist ( ) : Response
HandleGETLog ( ) : Response
HandleGETRoot ( ) : Response
HandleGETRootParam ( string param ) : Response
HandleGETSampleConfigFile ( ) : Response
HandleGETUpstreamWhitelist ( ) : Response
Main ( string args ) : void

The LogStreamer sample application allows simple transaction log streaming between Starcounter databases. It accepts three kinds of command line parameters. An URI or file path ending with ".logstreamer.xml" is taken to be the source of a LogStreamer configuration to use. If it is a local file path, the file will be created if necessary. Any other string not starting with '@' will be taken as the upstream URI to use. Either or both of these parameters may be omitted. Parameters starting with '@' are documented in code, but should not be needed for general use. Usually when starting LogStreamer, you'll want to launch it into a specific database. If you prefer, you can do that from the command line using something like this: star.exe -d=DBNAME LogStreamer.exe

SessionStatus ( System.StringBuilder sb, bool isUpstream, LogStreamerSession sess ) : void
StrFormatByteSize ( long fileSize, [ buffer, int bufferSize ) : long
Usage ( ) : void
WhitelistToJson ( System.StringBuilder sb, int>.Dictionary dict ) : void
WriteNonzero ( System.StringBuilder sb, string label, int n ) : bool
WriteNonzero ( System.StringBuilder sb, string label, ulong n ) : bool

Method Details

ConfigToJson() public static method

public static ConfigToJson ( ILogStreamerConfiguration cfg ) : string
cfg ILogStreamerConfiguration
return string

Connect() public static method

public static Connect ( ) : void
return void

Disconnect() public static method

public static Disconnect ( ) : void
return void

GetConfigDirectory() public static method

public static GetConfigDirectory ( ) : string
return string

GetDefaultFilePath() public static method

public static GetDefaultFilePath ( ) : string
return string

StrFormatByteSize() public static method

Converts a numeric value into a string that represents the number expressed as a size value in bytes, kilobytes, megabytes, or gigabytes, depending on the size.
public static StrFormatByteSize ( long filesize ) : string
filesize long
return string