class RestPayloadPublisherFactory implements PayloadPublisherFactory {

    @Override
    public PayloadPublisher create(Config config) {

        Discovery partyInfoService = Discovery.getInstance();

        ClientFactory clientFactory = new ClientFactory();
        Client client = clientFactory.buildFrom(config.getP2PServerConfig());
        return new RestPayloadPublisher(client, partyInfoService);
    }

}