Transport User of Replication Agent | Community
Skip to main content
Level 3
Jun 19, 2017 7:11 AM UTC
Solved

Transport User of Replication Agent

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.
Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
Jun 19, 2017 7:45 AM UTC

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

Level 3
Jun 20, 2017 5:10 PM UTC

Hi Rajeev,

Thanks ..
It worked

Thanks,

Pallavi

Translate
Rajeev_Kumar
Level 3
Jun 19, 2017 6:14 PM UTC

Did you try getting agentmanager by @reference annotation?

Translate
Level 3
Jun 19, 2017 10:56 AM UTC

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

Translate
Rajeev_Kumar
Rajeev_KumarAccepted solution
Level 3
Jun 19, 2017 7:45 AM UTC

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)

Translate