You add an AuditableEvent object to the audit trail of an object when you publish the object to the Registry or when you modify the object in any way. See Retrieving the Audit Trail of an Object for details on these events and on how to obtain information about them. Retrieving the Audit Trail of an Object describes the events and how they are created.
Many events are created as a side effect of some other action:
Saving an object to the Registry creates an EVENT_TYPE_CREATED event.
The following actions create an EVENT_TYPE_VERSIONED event:
Changing an object’s name or description
Adding, modifying, or removing a Classification, ExternalIdentifier, or Slot
For an Organization or User, adding, modifying, or removing a PostalAddress or TelephoneNumber
You can retrieve version information for an object. See Retrieving the Version of an Object for details.
Versioning of objects is enabled by default when you publish using the JAXR API. Versioning is disabled by default when you publish using the Web Console.
You can also change the state of objects explicitly. This feature may be useful in a production environment where different versions of objects exist and where you wish to use some form of version control. For example, you can approve a version of an object for general use and deprecate an obsolete version before you remove it. If you change your mind after deprecating an object, you can undeprecate it. As a registered user, you can perform these actions only on objects you own.
You can approve objects by using the LifeCycleManagerImpl.approveObjects method. This feature is implementation-specific.
You can deprecate objects by using the LifeCycleManager.deprecateObjects method.
You can undeprecate objects by using the LifeCycleManager.unDeprecateObjects method.
The LifeCycleManagerImpl.approveObjects method has the following signature:
public BulkResponse approveObjects(java.util.Collection keys) throws JAXRException
The code to deprecate an object typically looks like this:
String id = id_string; Key key = lcm.createKey(id); Collection keys = new ArrayList(); keys.add(key); // deprecate the object lcm.deprecateObjects(keys);
It is possible to restrict access to these actions to specific users, user roles, and user groups, such as registry administrators. See Controlling Access to Objects.
No AuditableEvent is created for actions that do not alter the state of a RegistryObject. For example, queries do not generate an AuditableEvent, and no AuditableEvent is generated for a RegistryObject when it is added to a RegistryPackage or when you create an Association with the object as the source or target.
For examples of approving, deprecating, undeprecating objects, see the examples in <INSTALL>/registry/samples/auditable-events/src: JAXRApproveObject.java, JAXRDeprecateObject.java, and JAXRUndeprecateObject.java. Each example performs an action on an object whose unique identifier you specify, then displays the object’s audit trail so that you can see the effect of the example.
For all examples, the object that you specify must be one that you created.