org.jivesoftware.smack.packet.Message.setProperty()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(188)

本文整理了Java中org.jivesoftware.smack.packet.Message.setProperty()方法的一些代码示例,展示了Message.setProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.setProperty()方法的具体详情如下:
包路径:org.jivesoftware.smack.packet.Message
类名称:Message
方法名:setProperty

Message.setProperty介绍

暂无

代码示例

代码示例来源:origin: org.littleshoot/xmpp

  1. protected Message newError(final String from, final Long tid) {
  2. final Message error = new Message();
  3. error.setProperty(P2PConstants.MESSAGE_TYPE,
  4. P2PConstants.INVITE_ERROR);
  5. if (tid != null) {
  6. error.setProperty(P2PConstants.TRANSACTION_ID, tid);
  7. }
  8. error.setTo(from);
  9. return error;
  10. }

代码示例来源:origin: org.littleshoot/xmpp

  1. protected Message newError(final String from, final Long tid) {
  2. final Message error = new Message();
  3. error.setProperty(P2PConstants.MESSAGE_TYPE,
  4. P2PConstants.INVITE_ERROR);
  5. if (tid != null) {
  6. error.setProperty(P2PConstants.TRANSACTION_ID, tid);
  7. }
  8. error.setTo(from);
  9. return error;
  10. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteOverControlSocket(final String jid,
  2. final byte[] offer, final KeyStorage keyStorage) {
  3. final Message msg = new Message();
  4. msg.setTo(jid);
  5. log.info("Sending offer: {}", new String(offer));
  6. final String base64Sdp =
  7. Base64.encodeBase64URLSafeString(offer);
  8. msg.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE);
  9. msg.setProperty(P2PConstants.SDP, base64Sdp);
  10. msg.setProperty(P2PConstants.CONTROL, "true");
  11. //final byte[] writeKey = keyStorage.getWriteKey();
  12. //log.info("Setting client write key to: {}", writeKey);
  13. //msg.setProperty(P2PConstants.SECRET_KEY,
  14. // Base64.encodeBase64String(writeKey));
  15. return msg;
  16. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteOverControlSocket(final String jid,
  2. final byte[] offer, final KeyStorage keyStorage) {
  3. final Message msg = new Message();
  4. msg.setTo(jid);
  5. log.info("Sending offer: {}", new String(offer));
  6. final String base64Sdp =
  7. Base64.encodeBase64URLSafeString(offer);
  8. msg.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE);
  9. msg.setProperty(P2PConstants.SDP, base64Sdp);
  10. msg.setProperty(P2PConstants.CONTROL, "true");
  11. //final byte[] writeKey = keyStorage.getWriteKey();
  12. //log.info("Setting client write key to: {}", writeKey);
  13. //msg.setProperty(P2PConstants.SECRET_KEY,
  14. // Base64.encodeBase64String(writeKey));
  15. return msg;
  16. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteOk(final Long tid, final byte[] answer) {
  2. final Message inviteOk = new Message();
  3. if (tid != null) {
  4. inviteOk.setProperty(P2PConstants.TRANSACTION_ID, tid.longValue());
  5. }
  6. inviteOk.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE_OK);
  7. inviteOk.setProperty(P2PConstants.SDP,
  8. Base64.encodeBase64String(answer));
  9. if (this.offerAnswerFactory.isAnswererPortMapped()) {
  10. inviteOk.setProperty(P2PConstants.MAPPED_PORT,
  11. this.offerAnswerFactory.getMappedPort());
  12. inviteOk.setProperty(P2PConstants.PUBLIC_IP,
  13. this.publicIp.getPublicIpAddress().getHostAddress());
  14. }
  15. return inviteOk;
  16. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteOk(final Long tid, final byte[] answer) {
  2. final Message inviteOk = new Message();
  3. if (tid != null) {
  4. inviteOk.setProperty(P2PConstants.TRANSACTION_ID, tid.longValue());
  5. }
  6. inviteOk.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE_OK);
  7. inviteOk.setProperty(P2PConstants.SDP,
  8. Base64.encodeBase64String(answer));
  9. if (this.offerAnswerFactory.isAnswererPortMapped()) {
  10. inviteOk.setProperty(P2PConstants.MAPPED_PORT,
  11. this.offerAnswerFactory.getMappedPort());
  12. inviteOk.setProperty(P2PConstants.PUBLIC_IP,
  13. this.publicIp.getPublicIpAddress().getHostAddress());
  14. }
  15. return inviteOk;
  16. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteToEstablishControlSocket(final String jid,
  2. final byte[] offer,
  3. final OfferAnswerTransactionListener transactionListener,
  4. final KeyStorage keyStorage) {
  5. final long id = RandomUtils.nextLong();
  6. transactionIdsToProcessors.put(id,
  7. new TransactionData(transactionListener, keyStorage));
  8. //transactionIdsToProcessors.put(id, td);
  9. final Message msg = new Message();
  10. msg.setTo(jid);
  11. log.info("Sending offer: {}", new String(offer));
  12. final String base64Sdp =
  13. Base64.encodeBase64URLSafeString(offer);
  14. msg.setProperty(P2PConstants.TRANSACTION_ID, id);
  15. msg.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE);
  16. msg.setProperty(P2PConstants.SDP, base64Sdp);
  17. msg.setProperty(P2PConstants.CONTROL, "true");
  18. //msg.setProperty(P2PConstants.SECRET_KEY,
  19. // Base64.encodeBase64String(keyStorage.getWriteKey()));
  20. return msg;
  21. }

