public static AuditEntryBean contractCreatedToApi(ContractBean bean, ISecurityContext securityContext) {
        AuditEntryBean entry = newEntry(bean.getApi().getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
        // Ensure the order of contract-created events are deterministic by adding 1 ms to this one
        entry.setCreatedOn(new Date(entry.getCreatedOn().getTime() + 1));
        entry.setWhat(AuditEntryType.CreateContract);
        entry.setEntityId(bean.getApi().getApi().getId());
        entry.setEntityVersion(bean.getApi().getVersion());
        ContractData data = new ContractData(bean);
        entry.setData(toJSON(data));
        return entry;
    }
public static AuditEntryBean contractCreatedToApi ( ContractBean bean , ISecurityContext securityContext ) { AuditEntryBean entry = newEntry ( bean . getApi ( ) . getApi ( ) . getOrganization ( ) . getId ( ) , AuditEntityType . Api , securityContext ) ; entry . setCreatedOn ( new Date ( entry . getCreatedOn ( ) . getTime ( ) + 1 ) ) ; entry . setWhat ( AuditEntryType . CreateContract ) ; entry . setEntityId ( bean . getApi ( ) . getApi ( ) . getId ( ) ) ; entry . setEntityVersion ( bean . getApi ( ) . getVersion ( ) ) ; ContractData data = new ContractData ( bean ) ; entry . setData ( toJSON ( data ) ) ; return entry ; }
Creates an audit entry for the 'contract created' event.
@param bean the bean
@param securityContext the security context
@return the audit entry