= EntityChanges
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

As used by xref:refguide:applib:index/services/publishing/spi/EntityChangesSubscriber.adoc[EntityChangesSubscriber] , provides metrics on the "footprint" of an interaction, in other words the number of objects accessed or changed.

The numbers of objects loaded, created, updated or deleted and the number of object properties modified (in other words the "size" or "weight" of the transaction).

== API

[source,java]
.EntityChanges.java
----
interface EntityChanges {
  UUID getInteractionId()     // <.>
  int getSequence()     // <.>
  String getUsername()     // <.>
  Timestamp getCompletedAt()     // <.>
  int getNumberLoaded()     // <.>
  int getNumberCreated()     // <.>
  int getNumberUpdated()     // <.>
  int getNumberDeleted()     // <.>
  int getNumberPropertiesModified()     // <.>
  ChangesDto getDto()     // <.>
}
----

<.> xref:#getInteractionId_[getInteractionId()]
+
--
inherited from xref:refguide:applib:index/mixins/system/HasInteractionIdAndSequence.adoc[HasInteractionIdAndSequence] and transitively from xref:refguide:applib:index/mixins/system/HasInteractionId.adoc[HasInteractionId] , correlates back to the unique identifier of the _org.apache.isis.applib.services.iactn.Interaction_ in which these objects were changed.
--
<.> xref:#getSequence_[getSequence()]
+
--
inherited from xref:refguide:applib:index/mixins/system/HasInteractionIdAndSequence.adoc[HasInteractionIdAndSequence] , with _#getInteractionId()_ it identifies the transaction within the _org.apache.isis.applib.services.iactn.Interaction_ in which these objects were changed.
--
<.> xref:#getUsername_[getUsername()]
+
--
Inherited from xref:refguide:applib:index/mixins/security/HasUsername.adoc[HasUsername] , is the user that initiated the transaction causing these objects to change.
--
<.> xref:#getCompletedAt_[getCompletedAt()]
+
--
Time that the interaction execution completed
--
<.> xref:#getNumberLoaded_[getNumberLoaded()]
+
--
Number of domain objects loaded in this interaction
--
<.> xref:#getNumberCreated_[getNumberCreated()]
+
--
Number of domain objects created in this interaction
--
<.> xref:#getNumberUpdated_[getNumberUpdated()]
+
--
Number of domain objects updated in this interaction
--
<.> xref:#getNumberDeleted_[getNumberDeleted()]
+
--
Number of domain objects deleted in this interaction
--
<.> xref:#getNumberPropertiesModified_[getNumberPropertiesModified()]
+
--
Number of domain objects properties that were changed in this interaction
--
<.> xref:#getDto_[getDto()]
+
--
Same details, but as an an instance of _ChangesDto_ .
--

== Members

[#getInteractionId_]
=== getInteractionId()

inherited from xref:refguide:applib:index/mixins/system/HasInteractionIdAndSequence.adoc[HasInteractionIdAndSequence] and transitively from xref:refguide:applib:index/mixins/system/HasInteractionId.adoc[HasInteractionId] , correlates back to the unique identifier of the _org.apache.isis.applib.services.iactn.Interaction_ in which these objects were changed.

[#getSequence_]
=== getSequence()

inherited from xref:refguide:applib:index/mixins/system/HasInteractionIdAndSequence.adoc[HasInteractionIdAndSequence] , with _#getInteractionId()_ it identifies the transaction within the _org.apache.isis.applib.services.iactn.Interaction_ in which these objects were changed.

[#getUsername_]
=== getUsername()

Inherited from xref:refguide:applib:index/mixins/security/HasUsername.adoc[HasUsername] , is the user that initiated the transaction causing these objects to change.

[#getCompletedAt_]
=== getCompletedAt()

Time that the interaction execution completed

[#getNumberLoaded_]
=== getNumberLoaded()

Number of domain objects loaded in this interaction

[#getNumberCreated_]
=== getNumberCreated()

Number of domain objects created in this interaction

[#getNumberUpdated_]
=== getNumberUpdated()

Number of domain objects updated in this interaction

[#getNumberDeleted_]
=== getNumberDeleted()

Number of domain objects deleted in this interaction

[#getNumberPropertiesModified_]
=== getNumberPropertiesModified()

Number of domain objects properties that were changed in this interaction

[#getDto_]
=== getDto()

Same details, but as an an instance of _ChangesDto_ .

This can be converted into a serializable XML representation using the _org.apache.isis.applib.util.schema.ChangesDtoUtils_ utility class.
