use of io.apiman.manager.api.beans.audit.data.ContractData in project apiman by apiman.
the class AuditUtils method contractCreatedFromClient.
/**
* Creates an audit entry for the 'contract created' event.
* @param bean the bean
* @param securityContext the security context
* @return the audit entry
*/
public static AuditEntryBean contractCreatedFromClient(ContractBean bean, ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getClient().getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setWhat(AuditEntryType.CreateContract);
entry.setEntityId(bean.getClient().getClient().getId());
entry.setEntityVersion(bean.getClient().getVersion());
ContractData data = new ContractData(bean);
entry.setData(toJSON(data));
return entry;
}
use of io.apiman.manager.api.beans.audit.data.ContractData in project apiman by apiman.
the class AuditUtils method contractBrokenFromClient.
/**
* Creates an audit entry for the 'contract broken' event.
* @param bean the bean
* @param securityContext the security context
* @return the audit entry
*/
public static AuditEntryBean contractBrokenFromClient(ContractBean bean, ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getClient().getClient().getOrganization().getId(), AuditEntityType.Client, securityContext);
entry.setWhat(AuditEntryType.BreakContract);
entry.setEntityId(bean.getClient().getClient().getId());
entry.setEntityVersion(bean.getClient().getVersion());
ContractData data = new ContractData(bean);
entry.setData(toJSON(data));
return entry;
}
use of io.apiman.manager.api.beans.audit.data.ContractData in project apiman by apiman.
the class AuditUtils method contractBrokenToApi.
/**
* Creates an audit entry for the 'contract broken' event.
* @param bean the bean
* @param securityContext the security context
* @return the audit entry
*/
public static AuditEntryBean contractBrokenToApi(ContractBean bean, ISecurityContext securityContext) {
AuditEntryBean entry = newEntry(bean.getApi().getApi().getOrganization().getId(), AuditEntityType.Api, securityContext);
entry.setWhat(AuditEntryType.BreakContract);
entry.setEntityId(bean.getApi().getApi().getId());
entry.setEntityVersion(bean.getApi().getVersion());
ContractData data = new ContractData(bean);
entry.setData(toJSON(data));
return entry;
}
use of io.apiman.manager.api.beans.audit.data.ContractData in project apiman by apiman.
the class AuditUtils method contractCreatedToApi.
/**
* Creates an audit entry for the 'contract created' event.
* @param bean the bean
* @param securityContext the security context
* @return the audit entry
*/
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;
}
Aggregations