Hi,
if you want to get an Id, the parent class MediaObject has just
that:
https://doc-kurento.readthedocs.io/en/latest/_static/client-javadoc/org/kurento/client/MediaObject.html
But note that an Id is only useful to refer to an already existing
object in the media server. Note that objects have a lot of state
that cannot be just serialized and passed to a different instance of
Kurento and say "hey this is a description of an object that I had
in a different server, just recreate it"; that's not possible.
For example a WebRtcEndpoint will have varying levels of ICE
candidate negotiations, RTP sequence numbering and clock skew
detection, packet loss correction in coordination with the receiver
web browser... all that stuff is simply not possible to replicate
with a serialization of an object.
Apart from that, it depends on what you intend to achieve. Evicting
already running objects from one media server to another is not
practical, so a good idea is to have a fleet of media servers, and
assign new sessions (for example videoconference rooms) to the less
loaded ones, in a round-robin or more advanced algorithm. This is
what we've been working on behind the scenes for the pro tier of
OpenVidu, and it works great to have e.g. 3 media servers and one
central application server that monitors their load and coordinates
them.
A more advanced technique is to create a tree-like of media-servers
which can join an already existing session and act as a relay for
even more participants... this already existed as a (now abandoned)
old project "Kurento-Tree", and is in the roadmap for future
iterations of Openvidu.
Regards,
--
Juan Navarro
Software Development Engineer
Kurento & OpenVidu WebRTC platforms | https://openvidu.io/