s/replication_client/federation_client/

This commit is contained in:
Erik Johnston 2018-03-13 13:26:52 +00:00
parent cea462e285
commit cb9f8e527c
17 changed files with 29 additions and 29 deletions

View File

@ -348,7 +348,7 @@ def setup(config_options):
hs.get_state_handler().start_caching()
hs.get_datastore().start_profiling()
hs.get_datastore().start_doing_background_updates()
hs.get_replication_client().start_get_pdu_cache()
hs.get_federation_client().start_get_pdu_cache()
register_memory_metrics(hs)

View File

@ -431,7 +431,7 @@ class DeviceListEduUpdater(object):
def __init__(self, hs, device_handler):
self.store = hs.get_datastore()
self.federation = hs.get_replication_client()
self.federation = hs.get_federation_client()
self.clock = hs.get_clock()
self.device_handler = device_handler

View File

@ -36,7 +36,7 @@ class DirectoryHandler(BaseHandler):
self.appservice_handler = hs.get_application_service_handler()
self.event_creation_handler = hs.get_event_creation_handler()
self.federation = hs.get_replication_client()
self.federation = hs.get_federation_client()
hs.get_federation_registry().register_query_handler(
"directory", self.on_directory_query
)

View File

@ -32,7 +32,7 @@ logger = logging.getLogger(__name__)
class E2eKeysHandler(object):
def __init__(self, hs):
self.store = hs.get_datastore()
self.federation = hs.get_replication_client()
self.federation = hs.get_federation_client()
self.device_handler = hs.get_device_handler()
self.is_mine = hs.is_mine
self.clock = hs.get_clock()

View File

@ -68,7 +68,7 @@ class FederationHandler(BaseHandler):
self.hs = hs
self.store = hs.get_datastore()
self.replication_layer = hs.get_replication_client()
self.replication_layer = hs.get_federation_client()
self.state_handler = hs.get_state_handler()
self.server_name = hs.hostname
self.keyring = hs.get_keyring()

View File

@ -31,7 +31,7 @@ class ProfileHandler(BaseHandler):
def __init__(self, hs):
super(ProfileHandler, self).__init__(hs)
self.federation = hs.get_replication_client()
self.federation = hs.get_federation_client()
hs.get_federation_registry().register_query_handler(
"profile", self.on_profile_query
)

View File

@ -409,7 +409,7 @@ class RoomListHandler(BaseHandler):
def _get_remote_list_cached(self, server_name, limit=None, since_token=None,
search_filter=None, include_all_networks=False,
third_party_instance_id=None,):
repl_layer = self.hs.get_replication_client()
repl_layer = self.hs.get_federation_client()
if search_filter:
# We can't cache when asking for search
return repl_layer.get_public_rooms(

View File

@ -101,7 +101,7 @@ class HomeServer(object):
DEPENDENCIES = [
'http_client',
'db_pool',
'replication_client',
'federation_client',
'federation_server',
'handlers',
'v1auth',
@ -199,7 +199,7 @@ class HomeServer(object):
def get_ratelimiter(self):
return self.ratelimiter
def build_replication_client(self):
def build_federation_client(self):
return FederationClient(self)
def build_federation_server(self):

View File

@ -47,7 +47,7 @@ class DirectoryTestCase(unittest.TestCase):
hs = yield setup_test_homeserver(
http_client=None,
resource_for_federation=Mock(),
replication_client=self.mock_federation,
federation_client=self.mock_federation,
federation_registry=self.mock_registry,
)
hs.handlers = DirectoryHandlers(hs)

View File

@ -34,7 +34,7 @@ class E2eKeysHandlerTestCase(unittest.TestCase):
def setUp(self):
self.hs = yield utils.setup_test_homeserver(
handlers=None,
replication_client=mock.Mock(),
federation_client=mock.Mock(),
)
self.handler = synapse.handlers.e2e_keys.E2eKeysHandler(self.hs)

View File

@ -51,7 +51,7 @@ class ProfileTestCase(unittest.TestCase):
http_client=None,
handlers=None,
resource_for_federation=Mock(),
replication_client=self.mock_federation,
federation_client=self.mock_federation,
federation_server=Mock(),
federation_registry=self.mock_registry,
ratelimiter=NonCallableMock(spec_set=[

View File

@ -31,7 +31,7 @@ class BaseSlavedStoreTestCase(unittest.TestCase):
self.hs = yield setup_test_homeserver(
"blue",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=[
"send_message",
]),

View File

@ -114,7 +114,7 @@ class EventStreamPermissionsTestCase(RestTestCase):
hs = yield setup_test_homeserver(
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=[
"send_message",
]),

View File

@ -45,7 +45,7 @@ class ProfileTestCase(unittest.TestCase):
http_client=None,
resource_for_client=self.mock_resource,
federation=Mock(),
replication_client=Mock(),
federation_client=Mock(),
profile_handler=self.mock_handler
)

View File

@ -46,7 +46,7 @@ class RoomPermissionsTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -409,7 +409,7 @@ class RoomsMemberListTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -493,7 +493,7 @@ class RoomsCreateTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -582,7 +582,7 @@ class RoomTopicTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -697,7 +697,7 @@ class RoomMemberStateTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -829,7 +829,7 @@ class RoomMessagesTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()
@ -929,7 +929,7 @@ class RoomInitialSyncTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=[
"send_message",
]),
@ -1003,7 +1003,7 @@ class RoomMessageListTestCase(RestTestCase):
hs = yield setup_test_homeserver(
"red",
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=["send_message"]),
)
self.ratelimiter = hs.get_ratelimiter()

View File

@ -47,7 +47,7 @@ class RoomTypingTestCase(RestTestCase):
"red",
clock=self.clock,
http_client=None,
replication_client=Mock(),
federation_client=Mock(),
ratelimiter=NonCallableMock(spec_set=[
"send_message",
]),

View File

@ -42,7 +42,7 @@ class ApplicationServiceStoreTestCase(unittest.TestCase):
hs = yield setup_test_homeserver(
config=config,
federation_sender=Mock(),
replication_client=Mock(),
federation_client=Mock(),
)
self.as_token = "token1"
@ -119,7 +119,7 @@ class ApplicationServiceTransactionStoreTestCase(unittest.TestCase):
hs = yield setup_test_homeserver(
config=config,
federation_sender=Mock(),
replication_client=Mock(),
federation_client=Mock(),
)
self.db_pool = hs.get_db_pool()
@ -455,7 +455,7 @@ class ApplicationServiceStoreConfigTestCase(unittest.TestCase):
config=config,
datastore=Mock(),
federation_sender=Mock(),
replication_client=Mock(),
federation_client=Mock(),
)
ApplicationServiceStore(None, hs)
@ -473,7 +473,7 @@ class ApplicationServiceStoreConfigTestCase(unittest.TestCase):
config=config,
datastore=Mock(),
federation_sender=Mock(),
replication_client=Mock(),
federation_client=Mock(),
)
with self.assertRaises(ConfigError) as cm:
@ -497,7 +497,7 @@ class ApplicationServiceStoreConfigTestCase(unittest.TestCase):
config=config,
datastore=Mock(),
federation_sender=Mock(),
replication_client=Mock(),
federation_client=Mock(),
)
with self.assertRaises(ConfigError) as cm: