C# Class Zetbox.Server.ZetboxService

Implements the main service interface.
Inheritance: IZetboxService, IDisposable
Show file Open project: daszat/zetbox

Public Methods

Method Description
Dispose ( ) : void
FetchRelation ( System.Guid version, System.Guid relId, int serializableRole, int parentObjID ) : byte[]

Fetches a list of CollectionEntry objects of the Relation relId which are owned by the object with the ID parentObjID in the role serializableRole.

GetBlobStream ( System.Guid version, int ID ) : Stream

Gets the content stream of the given Document instance ID

GetObjects ( System.Guid version, SerializableExpression query ) : byte[]

Returns a list of objects from the datastore, as requested by the query.

InvokeServerMethod ( System.Guid version, SerializableType type, int ID, string method, SerializableType parameterTypes, byte parameterArray, byte changedObjectsArray, ObjectNotificationRequest notificationRequests, byte &retChangedObjects ) : byte[]
SetBlobStream ( BlobMessage blob ) : BlobResponse

Sets the content stream of the given Document instance ID

SetObjects ( System.Guid version, byte msgArray, ObjectNotificationRequest notificationRequests ) : byte[]

Puts a number of changed objects into the database. The resultant objects are sent back to the client.

ZetboxService ( IServerObjectHandlerFactory sohFactory, Func ctxFactory, InterfaceType iftFactory, IPerfCounter perfCounter, ZetboxStreamReader readerFactory, ZetboxStreamWriter writerFactory ) : System

Private Methods

Method Description
DebugLogIdentity ( ) : void
GetListOf ( System.Guid version, SerializableType type, int ID, string property ) : byte[]
ReadObjects ( Stream msg, IZetboxContext ctx ) : List
SendAuxiliaryObjects ( ZetboxStreamWriter sw, HashSet auxObjects, HashSet sentObjects, bool eagerLoadLists ) : void

Sends a list of auxiliary objects to the specified ZetboxStreamWriter while avoiding to send objects twice.

SendObjects ( IEnumerable lst, bool eagerLoadLists ) : MemoryStream

Serializes a list of objects onto a MemoryStream.

Method Details

Dispose() public method

public Dispose ( ) : void
return void

FetchRelation() public method

Fetches a list of CollectionEntry objects of the Relation relId which are owned by the object with the ID parentObjID in the role serializableRole.
public FetchRelation ( System.Guid version, System.Guid relId, int serializableRole, int parentObjID ) : byte[]
version System.Guid Current version of generated Zetbox.Objects assembly
relId System.Guid the requested Relation
serializableRole int the parent role (1 == A, 2 == B)
parentObjID int the ID of the parent object
return byte[]

GetBlobStream() public method

Gets the content stream of the given Document instance ID
public GetBlobStream ( System.Guid version, int ID ) : Stream
version System.Guid Current version of generated Zetbox.Objects assembly
ID int ID of an valid Document instance
return Stream

GetObjects() public method

Returns a list of objects from the datastore, as requested by the query.
public GetObjects ( System.Guid version, SerializableExpression query ) : byte[]
version System.Guid Current version of generated Zetbox.Objects assembly
query SerializableExpression A full LINQ query returning zero, one or more objects (FirstOrDefault, Single, Where, Skip, Take, etc.)
return byte[]

InvokeServerMethod() public method

public InvokeServerMethod ( System.Guid version, SerializableType type, int ID, string method, SerializableType parameterTypes, byte parameterArray, byte changedObjectsArray, ObjectNotificationRequest notificationRequests, byte &retChangedObjects ) : byte[]
version System.Guid
type Zetbox.API.SerializableType
ID int
method string
parameterTypes Zetbox.API.SerializableType
parameterArray byte
changedObjectsArray byte
notificationRequests Zetbox.API.ObjectNotificationRequest
retChangedObjects byte
return byte[]

SetBlobStream() public method

Sets the content stream of the given Document instance ID
public SetBlobStream ( BlobMessage blob ) : BlobResponse
blob Zetbox.API.BlobMessage Information about the given blob
return Zetbox.API.BlobResponse

SetObjects() public method

Puts a number of changed objects into the database. The resultant objects are sent back to the client.
public SetObjects ( System.Guid version, byte msgArray, ObjectNotificationRequest notificationRequests ) : byte[]
version System.Guid Current version of generated Zetbox.Objects assembly
msgArray byte a streamable list of s
notificationRequests Zetbox.API.ObjectNotificationRequest A list of objects the client wants to be notified about, if they change.
return byte[]

ZetboxService() public method

public ZetboxService ( IServerObjectHandlerFactory sohFactory, Func ctxFactory, InterfaceType iftFactory, IPerfCounter perfCounter, ZetboxStreamReader readerFactory, ZetboxStreamWriter writerFactory ) : System
sohFactory IServerObjectHandlerFactory
ctxFactory Func
iftFactory Zetbox.API.InterfaceType
perfCounter IPerfCounter
readerFactory ZetboxStreamReader
writerFactory ZetboxStreamWriter
return System