private Long getAccountRecordIdSafe(final UUID objectId, final ObjectType objectType, final Long tenantRecordId) throws ObjectDoesNotExist { if (objectBelongsToTheRightTenant(objectId, objectType, tenantRecordId)) { return getAccountRecordIdUnsafe(objectId, objectType); } else { throw new IllegalStateException(String.format("Object id=%s type=%s doesn't belong to tenant recordId=%s", objectId, objectType, tenantRecordId)); } }
private Long getAccountRecordIdSafe(final UUID objectId, final ObjectType objectType, final TenantContext context) { if (objectBelongsToTheRightTenant(objectId, objectType, context)) { return getAccountRecordIdUnsafe(objectId, objectType); } else { throw new IllegalStateException(String.format("Object id=%s type=%s doesn't belong to tenant id=%s", objectId, objectType, context.getTenantId())); } }
private Long getAccountRecordIdSafe(final UUID objectId, final ObjectType objectType, final Long tenantRecordId) throws ObjectDoesNotExist { if (objectBelongsToTheRightTenant(objectId, objectType, tenantRecordId)) { return getAccountRecordIdUnsafe(objectId, objectType); } else { throw new IllegalStateException(String.format("Object id=%s type=%s doesn't belong to tenant recordId=%s", objectId, objectType, tenantRecordId)); } }
private Long getAccountRecordIdSafe(final UUID objectId, final ObjectType objectType, final TenantContext context) { if (objectBelongsToTheRightTenant(objectId, objectType, context)) { return getAccountRecordIdUnsafe(objectId, objectType); } else { throw new IllegalStateException(String.format("Object id=%s type=%s doesn't belong to tenant id=%s", objectId, objectType, context.getTenantId())); } }