@Provides @Named(POLL_PREDICATE_SERVER) Predicate<ServerRef> provideServerAvailablePredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new ServerAvaiblablePredicate(api, State.AVAILABLE), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }
@Provides @Named(TIMEOUT_NODE_SUSPENDED) Predicate<ServerRef> provideServerSuspendedPredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new ServerStatusPredicate(api, Server.Status.SHUTOFF), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }
@Provides @Named(TIMEOUT_NODE_RUNNING) Predicate<ServerRef> provideServerRunningPredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new ServerStatusPredicate(api, Server.Status.RUNNING), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }
@Provides @Singleton @Named(TIMEOUT_NODE_RUNNING) Predicate<VolumeRef> provideVolumeAvailablePredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new VolumeProvisoningStatusPredicate(api, State.AVAILABLE), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }
@Provides @Singleton @Named(POLL_PREDICATE_SNAPSHOT) Predicate<String> provideSnapshotAvailablePredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new SnapshotProvisioningStatePredicate(api, State.AVAILABLE), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }
@Provides @Singleton @Named(POLL_PREDICATE_DATACENTER) Predicate<String> provideDataCenterAvailablePredicate( final ProfitBricksApi api, ComputeConstants constants) { return retry( new DataCenterProvisioningStatePredicate(api, State.AVAILABLE), constants.pollTimeout(), constants.pollPeriod(), constants.pollMaxPeriod(), TimeUnit.SECONDS); }