Expand my Community achievements bar.

SOLVED

Transport User of Replication Agent

Avatar

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

Avatar

Correct answer by
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

Avatar

Correct answer by
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)

Avatar

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 ?

Avatar

Level 3

Did you try getting agentmanager by @reference annotation?

Avatar

Level 3

Hi Rajeev,

Thanks ..
It worked

Thanks,

Pallavi