Class: Adobe::Aem::Replication

Inherits:
Object
  • Object
show all
Defined in:
lib/adobe/aem/replication.rb

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Replication

Returns a new instance of Replication.



4
5
6
# File 'lib/adobe/aem/replication.rb', line 4

def initialize(context)
  @context = context
end

Instance Method Details

#agentsObject



8
9
10
# File 'lib/adobe/aem/replication.rb', line 8

def agents
  @context.connector.get('/etc/replication.1.json')
end

#create_agent(type, name, options = {}, agentType = '') ⇒ Object

AgentyType can be empty for default replication agent, rev for reverse and static for static



13
14
15
16
# File 'lib/adobe/aem/replication.rb', line 13

def create_agent(type, name, options = {}, agentType = '')
  # agent, revagent, staticagent
  @context.connector.create_page("/etc/replication/#{type}", name, name, "/libs/cq/replication/templates/#{agentType}agent", options)
end

#delete_agent(type, name) ⇒ Object



18
19
20
# File 'lib/adobe/aem/replication.rb', line 18

def delete_agent(type, name)
  @context.connector.delete_page("/etc/replication/#{type}/#{name}")
end