Package com.qfs.snl.dtos
Class AuditDto
java.lang.Object
com.qfs.snl.dtos.AuditDto
- All Implemented Interfaces:
IAudit
,IIdentifiable
,Serializable
The audit data transfer object.
- Author:
- ActiveViam
- See Also:
-
Field Summary
Fields inherited from interface com.qfs.snl.persistence.IIdentifiable
NO_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuditDto
Creates a DTO from an existing audit.static boolean
Tests the equality between a IAudit and an object.boolean
The hostname of the computer that created the action.long
getId()
Gets the resource id.getIp()
Return the ip of the computer that created the action.long
Return the timestamp in milliseconds when the action occurred.Return the name of the user.int
hashCode()
static int
Returns the hashcode of the given audit.setHostname
(String hostname) Sets the hostname of the host machine.setId
(long id) Sets this audit unique id.Sets the host ip address.setTimestamp
(long timestamp) Sets the timestamp of this audit entry.setUsername
(String username) Sets the name of the user.toString()
static String
Returns the string representation of the given audit.
-
Constructor Details
-
Method Details
-
create
Creates a DTO from an existing audit.If the audit is null, the equivalent DTO is null as well.
- Parameters:
audit
- audit to convert- Returns:
- the DTO or null
-
getId
public long getId()Description copied from interface:IIdentifiable
Gets the resource id.- Specified by:
getId
in interfaceIIdentifiable
- Returns:
- the id
-
setId
Sets this audit unique id.- Returns:
- this
-
getTimestamp
public long getTimestamp()Description copied from interface:IAudit
Return the timestamp in milliseconds when the action occurred.- Specified by:
getTimestamp
in interfaceIAudit
- Returns:
- the timestamp in milliseconds
-
setTimestamp
Sets the timestamp of this audit entry.- Parameters:
timestamp
- date time in milliseconds- Returns:
- this
-
getUsername
Description copied from interface:IAudit
Return the name of the user.- Specified by:
getUsername
in interfaceIAudit
- Returns:
- the users's name
-
setUsername
Sets the name of the user.- Returns:
- this
-
getIp
Description copied from interface:IAudit
Return the ip of the computer that created the action. -
setIp
Sets the host ip address.- Returns:
- this
-
getHostname
Description copied from interface:IAudit
The hostname of the computer that created the action.- Specified by:
getHostname
in interfaceIAudit
- Returns:
- the hostname
-
setHostname
Sets the hostname of the host machine.- Returns:
- this
-
toString
-
toString
Returns the string representation of the given audit. -
hashCode
public int hashCode() -
hashCode
Returns the hashcode of the given audit. -
equals
-
equals
Tests the equality between a IAudit and an object.Two audit entries are equals if they come from the same user, using the same ip on the same host simultaneously.
This is consistent for an append-only resource.- Parameters:
audit
- the reference auditobj
- the object to test- Returns:
- true for equality
-