public UUID getAccountId(final UUID objectId, final ObjectType objectType, final TenantContext context) { final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, context); if (accountRecordId != null) { return nonEntityDao.retrieveIdFromObject(accountRecordId, ObjectType.ACCOUNT, objectIdCacheController); } else { return null; } }
public InternalCallContext createInternalCallContext(final UUID objectId, final ObjectType objectType, final String userName, final CallOrigin callOrigin, final UserType userType, @Nullable final UUID userToken, final Long tenantRecordId) { final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, tenantRecordId); return createInternalCallContext(tenantRecordId, accountRecordId, userName, callOrigin, userType, userToken, null, null, null, null); }
/** * Crate an internal tenant callcontext from a tenant 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 tenant callcontext * @return internal tenant callcontext from callcontext, with a non null account_record_id (if found) */ public InternalTenantContext createInternalTenantContext(final UUID objectId, final ObjectType objectType, final TenantContext 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 createInternalTenantContext(tenantRecordId, accountRecordId); }
public InternalTenantContext createInternalTenantContext(final UUID accountId, final InternalTenantContext context) { final Long tenantRecordId = context.getTenantRecordId(); final Long accountRecordId = getAccountRecordIdSafe(accountId, ObjectType.ACCOUNT, context.getTenantRecordId()); return createInternalTenantContext(tenantRecordId, accountRecordId); }
/** * 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()); }
public InternalCallContext createInternalCallContext(final UUID objectId, final ObjectType objectType, final String userName, final CallOrigin callOrigin, final UserType userType, @Nullable final UUID userToken, final Long tenantRecordId) { final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, tenantRecordId); return createInternalCallContext(tenantRecordId, accountRecordId, userName, callOrigin, userType, userToken, null, null, null, null); }
public UUID getAccountId(final UUID objectId, final ObjectType objectType, final TenantContext context) { final Long accountRecordId = getAccountRecordIdSafe(objectId, objectType, context); if (accountRecordId != null) { return nonEntityDao.retrieveIdFromObject(accountRecordId, ObjectType.ACCOUNT, objectIdCacheController); } else { return null; } }
/** * Crate an internal tenant callcontext from a tenant 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 tenant callcontext * @return internal tenant callcontext from callcontext, with a non null account_record_id (if found) */ public InternalTenantContext createInternalTenantContext(final UUID objectId, final ObjectType objectType, final TenantContext 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 createInternalTenantContext(tenantRecordId, accountRecordId); }
public InternalTenantContext createInternalTenantContext(final UUID accountId, final InternalTenantContext context) { final Long tenantRecordId = context.getTenantRecordId(); final Long accountRecordId = getAccountRecordIdSafe(accountId, ObjectType.ACCOUNT, context.getTenantRecordId()); return createInternalTenantContext(tenantRecordId, accountRecordId); }
/** * 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()); }