代码示例来源:origin: org.littleshoot/xmpp

  1. private Message newInviteToEstablishControlSocket(final String jid,
  2. final byte[] offer,
  3. final OfferAnswerTransactionListener transactionListener,
  4. final KeyStorage keyStorage) {
  5. final long id = RandomUtils.nextLong();
  6. transactionIdsToProcessors.put(id,
  7. new TransactionData(transactionListener, keyStorage));
  8. //transactionIdsToProcessors.put(id, td);
  9. final Message msg = new Message();
  10. msg.setTo(jid);
  11. log.info("Sending offer: {}", new String(offer));
  12. final String base64Sdp =
  13. Base64.encodeBase64URLSafeString(offer);
  14. msg.setProperty(P2PConstants.TRANSACTION_ID, id);
  15. msg.setProperty(P2PConstants.MESSAGE_TYPE, P2PConstants.INVITE);
  16. msg.setProperty(P2PConstants.SDP, base64Sdp);
  17. msg.setProperty(P2PConstants.CONTROL, "true");
  18. //msg.setProperty(P2PConstants.SECRET_KEY,
  19. // Base64.encodeBase64String(keyStorage.getWriteKey()));
  20. return msg;
  21. }

代码示例来源:origin: org.nuiton.wikitty/wikitty-api

  1. @Override
  2. public void sendMessage(WikittyEvent event) throws Exception {
  3. if (propagateEvent) {
  4. Message message = muc.createMessage();
  5. message.setBody(event.getType().toString());
  6. message.setProperty(PROPERTY_EVENT_NAME, event);
  7. muc.sendMessage(message);
  8. }
  9. }

