Builds a default messaging service.
499302
protected static ManagedMessagingService buildMessagingService(ClusterConfig config) {
    return new NettyMessagingService(
        config.getClusterId(),
        config.getNodeConfig().getAddress(),
        config.getMessagingConfig());
  }
1154453
LineMessagingService buildRetrofitIface() {
        if (okHttpClientBuilder == null) {
            okHttpClientBuilder = new OkHttpClient.Builder();
        }

        // Add interceptors.
        if (addAuthenticationHeader) {
            okHttpClientBuilder.addInterceptor(buildAuthenticationInterceptor(channelTokenSupplier));
        }
        if (additionalInterceptors != null) {
            additionalInterceptors.forEach(okHttpClientBuilder::addInterceptor);
        }
        okHttpClientBuilder.addInterceptor(buildLoggingInterceptor());

        // Set timeout.
        okHttpClientBuilder
                .connectTimeout(connectTimeout, TimeUnit.MILLISECONDS)
                .readTimeout(readTimeout, TimeUnit.MILLISECONDS)
                .writeTimeout(writeTimeout, TimeUnit.MILLISECONDS);

        final OkHttpClient okHttpClient = okHttpClientBuilder.build();

        if (retrofitBuilder == null) {
            retrofitBuilder = createDefaultRetrofitBuilder();
        }
        retrofitBuilder.client(okHttpClient);
        retrofitBuilder.baseUrl(apiEndPoint);

        final Retrofit retrofit = retrofitBuilder.build();

        return retrofit.create(LineMessagingService.class);
    }
568646
def push(self):
        ''''''
        message = self.build_message()
        return requests.post(self.hook, json=message)
572366
def build_message(self, stat, value):
        """"""
        return ' '.join((self.prefix + str(stat), str(value), str(round(time()))))
689030
private Map<String, Properties> loadRegisteredMessageResources(String name) {
        Map<String, Properties> messageResources = new TreeMap<>();

        // Load default messages
        Properties defaultMessages = loadMessages(String.format(name, ""));
        if (defaultMessages == null) {
            log.error("Could not locate the default messages resource '{}', please create it.", String.format(name, ""));
        } else {
            messageResources.put("", defaultMessages);
        }

        // Load the registered language resources
        List<String> registeredLanguages = languages.getRegisteredLanguages();
        for (String language : registeredLanguages) {
            // First step: Load complete language eg. en-US
            Properties messages = loadMessages(String.format(name, "_" + language));

            Properties messagesLangOnly = null;

            // If the language has a country code load the default values for
            // the language. For example missing keys in en-US will
            // be filled-in by the default language.
            String langComponent = languages.getLanguageComponent(language);
            if (!langComponent.equals(language)) {
                // see if we have already loaded the language messages
                messagesLangOnly = messageResources.get(langComponent);
                if (messagesLangOnly == null) {
                    // load the language messages
                    messagesLangOnly = loadMessages(String.format(name, "_" + langComponent));
                }
            }

            // If a language is registered in application.properties it should
            // be there.
            if (messages == null) {
                log.error(
                    "Could not locate the '{}' messages resource '{}' specified in '{}'.",
                    language, String.format(name, "_" + language),
                    PippoConstants.SETTING_APPLICATION_LANGUAGES);
            } else {
                // add a new language

                // start with the default messages
                Properties compositeMessages = new Properties(defaultMessages);

                // put all the language component messages "en"
                if (messagesLangOnly != null) {
                    compositeMessages.putAll(messagesLangOnly);

                    // cache language component messages
                    if (!messageResources.containsKey(langComponent)) {
                        Properties langResources = new Properties();
                        langResources.putAll(compositeMessages);
                        messageResources.put(langComponent, langResources);
                    }
                }

                // put all the language specific messages "en-US"
                compositeMessages.putAll(messages);

                // and add the composite messages to the hashmap with the
                // mapping.
                messageResources.put(language.toLowerCase(), compositeMessages);
            }
        }

        return Collections.unmodifiableMap(messageResources);
    }
290144
def messaging(_context, repository, reset_on_start=False):
    
    discriminator = ('messaging', repository)
    reg = get_current_registry()
    config = Configurator(reg, package=_context.package)
    _context.action(discriminator=discriminator, # pylint: disable=E1101
                    callable=config.setup_system_repository,
                    args=(repository,),
                    kw=dict(reset_on_start=reset_on_start))
1223068
public static ServiceMessage toServiceMessage(GatewayMessage message) {
    return ServiceMessage.builder().headers(message.headers).data(message.data).build();
  }
