Class: RubyAem::Resources::ReplicationAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_aem/resources/replication_agent.rb

Overview

ReplicationAgent class contains API calls related to managing an AEM replication agent.

Instance Method Summary collapse

Constructor Details

#initialize(client, run_mode, name) ⇒ Object

Initialise a replication agent.

Parameters:

  • client

    RubyAem::Client

  • run_mode

    AEM run mode: author or publish

  • name

    the replication agent’s name, e.g. some-replication-agent



28
29
30
31
32
33
34
# File 'lib/ruby_aem/resources/replication_agent.rb', line 28

def initialize(client, run_mode, name)
  @client = client
  @call_params = {
    run_mode: run_mode,
    name: name
  }
end

Instance Method Details

#create_update(title, description, dest_base_url, opts = { transport_user: 'admin', transport_password: 'admin', log_level: 'error', retry_delay: 30000 }) ⇒ Object

Create or update a replication agent.

  • transport_user: username for transport user, default is admin

  • transport_password: username for transport user, default is admin

  • log_level: error, info, debug, default is error

  • retry_delay: in milliseconds, default is 30000

Parameters:

  • title

    replication agent title

  • description

    replication agent description

  • dest_base_url

    base URL of the agent target destination, e.g. somepublisher:4503

  • opts (defaults to: { transport_user: 'admin', transport_password: 'admin', log_level: 'error', retry_delay: 30000 })

    optional parameters:

Returns:

  • RubyAem::Result



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/ruby_aem/resources/replication_agent.rb', line 47

def create_update(title, description, dest_base_url,
  opts = {
    transport_user: 'admin',
    transport_password: 'admin',
    log_level: 'error',
    retry_delay: 30000
  })
  @call_params[:title] = title
  @call_params[:description] = description
  @call_params[:dest_base_url] = dest_base_url
  @call_params = @call_params.merge(opts)
  @client.call(self.class, __callee__.to_s, @call_params)
end

#deleteObject

Delete the replication agent.

Returns:

  • RubyAem::Result



64
65
66
# File 'lib/ruby_aem/resources/replication_agent.rb', line 64

def delete()
  @client.call(self.class, __callee__.to_s, @call_params)
end

#existsObject

Check whether the replication agent exists or not. If the replication agent exists, this method returns a true result data, false otherwise.

Returns:

  • RubyAem::Result



73
74
75
# File 'lib/ruby_aem/resources/replication_agent.rb', line 73

def exists()
  @client.call(self.class, __callee__.to_s, @call_params)
end