代码示例来源:origin: org.mobicents.resources/mobicents-slee-ra-xmpp-library

  1. for (Iterator i=properties.keySet().iterator(); i.hasNext(); ) {
  2. String name = (String)i.next();
  3. message.setProperty(name, properties.get(name));

代码示例来源:origin: org.igniterealtime.smack/smack

  1. message.setProperty(name, properties.get(name));

代码示例来源:origin: tiandawu/IotXmpp

  1. message.setProperty(name, properties.get(name));

代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2

  1. message.setProperty(name, properties.get(name));

代码示例来源:origin: org.apache.axis2.transport/axis2-transport-xmpp

  1. message.setProperty(XMPPConstants.CONTENT_TYPE, HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML+ "; action="+ msgCtx.getSoapAction());
  2. }else{
  3. message.setProperty(XMPPConstants.CONTENT_TYPE, HTTPConstants.MEDIA_TYPE_TEXT_XML);
  4. message.setProperty(XMPPConstants.IS_SERVER_SIDE, new Boolean(false));
  5. message.setProperty(XMPPConstants.IN_REPLY_TO, xmppOutTransportInfo.getInReplyTo());
  6. message.setProperty(XMPPConstants.SEQUENCE_ID, xmppOutTransportInfo.getSequenceID());
  7. }else{
  8. message.setProperty(XMPPConstants.IS_SERVER_SIDE,new Boolean(true));
  9. message.setProperty(XMPPConstants.CONTAINS_SOAP_ENVELOPE, new Boolean(true));
  10. message.setProperty(XMPPConstants.SERVICE_NAME, serviceName);
  11. String action = options.getAction();
  12. if (action == null) {
  13. message.setProperty(XMPPConstants.ACTION, action);
  14. key = UUID.randomUUID().toString();
  15. xmppClientSidePacketListener.listenForResponse(key, msgCtx);
  16. message.setProperty(XMPPConstants.SEQUENCE_ID, key);

代码示例来源:origin: apache/axis2-java

  1. message.setProperty(XMPPConstants.CONTENT_TYPE, HTTPConstants.MEDIA_TYPE_APPLICATION_SOAP_XML+ "; action="+ msgCtx.getSoapAction());
  2. }else{
  3. message.setProperty(XMPPConstants.CONTENT_TYPE, HTTPConstants.MEDIA_TYPE_TEXT_XML);
  4. message.setProperty(XMPPConstants.IS_SERVER_SIDE, new Boolean(false));
  5. message.setProperty(XMPPConstants.IN_REPLY_TO, xmppOutTransportInfo.getInReplyTo());
  6. message.setProperty(XMPPConstants.SEQUENCE_ID, xmppOutTransportInfo.getSequenceID());
  7. }else{
  8. message.setProperty(XMPPConstants.IS_SERVER_SIDE,new Boolean(true));
  9. message.setProperty(XMPPConstants.CONTAINS_SOAP_ENVELOPE, new Boolean(true));
  10. message.setProperty(XMPPConstants.SERVICE_NAME, serviceName);
  11. String action = options.getAction();
  12. if (action == null) {
  13. message.setProperty(XMPPConstants.ACTION, action);
  14. key = UUID.randomUUID().toString();
  15. xmppClientSidePacketListener.listenForResponse(key, msgCtx);
  16. message.setProperty(XMPPConstants.SEQUENCE_ID, key);

代码示例来源:origin: org.apache.axis2.transport/axis2-transport-xmpp

  1. message.setProperty(XMPPConstants.IN_REPLY_TO, xmppOutTransportInfo.getInReplyTo());
  2. xmppConnection = xmppOutTransportInfo.getConnectionFactory().getXmppConnection();
  3. if(xmppConnection == null){
  4. Chat chat = chatManager.createChat(xmppOutTransportInfo.getDestinationAccount(), null);
  5. try{
  6. message.setProperty(XMPPConstants.SEQUENCE_ID,
  7. xmppOutTransportInfo.getSequenceID());
  8. message.setBody(responseMsg);

代码示例来源:origin: apache/axis2-java

  1. message.setProperty(XMPPConstants.IN_REPLY_TO, xmppOutTransportInfo.getInReplyTo());
  2. xmppConnection = xmppOutTransportInfo.getConnectionFactory().getXmppConnection();
  3. if(xmppConnection == null){
  4. Chat chat = chatManager.createChat(xmppOutTransportInfo.getDestinationAccount(), null);
  5. try{
  6. message.setProperty(XMPPConstants.SEQUENCE_ID,
  7. xmppOutTransportInfo.getSequenceID());
  8. message.setBody(responseMsg);

代码示例来源:origin: org.mule.transports/mule-transport-xmpp

  1. result.setProperty(propertyName, muleMessage.<Object>getOutboundProperty(propertyName));

相关文章