_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q21000
SASLAuthentication.registerSASLMechanism
train
public static void registerSASLMechanism(SASLMechanism mechanism) { synchronized (REGISTERED_MECHANISMS) { REGISTERED_MECHANISMS.add(mechanism); Collections.sort(REGISTERED_MECHANISMS); } }
java
{ "resource": "" }
q21001
SASLAuthentication.getRegisterdSASLMechanisms
train
public static Map<String, String> getRegisterdSASLMechanisms() { Map<String, String> answer = new LinkedHashMap<>(); synchronized (REGISTERED_MECHANISMS) { for (SASLMechanism mechanism : REGISTERED_MECHANISMS) { answer.put(mechanism.getClass().getName(), mechanism.toString())...
java
{ "resource": "" }
q21002
SASLAuthentication.unregisterSASLMechanism
train
public static boolean unregisterSASLMechanism(String clazz) { synchronized (REGISTERED_MECHANISMS) { Iterator<SASLMechanism> it = REGISTERED_MECHANISMS.iterator(); while (it.hasNext()) { SASLMechanism mechanism = it.next(); if (mechanism.getClass().getName...
java
{ "resource": "" }
q21003
SASLAuthentication.challengeReceived
train
public void challengeReceived(String challenge, boolean finalChallenge) throws SmackSaslException, NotConnectedException, InterruptedException { try { currentMechanism.challengeReceived(challenge, finalChallenge); } catch (InterruptedException | SmackSaslException | NotConnectedException e) ...
java
{ "resource": "" }
q21004
SASLAuthentication.authenticated
train
public void authenticated(Success success) throws SmackException, InterruptedException { // RFC6120 6.3.10 "At the end of the authentication exchange, the SASL server (the XMPP // "receiving entity") can include "additional data with success" if appropriate for the // SASL mechanism in use. In X...
java
{ "resource": "" }
q21005
MultipleAddresses.addAddress
train
public void addAddress(Type type, Jid jid, String node, String desc, boolean delivered, String uri) { // Create a new address with the specified configuration Address address = new Address(type); address.setJid(jid); address.setNode(node); address.setDescription(desc)...
java
{ "resource": "" }
q21006
PepManager.publish
train
public void publish(Item item, String node) throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException, NotAPubSubNodeException, NotALeafNodeException { LeafNode pubSubNode = pepPubSubManager.getLeafNode(node); pubSubNode.publish(item); }
java
{ "resource": "" }
q21007
JingleContent.addTransports
train
public void addTransports(final List<JingleTransport> transports) { synchronized (transports) { for (JingleTransport transport : transports) { addJingleTransport(transport); } } }
java
{ "resource": "" }
q21008
AdHocCommandManager.getRemoteCommand
train
public RemoteCommand getRemoteCommand(Jid jid, String node) { return new RemoteCommand(connection(), node, jid); }
java
{ "resource": "" }
q21009
AdHocCommandManager.respondError
train
private static IQ respondError(AdHocCommandData response, StanzaError.Builder error) { response.setType(IQ.Type.error); response.setError(error); return response; }
java
{ "resource": "" }
q21010
AdHocCommandManager.newInstanceOfCmd
train
private LocalCommand newInstanceOfCmd(String commandNode, String sessionID) throws XMPPErrorException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { AdHocCommandInfo commandI...
java
{ "resource": "" }
q21011
DefaultPrivateData.getNames
train
public synchronized Set<String> getNames() { if (map == null) { return Collections.emptySet(); } return Collections.unmodifiableSet(map.keySet()); }
java
{ "resource": "" }
q21012
ContentNegotiator.isFullyEstablished
train
public boolean isFullyEstablished() { boolean result = true; MediaNegotiator mediaNeg = getMediaNegotiator(); if ((mediaNeg == null) || !mediaNeg.isFullyEstablished()) { result = false; } TransportNegotiator transNeg = getTransportNegotiator(); if ((transNeg...
java
{ "resource": "" }
q21013
ContentNegotiator.getNegotiatorState
train
@Override public JingleNegotiatorState getNegotiatorState() { JingleNegotiatorState result = JingleNegotiatorState.PENDING; if ((mediaNeg != null) && (transNeg != null)) { if ((mediaNeg.getNegotiatorState() == JingleNegotiatorState.SUCCEEDED) || (transNeg.getNegotia...
java
{ "resource": "" }
q21014
ParserUtils.getBooleanAttribute
train
public static Boolean getBooleanAttribute(XmlPullParser parser, String name) { String valueString = parser.getAttributeValue("", name); if (valueString == null) return null; valueString = valueString.toLowerCase(Locale.US); return parseXmlBoolean(valueString); }
java
{ "resource": "" }
q21015
RTPBridge.getAttributes
train
public String getAttributes() { StringBuilder str = new StringBuilder(); if (getSid() != null) str.append(" sid='").append(getSid()).append('\''); if (getPass() != null) str.append(" pass='").append(getPass()).append('\''); if (getPortA() != -1) str...
java
{ "resource": "" }
q21016
RTPBridge.getIQChildElementBuilder
train
@Override protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder str) { str.attribute("sid", sid); str.rightAngleBracket(); if (bridgeAction.equals(BridgeAction.create)) str.append("<candidate/>"); else if (bridgeAction.equals(Br...
java
{ "resource": "" }
q21017
RTPBridge.getRTPBridge
train
@SuppressWarnings("deprecation") public static RTPBridge getRTPBridge(XMPPConnection connection, String sessionID) throws NotConnectedException, InterruptedException { if (!connection.isConnected()) { return null; } RTPBridge rtpPacket = new RTPBridge(sessionID); rtpPac...
java
{ "resource": "" }
q21018
RTPBridge.getPublicIP
train
@SuppressWarnings("deprecation") public static String getPublicIP(XMPPConnection xmppConnection) throws NotConnectedException, InterruptedException { if (!xmppConnection.isConnected()) { return null; } RTPBridge rtpPacket = new RTPBridge(RTPBridge.BridgeAction.publicip); ...
java
{ "resource": "" }
q21019
AudioChannel.start
train
public synchronized String start() { if (started) return null; // Create a processor for the specified jmf locator String result = createProcessor(); if (result != null) { started = false; } // Create an RTP session to transmit the output of the // p...
java
{ "resource": "" }
q21020
AudioChannel.stop
train
public void stop() { if (!started) return; synchronized (this) { try { started = false; if (processor != null) { processor.stop(); processor = null; for (RTPManager rtpMgr : rtpMgrs) { ...
java
{ "resource": "" }
q21021
AudioChannel.getPacketSize
train
private int getPacketSize(Format codecFormat, int milliseconds) throws IllegalArgumentException { String encoding = codecFormat.getEncoding(); if (encoding.equalsIgnoreCase(AudioFormat.GSM) || encoding.equalsIgnoreCase(AudioFormat.GSM_RTP)) { return milliseconds * 4; // 1 byt...
java
{ "resource": "" }
q21022
AudioChannel.createTransmitter
train
private String createTransmitter() { // Cheated. Should have checked the type. PushBufferDataSource pbds = (PushBufferDataSource) dataOutput; PushBufferStream[] pbss = pbds.getStreams(); rtpMgrs = new RTPManager[pbss.length]; SessionAddress localAddr, destAddr; InetAdd...
java
{ "resource": "" }
q21023
AudioChannel.setTrasmit
train
public void setTrasmit(boolean active) { for (SendStream sendStream : sendStreams) { try { if (active) { sendStream.start(); LOGGER.fine("START"); } else { sendStream.stop(); ...
java
{ "resource": "" }
q21024
GeoLocationManager.sendGeolocation
train
public void sendGeolocation(GeoLocation geoLocation) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotALeafNodeException { getNode().publish(new PayloadItem<GeoLocation>(geoLocation)); }
java
{ "resource": "" }
q21025
GeoLocationManager.stopPublishingGeolocation
train
public void stopPublishingGeolocation() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotALeafNodeException { GeoLocation emptyGeolocation = new GeoLocation.Builder().build(); getNode().publish(new PayloadItem<GeoLocation>(emptyGeolocation)); ...
java
{ "resource": "" }
q21026
OmemoService.setOmemoStoreBackend
train
@SuppressWarnings("unused") public void setOmemoStoreBackend( OmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> omemoStore) { if (this.omemoStore != null) { throw new IllegalStateException("An OmemoStore backend has already been set.")...
java
{ "resource": "" }
q21027
OmemoService.getOmemoRatchet
train
protected OmemoRatchet<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> getOmemoRatchet(OmemoManager manager) { OmemoRatchet<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Sess, T_Addr, T_ECPub, T_Bundle, T_Ciph> omemoRatchet = omemoRatchets.get(manager...
java
{ "resource": "" }
q21028
OmemoService.init
train
void init(OmemoManager.LoggedInOmemoManager managerGuard) throws InterruptedException, CorruptedOmemoKeyException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException, PubSubException.NotALeafNodeException { OmemoManager...
java
{ "resource": "" }
q21029
OmemoService.createRatchetUpdateElement
train
OmemoElement createRatchetUpdateElement(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice) throws InterruptedException, SmackException.NoResponseException, CorruptedOmemoKeyException, SmackException.NotConnectedException, Canno...
java
{ "resource": "" }
q21030
OmemoService.createOmemoMessage
train
OmemoMessage.Sent createOmemoMessage(OmemoManager.LoggedInOmemoManager managerGuard, Set<OmemoDevice> contactsDevices, String message) throws InterruptedException, UndecidedOmemoIdentityException, CryptoFailedException, ...
java
{ "resource": "" }
q21031
OmemoService.fetchBundle
train
private static OmemoBundleElement fetchBundle(XMPPConnection connection, OmemoDevice contactsDevice) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, PubSubEx...
java
{ "resource": "" }
q21032
OmemoService.publishBundle
train
static void publishBundle(XMPPConnection connection, OmemoDevice userDevice, OmemoBundleElement bundle) throws XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException { PubSubManager pm = PubSubManager.getInstanceFo...
java
{ "resource": "" }
q21033
OmemoService.fetchDeviceList
train
private static OmemoDeviceListElement fetchDeviceList(XMPPConnection connection, BareJid contact) throws InterruptedException, PubSubException.NotALeafNodeException, SmackException.NoResponseException, SmackException.NotConnectedException, XMPPException.XMPPErrorException, PubSubExce...
java
{ "resource": "" }
q21034
OmemoService.publishDeviceList
train
static void publishDeviceList(XMPPConnection connection, OmemoDeviceListElement deviceList) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { PubSubManager.getInstanceFor(connection, connection.getUs...
java
{ "resource": "" }
q21035
OmemoService.cleanUpDeviceList
train
OmemoCachedDeviceList cleanUpDeviceList(OmemoDevice userDevice) { OmemoCachedDeviceList cachedDeviceList; // Delete stale devices if allowed and necessary if (OmemoConfiguration.getDeleteStaleDevices()) { cachedDeviceList = deleteStaleDevices(userDevice); } else { ...
java
{ "resource": "" }
q21036
OmemoService.refreshDeviceList
train
OmemoCachedDeviceList refreshDeviceList(XMPPConnection connection, OmemoDevice userDevice, BareJid contact) throws InterruptedException, PubSubException.NotALeafNodeException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { // ...
java
{ "resource": "" }
q21037
OmemoService.buildFreshSessionWithDevice
train
void buildFreshSessionWithDevice(XMPPConnection connection, OmemoDevice userDevice, OmemoDevice contactsDevice) throws CannotEstablishOmemoSessionException, SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, CorruptedOmemoKeyException { if (c...
java
{ "resource": "" }
q21038
OmemoService.getUndecidedDevices
train
private Set<OmemoDevice> getUndecidedDevices(OmemoDevice userDevice, OmemoTrustCallback callback, Set<OmemoDevice> devices) { Set<OmemoDevice> undecidedDevices = new HashSet<>(); for (OmemoDevice device : devices) { OmemoFingerprint fingerprint; try { fingerprin...
java
{ "resource": "" }
q21039
OmemoService.hasSession
train
private boolean hasSession(OmemoDevice userDevice, OmemoDevice contactsDevice) { return getOmemoStoreBackend().loadRawSession(userDevice, contactsDevice) != null; }
java
{ "resource": "" }
q21040
OmemoService.shouldRotateSignedPreKey
train
private boolean shouldRotateSignedPreKey(OmemoDevice userDevice) { if (!OmemoConfiguration.getRenewOldSignedPreKeys()) { return false; } Date now = new Date(); Date lastRenewal = getOmemoStoreBackend().getDateOfLastSignedPreKeyRenewal(userDevice); if (lastRenewal ==...
java
{ "resource": "" }
q21041
OmemoService.removeStaleDevicesFromDeviceList
train
private OmemoCachedDeviceList removeStaleDevicesFromDeviceList(OmemoDevice userDevice, BareJid contact, OmemoCachedDeviceList contactsDeviceList, ...
java
{ "resource": "" }
q21042
OmemoService.removeOurDevice
train
static void removeOurDevice(OmemoDevice userDevice, Collection<OmemoDevice> devices) { if (devices.contains(userDevice)) { devices.remove(userDevice); } }
java
{ "resource": "" }
q21043
OmemoService.repairBrokenSessionWithPreKeyMessage
train
private void repairBrokenSessionWithPreKeyMessage(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice brokenDevice) { LOGGER.log(Level.WARNING, "Attempt to repair the session by sending a fresh preKey message to " + brokenDevice); ...
java
{ "resource": "" }
q21044
OmemoService.sendRatchetUpdate
train
private void sendRatchetUpdate(OmemoManager.LoggedInOmemoManager managerGuard, OmemoDevice contactsDevice) throws CorruptedOmemoKeyException, InterruptedException, SmackException.NoResponseException, NoSuchAlgorithmException, SmackException.NotConnectedException, CryptoFailedException, ...
java
{ "resource": "" }
q21045
OmemoService.purgeDeviceList
train
public void purgeDeviceList(OmemoManager.LoggedInOmemoManager managerGuard) throws InterruptedException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, SmackException.NoResponseException { OmemoManager omemoManager = managerGuard.get(); OmemoDevice userD...
java
{ "resource": "" }
q21046
JingleNegotiator.getListenersList
train
protected List<JingleListener> getListenersList() { ArrayList<JingleListener> result; synchronized (listeners) { result = new ArrayList<>(listeners); } return result; }
java
{ "resource": "" }
q21047
MultiUserChatLight.sendMessage
train
public void sendMessage(String text) throws NotConnectedException, InterruptedException { Message message = createMessage(); message.setBody(text); connection.sendStanza(message); }
java
{ "resource": "" }
q21048
MultiUserChatLight.sendMessage
train
public void sendMessage(Message message) throws NotConnectedException, InterruptedException { message.setTo(room); message.setType(Message.Type.groupchat); connection.sendStanza(message); }
java
{ "resource": "" }
q21049
MultiUserChatLight.removeConnectionCallbacks
train
private void removeConnectionCallbacks() { connection.removeSyncStanzaListener(messageListener); if (messageCollector != null) { messageCollector.cancel(); messageCollector = null; } }
java
{ "resource": "" }
q21050
MultiUserChatLight.leave
train
public void leave() throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException { HashMap<Jid, MUCLightAffiliation> affiliations = new HashMap<>(); affiliations.put(connection.getUser(), MUCLightAffiliation.none); MUCLightChangeAffiliationsIQ changeAffiliationsIQ...
java
{ "resource": "" }
q21051
MultiUserChatLight.getFullInfo
train
public MUCLightRoomInfo getFullInfo(String version) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightGetInfoIQ mucLightGetInfoIQ = new MUCLightGetInfoIQ(room, version); IQ responseIq = connection.createStanzaCollectorAndSend(mucLightGetIn...
java
{ "resource": "" }
q21052
MultiUserChatLight.getConfiguration
train
public MUCLightRoomConfiguration getConfiguration(String version) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightGetConfigsIQ mucLightGetConfigsIQ = new MUCLightGetConfigsIQ(room, version); IQ responseIq = connection.createStanzaCollecto...
java
{ "resource": "" }
q21053
MultiUserChatLight.changeAffiliations
train
public void changeAffiliations(HashMap<Jid, MUCLightAffiliation> affiliations) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightChangeAffiliationsIQ changeAffiliationsIQ = new MUCLightChangeAffiliationsIQ(room, affiliations); connection.cr...
java
{ "resource": "" }
q21054
MultiUserChatLight.destroy
train
public void destroy() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightDestroyIQ mucLightDestroyIQ = new MUCLightDestroyIQ(room); IQ responseIq = connection.createStanzaCollectorAndSend(mucLightDestroyIQ).nextResultOrThrow(); boolean roomDestr...
java
{ "resource": "" }
q21055
MultiUserChatLight.changeSubject
train
public void changeSubject(String subject) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, null, subject, null); connection.createStanzaCollectorAndSend(mucLightSetConfigIQ)...
java
{ "resource": "" }
q21056
MultiUserChatLight.changeRoomName
train
public void changeRoomName(String roomName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, null); connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).ne...
java
{ "resource": "" }
q21057
FileTransferNegotiator.getInstanceFor
train
public static synchronized FileTransferNegotiator getInstanceFor( final XMPPConnection connection) { FileTransferNegotiator fileTransferNegotiator = INSTANCES.get(connection); if (fileTransferNegotiator == null) { fileTransferNegotiator = new FileTransferNegotiator(connection); ...
java
{ "resource": "" }
q21058
FileTransferNegotiator.setServiceEnabled
train
private static void setServiceEnabled(final XMPPConnection connection, final boolean isEnabled) { ServiceDiscoveryManager manager = ServiceDiscoveryManager .getInstanceFor(connection); List<String> namespaces = new ArrayList<>(); namespaces.addAll(Arrays.asList(NAMES...
java
{ "resource": "" }
q21059
FileTransferNegotiator.isServiceEnabled
train
public static boolean isServiceEnabled(final XMPPConnection connection) { ServiceDiscoveryManager manager = ServiceDiscoveryManager .getInstanceFor(connection); List<String> namespaces = new ArrayList<>(); namespaces.addAll(Arrays.asList(NAMESPACE)); namespaces.add(DataP...
java
{ "resource": "" }
q21060
FileTransferNegotiator.getSupportedProtocols
train
public static Collection<String> getSupportedProtocols() { List<String> protocols = new ArrayList<>(); protocols.add(DataPacketExtension.NAMESPACE); if (!IBB_ONLY) { protocols.add(Bytestream.NAMESPACE); } return Collections.unmodifiableList(protocols); }
java
{ "resource": "" }
q21061
FileTransferNegotiator.selectStreamNegotiator
train
public StreamNegotiator selectStreamNegotiator( FileTransferRequest request) throws NotConnectedException, NoStreamMethodsOfferedException, NoAcceptableTransferMechanisms, InterruptedException { StreamInitiation si = request.getStreamInitiation(); FormField streamMethodField = getStreamMetho...
java
{ "resource": "" }
q21062
FileTransferNegotiator.getNextStreamID
train
public static String getNextStreamID() { StringBuilder buffer = new StringBuilder(); buffer.append(STREAM_INIT_PREFIX); buffer.append(randomGenerator.nextInt(Integer.MAX_VALUE) + randomGenerator.nextInt(Integer.MAX_VALUE)); return buffer.toString(); }
java
{ "resource": "" }
q21063
OmemoBundleElement.getPreKeys
train
public HashMap<Integer, byte[]> getPreKeys() { if (preKeys == null) { preKeys = new HashMap<>(); for (int id : preKeysB64.keySet()) { preKeys.put(id, Base64.decode(preKeysB64.get(id))); } } return this.preKeys; }
java
{ "resource": "" }
q21064
IQ.getChildElementXML
train
public final XmlStringBuilder getChildElementXML(XmlEnvironment enclosingXmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(); if (type == Type.error) { // Add the error sub-packet, if there is one. appendErrorIfExists(xml, enclosingXmlEnvironment); } e...
java
{ "resource": "" }
q21065
RosterGroup.setName
train
public void setName(String name) throws NotConnectedException, NoResponseException, XMPPErrorException, InterruptedException { synchronized (entries) { for (RosterEntry entry : entries) { RosterPacket packet = new RosterPacket(); packet.setType(IQ.Type.set); ...
java
{ "resource": "" }
q21066
ChatMarkersManager.getInstanceFor
train
public static synchronized ChatMarkersManager getInstanceFor(XMPPConnection connection) { ChatMarkersManager chatMarkersManager = INSTANCES.get(connection); if (chatMarkersManager == null) { chatMarkersManager = new ChatMarkersManager(connection); INSTANCES.put(connection, chatM...
java
{ "resource": "" }
q21067
ChatMarkersManager.addIncomingChatMarkerMessageListener
train
public synchronized boolean addIncomingChatMarkerMessageListener(ChatMarkersListener listener) { boolean res = incomingListeners.add(listener); if (!enabled) { serviceDiscoveryManager.addFeature(ChatMarkersElements.NAMESPACE); enabled = true; } return res; }
java
{ "resource": "" }
q21068
ChatMarkersManager.removeIncomingChatMarkerMessageListener
train
public synchronized boolean removeIncomingChatMarkerMessageListener(ChatMarkersListener listener) { boolean res = incomingListeners.remove(listener); if (incomingListeners.isEmpty() && enabled) { serviceDiscoveryManager.removeFeature(ChatMarkersElements.NAMESPACE); enabled = fals...
java
{ "resource": "" }
q21069
ConnectionConfiguration.isEnabledSaslMechanism
train
public boolean isEnabledSaslMechanism(String saslMechanism) { // If enabledSaslMechanisms is not set, then all mechanisms which are not blacklisted are enabled per default. if (enabledSaslMechanisms == null) { return !SASLAuthentication.getBlacklistedSASLMechanisms().contains(saslMechanism);...
java
{ "resource": "" }
q21070
StanzaIdElement.getStanzaId
train
public static StanzaIdElement getStanzaId(Message message) { return message.getExtension(StanzaIdElement.ELEMENT, StableUniqueStanzaIdManager.NAMESPACE); }
java
{ "resource": "" }
q21071
Stanza.setTo
train
@Deprecated public void setTo(String to) { Jid jid; try { jid = JidCreate.from(to); } catch (XmppStringprepException e) { throw new IllegalArgumentException(e); } setTo(jid); }
java
{ "resource": "" }
q21072
Stanza.setFrom
train
@Deprecated public void setFrom(String from) { Jid jid; try { jid = JidCreate.from(from); } catch (XmppStringprepException e) { throw new IllegalArgumentException(e); } setFrom(jid); }
java
{ "resource": "" }
q21073
Stanza.setError
train
public void setError(StanzaError.Builder xmppErrorBuilder) { if (xmppErrorBuilder == null) { return; } xmppErrorBuilder.setStanza(this); error = xmppErrorBuilder.build(); }
java
{ "resource": "" }
q21074
Stanza.addExtension
train
public void addExtension(ExtensionElement extension) { if (extension == null) return; String key = XmppStringUtils.generateKey(extension.getElementName(), extension.getNamespace()); synchronized (packetExtensions) { packetExtensions.put(key, extension); } }
java
{ "resource": "" }
q21075
Stanza.overrideExtension
train
public ExtensionElement overrideExtension(ExtensionElement extension) { if (extension == null) return null; synchronized (packetExtensions) { // Note that we need to use removeExtension(String, String) here. If would use // removeExtension(ExtensionElement) then we would remove b...
java
{ "resource": "" }
q21076
Stanza.addExtensions
train
public void addExtensions(Collection<ExtensionElement> extensions) { if (extensions == null) return; for (ExtensionElement packetExtension : extensions) { addExtension(packetExtension); } }
java
{ "resource": "" }
q21077
Stanza.hasExtension
train
public boolean hasExtension(String namespace) { synchronized (packetExtensions) { for (ExtensionElement packetExtension : packetExtensions.values()) { if (packetExtension.getNamespace().equals(namespace)) { return true; } } } ...
java
{ "resource": "" }
q21078
Stanza.removeExtension
train
public ExtensionElement removeExtension(String elementName, String namespace) { String key = XmppStringUtils.generateKey(elementName, namespace); synchronized (packetExtensions) { return packetExtensions.remove(key); } }
java
{ "resource": "" }
q21079
Stanza.removeExtension
train
public ExtensionElement removeExtension(ExtensionElement extension) { String key = XmppStringUtils.generateKey(extension.getElementName(), extension.getNamespace()); synchronized (packetExtensions) { List<ExtensionElement> list = packetExtensions.getAll(key); boolean removed = l...
java
{ "resource": "" }
q21080
Stanza.appendErrorIfExists
train
protected void appendErrorIfExists(XmlStringBuilder xml, XmlEnvironment enclosingXmlEnvironment) { StanzaError error = getError(); if (error != null) { xml.append(error.toXML(enclosingXmlEnvironment)); } }
java
{ "resource": "" }
q21081
Agent.getName
train
public String getName() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.get); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); AgentInfo response = connectio...
java
{ "resource": "" }
q21082
Agent.setName
train
public void setName(String newName) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { AgentInfo agentInfo = new AgentInfo(); agentInfo.setType(IQ.Type.set); agentInfo.setTo(workgroupJID); agentInfo.setFrom(getUser()); agentInfo.setName(...
java
{ "resource": "" }
q21083
JivePropertiesExtension.setProperty
train
public synchronized void setProperty(String name, Object value) { if (!(value instanceof Serializable)) { throw new IllegalArgumentException("Value must be serializable"); } properties.put(name, value); }
java
{ "resource": "" }
q21084
JivePropertiesExtension.getPropertyNames
train
public synchronized Collection<String> getPropertyNames() { if (properties == null) { return Collections.emptySet(); } return Collections.unmodifiableSet(new HashSet<>(properties.keySet())); }
java
{ "resource": "" }
q21085
JivePropertiesExtension.getProperties
train
public synchronized Map<String, Object> getProperties() { if (properties == null) { return Collections.emptyMap(); } return Collections.unmodifiableMap(new HashMap<>(properties)); }
java
{ "resource": "" }
q21086
OctTreeQuantizer.addPixels
train
@Override public void addPixels(int[] pixels, int offset, int count) { for (int i = 0; i < count; i++) { insertColor(pixels[i + offset]); if (colors > reduceColors) reduceTree(reduceColors); } }
java
{ "resource": "" }
q21087
OctTreeQuantizer.buildColorTable
train
public void buildColorTable(int[] inPixels, int[] table) { int count = inPixels.length; maximumColors = table.length; for (int i = 0; i < count; i++) { insertColor(inPixels[i]); if (colors > reduceColors) reduceTree(reduceColors); } if (col...
java
{ "resource": "" }
q21088
MultiUserChat.enter
train
private Presence enter(MucEnterConfiguration conf) throws NotConnectedException, NoResponseException, XMPPErrorException, InterruptedException, NotAMucServiceException { final DomainBareJid mucService = room.asDomainBareJid(); if (!KNOWN_MUC_SERVICES.containsKey(mucService)) { ...
java
{ "resource": "" }
q21089
MultiUserChat.getEnterConfigurationBuilder
train
public MucEnterConfiguration.Builder getEnterConfigurationBuilder(Resourcepart nickname) { return new MucEnterConfiguration.Builder(nickname, connection.getReplyTimeout()); }
java
{ "resource": "" }
q21090
MultiUserChat.createOrJoin
train
public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException { MucEnterConfiguration mucEnterConfiguration = getEnterConfigurat...
java
{ "resource": "" }
q21091
MultiUserChat.createOrJoinIfNecessary
train
public MucCreateConfigFormHandle createOrJoinIfNecessary(Resourcepart nickname, String password) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotAMucServiceException { if (isJoined()) { return null; } MucEnterConfigu...
java
{ "resource": "" }
q21092
MultiUserChat.join
train
public void join(Resourcepart nickname) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException, NotAMucServiceException { MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname); join(builder.build()); }
java
{ "resource": "" }
q21093
MultiUserChat.leave
train
public synchronized Presence leave() throws NotConnectedException, InterruptedException, NoResponseException, XMPPErrorException, MucNotJoinedException { // Note that this method is intentionally not guarded by // "if (!joined) return" because it should be always be possible to lea...
java
{ "resource": "" }
q21094
MultiUserChat.sendConfigurationForm
train
public void sendConfigurationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { MUCOwner iq = new MUCOwner(); iq.setTo(room); iq.setType(IQ.Type.set); iq.addExtension(form.getDataFormToSend()); connection.createStanzaCol...
java
{ "resource": "" }
q21095
MultiUserChat.fireInvitationRejectionListeners
train
private void fireInvitationRejectionListeners(Message message, MUCUser.Decline rejection) { EntityBareJid invitee = rejection.getFrom(); String reason = rejection.getReason(); InvitationRejectionListener[] listeners; synchronized (invitationRejectionListeners) { listeners = n...
java
{ "resource": "" }
q21096
MultiUserChat.getReservedNickname
train
public String getReservedNickname() throws SmackException, InterruptedException { try { DiscoverInfo result = ServiceDiscoveryManager.getInstanceFor(connection).discoverInfo( room, "x-roomuser-item"); // Look for an Identity that ho...
java
{ "resource": "" }
q21097
MultiUserChat.requestVoice
train
public void requestVoice() throws NotConnectedException, InterruptedException { DataForm form = new DataForm(DataForm.Type.submit); FormField formTypeField = new FormField(FormField.FORM_TYPE); formTypeField.addValue(MUCInitialPresence.NAMESPACE + "#request"); form.addField(formTypeField...
java
{ "resource": "" }
q21098
MultiUserChat.grantVoice
train
public void grantVoice(Collection<Resourcepart> nicknames) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeRole(nicknames, MUCRole.participant); }
java
{ "resource": "" }
q21099
MultiUserChat.grantVoice
train
public void grantVoice(Resourcepart nickname) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeRole(nickname, MUCRole.participant, null); }
java
{ "resource": "" }