|
| 1 | +%% The contents of this file are subject to the Mozilla Public License |
| 2 | +%% Version 1.1 (the "License"); you may not use this file except in |
| 3 | +%% compliance with the License. You may obtain a copy of the License at |
| 4 | +%% https://www.mozilla.org/MPL/ |
| 5 | +%% |
| 6 | +%% Software distributed under the License is distributed on an "AS IS" |
| 7 | +%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the |
| 8 | +%% License for the specific language governing rights and limitations |
| 9 | +%% under the License. |
| 10 | +%% |
| 11 | +%% The Original Code is RabbitMQ. |
| 12 | +%% |
| 13 | +%% Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. |
| 14 | +%% |
| 15 | + |
| 16 | +%% This module exists as an alias for rabbit_peer_discovery_aws. |
| 17 | +%% Some users assume that the discovery module is the same as plugin |
| 18 | +%% name. This module tries to fill the naming gap between module and plugin names. |
| 19 | +-module(rabbitmq_peer_discovery_aws). |
| 20 | +-behaviour(rabbit_peer_discovery_backend). |
| 21 | + |
| 22 | +-export([init/0, list_nodes/0, supports_registration/0, register/0, unregister/0, |
| 23 | + post_registration/0, lock/1, unlock/1]). |
| 24 | + |
| 25 | +-define(DELEGATE, rabbit_peer_discovery_aws). |
| 26 | + |
| 27 | +%% |
| 28 | +%% API |
| 29 | +%% |
| 30 | + |
| 31 | +init() -> |
| 32 | + ?DELEGATE:init(). |
| 33 | + |
| 34 | +-spec list_nodes() -> {ok, {Nodes :: list(), NodeType :: rabbit_types:node_type()}} | |
| 35 | + {error, Reason :: string()}. |
| 36 | +list_nodes() -> |
| 37 | + ?DELEGATE:list_nodes(). |
| 38 | + |
| 39 | +-spec supports_registration() -> boolean(). |
| 40 | +supports_registration() -> |
| 41 | + ?DELEGATE:supports_registration(). |
| 42 | + |
| 43 | + |
| 44 | +-spec register() -> ok. |
| 45 | +register() -> |
| 46 | + ?DELEGATE:register(). |
| 47 | + |
| 48 | +-spec unregister() -> ok. |
| 49 | +unregister() -> |
| 50 | + ?DELEGATE:unregister(). |
| 51 | + |
| 52 | +-spec post_registration() -> ok | {error, Reason :: string()}. |
| 53 | +post_registration() -> |
| 54 | + ?DELEGATE:post_registration(). |
| 55 | + |
| 56 | +-spec lock(Node :: atom()) -> not_supported. |
| 57 | +lock(Node) -> |
| 58 | + ?DELEGATE:lock(Node). |
| 59 | + |
| 60 | +-spec unlock(Data :: term()) -> ok. |
| 61 | +unlock(Data) -> |
| 62 | + ?DELEGATE:unlock(Data). |
0 commit comments