Transport User of Replication Agent | Community
Skip to main content
Level 3
June 19, 2017
Solved

Transport User of Replication Agent

  • June 19, 2017
  • 4 replies
  • 3423 views

Hi ,

I want to fetch tranport user of a particular replication agent to check what permission he has.

Is there a way to check ?

Thanks in advance. !

Pallavi

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rajeev_Kumar

Hi Pallavi,

You can not get the User object of transport user. However, you can get the transport user id and password and using this you can create User object to check permission of User.

The way you can get the transport user id is :

Get the 'com.day.cq.replication.AgentManager' (I think resourceResolver can be adapted to this). Then Get the agent using

Agent agent = agentMgr.getAgents().get("id") where id is the replication agent Id

and then you can do the following to get transportUserId and password :
String transportUserid = agent.getConfiguration().getTransportUser();

String pass = agent.getTransportPassword();

AgentConfig (Adobe CQ 5.6.1 Java Documentation 5.6.1 API)

4 replies

Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
June 19, 2017

Hi Pallavi,

You can not get the User object of transport user. However, you can get the transport user id and password and using this you can create User object to check permission of User.

The way you can get the transport user id is :

Get the 'com.day.cq.replication.AgentManager' (I think resourceResolver can be adapted to this). Then Get the agent using

Agent agent = agentMgr.getAgents().get("id") where id is the replication agent Id

and then you can do the following to get transportUserId and password :
String transportUserid = agent.getConfiguration().getTransportUser();

String pass = agent.getTransportPassword();

AgentConfig (Adobe CQ 5.6.1 Java Documentation 5.6.1 API)

Level 3
June 19, 2017

AgentManager agmr=resourceResolver.adaptTo(AgentManager.class); is giving me null
where as for others(ex: UserManager not giving null)
is there any other way ?

Rajeev_Kumar
Level 3
June 19, 2017

Did you try getting agentmanager by @reference annotation?

Level 3
June 20, 2017

Hi Rajeev,

Thanks ..
It worked

Thanks,

Pallavi