summaryrefslogtreecommitdiff
path: root/components/authorize/src
diff options
context:
space:
mode:
authorMagnus Feuer <mfeuer@jaguarlandrover.com>2014-11-07 16:43:01 -0800
committerMagnus Feuer <mfeuer@jaguarlandrover.com>2014-11-07 16:43:01 -0800
commit8f3d40ec7aaea3dca63428da3f694c3d50179053 (patch)
treef910fa88c5277f27e483f5a938f290574d76f15f /components/authorize/src
parent4bf08f04e196192e539fd067bb1709d2a24a821b (diff)
downloadrvi_core-8f3d40ec7aaea3dca63428da3f694c3d50179053.tar.gz
First shot at gen_server calls between components. only authorize implemented so far
Diffstat (limited to 'components/authorize/src')
-rw-r--r--components/authorize/src/authorize_rpc.erl58
1 files changed, 2 insertions, 56 deletions
diff --git a/components/authorize/src/authorize_rpc.erl b/components/authorize/src/authorize_rpc.erl
index 7a3e36e..a6faad9 100644
--- a/components/authorize/src/authorize_rpc.erl
+++ b/components/authorize/src/authorize_rpc.erl
@@ -145,20 +145,9 @@ handle_rpc(Other, _Args) ->
-%%--------------------------------------------------------------------
-%% @private
-%% @doc
-%% Handling call messages
%%
-%% @spec handle_call(Request, From, State) ->
-%% {reply, Reply, State} |
-%% {reply, Reply, State, Timeout} |
-%% {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, Reply, State} |
-%% {stop, Reason, State}
-%% @end
-%%--------------------------------------------------------------------
+%% Genserver implementation
+%%
handle_call({rvi_call, authorize_local_message, Args}, _From, State) ->
{_, ServiceName} = lists:keyfind(service_name, 1, Args),
{_, CallingService} = lists:keyfind(calling_service, 1, Args),
@@ -177,57 +166,14 @@ handle_call(Other, _From, State) ->
?warning("authorize_call:handle_rpc(~p): unknown", [ Other ]),
{ reply, { ok, [ { status, rvi_common:json_rpc_status(invalid_command)} ]}, State}.
-%%--------------------------------------------------------------------
-%% @private
-%% @doc
-%% Handling cast messages
-%%
-%% @spec handle_cast(Msg, State) -> {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State}
-%% @end
-%%--------------------------------------------------------------------
handle_cast(_Msg, State) ->
{noreply, State}.
-%%--------------------------------------------------------------------
-%% @private
-%% @doc
-%% Handling all non call/cast messages
-%%
-%% @spec handle_info(Info, State) -> {noreply, State} |
-%% {noreply, State, Timeout} |
-%% {stop, Reason, State}
-%% @end
-%%--------------------------------------------------------------------
handle_info(_Info, State) ->
{noreply, State}.
-%%--------------------------------------------------------------------
-%% @private
-%% @doc
-%% This function is called by a gen_server when it is about to
-%% terminate. It should be the opposite of Module:init/1 and do any
-%% necessary cleaning up. When it returns, the gen_server terminates
-%% with Reason. The return value is ignored.
-%%
-%% @spec terminate(Reason, State) -> void()
-%% @end
-%%--------------------------------------------------------------------
terminate(_Reason, _State) ->
ok.
-
-%%--------------------------------------------------------------------
-%% @private
-%% @doc
-%% Convert process state when code is changed
-%%
-%% @spec code_change(OldVsn, State, Extra) -> {ok, NewState}
-%% @end
-%%--------------------------------------------------------------------
code_change(_OldVsn, State, _Extra) ->
{ok, State}.
-%%%===================================================================
-%%% Internal functions
-%%%===================================================================