Class: Content::Pulp::RepositorySyncStatus

Inherits:
Object
  • Object
show all
Defined in:
app/services/content/pulp/repository_sync_status.rb

Constant Summary collapse

HISTORY_ERROR =
'failed'
HISTORY_SUCCESS =
'success'
FINISHED =
'finished'
ERROR =
'error'
RUNNING =
'running'
WAITING =
'waiting'
CANCELED =
'canceled'
NOT_SYNCED =
'not synchronized'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ RepositorySyncStatus



13
14
15
16
17
18
19
20
# File 'app/services/content/pulp/repository_sync_status.rb', line 13

def initialize(attrs)
  @state      = NOT_SYNCED
  @sync_times = @sync_metrics = {}

  attrs.each do |k, v|
    instance_variable_set("@#{k}", v) if respond_to?("#{k}".to_sym)
  end
end

Instance Attribute Details

#finish_timeObject (readonly)

Returns the value of attribute finish_time.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def finish_time
  @finish_time
end

#messageObject (readonly)

Returns the value of attribute message.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def message
  @message
end

#progressObject (readonly)

Returns the value of attribute progress.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def progress
  @progress
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def start_time
  @start_time
end

#stateObject (readonly)

Returns the value of attribute state.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def state
  @state
end

#sync_metricsObject (readonly)

Returns the value of attribute sync_metrics.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def sync_metrics
  @sync_metrics
end

#sync_timesObject (readonly)

Returns the value of attribute sync_times.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def sync_times
  @sync_times
end

#task_idObject (readonly)

Returns the value of attribute task_id.



2
3
4
# File 'app/services/content/pulp/repository_sync_status.rb', line 2

def task_id
  @task_id
end

Instance Method Details

#not_synced?Boolean



22
23
24
# File 'app/services/content/pulp/repository_sync_status.rb', line 22

def not_synced?
  state == NOT_SYNCED
end

#running?Boolean



26
27
28
# File 'app/services/content/pulp/repository_sync_status.rb', line 26

def running?
  state == RUNNING
end