Cisco Cisco Collaboration Server (CS) User Guide
array to a ByteArrayInputStream and read the state in from the bytes that were
written previously. You may find it convenient to use the read and write functions on
written previously. You may find it convenient to use the read and write functions on
the CAPIUtils class to help with your serialization.Implement merge, recordToDb,
load, save if desired. If your object will be using the merge or database features of
load, save if desired. If your object will be using the merge or database features of
CSSP SDK, you must override the merge and recordToDb functions with merging and
database recording functionality implemented, respectively. If you are using the load
database recording functionality implemented, respectively. If you are using the load
and save features of CSSP SDK, you may choose to override the load and save
methods to provide specialized loading and saving functionality. Otherwise, load and
methods to provide specialized loading and saving functionality. Otherwise, load and
save just use read and write, respectively.
Integrate application with Collaboration Server
Session Platform SDK
Session Platform SDK
Finally, let's integrate the object model with your application. The goal here is
primarily to create or modify ResourceData objects based on actions in your
primarily to create or modify ResourceData objects based on actions in your
application and send them to your distributed object model. Additionally, you must
respond to events from the server.
respond to events from the server.
Manipulate the object model.
Locate the points in your application where actions will trigger changes in the object
model, and insert the appropriate object model functions there. When these
functions are called, CSSP SDK will update the distributed state on the Collaboration
Server and distribute events to all participants in the session.
functions are called, CSSP SDK will update the distributed state on the Collaboration
Server and distribute events to all participants in the session.
Handle events.
To respond to changes in the distributed state, implement the handleEvents method
of IEventHandler. This method will be called by the CSSP SDK system whenever the
server notifies your client of changes in the distributed state. The events will come
server notifies your client of changes in the distributed state. The events will come
with a type indicating what happened, a sender indicating who initiated the change,
and some ResourceData object for determining what actually changed. For example,
and some ResourceData object for determining what actually changed. For example,
if the change is a revision made to a base object on the server, the accompanying
data is the revision itself. Your application should use this accompanying
ResourceData object to update any local state either by replacing the counterpart,
data is the revision itself. Your application should use this accompanying
ResourceData object to update any local state either by replacing the counterpart,
locally stored ResourceData object, or by extracting information out of the
ResourceData object and applying to application objects. When a ResourceData
ResourceData object and applying to application objects. When a ResourceData
object comes from the server, it contains a unique identification value that can be
used to identify the object.
used to identify the object.
Handle Errors.
Finally, make sure you handle all appropriate errors with your application. The three
types of errors - communication, terminal, and session - may usually be handled in
groups. Communication errors may spawn some notification to the user and perhaps
a connection retry after a short period of time, terminal errors may just indicate that
groups. Communication errors may spawn some notification to the user and perhaps
a connection retry after a short period of time, terminal errors may just indicate that
the collaborative session is over, and session errors may just present a dialog box to
35