Skip to main content

JOD Object's ID

The Object ID is the unique code that identify a JOSP Object in a JOSP EcoSystem.

This code is generated on first object's startup and it's updated only when a user change his owner.

Object's id generation triggers also a re-generation of object's permission.
That provide a completely refreshed JOSP Object to the new object's owner. And, at the sametime, guarantee to the old object's owner that the data collected by object (until the owner switch) can't be accessible to the new owner.

The object's id is composed by 3 sequences of 5 random chars each:

XXXXX-XXXXX-XXXXX

JOD Agent store his object's id in the main config file configs/jod.yml with the property jod.obj.id_cloud.

info

If you are using the JOD Agent inside a JOD Distribution you can execute the state.sh|ps1 JOD Dist Cmds to print corresponding object's id.


Uniqueness

To guarantee that each JOSP Object have an unique id, the code generation is demanded to the John Cloud Platform.

Each time a JOD Agent starts, check the jod.obj.id_cloud property in the configs/jod.yml file. If it's empty or not set, then the JOD Agent ask the JCP APIs for a new unique code.

Generated code will always starts with the jod.obj.id_hw property from configs/jod.yml file. Because the 'id_hw' property, never change, that allow JOSP Services identify the object across object's id switches.

If the JCP is not available at JOD Agent startup, for example because there is NO internet connection, the JOD Agent use a temporary object's id with the format XXXXX-00000-00000 where the 'XXXXX' correspond to the jod.obj.id_hw property from configs/jod.yml file. Then, when the internet connection become available, the JOD Agent update his temporary object's id with a new one generated by the JCP.


Usage by JOSP Services

A JOSP Service use an object's id mainly to interact with that object: to get object's info, structure, statuses or permissions and to execute object's actions.
Developers can store object's ids and use them later to refer at same objects.

When a user change object's owner, object's become offline for user's JOSP Services but still available. So, user can still access to old JOSP Object's and get his events and statues history, but he can't execute action or receive statuses updates. On the other side, on new owner's JOSP Services, a new JOSP Object become available and online. So, new owner can start interacting with it.

Thanks to the object's id nature (first 5 chars sequence is always equals to the jod.obj.id_hw property), a JOSP Service can identify the same object also after update his id.