Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Transport User of Replication Agent

sripadap4996627
Level 3
Level 3

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

1 Accepted Solution
Rajeev_Kumar
Correct answer by
Level 3
Level 3

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)

View solution in original post

4 Replies
Rajeev_Kumar
Correct answer by
Level 3
Level 3

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)

View solution in original post

sripadap4996627
Level 3
Level 3

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
Level 3

Did you try getting agentmanager by @reference annotation?

sripadap4996627
Level 3
Level 3

Hi Rajeev,

Thanks ..
It worked

Thanks,

Pallavi