@Override public List<? extends InstanceLink> findBadInstanceLinks(int count) { return create().select(INSTANCE_LINK.fields()) .from(INSTANCE_LINK) .join(INSTANCE) .on(INSTANCE.ID.eq(INSTANCE_LINK.TARGET_INSTANCE_ID)) .where(INSTANCE.STATE.eq(CommonStatesConstants.PURGED)) .limit(count) .fetchInto(InstanceLinkRecord.class); }
protected List<? extends ConfigItemStatus> stackOutOfSyncItems() { return create() .select(CONFIG_ITEM_STATUS.fields()) .from(CONFIG_ITEM_STATUS) .join(STACK) .on(STACK.ID.eq(CONFIG_ITEM_STATUS.STACK_ID)) .where(CONFIG_ITEM_STATUS.REQUESTED_VERSION.ne(CONFIG_ITEM_STATUS.APPLIED_VERSION) .and(STACK.REMOVED.isNull())) .limit(BATCH_SIZE.get()) .fetchInto(ConfigItemStatusRecord.class); }
protected List<? extends ConfigItemStatus> serviceOutOfSyncItems() { return create() .select(CONFIG_ITEM_STATUS.fields()) .from(CONFIG_ITEM_STATUS) .join(SERVICE) .on(SERVICE.ID.eq(CONFIG_ITEM_STATUS.SERVICE_ID)) .where(CONFIG_ITEM_STATUS.REQUESTED_VERSION.ne(CONFIG_ITEM_STATUS.APPLIED_VERSION) .and(SERVICE.REMOVED.isNull())) .limit(BATCH_SIZE.get()) .fetchInto(ConfigItemStatusRecord.class); }
protected List<? extends ConfigItemStatus> accountOutOfSyncItems() { return create() .select(CONFIG_ITEM_STATUS.fields()) .from(CONFIG_ITEM_STATUS) .join(ACCOUNT) .on(ACCOUNT.ID.eq(CONFIG_ITEM_STATUS.ACCOUNT_ID)) .where(CONFIG_ITEM_STATUS.REQUESTED_VERSION.ne(CONFIG_ITEM_STATUS.APPLIED_VERSION) .and(ACCOUNT.REMOVED.isNull())) .limit(BATCH_SIZE.get()) .fetchInto(ConfigItemStatusRecord.class); }
protected List<? extends ConfigItemStatus> hostOutOfSyncItems() { return create() .select(CONFIG_ITEM_STATUS.fields()) .from(CONFIG_ITEM_STATUS) .join(HOST) .on(HOST.ID.eq(CONFIG_ITEM_STATUS.HOST_ID)) .where(CONFIG_ITEM_STATUS.REQUESTED_VERSION.ne(CONFIG_ITEM_STATUS.APPLIED_VERSION) .and(HOST.REMOVED.isNull())) .limit(BATCH_SIZE.get()) .fetchInto(ConfigItemStatusRecord.class); }
@Override public List<? extends ProjectMember> findBadProjectMembers(int count) { return create().select(PROJECT_MEMBER.fields()) .from(PROJECT_MEMBER) .join(ACCOUNT) .on(ACCOUNT.ID.eq(PROJECT_MEMBER.PROJECT_ID)) .where(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED) .and(PROJECT_MEMBER.REMOVED.isNull()) .and(PROJECT_MEMBER.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(ProjectMemberRecord.class); }
@Override public List<? extends Volume> findBadVolumes(int count) { return create().select(VOLUME.fields()) .from(VOLUME) .join(ACCOUNT) .on(ACCOUNT.ID.eq(VOLUME.ACCOUNT_ID)) .where(VOLUME.REMOVED.isNull() .and(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)) .and(VOLUME.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(VolumeRecord.class); }
@Override public List<? extends Network> findBadNetworks(int count) { return create().select(NETWORK.fields()) .from(NETWORK) .join(ACCOUNT) .on(ACCOUNT.ID.eq(NETWORK.ACCOUNT_ID)) .where(NETWORK.REMOVED.isNull() .and(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)) .and(NETWORK.STATE.notIn(CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(NetworkRecord.class); }
@Override public List<? extends UserPreference> findBadUserPreference(int count) { return create().select(USER_PREFERENCE.fields()) .from(USER_PREFERENCE) .join(ACCOUNT) .on(ACCOUNT.ID.eq(USER_PREFERENCE.ACCOUNT_ID)) .where(USER_PREFERENCE.REMOVED.isNull() .and(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)) .and(USER_PREFERENCE.STATE.notIn(CommonStatesConstants.REMOVING, CommonStatesConstants.DEACTIVATING))) .limit(count) .fetchInto(UserPreferenceRecord.class); }
@Override public List<? extends StoragePool> findBadPools(int count) { return create().select(STORAGE_POOL.fields()) .from(STORAGE_POOL) .join(ACCOUNT) .on(ACCOUNT.ID.eq(STORAGE_POOL.ACCOUNT_ID)) .where(STORAGE_POOL.REMOVED.isNull() .and(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)) .and(STORAGE_POOL.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(StoragePoolRecord.class); }
@Override public List<? extends VolumeStoragePoolMap> findBandVolumeStoragePoolMap(int count) { return create().select(VOLUME_STORAGE_POOL_MAP.fields()) .from(VOLUME_STORAGE_POOL_MAP) .join(VOLUME) .on(VOLUME.ID.eq(VOLUME_STORAGE_POOL_MAP.VOLUME_ID)) .where(VOLUME.STATE.eq(CommonStatesConstants.PURGED) .and(VOLUME_STORAGE_POOL_MAP.REMOVED.isNull()) .and(VOLUME_STORAGE_POOL_MAP.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(VolumeStoragePoolMapRecord.class); }
@Override public List<? extends GenericObject> findBadGO(int count) { return create().select(GENERIC_OBJECT.fields()) .from(GENERIC_OBJECT) .join(ACCOUNT) .on(ACCOUNT.ID.eq(GENERIC_OBJECT.ACCOUNT_ID)) .where(GENERIC_OBJECT.REMOVED.isNull() .and(ACCOUNT.STATE.eq(CommonStatesConstants.PURGED)) .and(GENERIC_OBJECT.STATE.notIn(CommonStatesConstants.REMOVING, CommonStatesConstants.DEACTIVATING))) .limit(count) .fetchInto(GenericObjectRecord.class); }
@Override public List<? extends Mount> findBadMounts(int count) { return create().select(MOUNT.fields()) .from(MOUNT) .join(VOLUME) .on(VOLUME.ID.eq(MOUNT.VOLUME_ID)) .where(VOLUME.STATE.eq(CommonStatesConstants.PURGED) .and(MOUNT.REMOVED.isNull()) .and(MOUNT.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(MountRecord.class); }
@Override public List<? extends InstanceHostMap> findBadInstanceHostMaps(int count) { return create().select(INSTANCE_HOST_MAP.fields()) .from(INSTANCE_HOST_MAP) .join(INSTANCE) .on(INSTANCE_HOST_MAP.INSTANCE_ID.eq(INSTANCE.ID)) .where(INSTANCE_HOST_MAP.REMOVED.isNull() .and(INSTANCE.STATE.eq(CommonStatesConstants.PURGED)) .and(INSTANCE_HOST_MAP.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(InstanceHostMapRecord.class); }
@Override public List<? extends Nic> findBadNics(int count) { return create().select(NIC.fields()) .from(NIC) .join(INSTANCE) .on(INSTANCE.ID.eq(NIC.INSTANCE_ID)) .where(NIC.REMOVED.isNull().and(INSTANCE.STATE.eq(CommonStatesConstants.PURGED)) .and(NIC.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(NicRecord.class); }
@Override public List<? extends ImageStoragePoolMap> findBadImageStoragePoolMaps(int count) { return create().select(IMAGE_STORAGE_POOL_MAP.fields()) .from(IMAGE_STORAGE_POOL_MAP) .join(IMAGE) .on(IMAGE.ID.eq(IMAGE_STORAGE_POOL_MAP.IMAGE_ID)) .where(IMAGE.STATE.eq(CommonStatesConstants.PURGED) .and(IMAGE_STORAGE_POOL_MAP.REMOVED.isNull()) .and(IMAGE_STORAGE_POOL_MAP.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(ImageStoragePoolMapRecord.class); } }
@Override public List<? extends HealthcheckInstance> findBadHealthcheckInstance(int limit) { return create() .select(HEALTHCHECK_INSTANCE.fields()) .from(HEALTHCHECK_INSTANCE) .join(INSTANCE) .on(INSTANCE.ID.eq(HEALTHCHECK_INSTANCE.INSTANCE_ID)) .where(INSTANCE.STATE.eq(CommonStatesConstants.PURGED) .and(HEALTHCHECK_INSTANCE.REMOVED.isNull()) .and(HEALTHCHECK_INSTANCE.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(limit) .fetchInto(HealthcheckInstanceRecord.class); }
@Override public List<? extends Image> findBadImages(int count) { return create().select(IMAGE.fields()) .from(IMAGE) .leftOuterJoin(INSTANCE) .on(IMAGE.ID.eq(INSTANCE.IMAGE_ID)) .where((INSTANCE.STATE.eq(CommonStatesConstants.PURGED).or(INSTANCE.ID.isNull())) .and(IMAGE.REMOVED.isNull()) .and(IMAGE.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(ImageRecord.class); }
@Override public List<? extends StoragePoolHostMap> findBadPoolMapss(int limit) { return create().select(STORAGE_POOL_HOST_MAP.fields()) .from(STORAGE_POOL_HOST_MAP) .join(STORAGE_POOL) .on(STORAGE_POOL.ID.eq(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID)) .join(HOST) .on(HOST.ID.eq(STORAGE_POOL_HOST_MAP.HOST_ID)) .where(STORAGE_POOL_HOST_MAP.REMOVED.isNull() .and(HOST.STATE.eq(CommonStatesConstants.PURGED).or(STORAGE_POOL.STATE.eq(CommonStatesConstants.PURGED)))) .limit(limit) .fetchInto(StoragePoolHostMapRecord.class); }
@Override public List<? extends Instance> findBadInstances(int count) { return create().select(INSTANCE.fields()) .from(INSTANCE) .join(INSTANCE_HOST_MAP) .on(INSTANCE_HOST_MAP.INSTANCE_ID.eq(INSTANCE.ID)) .join(HOST) .on(INSTANCE_HOST_MAP.HOST_ID.eq(HOST.ID)) .where(HOST.REMOVED.isNotNull().and(INSTANCE.REMOVED.isNull()) .and(INSTANCE.STATE.notIn(InstanceConstants.STATE_STOPPING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(InstanceRecord.class); }