@Override public String getComment() { return auditLogModelDao.getCallContext().getComments(); }
@Override public String getComments() { return delegate.getComments(); }
public InternalCallContext(final Long tenantRecordId, final CallContext callContext, final DateTime utcNow) { this(tenantRecordId, null, null, null, callContext.getUserToken(), callContext.getUserName(), callContext.getCallOrigin(), callContext.getUserType(), callContext.getReasonCode(), callContext.getComments(), utcNow, utcNow); }
public DefaultCallContext(final CallContext callContext) { super(callContext.getAccountId(), callContext.getTenantId(), callContext.getUserName(), callContext.getCallOrigin(), callContext.getUserType(), callContext.getReasonCode(), callContext.getComments(), callContext.getUserToken()); this.createdDate = callContext.getCreatedDate(); this.updateDate = callContext.getUpdatedDate(); }
/** * Create an internal call callcontext from a call callcontext, and retrieving the account_record_id from another table * * @param objectId the id of the row in the table pointed by object type where to look for account_record_id * @param objectType the object type pointed by this objectId * @param context original call callcontext * @return internal call callcontext from callcontext, with a non null account_record_id (if found) */ public InternalCallContext createInternalCallContext(final UUID objectId, final ObjectType objectType, final CallContext context) { // The callcontext may come from a user API - for security, check we're not doing cross-tenants operations //final Long tenantRecordIdFromObject = retrieveTenantRecordIdFromObject(objectId, objectType); //final Long tenantRecordIdFromContext = getTenantRecordIdSafe(callcontext); //Preconditions.checkState(tenantRecordIdFromContext.equals(tenantRecordIdFromObject), // "tenant of the pointed object (%s) and the callcontext (%s) don't match!", tenantRecordIdFromObject, tenantRecordIdFromContext); final Long tenantRecordId = getTenantRecordIdSafe(context); final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, context); return createInternalCallContext(tenantRecordId, accountRecordId, context.getUserName(), context.getCallOrigin(), context.getUserType(), context.getUserToken(), context.getReasonCode(), context.getComments(), context.getCreatedDate(), context.getUpdatedDate()); }
@Override public String getComment() { return auditLogModelDao.getCallContext().getComments(); }
@Override public String getComments() { return delegate.getComments(); }
public InternalCallContext(final Long tenantRecordId, final CallContext callContext, final DateTime utcNow) { this(tenantRecordId, null, null, null, callContext.getUserToken(), callContext.getUserName(), callContext.getCallOrigin(), callContext.getUserType(), callContext.getReasonCode(), callContext.getComments(), utcNow, utcNow); }
private <T extends EntitySqlDao<M, E>, M extends EntityModelDao<E>, E extends Entity> void checkAuditLog(final ChangeType changeType, @Nullable final CallContext context, final AuditLog auditLog, final UUID entityId, Class<T> sqlDao, boolean useHistory, boolean checkContext) { Assert.assertEquals(auditLog.getChangeType(), changeType); if (checkContext) { Assert.assertEquals(auditLog.getUserName(), context.getUserName()); Assert.assertEquals(auditLog.getComment(), context.getComments()); //Assert.assertEquals(auditLog.getCreatedDate().comparesTo(callcontext.getCreatedDate())); // We can't take userToken oustide of the 'if' because for instance NextBillingDate invoice will not have it. Assert.assertEquals(auditLog.getUserToken(), context.getUserToken().toString()); } final M entityModel = extractEntityModelFromEntityWithTargetRecordId(entityId, auditLog.getId(), sqlDao, context, useHistory); Assert.assertEquals(entityModel.getId(), entityId); }
public DefaultCallContext(final CallContext callContext) { super(callContext.getAccountId(), callContext.getTenantId(), callContext.getUserName(), callContext.getCallOrigin(), callContext.getUserType(), callContext.getReasonCode(), callContext.getComments(), callContext.getUserToken()); this.createdDate = callContext.getCreatedDate(); this.updateDate = callContext.getUpdatedDate(); }
public DefaultInvoiceContext(final LocalDate targetDate, final Invoice invoice, final List<Invoice> existingInvoices, final boolean isDryRun, final boolean isRescheduled, final CallContext context) { super(context.getAccountId(), context.getTenantId(), context.getUserName(), context.getCallOrigin(), context.getUserType(), context.getReasonCode(), context.getComments(), context.getUserToken(), context.getCreatedDate(), context.getUpdatedDate()); this.targetDate = targetDate; this.invoice = invoice; this.existingInvoices = existingInvoices; this.isDryRun = isDryRun; this.isRescheduled = isRescheduled; }
/** * Create an internal call callcontext from a call callcontext, and retrieving the account_record_id from another table * * @param objectId the id of the row in the table pointed by object type where to look for account_record_id * @param objectType the object type pointed by this objectId * @param context original call callcontext * @return internal call callcontext from callcontext, with a non null account_record_id (if found) */ public InternalCallContext createInternalCallContext(final UUID objectId, final ObjectType objectType, final CallContext context) { // The callcontext may come from a user API - for security, check we're not doing cross-tenants operations //final Long tenantRecordIdFromObject = retrieveTenantRecordIdFromObject(objectId, objectType); //final Long tenantRecordIdFromContext = getTenantRecordIdSafe(callcontext); //Preconditions.checkState(tenantRecordIdFromContext.equals(tenantRecordIdFromObject), // "tenant of the pointed object (%s) and the callcontext (%s) don't match!", tenantRecordIdFromObject, tenantRecordIdFromContext); final Long tenantRecordId = getTenantRecordIdSafe(context); final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, context); return createInternalCallContext(tenantRecordId, accountRecordId, context.getUserName(), context.getCallOrigin(), context.getUserType(), context.getUserToken(), context.getReasonCode(), context.getComments(), context.getCreatedDate(), context.getUpdatedDate()); }