anchor.diff:  	{ok, State}.
   
   
  -send_reply(_Reply,#state{client=undefined}=State) ->
  -    {ok,State};
  -send_reply(Reply,#state{client=Client}=State) ->
  -    gen_server:reply(Client,Reply),
  -    {ok,State#state{client=undefined}}.
  -
  -% This is the main working function
  -perform_request(State) ->
  +prepare_request(State) ->
       #state{service_id = ServiceId,
              user_info = UserInfo
             } = State,
       {ok, ServiceInfo} = tts_service:get_info(ServiceId),
  -    {ok, Connection} = connect_to_service(ServiceInfo),
  +    Connection = connect_to_service(ServiceInfo),
       {ok, CmdMod} = get_cmd_module(request,ServiceInfo),
  -    {ok, Result} = execute_commands(CmdMod,UserInfo,Connection),
  -    ok = close_connection(Connection),
  -    send_reply(Result ,State).
  +    create_command_list(CmdMod,UserInfo,Connection,State).
  +
  +    %% ok = close_connection(Connection,ServiceInfo),
  +    %% send_reply(Result ,State).
   
                         
   connect_to_service(#{con_type := local}) ->
  -    Connection = con,
  -    {ok, Connection};
  -connect_to_service(#{con_type := ssh , con_host := _Host, key_set := true} = Info ) ->
  -    _Port = maps:get(con_port,Info,22),
  -    _User = maps:get(con_user,Info,<<"root">>),
  -    Connection = con,
  -    {ok, Connection};
  +    {ok, local};
  +connect_to_service(#{con_type := ssh , con_host := Host, key_set := true} = Info ) ->
  +    Port = maps:get(con_port,Info,22),
  +    User = maps:get(con_user,Info,<<"root">>),
  +    UserDir = maps:get(con_ssh_user_dir,Info),
  +    ssh:connect(Host,Port,[{user_dir,UserDir},{user_interaction,false},{user,User},{id_string,"TokenTranslationService"}],10000);
   connect_to_service(#{con_type := ssh } ) ->
       throw(missing_ssh_config);
   connect_to_service( _ )  ->
  
positive.code:      } = UserInfo,
      {ok, IoList} = CmdMod:render([{user, User },{uid, Uid},{gid, Gid},{home_dir, HomeDir}]), 
      CmdList = binary:split(list_to_binary(IoList),[<<"\n">>],[global]),
      {ok, {ok,CmdList}};
  execute_commands(_Mod,_Info, _Connection) ->
      {error, no_cmd_mod}.
  
  close_connection(_Con) ->
      ok.
  
negative.code:           service_info = undefined,
            user_info = undefined,
            token = undefined,
            params = undefined,
            connection = undefined,
            con_type = undefined,
            cmd_list = [],
            cmd_log = [],
            cmd_state = undefined,
            error = undefined
  }).
  
  %% API.
  