class RubyAem::Resources::FlushAgent

FlushAgent class contains API calls related to managing an AEM flush agent.

Public Class Methods

new(client, run_mode, name) click to toggle source

Initialise a flush agent.

@param client RubyAem::Client @param run_mode AEM run mode: author or publish @param name the flush agent's name, e.g. some-flush-agent @return new RubyAem::Resources::FlushAgent instance

# File lib/ruby_aem/resources/flush_agent.rb, line 26
def initialize(client, run_mode, name)
  @client = client
  @call_params = {
    run_mode: run_mode,
    name: name
  }
end

Public Instance Methods

create_update( title, description, dest_base_url, opts = { log_level: 'error', retry_delay: 30_000 } ) click to toggle source

Create or update a flush agent.

@param title flush agent title @param description flush agent description @param dest_base_url base URL of the agent target destination, e.g. somedispatcher:8080 @param opts optional parameters:

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

  • retry_delay: in milliseconds, default is 30_000

@return RubyAem::Result

# File lib/ruby_aem/resources/flush_agent.rb, line 43
def create_update(
  title,
  description,
  dest_base_url,
  opts = {
    log_level: 'error',
    retry_delay: 30_000
  }
)
  @call_params[:title] = title
  @call_params[:description] = description
  @call_params[:dest_base_url] = dest_base_url

  uri = URI.parse(dest_base_url)
  @call_params[:ssl] = uri.scheme == 'https' ? 'relaxed' : ''

  @call_params = @call_params.merge(opts)
  @client.call(self.class, __callee__.to_s, @call_params)
end
delete() click to toggle source

Delete the flush agent.

@return RubyAem::Result

# File lib/ruby_aem/resources/flush_agent.rb, line 66
def delete
  @client.call(self.class, __callee__.to_s, @call_params)
end
exists() click to toggle source

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

@return RubyAem::Result

# File lib/ruby_aem/resources/flush_agent.rb, line 75
def exists
  @client.call(self.class, __callee__.to_s, @call_params)
end