744116
def _build_message(self, message):
        """"""
        if not message.recipients():
            return False
        recipients = ','.join(message.to)
        recipients_cc = ','.join(message.cc)
        recipients_bcc = ','.join(message.bcc)

        text_body = message.body
        html_body = None
        if isinstance(message, EmailMultiAlternatives):
            for alt in message.alternatives:
                if alt[1] == "text/html":
                    html_body = alt[0]
                    break

        elif getattr(message, 'content_subtype', None) == 'html':
            # Don't send html content as plain text
            text_body = None
            html_body = message.body

        reply_to = ','.join(message.reply_to)
        custom_headers = {}
        if message.extra_headers and isinstance(message.extra_headers, dict):
            if 'Reply-To' in message.extra_headers:
                reply_to = message.extra_headers.pop('Reply-To')
            if len(message.extra_headers):
                custom_headers = message.extra_headers
        attachments = []
        if message.attachments and isinstance(message.attachments, list):
            if len(message.attachments):
                for item in message.attachments:
                    if isinstance(item, tuple):
                        (f, content, m) = item
                        content = base64.b64encode(content)
                        # b64decode returns bytes on Python 3. PMMail needs a
                        # str (for JSON serialization). Convert on Python 3
                        # only to avoid a useless performance hit on Python 2.
                        if not isinstance(content, str):
                            content = content.decode()
                        attachments.append((f, content, m))
                    else:
                        attachments.append(item)

        postmark_message = PMMail(api_key=self.api_key,
                                  subject=message.subject,
                                  sender=message.from_email,
                                  to=recipients,
                                  cc=recipients_cc,
                                  bcc=recipients_bcc,
                                  text_body=text_body,
                                  html_body=html_body,
                                  reply_to=reply_to,
                                  custom_headers=custom_headers,
                                  attachments=attachments)

        postmark_message.tag = getattr(message, 'tag', None)
        postmark_message.track_opens = getattr(message, 'track_opens', False)

        return postmark_message
959452
public function buildMessage()
    {
        if (isset($this->message)) {
            return $this->message;
        }

        $this->message = [
            BuildUtil::removeNullElements([
                'type' => MessageType::FLEX,
                'altText' => $this->altText,
                'contents' => $this->containerBuilder->build(),
                'quickReply' => BuildUtil::build($this->quickReply, 'buildQuickReply'),
            ])
        ];

        return $this->message;
    }
1140071
public static AbstractLifeCycleManager build( Instance instance, String appName, IAgentClient messagingClient ) {

		AbstractLifeCycleManager result;
		switch( instance.getStatus()) {
		case DEPLOYED_STARTED:
			result = new DeployedStarted( appName, messagingClient );
			break;

		case DEPLOYED_STOPPED:
			result = new DeployedStopped( appName, messagingClient );
			break;

		case NOT_DEPLOYED:
			result = new NotDeployed( appName, messagingClient );
			break;

		case UNRESOLVED:
			result = new Unresolved( appName, messagingClient );
			break;

		case WAITING_FOR_ANCESTOR:
			result = new WaitingForAncestor( appName, messagingClient );
			break;

		default:
			result = new TransitiveStates( appName, messagingClient );
			break;
		}

		return result;
	}
867842
def _build_message(self, auto_decode):
        
        with self.lock:
            if len(self._inbound) < 2:
                return None
            headers = self._build_message_headers()
            if not headers:
                return None
            basic_deliver, content_header = headers
            body = self._build_message_body(content_header.body_size)

        message = Message(channel=self,
                          body=body,
                          method=dict(basic_deliver),
                          properties=dict(content_header.properties),
                          auto_decode=auto_decode)
        return message
122501
def default_message_notifications=(notification_level)
      notification_level = NOTIFICATION_LEVELS[notification_level] if notification_level.is_a?(Symbol)

      update_server_data(default_message_notifications: notification_level)
    end
553925
public function buildDefaultHeader(): void
    {
        $this->set(PoTokens::MESSAGE, "");
        $this->set(PoTokens::TRANSLATOR_COMMENTS, 'SOME DESCRIPTIVE TITLE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'Copyright (C) YEAR HOLDER');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'LICENSE');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, 'FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.');
        $this->add(PoTokens::TRANSLATOR_COMMENTS, '');
        $this->set(PoTokens::FLAG, 'fuzzy');
        $this->setHeader('Project-Id-Version', 'PACKAGE VERSION');
        $this->setHeader('Report-Msgid-Bugs-To', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setCreateDate();
        $this->setHeader('PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE');
        $this->setHeader('Last-Translator', 'FULL NAME <EMAIL@ADDRESS>');
        $this->setHeader('Language-Team', 'LANGUAGE <EMAIL@ADDRESS>');
        $this->setHeader('MIME-Version', '1.0');
        $this->setHeader('Content-Type', 'text/plain; charset=UTF-8');
        $this->setHeader('Content-Transfer-Encoding', '8bit');
        $this->setHeader('Plural-Forms', 'nplurals=INTEGER; plural=EXPRESSION;');
        $this->setHeader('X-Generator', 'geekwright/po');
    }
1272526
def factory(opts, **kwargs):
        '''
        
        '''
        import salt.transport.ipc
        return salt.transport.ipc.IPCMessageServer(opts, **kwargs)
962998
protected Response buildPost(final WebApplicationService service, final Map<String, String> parameters) {
        return DefaultResponse.getPostResponse(service.getOriginalUrl(), parameters);
    }
630960
public SoapServerFaultResponseActionBuilder sendFault() {
        SoapServerFaultResponseActionBuilder soapServerResponseActionBuilder = new SoapServerFaultResponseActionBuilder(action, soapServer)
                .withApplicationContext(applicationContext);
        return soapServerResponseActionBuilder;
    }
1299195
public function buildDefaults()
    {
        $dataClasses = ClassInfo::subclassesFor(DataObject::class);
        array_shift($dataClasses);

        if (!Director::is_cli()) {
            echo "<ul>";
        }

        foreach ($dataClasses as $dataClass) {
            singleton($dataClass)->requireDefaultRecords();
            if (Director::is_cli()) {
                echo "Defaults loaded for $dataClass\n";
            } else {
                echo "<li>Defaults loaded for $dataClass</li>\n";
            }
        }

        if (!Director::is_cli()) {
            echo "</ul>";
        }
    }