@Path("/trusted/{username}/connectors/{connector}")
@ApiOperation(value = "Share a connector with a buddy")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successfully added a connector ({username}/{connectorName})")})
public Response addSharedConnector(@ApiParam(value="The buddy's username", required=true) @PathParam("username") String username,
@ApiParam(value="A connector name", required=true) @PathParam("connector") String connectorName) {
final SharedConnector sharedConnector = buddiesService.addSharedConnector(AuthHelper.getGuestId(), username, connectorName, "{}");
final ApiKey apiKey = guestService.getApiKey(AuthHelper.getGuestId(), Connector.getConnector(connectorName));
final Class<? extends AbstractUpdater> updaterClass = apiKey.getConnector().getUpdaterClass();
if (SharedConnectorSettingsAwareUpdater.class.isAssignableFrom(updaterClass)) {
final SharedConnectorSettingsAwareUpdater updater = (SharedConnectorSettingsAwareUpdater) beanFactory.getBean(updaterClass);
updater.syncSharedConnectorSettings(apiKey.getId(), sharedConnector);