Class: RubyAem::ReplicationAgent

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_aem/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



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

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

Instance Method Details

#create_update(title, description, dest_base_url) ⇒ Object

Create or update a replication agent.

Parameters:

  • title

    replication agent title

  • description

    replication agent description

  • dest_base_url

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

Returns:

  • RubyAem::Result



41
42
43
44
45
46
# File 'lib/ruby_aem/replication_agent.rb', line 41

def create_update(title, description, dest_base_url)
  @info[:title] = title
  @info[:description] = description
  @info[:dest_base_url] = dest_base_url
  @client.call(self.class, __callee__.to_s, @info)
end

#deleteObject

Delete the replication agent.

Returns:

  • RubyAem::Result



51
52
53
# File 'lib/ruby_aem/replication_agent.rb', line 51

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

#existsObject

Check whether the replication agent exists or not. If the replication agent exists, this method returns a success result. Otherwise it returns a failure result.

Returns:

  • RubyAem::Result



60
61
62
# File 'lib/ruby_aem/replication_agent.rb', line 60

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