├── build ├── README.html ├── ant-contrib.jar ├── asm.jar ├── build.properties ├── build.xml ├── build │ ├── java-xmlbuilder-0.3.jar │ ├── versions.txt │ └── xmlunit.jar ├── javassist-3.10.0.GA.jar ├── jaxen.jar ├── junit.jar ├── merge │ ├── jbosh-0.6.0.jar │ ├── jzlib.jar │ └── xpp.jar ├── mockito-all-1.8.2.jar ├── objenesis-1.1.jar ├── pmd.jar ├── powermock-mockito-1.3.5-full.jar ├── projects │ ├── Smack.iml │ ├── Smack.ipr │ └── SmackUnitTest.iml ├── release.xml └── resources │ ├── META-INF │ ├── smack-config.xml │ └── smack.providers │ ├── images │ ├── message.png │ ├── nav_left_blue.png │ ├── nav_right_red.png │ ├── photo_portrait.png │ ├── question_and_answer.png │ ├── trafficlight_green.png │ ├── trafficlight_off.png │ ├── trafficlight_red.png │ ├── unknown.png │ └── warning.png │ └── releasedocs │ ├── README.html │ └── changelog.html ├── documentation ├── connections.html ├── debugging.html ├── extensions │ ├── dataforms.html │ ├── disco.html │ ├── filetransfer.html │ ├── index.html │ ├── intro.html │ ├── invitation.html │ ├── messageevents.html │ ├── muc.html │ ├── privatedata.html │ ├── pubsub.html │ ├── rosterexchange.html │ ├── style.css │ ├── time.html │ ├── toc.html │ └── xhtml.html ├── gettingstarted.html ├── images │ ├── debugwindow.gif │ ├── enhanceddebugger.png │ ├── roster.png │ └── smacklogo.png ├── index.html ├── messaging.html ├── overview.html ├── privacy.html ├── processing.html ├── properties.html ├── providers.html ├── roster.html └── style.css ├── jingle └── extension │ ├── build │ ├── build.properties │ ├── build.xml │ ├── lib │ │ ├── Speex.jar │ │ ├── commons-logging-1.1.jar │ │ ├── commons-logging-adapters-1.1.jar │ │ ├── commons-logging-api-1.1.jar │ │ ├── jmf.jar │ │ ├── jspeex-0.9.7-jfcom.jar │ │ ├── junit.jar │ │ ├── mac │ │ │ ├── 0JavaSoundStream.fix.mac.jar │ │ │ └── 0jmf.mac.jar │ │ └── windows │ │ │ ├── jmacm.dll │ │ │ ├── jmam.dll │ │ │ ├── jmcvid.dll │ │ │ ├── jmdaud.dll │ │ │ ├── jmdaudc.dll │ │ │ ├── jmddraw.dll │ │ │ ├── jmfjawt.dll │ │ │ ├── jmg723.dll │ │ │ ├── jmgdi.dll │ │ │ ├── jmgsm.dll │ │ │ ├── jmh263enc.dll │ │ │ ├── jmjpeg.dll │ │ │ ├── jmmci.dll │ │ │ ├── jmmpa.dll │ │ │ ├── jmmpegv.dll │ │ │ ├── jmutil.dll │ │ │ ├── jmvcm.dll │ │ │ ├── jmvfw.dll │ │ │ └── jmvh263.dll │ ├── merge │ │ └── jstun.jar │ └── projects │ │ ├── Jingle.ipr │ │ ├── Jingle.iws │ │ ├── JingleExtension.iml │ │ └── Smack.iws │ ├── source │ ├── org │ │ └── jivesoftware │ │ │ └── smackx │ │ │ ├── jingle │ │ │ ├── ContentNegotiator.java │ │ │ ├── JingleActionEnum.java │ │ │ ├── JingleException.java │ │ │ ├── JingleManager.java │ │ │ ├── JingleNegotiator.java │ │ │ ├── JingleNegotiatorState.java │ │ │ ├── JingleSession.java │ │ │ ├── JingleSessionRequest.java │ │ │ ├── JingleSessionState.java │ │ │ ├── JingleSessionStateActive.java │ │ │ ├── JingleSessionStateEnded.java │ │ │ ├── JingleSessionStatePending.java │ │ │ ├── JingleSessionStateUnknown.java │ │ │ ├── SmackLogger.java │ │ │ ├── listeners │ │ │ │ ├── CreatedJingleSessionListener.java │ │ │ │ ├── JingleListener.java │ │ │ │ ├── JingleMediaInfoListener.java │ │ │ │ ├── JingleMediaListener.java │ │ │ │ ├── JingleSessionListener.java │ │ │ │ ├── JingleSessionRequestListener.java │ │ │ │ └── JingleTransportListener.java │ │ │ ├── media │ │ │ │ ├── ContentInfo.java │ │ │ │ ├── JingleMediaManager.java │ │ │ │ ├── JingleMediaSession.java │ │ │ │ ├── MediaNegotiator.java │ │ │ │ ├── MediaReceivedListener.java │ │ │ │ └── PayloadType.java │ │ │ ├── mediaimpl │ │ │ │ ├── JMFInit.java │ │ │ │ ├── demo │ │ │ │ │ └── Demo.java │ │ │ │ ├── jmf │ │ │ │ │ ├── AudioChannel.java │ │ │ │ │ ├── AudioFormatUtils.java │ │ │ │ │ ├── AudioMediaSession.java │ │ │ │ │ ├── AudioReceiver.java │ │ │ │ │ └── JmfMediaManager.java │ │ │ │ ├── jspeex │ │ │ │ │ ├── AudioMediaSession.java │ │ │ │ │ └── SpeexMediaManager.java │ │ │ │ ├── multi │ │ │ │ │ └── MultiMediaManager.java │ │ │ │ ├── sshare │ │ │ │ │ ├── ScreenShareMediaManager.java │ │ │ │ │ ├── ScreenShareSession.java │ │ │ │ │ └── api │ │ │ │ │ │ ├── AbstractBufferedImageOp.java │ │ │ │ │ │ ├── DefaultDecoder.java │ │ │ │ │ │ ├── DefaultEncoder.java │ │ │ │ │ │ ├── ImageDecoder.java │ │ │ │ │ │ ├── ImageEncoder.java │ │ │ │ │ │ ├── ImageReceiver.java │ │ │ │ │ │ ├── ImageTransmitter.java │ │ │ │ │ │ ├── OctTreeQuantizer.java │ │ │ │ │ │ ├── PixelUtils.java │ │ │ │ │ │ ├── QuantizeFilter.java │ │ │ │ │ │ ├── Quantizer.java │ │ │ │ │ │ └── WholeImageFilter.java │ │ │ │ └── test │ │ │ │ │ ├── TestMediaManager.java │ │ │ │ │ └── TestMediaSession.java │ │ │ └── nat │ │ │ │ ├── BasicResolver.java │ │ │ │ ├── BasicTransportManager.java │ │ │ │ ├── BridgedResolver.java │ │ │ │ ├── BridgedTransportManager.java │ │ │ │ ├── DatagramListener.java │ │ │ │ ├── FixedResolver.java │ │ │ │ ├── FixedTransportManager.java │ │ │ │ ├── HttpServer.java │ │ │ │ ├── ICECandidate.java │ │ │ │ ├── ICEResolver.java │ │ │ │ ├── ICETransportManager.java │ │ │ │ ├── JingleTransportManager.java │ │ │ │ ├── RTPBridge.java │ │ │ │ ├── ResultListener.java │ │ │ │ ├── STUN.java │ │ │ │ ├── STUNResolver.java │ │ │ │ ├── STUNTransportManager.java │ │ │ │ ├── TcpUdpBridgeClient.java │ │ │ │ ├── TcpUdpBridgeServer.java │ │ │ │ ├── TestResult.java │ │ │ │ ├── TransportCandidate.java │ │ │ │ ├── TransportNegotiator.java │ │ │ │ ├── TransportResolver.java │ │ │ │ └── TransportResolverListener.java │ │ │ ├── package.html │ │ │ ├── packet │ │ │ ├── Jingle.java │ │ │ ├── JingleContent.java │ │ │ ├── JingleContentDescription.java │ │ │ ├── JingleContentInfo.java │ │ │ ├── JingleDescription.java │ │ │ ├── JingleError.java │ │ │ ├── JingleTransport.java │ │ │ └── package.html │ │ │ └── provider │ │ │ ├── JingleContentDescriptionProvider.java │ │ │ ├── JingleContentInfoProvider.java │ │ │ ├── JingleContentProvider.java │ │ │ ├── JingleDescriptionProvider.java │ │ │ ├── JingleProvider.java │ │ │ ├── JingleTransportProvider.java │ │ │ └── package.html │ └── overview.html │ └── test │ ├── config │ └── test-case.xml │ └── org │ └── jivesoftware │ └── smackx │ ├── jingle │ ├── JingleManagerTest.java │ ├── JingleMediaTest.java │ ├── JingleSessionTest.java │ ├── JingleSupportTests.java │ ├── PayloadTypeTest.java │ └── nat │ │ ├── BasicResolverTest.java │ │ ├── BridgedResolverTest.java │ │ ├── LocalhostTest.java │ │ ├── STUNResolverTest.java │ │ ├── TransportCandidateTest.java │ │ └── TransportResolverTest.java │ └── provider │ └── JingleProviderTest.java ├── sample ├── conf │ └── WEB-INF │ │ └── web.xml └── web │ ├── addContact.jsp │ ├── chat.jsp │ ├── css │ └── general.css │ ├── global.jsp │ ├── images │ ├── address_book.png │ ├── businessman_add.png │ ├── businessman_delete.png │ ├── businessmen.png │ ├── garbage.png │ ├── messages.png │ ├── nav_right_blue.png │ ├── plug_delete.png │ └── refresh.png │ ├── index.jsp │ ├── login.jsp │ ├── moveContact.jsp │ └── viewRoster.jsp ├── source ├── org │ └── jivesoftware │ │ ├── smack │ │ ├── AbstractConnectionListener.java │ │ ├── AccountManager.java │ │ ├── BOSHConfiguration.java │ │ ├── BOSHConnection.java │ │ ├── BOSHPacketReader.java │ │ ├── Chat.java │ │ ├── ChatManager.java │ │ ├── ChatManagerListener.java │ │ ├── Connection.java │ │ ├── ConnectionConfiguration.java │ │ ├── ConnectionCreationListener.java │ │ ├── ConnectionListener.java │ │ ├── MessageListener.java │ │ ├── NonSASLAuthentication.java │ │ ├── OpenTrustManager.java │ │ ├── PacketCollector.java │ │ ├── PacketInterceptor.java │ │ ├── PacketListener.java │ │ ├── PacketReader.java │ │ ├── PacketWriter.java │ │ ├── PrivacyList.java │ │ ├── PrivacyListListener.java │ │ ├── PrivacyListManager.java │ │ ├── ReconnectionManager.java │ │ ├── Roster.java │ │ ├── RosterEntry.java │ │ ├── RosterGroup.java │ │ ├── RosterListener.java │ │ ├── RosterStorage.java │ │ ├── SASLAuthentication.java │ │ ├── ServerTrustManager.java │ │ ├── SmackConfiguration.java │ │ ├── UserAuthentication.java │ │ ├── XMPPConnection.java │ │ ├── XMPPException.java │ │ ├── debugger │ │ │ ├── ConsoleDebugger.java │ │ │ ├── LiteDebugger.java │ │ │ ├── SmackDebugger.java │ │ │ └── package.html │ │ ├── filter │ │ │ ├── AndFilter.java │ │ │ ├── FromContainsFilter.java │ │ │ ├── FromMatchesFilter.java │ │ │ ├── IQTypeFilter.java │ │ │ ├── MessageTypeFilter.java │ │ │ ├── NotFilter.java │ │ │ ├── OrFilter.java │ │ │ ├── PacketExtensionFilter.java │ │ │ ├── PacketFilter.java │ │ │ ├── PacketIDFilter.java │ │ │ ├── PacketTypeFilter.java │ │ │ ├── ThreadFilter.java │ │ │ ├── ToContainsFilter.java │ │ │ └── package.html │ │ ├── package.html │ │ ├── packet │ │ │ ├── Authentication.java │ │ │ ├── Bind.java │ │ │ ├── DefaultPacketExtension.java │ │ │ ├── IQ.java │ │ │ ├── Message.java │ │ │ ├── Packet.java │ │ │ ├── PacketExtension.java │ │ │ ├── Presence.java │ │ │ ├── Privacy.java │ │ │ ├── PrivacyItem.java │ │ │ ├── Registration.java │ │ │ ├── RosterPacket.java │ │ │ ├── Session.java │ │ │ ├── StreamError.java │ │ │ ├── XMPPError.java │ │ │ └── package.html │ │ ├── provider │ │ │ ├── IQProvider.java │ │ │ ├── PacketExtensionProvider.java │ │ │ ├── PrivacyProvider.java │ │ │ ├── ProviderManager.java │ │ │ └── package.html │ │ ├── proxy │ │ │ ├── DirectSocketFactory.java │ │ │ ├── HTTPProxySocketFactory.java │ │ │ ├── ProxyException.java │ │ │ ├── ProxyInfo.java │ │ │ ├── Socks4ProxySocketFactory.java │ │ │ └── Socks5ProxySocketFactory.java │ │ ├── sasl │ │ │ ├── SASLAnonymous.java │ │ │ ├── SASLCramMD5Mechanism.java │ │ │ ├── SASLDigestMD5Mechanism.java │ │ │ ├── SASLExternalMechanism.java │ │ │ ├── SASLFacebookConnect.java │ │ │ ├── SASLGSSAPIMechanism.java │ │ │ ├── SASLMechanism.java │ │ │ ├── SASLPlainMechanism.java │ │ │ └── package.html │ │ └── util │ │ │ ├── Base64.java │ │ │ ├── Cache.java │ │ │ ├── DNSUtil.java │ │ │ ├── ObservableReader.java │ │ │ ├── ObservableWriter.java │ │ │ ├── PacketParserUtils.java │ │ │ ├── ReaderListener.java │ │ │ ├── StringUtils.java │ │ │ ├── WriterListener.java │ │ │ ├── collections │ │ │ ├── AbstractEmptyIterator.java │ │ │ ├── AbstractHashedMap.java │ │ │ ├── AbstractKeyValue.java │ │ │ ├── AbstractMapEntry.java │ │ │ ├── AbstractReferenceMap.java │ │ │ ├── DefaultMapEntry.java │ │ │ ├── EmptyIterator.java │ │ │ ├── EmptyMapIterator.java │ │ │ ├── IterableMap.java │ │ │ ├── KeyValue.java │ │ │ ├── MapIterator.java │ │ │ ├── ReferenceMap.java │ │ │ └── ResettableIterator.java │ │ │ └── package.html │ │ └── smackx │ │ ├── CapsVerListener.java │ │ ├── ChatState.java │ │ ├── ChatStateListener.java │ │ ├── ChatStateManager.java │ │ ├── DefaultMessageEventRequestListener.java │ │ ├── EntityCapsManager.java │ │ ├── Form.java │ │ ├── FormField.java │ │ ├── Gateway.java │ │ ├── GatewayManager.java │ │ ├── GroupChatInvitation.java │ │ ├── LastActivityManager.java │ │ ├── MessageEventManager.java │ │ ├── MessageEventNotificationListener.java │ │ ├── MessageEventRequestListener.java │ │ ├── MultipleRecipientInfo.java │ │ ├── MultipleRecipientManager.java │ │ ├── NodeInformationProvider.java │ │ ├── OfflineMessageHeader.java │ │ ├── OfflineMessageManager.java │ │ ├── PEPListener.java │ │ ├── PEPManager.java │ │ ├── PrivateDataManager.java │ │ ├── RemoteRosterEntry.java │ │ ├── ReportedData.java │ │ ├── RosterExchangeListener.java │ │ ├── RosterExchangeManager.java │ │ ├── ServiceDiscoveryManager.java │ │ ├── SharedGroupManager.java │ │ ├── XHTMLManager.java │ │ ├── XHTMLText.java │ │ ├── bookmark │ │ ├── BookmarkManager.java │ │ ├── BookmarkedConference.java │ │ ├── BookmarkedURL.java │ │ ├── Bookmarks.java │ │ └── SharedBookmark.java │ │ ├── bytestreams │ │ ├── BytestreamListener.java │ │ ├── BytestreamManager.java │ │ ├── BytestreamRequest.java │ │ ├── BytestreamSession.java │ │ ├── ibb │ │ │ ├── CloseListener.java │ │ │ ├── DataListener.java │ │ │ ├── InBandBytestreamListener.java │ │ │ ├── InBandBytestreamManager.java │ │ │ ├── InBandBytestreamRequest.java │ │ │ ├── InBandBytestreamSession.java │ │ │ ├── InitiationListener.java │ │ │ ├── packet │ │ │ │ ├── Close.java │ │ │ │ ├── Data.java │ │ │ │ ├── DataPacketExtension.java │ │ │ │ └── Open.java │ │ │ └── provider │ │ │ │ ├── CloseIQProvider.java │ │ │ │ ├── DataPacketProvider.java │ │ │ │ └── OpenIQProvider.java │ │ └── socks5 │ │ │ ├── InitiationListener.java │ │ │ ├── Socks5BytestreamListener.java │ │ │ ├── Socks5BytestreamManager.java │ │ │ ├── Socks5BytestreamRequest.java │ │ │ ├── Socks5BytestreamSession.java │ │ │ ├── Socks5Client.java │ │ │ ├── Socks5ClientForInitiator.java │ │ │ ├── Socks5Proxy.java │ │ │ ├── Socks5Utils.java │ │ │ ├── packet │ │ │ └── Bytestream.java │ │ │ └── provider │ │ │ └── BytestreamsProvider.java │ │ ├── commands │ │ ├── AdHocCommand.java │ │ ├── AdHocCommandManager.java │ │ ├── AdHocCommandNote.java │ │ ├── LocalCommand.java │ │ ├── LocalCommandFactory.java │ │ └── RemoteCommand.java │ │ ├── debugger │ │ ├── EnhancedDebugger.java │ │ ├── EnhancedDebuggerWindow.java │ │ └── package.html │ │ ├── filetransfer │ │ ├── FaultTolerantNegotiator.java │ │ ├── FileTransfer.java │ │ ├── FileTransferListener.java │ │ ├── FileTransferManager.java │ │ ├── FileTransferNegotiator.java │ │ ├── FileTransferRequest.java │ │ ├── IBBTransferNegotiator.java │ │ ├── IncomingFileTransfer.java │ │ ├── OutgoingFileTransfer.java │ │ ├── Socks5TransferNegotiator.java │ │ └── StreamNegotiator.java │ │ ├── muc │ │ ├── Affiliate.java │ │ ├── ConnectionDetachedPacketCollector.java │ │ ├── DeafOccupantInterceptor.java │ │ ├── DefaultParticipantStatusListener.java │ │ ├── DefaultUserStatusListener.java │ │ ├── DiscussionHistory.java │ │ ├── HostedRoom.java │ │ ├── InvitationListener.java │ │ ├── InvitationRejectionListener.java │ │ ├── MultiUserChat.java │ │ ├── Occupant.java │ │ ├── PacketMultiplexListener.java │ │ ├── ParticipantStatusListener.java │ │ ├── RoomInfo.java │ │ ├── RoomListenerMultiplexor.java │ │ ├── SubjectUpdatedListener.java │ │ ├── UserStatusListener.java │ │ └── package.html │ │ ├── package.html │ │ ├── packet │ │ ├── AdHocCommandData.java │ │ ├── AttentionExtension.java │ │ ├── CapsExtension.java │ │ ├── ChatStateExtension.java │ │ ├── DataForm.java │ │ ├── DefaultPrivateData.java │ │ ├── DelayInfo.java │ │ ├── DelayInformation.java │ │ ├── DiscoverInfo.java │ │ ├── DiscoverItems.java │ │ ├── Header.java │ │ ├── HeadersExtension.java │ │ ├── LastActivity.java │ │ ├── MUCAdmin.java │ │ ├── MUCInitialPresence.java │ │ ├── MUCOwner.java │ │ ├── MUCUser.java │ │ ├── MessageEvent.java │ │ ├── MultipleAddresses.java │ │ ├── Nick.java │ │ ├── OfflineMessageInfo.java │ │ ├── OfflineMessageRequest.java │ │ ├── PEPEvent.java │ │ ├── PEPItem.java │ │ ├── PEPPubSub.java │ │ ├── PrivateData.java │ │ ├── RosterExchange.java │ │ ├── SharedGroupsInfo.java │ │ ├── StreamInitiation.java │ │ ├── SyncPacketSend.java │ │ ├── Time.java │ │ ├── VCard.java │ │ ├── Version.java │ │ ├── XHTMLExtension.java │ │ └── package.html │ │ ├── provider │ │ ├── AdHocCommandDataProvider.java │ │ ├── CapsExtensionProvider.java │ │ ├── DataFormProvider.java │ │ ├── DelayInfoProvider.java │ │ ├── DelayInformationProvider.java │ │ ├── DiscoverInfoProvider.java │ │ ├── DiscoverItemsProvider.java │ │ ├── EmbeddedExtensionProvider.java │ │ ├── HeaderProvider.java │ │ ├── HeadersProvider.java │ │ ├── MUCAdminProvider.java │ │ ├── MUCOwnerProvider.java │ │ ├── MUCUserProvider.java │ │ ├── MessageEventProvider.java │ │ ├── MultipleAddressesProvider.java │ │ ├── PEPProvider.java │ │ ├── PrivateDataProvider.java │ │ ├── RosterExchangeProvider.java │ │ ├── StreamInitiationProvider.java │ │ ├── VCardProvider.java │ │ ├── XHTMLExtensionProvider.java │ │ └── package.html │ │ ├── pubsub │ │ ├── AccessModel.java │ │ ├── Affiliation.java │ │ ├── AffiliationsExtension.java │ │ ├── ChildrenAssociationPolicy.java │ │ ├── CollectionNode.java │ │ ├── ConfigurationEvent.java │ │ ├── ConfigureForm.java │ │ ├── ConfigureNodeFields.java │ │ ├── EmbeddedPacketExtension.java │ │ ├── EventElement.java │ │ ├── EventElementType.java │ │ ├── FormNode.java │ │ ├── FormNodeType.java │ │ ├── FormType.java │ │ ├── GetItemsRequest.java │ │ ├── Item.java │ │ ├── ItemDeleteEvent.java │ │ ├── ItemPublishEvent.java │ │ ├── ItemReply.java │ │ ├── ItemsExtension.java │ │ ├── LeafNode.java │ │ ├── Node.java │ │ ├── NodeEvent.java │ │ ├── NodeExtension.java │ │ ├── NodeType.java │ │ ├── OptionsExtension.java │ │ ├── PayloadItem.java │ │ ├── PresenceState.java │ │ ├── PubSubElementType.java │ │ ├── PubSubManager.java │ │ ├── PublishItem.java │ │ ├── PublishModel.java │ │ ├── RetractItem.java │ │ ├── SimplePayload.java │ │ ├── SubscribeExtension.java │ │ ├── SubscribeForm.java │ │ ├── SubscribeOptionFields.java │ │ ├── Subscription.java │ │ ├── SubscriptionEvent.java │ │ ├── SubscriptionsExtension.java │ │ ├── UnsubscribeExtension.java │ │ ├── listener │ │ │ ├── ItemDeleteListener.java │ │ │ ├── ItemEventListener.java │ │ │ └── NodeConfigListener.java │ │ ├── packet │ │ │ ├── PubSub.java │ │ │ ├── PubSubNamespace.java │ │ │ └── SyncPacketSend.java │ │ ├── provider │ │ │ ├── AffiliationProvider.java │ │ │ ├── AffiliationsProvider.java │ │ │ ├── ConfigEventProvider.java │ │ │ ├── EventProvider.java │ │ │ ├── FormNodeProvider.java │ │ │ ├── ItemProvider.java │ │ │ ├── ItemsProvider.java │ │ │ ├── PubSubProvider.java │ │ │ ├── RetractEventProvider.java │ │ │ ├── SimpleNodeProvider.java │ │ │ ├── SubscriptionProvider.java │ │ │ └── SubscriptionsProvider.java │ │ └── util │ │ │ ├── NodeUtils.java │ │ │ └── XmlUtils.java │ │ ├── search │ │ ├── SimpleUserSearch.java │ │ ├── UserSearch.java │ │ └── UserSearchManager.java │ │ └── workgroup │ │ ├── MetaData.java │ │ ├── QueueUser.java │ │ ├── WorkgroupInvitation.java │ │ ├── WorkgroupInvitationListener.java │ │ ├── agent │ │ ├── Agent.java │ │ ├── AgentRoster.java │ │ ├── AgentRosterListener.java │ │ ├── AgentSession.java │ │ ├── InvitationRequest.java │ │ ├── Offer.java │ │ ├── OfferConfirmation.java │ │ ├── OfferConfirmationListener.java │ │ ├── OfferContent.java │ │ ├── OfferListener.java │ │ ├── QueueUsersListener.java │ │ ├── RevokedOffer.java │ │ ├── TranscriptManager.java │ │ ├── TranscriptSearchManager.java │ │ ├── TransferRequest.java │ │ ├── UserRequest.java │ │ └── WorkgroupQueue.java │ │ ├── ext │ │ ├── forms │ │ │ └── WorkgroupForm.java │ │ ├── history │ │ │ ├── AgentChatHistory.java │ │ │ ├── AgentChatSession.java │ │ │ └── ChatMetadata.java │ │ ├── macros │ │ │ ├── Macro.java │ │ │ ├── MacroGroup.java │ │ │ └── Macros.java │ │ └── notes │ │ │ └── ChatNotes.java │ │ ├── packet │ │ ├── AgentInfo.java │ │ ├── AgentStatus.java │ │ ├── AgentStatusRequest.java │ │ ├── AgentWorkgroups.java │ │ ├── DepartQueuePacket.java │ │ ├── MetaDataProvider.java │ │ ├── MonitorPacket.java │ │ ├── OccupantsInfo.java │ │ ├── OfferRequestProvider.java │ │ ├── OfferRevokeProvider.java │ │ ├── QueueDetails.java │ │ ├── QueueOverview.java │ │ ├── QueueUpdate.java │ │ ├── RoomInvitation.java │ │ ├── RoomTransfer.java │ │ ├── SessionID.java │ │ ├── Transcript.java │ │ ├── TranscriptProvider.java │ │ ├── TranscriptSearch.java │ │ ├── Transcripts.java │ │ ├── TranscriptsProvider.java │ │ ├── UserID.java │ │ └── WorkgroupInformation.java │ │ ├── settings │ │ ├── ChatSetting.java │ │ ├── ChatSettings.java │ │ ├── GenericSettings.java │ │ ├── OfflineSettings.java │ │ ├── SearchSettings.java │ │ ├── SoundSettings.java │ │ └── WorkgroupProperties.java │ │ ├── user │ │ ├── QueueListener.java │ │ └── Workgroup.java │ │ └── util │ │ ├── ListenerEventDispatcher.java │ │ ├── MetaDataUtils.java │ │ └── ModelUtil.java └── overview.html ├── test-unit └── org │ └── jivesoftware │ ├── smack │ ├── DummyConnection.java │ ├── RosterOfflineTest.java │ ├── RosterTest.java │ ├── packet │ │ ├── IQResponseTest.java │ │ ├── MessageTest.java │ │ └── PresenceTest.java │ └── util │ │ └── PacketParserUtilsTest.java │ ├── smackx │ ├── bytestreams │ │ ├── ibb │ │ │ ├── CloseListenerTest.java │ │ │ ├── DataListenerTest.java │ │ │ ├── IBBPacketUtils.java │ │ │ ├── IBBTestsSuite.java │ │ │ ├── InBandBytestreamManagerTest.java │ │ │ ├── InBandBytestreamRequestTest.java │ │ │ ├── InBandBytestreamSessionMessageTest.java │ │ │ ├── InBandBytestreamSessionTest.java │ │ │ ├── InitiationListenerTest.java │ │ │ ├── packet │ │ │ │ ├── CloseTest.java │ │ │ │ ├── DataPacketExtensionTest.java │ │ │ │ ├── DataTest.java │ │ │ │ └── OpenTest.java │ │ │ └── provider │ │ │ │ └── OpenIQProviderTest.java │ │ └── socks5 │ │ │ ├── InitiationListenerTest.java │ │ │ ├── Socks5ByteStreamManagerTest.java │ │ │ ├── Socks5ByteStreamRequestTest.java │ │ │ ├── Socks5ClientForInitiatorTest.java │ │ │ ├── Socks5ClientTest.java │ │ │ ├── Socks5PacketUtils.java │ │ │ ├── Socks5ProxyTest.java │ │ │ └── Socks5TestProxy.java │ └── provider │ │ └── DelayInformationTest.java │ └── util │ ├── ConnectionUtils.java │ ├── Protocol.java │ └── Verification.java └── test ├── config └── test-case.xml └── org └── jivesoftware ├── smack ├── ChatTest.java ├── FloodTest.java ├── IQTest.java ├── LoginTest.java ├── MessageTest.java ├── PacketReaderTest.java ├── PresenceTest.java ├── PrivacyClient.java ├── ReconnectionTest.java ├── RosterInitializedBeforeConnectTest.java ├── RosterListenerTest.java ├── RosterSmackTest.java ├── filter │ ├── AndFilterTest.java │ ├── FromContainsFilterTest.java │ ├── NotFilterTest.java │ ├── OrFilterTest.java │ ├── PacketIDFilterTest.java │ ├── PacketTypeFilterTest.java │ └── ToContainsFilterTest.java ├── packet │ ├── MockPacket.java │ ├── MockPacketFilter.java │ ├── PrivacyProviderTest.java │ └── PrivacyTest.java ├── test │ └── SmackTestCase.java └── util │ ├── CacheTest.java │ ├── StringUtilsTest.java │ └── XMPPErrorTest.java └── smackx ├── CompressionTest.java ├── FileTransferTest.java ├── FormTest.java ├── GroupChatInvitationTest.java ├── LastActivityManagerTest.java ├── MessageEventManagerTest.java ├── MessageEventTests.java ├── MultipleRecipientManagerTest.java ├── OfflineMessageManagerTest.java ├── RosterExchangeManagerTest.java ├── RosterExchangeTests.java ├── ServiceDiscoveryManagerTest.java ├── SharedGroupsTest.java ├── VCardTest.java ├── VersionTest.java ├── XHTMLManagerTest.java ├── XHTMLSupportTests.java ├── bytestreams ├── ibb │ └── InBandBytestreamTest.java └── socks5 │ └── Socks5ByteStreamTest.java ├── commands └── AdHocCommandDiscoTest.java ├── muc ├── MultiUserChatCreationTest.java └── MultiUserChatTest.java ├── packet ├── MessageEventTest.java ├── RosterExchangeTest.java └── XHTMLExtensionTest.java └── pubsub ├── CarExtension.java ├── CarExtensionProvider.java ├── EntityUseCases.java ├── MultiUserSubscriptionUseCases.java ├── OwnerUseCases.java ├── PublisherUseCases.java ├── SubscriberUseCases.java ├── TestAPI.java ├── TestEvents.java ├── TestMessageContent.java └── test ├── PubSubTestCase.java └── SingleUserTestCase.java /build/ant-contrib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/ant-contrib.jar -------------------------------------------------------------------------------- /build/asm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/asm.jar -------------------------------------------------------------------------------- /build/build.properties: -------------------------------------------------------------------------------- 1 | # 2 | # $RCSfile$ 3 | # $Revision$ 4 | # $Date$ 5 | # 6 | 7 | # Test properties. Uncomment these to override default values declared 8 | # in the build.xml file. 9 | 10 | # test.host= 11 | # test.port= 12 | # test.admin.username= 13 | # test.admin.resource= 14 | # test.smack.debug= 15 | -------------------------------------------------------------------------------- /build/build/java-xmlbuilder-0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/build/java-xmlbuilder-0.3.jar -------------------------------------------------------------------------------- /build/build/versions.txt: -------------------------------------------------------------------------------- 1 | jar | version 2 | ---------------------------------------- 3 | xmlunit | 1.2 4 | java-xmlbuilder-0.3 | 0.3 5 | jstun | 0.7.2 6 | xpp | 1.1.4c 7 | -------------------------------------------------------------------------------- /build/build/xmlunit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/build/xmlunit.jar -------------------------------------------------------------------------------- /build/javassist-3.10.0.GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/javassist-3.10.0.GA.jar -------------------------------------------------------------------------------- /build/jaxen.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/jaxen.jar -------------------------------------------------------------------------------- /build/junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/junit.jar -------------------------------------------------------------------------------- /build/merge/jbosh-0.6.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/merge/jbosh-0.6.0.jar -------------------------------------------------------------------------------- /build/merge/jzlib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/merge/jzlib.jar -------------------------------------------------------------------------------- /build/merge/xpp.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/merge/xpp.jar -------------------------------------------------------------------------------- /build/mockito-all-1.8.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/mockito-all-1.8.2.jar -------------------------------------------------------------------------------- /build/objenesis-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/objenesis-1.1.jar -------------------------------------------------------------------------------- /build/pmd.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/pmd.jar -------------------------------------------------------------------------------- /build/powermock-mockito-1.3.5-full.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/powermock-mockito-1.3.5-full.jar -------------------------------------------------------------------------------- /build/projects/SmackUnitTest.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /build/resources/META-INF/smack-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | org.jivesoftware.smackx.ServiceDiscoveryManager 8 | org.jivesoftware.smack.PrivacyListManager 9 | org.jivesoftware.smackx.XHTMLManager 10 | org.jivesoftware.smackx.muc.MultiUserChat 11 | org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager 12 | org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamManager 13 | org.jivesoftware.smackx.filetransfer.FileTransferManager 14 | org.jivesoftware.smackx.LastActivityManager 15 | org.jivesoftware.smack.ReconnectionManager 16 | org.jivesoftware.smackx.commands.AdHocCommandManager 17 | 18 | 19 | 20 | 5000 21 | 22 | 23 | 30000 24 | 25 | 26 | true 27 | 28 | 29 | 7777 30 | 31 | 32 | -------------------------------------------------------------------------------- /build/resources/images/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/message.png -------------------------------------------------------------------------------- /build/resources/images/nav_left_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/nav_left_blue.png -------------------------------------------------------------------------------- /build/resources/images/nav_right_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/nav_right_red.png -------------------------------------------------------------------------------- /build/resources/images/photo_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/photo_portrait.png -------------------------------------------------------------------------------- /build/resources/images/question_and_answer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/question_and_answer.png -------------------------------------------------------------------------------- /build/resources/images/trafficlight_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/trafficlight_green.png -------------------------------------------------------------------------------- /build/resources/images/trafficlight_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/trafficlight_off.png -------------------------------------------------------------------------------- /build/resources/images/trafficlight_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/trafficlight_red.png -------------------------------------------------------------------------------- /build/resources/images/unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/unknown.png -------------------------------------------------------------------------------- /build/resources/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/build/resources/images/warning.png -------------------------------------------------------------------------------- /documentation/extensions/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Smack Extensions User Manual 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | <H2>Smack Extensions User Manual</H2> 14 | 15 | <a href="toc.html">Smack Extensions User Manual</a> -------------------------------------------------------------------------------- /documentation/extensions/privatedata.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Private Data 4 | 5 | 6 | 7 | 8 | 9 |
Private Data

10 | 11 | Manages private data, which is a mechanism to allow users to store arbitrary XML 12 | data on an XMPP server. Each private data chunk is defined by a element name and 13 | XML namespace. Example private data: 14 | 15 |

16 | <color xmlns="http://example.com/xmpp/color">
17 |     <favorite>blue</blue>
18 |     <leastFavorite>puce</leastFavorite>
19 | </color>
20 | 

21 | 22 | JEP related: JEP-49 23 | 24 |


25 | 26 | More coming soon. 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /documentation/extensions/style.css: -------------------------------------------------------------------------------- 1 | BODY { 2 | font-size : 100%; 3 | background-color : #fff; 4 | } 5 | BODY, TD, TH { 6 | font-family : tahoma, arial, helvetica; 7 | font-size : 0.8em; 8 | } 9 | PRE, TT, CODE { 10 | font-family : courier new, monospaced; 11 | font-size : 1.0em; 12 | } 13 | A:hover { 14 | text-decoration : none; 15 | } 16 | LI { 17 | padding-bottom : 4px; 18 | } 19 | .header { 20 | font-size : 1.4em; 21 | font-weight : bold; 22 | width : 100%; 23 | border-bottom : 1px #ccc solid; 24 | padding-bottom : 2px; 25 | } 26 | .subheader { 27 | font-size: 1.1em; 28 | font-weight : bold; 29 | } 30 | .footer { 31 | font-size : 0.8em; 32 | color : #999; 33 | text-align : center; 34 | width : 100%; 35 | border-top : 1px #ccc solid; 36 | padding-top : 2px; 37 | } 38 | .code { 39 | border : 1px #ccc solid; 40 | padding : 0em 1.0em 0em 1.0em; 41 | margin : 4px 0px 4px 0px; 42 | } 43 | .nav, .nav A { 44 | font-family : verdana; 45 | font-size : 0.85em; 46 | color : #600; 47 | text-decoration : none; 48 | font-weight : bold; 49 | } 50 | .nav { 51 | width : 100%; 52 | border-bottom : 1px #ccc solid; 53 | padding : 3px 3px 5px 1px; 54 | } 55 | .nav A:hover { 56 | text-decoration : underline; 57 | } -------------------------------------------------------------------------------- /documentation/extensions/time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Time 4 | 5 | 6 | 7 | 8 | 9 |
Entity Time Exchange

10 | 11 | Supports a protocol that XMPP clients use to exchange their respective local 12 | times and time zones.

13 | 14 | JEP related: JEP-90 15 | 16 |


17 | 18 | More coming soon. 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /documentation/extensions/toc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Smack Extensions User Manual 4 | 5 | 6 | 7 | 8 | 9 | 10 | Introduction

11 | 12 |

Smack Extensions

13 | 14 | Private Data
15 | XHTML Messages
16 | Message Events
17 | Data Forms
18 | Multi User Chat
19 | Roster Item Exchange
20 | Time Exchange
21 | Group Chat Invitations
22 | Service Discovery
23 | File Transfer
24 | PubSub
25 |

26 | 27 | 28 | -------------------------------------------------------------------------------- /documentation/images/debugwindow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/documentation/images/debugwindow.gif -------------------------------------------------------------------------------- /documentation/images/enhanceddebugger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/documentation/images/enhanceddebugger.png -------------------------------------------------------------------------------- /documentation/images/roster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/documentation/images/roster.png -------------------------------------------------------------------------------- /documentation/images/smacklogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/documentation/images/smacklogo.png -------------------------------------------------------------------------------- /documentation/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Smack Documentation - Jive Software 4 | 5 | 6 | 7 | 8 | 9 | Smack Documentation 10 | 11 |

12 | Contents: 13 |

14 | 15 | 29 | 30 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /documentation/style.css: -------------------------------------------------------------------------------- 1 | BODY { 2 | font-size : 100%; 3 | background-color : #fff; 4 | } 5 | BODY, TD, TH { 6 | font-family : tahoma, arial, helvetica; 7 | font-size : 0.8em; 8 | } 9 | PRE, TT, CODE { 10 | font-family : courier new, monospaced; 11 | font-size : 1.0em; 12 | } 13 | A:hover { 14 | text-decoration : none; 15 | } 16 | LI { 17 | padding-bottom : 4px; 18 | } 19 | .header { 20 | font-size : 1.4em; 21 | font-weight : bold; 22 | width : 100%; 23 | border-bottom : 1px #ccc solid; 24 | padding-bottom : 2px; 25 | } 26 | .subheader { 27 | font-weight : bold; 28 | } 29 | .footer { 30 | font-size : 0.8em; 31 | color : #999; 32 | text-align : center; 33 | width : 100%; 34 | border-top : 1px #ccc solid; 35 | padding-top : 2px; 36 | } 37 | .code { 38 | border : 1px #ccc solid; 39 | padding : 0em 1.0em 0em 1.0em; 40 | margin : 4px 0px 4px 0px; 41 | } 42 | .nav, .nav A { 43 | font-family : verdana; 44 | font-size : 0.85em; 45 | color : #600; 46 | text-decoration : none; 47 | font-weight : bold; 48 | } 49 | .nav { 50 | width : 100%; 51 | border-bottom : 1px #ccc solid; 52 | padding : 3px 3px 5px 1px; 53 | } 54 | .nav A:hover { 55 | text-decoration : underline; 56 | } -------------------------------------------------------------------------------- /jingle/extension/build/build.properties: -------------------------------------------------------------------------------- 1 | jdk.home.1.5=C:/Arquivos de programas/Java/jdk1.5.0_09 -------------------------------------------------------------------------------- /jingle/extension/build/lib/Speex.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/Speex.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/commons-logging-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/commons-logging-1.1.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/commons-logging-adapters-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/commons-logging-adapters-1.1.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/commons-logging-api-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/commons-logging-api-1.1.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/jmf.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/jmf.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/jspeex-0.9.7-jfcom.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/jspeex-0.9.7-jfcom.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/junit.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/mac/0JavaSoundStream.fix.mac.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/mac/0JavaSoundStream.fix.mac.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/mac/0jmf.mac.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/mac/0jmf.mac.jar -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmacm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmacm.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmam.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmam.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmcvid.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmcvid.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmdaud.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmdaud.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmdaudc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmdaudc.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmddraw.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmddraw.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmfjawt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmfjawt.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmg723.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmg723.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmgdi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmgdi.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmgsm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmgsm.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmh263enc.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmh263enc.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmjpeg.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmjpeg.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmmci.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmmci.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmmpa.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmmpa.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmmpegv.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmmpegv.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmutil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmutil.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmvcm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmvcm.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmvfw.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmvfw.dll -------------------------------------------------------------------------------- /jingle/extension/build/lib/windows/jmvh263.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/lib/windows/jmvh263.dll -------------------------------------------------------------------------------- /jingle/extension/build/merge/jstun.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/jingle/extension/build/merge/jstun.jar -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/JingleActionEnum.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle; 2 | 3 | /** 4 | * The "action" in the jingle packet, as an enum. 5 | * 6 | * Changed to reflect XEP-166 rev: 20JUN07 7 | * 8 | * @author Jeff Williams 9 | */ 10 | public enum JingleActionEnum { 11 | 12 | UNKNOWN("unknown"), 13 | CONTENT_ACCEPT("content-accept"), 14 | CONTENT_ADD("content-add"), 15 | CONTENT_MODIFY("content-modify"), 16 | CONTENT_REMOVE("content-remove"), 17 | SESSION_ACCEPT("session-accept"), 18 | SESSION_INFO("session-info"), 19 | SESSION_INITIATE("session-initiate"), 20 | SESSION_TERMINATE("session-terminate"), 21 | TRANSPORT_INFO("transport-info"); 22 | 23 | private String actionCode; 24 | 25 | private JingleActionEnum(String inActionCode) { 26 | actionCode = inActionCode; 27 | } 28 | 29 | /** 30 | * Returns the String value for an Action. 31 | */ 32 | 33 | public String toString() { 34 | return actionCode; 35 | } 36 | 37 | /** 38 | * Returns the Action enum for a String action value. 39 | */ 40 | public static JingleActionEnum getAction(String inActionCode) { 41 | for (JingleActionEnum jingleAction : JingleActionEnum.values()) { 42 | if (jingleAction.actionCode.equals(inActionCode)) { 43 | return jingleAction; 44 | } 45 | } 46 | return null; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/JingleException.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle; 2 | 3 | 4 | import org.jivesoftware.smack.XMPPException; 5 | import org.jivesoftware.smackx.packet.JingleError; 6 | 7 | /** 8 | * A Jingle exception. 9 | * 10 | * @author Alvaro Saurin 11 | */ 12 | public class JingleException extends XMPPException { 13 | 14 | private final JingleError error; 15 | 16 | /** 17 | * Default constructor. 18 | */ 19 | public JingleException() { 20 | super(); 21 | error = null; 22 | } 23 | 24 | /** 25 | * Constructor with an error message. 26 | * 27 | * @param msg The message. 28 | */ 29 | public JingleException(String msg) { 30 | super(msg); 31 | error = null; 32 | } 33 | 34 | /** 35 | * Constructor with an error response. 36 | * 37 | * @param error The error message. 38 | */ 39 | public JingleException(JingleError error) { 40 | super(); 41 | this.error = error; 42 | } 43 | 44 | /** 45 | * Return the error message. 46 | * 47 | * @return the error 48 | */ 49 | public JingleError getError() { 50 | return error; 51 | } 52 | } -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/JingleNegotiatorState.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle; 2 | 3 | /** 4 | * @author Jeff Williams 5 | */ 6 | public enum JingleNegotiatorState { 7 | PENDING, 8 | FAILED, 9 | SUCCEEDED 10 | } 11 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSessionState.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle; 2 | 3 | import org.jivesoftware.smack.packet.IQ; 4 | import org.jivesoftware.smackx.packet.Jingle; 5 | 6 | /** 7 | * Implement the Jingle Session state using the State Behavioral pattern. 8 | * (From the book Design Patterns, AKA GoF.) 9 | * These classes also employ the Flyweight and Singleton patterns as recommended for the State pattern by GoF. 10 | * 11 | * There seems to be three ways to go with the State pattern in Java: interface, abstract class and enums. 12 | * Most of the accepted models use abstract classes. It wasn't clear to me that any of the three models was 13 | * superior, so I went with the most common example. 14 | * 15 | * @author Jeff Williams 16 | */ 17 | public abstract class JingleSessionState { 18 | 19 | /** 20 | * Called when entering the state. 21 | */ 22 | public static JingleSessionState getInstance() { 23 | // Since we can never instantiate this class there is nothing to return (ever). 24 | return null; 25 | } 26 | 27 | /** 28 | * Called when entering the state. 29 | */ 30 | public abstract void enter(); 31 | 32 | /** 33 | * Called when exiting the state. 34 | */ 35 | public abstract void exit(); 36 | 37 | /** 38 | * Process an incoming Jingle Packet. 39 | * When you look at the GoF State pattern this method roughly corresponds to example on p310: ProcessOctect(). 40 | */ 41 | public abstract IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action); 42 | 43 | /** 44 | * For debugging just emit the short name of the class. 45 | */ 46 | public String toString() { 47 | return this.getClass().getSimpleName(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/JingleSessionStateEnded.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle; 2 | 3 | import org.jivesoftware.smack.packet.IQ; 4 | import org.jivesoftware.smackx.packet.Jingle; 5 | import org.jivesoftware.smackx.packet.JingleError; 6 | 7 | /** 8 | * @author Jeff Williams 9 | * @see JingleSessionState 10 | */ 11 | public class JingleSessionStateEnded extends JingleSessionState { 12 | 13 | private static final SmackLogger LOGGER = SmackLogger.getLogger(JingleSessionStateEnded.class); 14 | 15 | private static JingleSessionStateEnded INSTANCE = null; 16 | 17 | protected JingleSessionStateEnded() { 18 | // Prevent instantiation of the class. 19 | } 20 | 21 | /** 22 | * A thread-safe means of getting the one instance of this class. 23 | * @return The singleton instance of this class. 24 | */ 25 | public synchronized static JingleSessionState getInstance() { 26 | if (INSTANCE == null) { 27 | INSTANCE = new JingleSessionStateEnded(); 28 | } 29 | 30 | return INSTANCE; 31 | } 32 | 33 | public void enter() { 34 | LOGGER.debug("Session Ended"); 35 | LOGGER.debug("-------------------------------------------------------------------"); 36 | 37 | } 38 | 39 | public void exit() { 40 | // TODO Auto-generated method stub 41 | 42 | } 43 | 44 | /** 45 | * Pretty much nothing is valid for receiving once we've ended the session. 46 | */ 47 | public IQ processJingle(JingleSession session, Jingle jingle, JingleActionEnum action) { 48 | IQ response = null; 49 | 50 | response = session.createJingleError(jingle, JingleError.MALFORMED_STANZA); 51 | 52 | return response; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/listeners/CreatedJingleSessionListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: CreatedJingleSessionListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 17/11/2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.jingle.listeners; 22 | 23 | import org.jivesoftware.smackx.jingle.JingleSession; 24 | 25 | /** 26 | * Inteface used to dispatch a event when a Jingle session is created. 27 | * 28 | * @author Thiago Camargo 29 | */ 30 | public interface CreatedJingleSessionListener { 31 | 32 | public void sessionCreated(JingleSession jingleSession); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/listeners/JingleListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: JingleListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:12 $11-07-2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.jingle.listeners; 22 | 23 | /** 24 | * Jingle listeners interface. 25 | * 26 | * This is the list of events that can be observed from a JingleSession and some 27 | * sub negotiators. This listeners can be added to different elements of the 28 | * Jingle model. 29 | * 30 | * For example, a JingleManager can notify any SessionRequestListenerListener 31 | * listener when a new session request is received. In this case, the 32 | * sessionRequested() of the listener will be executed, and the listener 33 | * will be able to accept() or decline() the invitation. 34 | * 35 | * @author Thiago Camargo 36 | */ 37 | public interface JingleListener { 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/listeners/JingleMediaInfoListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: JingleMediaInfoListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:12 $11-07-2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.listeners; 21 | 22 | /** 23 | * Interface for listening to jmf info events. 24 | * @author Thiago Camargo 25 | */ 26 | public interface JingleMediaInfoListener extends JingleListener { 27 | /** 28 | * The other end is busy. 29 | */ 30 | public void mediaInfoBusy(); 31 | 32 | /** 33 | * We are on hold. 34 | */ 35 | public void mediaInfoHold(); 36 | 37 | /** 38 | * The jmf is muted. 39 | */ 40 | public void mediaInfoMute(); 41 | 42 | /** 43 | * We are queued. 44 | */ 45 | public void mediaInfoQueued(); 46 | 47 | /** 48 | * We are ringing. 49 | */ 50 | public void mediaInfoRinging(); 51 | } -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/listeners/JingleMediaListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: JingleMediaListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:12 $11-07-2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.jingle.listeners; 22 | 23 | import org.jivesoftware.smackx.jingle.media.PayloadType; 24 | 25 | /** 26 | * Interface for listening to jmf events. 27 | * @author Thiago Camargo 28 | */ 29 | public interface JingleMediaListener extends JingleListener { 30 | /** 31 | * Notification that the jmf has been negotiated and established. 32 | * 33 | * @param pt The payload type agreed. 34 | */ 35 | public void mediaEstablished(PayloadType pt); 36 | 37 | /** 38 | * Notification that a payload type must be cancelled 39 | * 40 | * @param cand The payload type that must be closed 41 | */ 42 | public void mediaClosed(PayloadType cand); 43 | } 44 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/listeners/JingleSessionRequestListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: JingleSessionRequestListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:12 $11-07-2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.listeners; 21 | 22 | import org.jivesoftware.smackx.jingle.JingleSessionRequest; 23 | 24 | /** 25 | * Interface to listener Jingle session requests. 26 | * 27 | * @author Alvaro Saurin 28 | */ 29 | public interface JingleSessionRequestListener extends JingleListener { 30 | /** 31 | * A request to start a session has been recieved from another user. 32 | * 33 | * @param request The request from the other user. 34 | */ 35 | public void sessionRequested(JingleSessionRequest request); 36 | } -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/media/MediaReceivedListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: MediaReceivedListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:14 $11-07-2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.media; 21 | 22 | /** 23 | * Listener for new Incoming Media Streams 24 | */ 25 | public interface MediaReceivedListener { 26 | 27 | /** 28 | * Called when new Media is received. 29 | */ 30 | public void mediaReceived(String participant); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/jmf/AudioFormatUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: AudioFormatUtils.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 08/11/2006 5 | *

6 | * Copyright 2003-2006 Jive Software. 7 | *

8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | *

12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | *

14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.mediaimpl.jmf; 21 | 22 | import org.jivesoftware.smackx.jingle.media.PayloadType; 23 | 24 | import javax.media.format.AudioFormat; 25 | 26 | /** 27 | * Audio Format Utils. 28 | * 29 | * @author Thiago Camargo 30 | */ 31 | public class AudioFormatUtils { 32 | 33 | /** 34 | * Return a JMF AudioFormat for a given Jingle Payload type. 35 | * Return null if the payload is not supported by this jmf API. 36 | * 37 | * @param payloadtype payloadtype 38 | * @return correspondent audioType 39 | */ 40 | public static AudioFormat getAudioFormat(PayloadType payloadtype) { 41 | 42 | switch (payloadtype.getId()) { 43 | case 0: 44 | return new AudioFormat(AudioFormat.ULAW_RTP); 45 | case 3: 46 | return new AudioFormat(AudioFormat.GSM_RTP); 47 | case 4: 48 | return new AudioFormat(AudioFormat.G723_RTP); 49 | default: 50 | return null; 51 | } 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/sshare/api/DefaultDecoder.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api; 2 | 3 | import javax.imageio.ImageIO; 4 | import java.awt.image.BufferedImage; 5 | import java.io.ByteArrayInputStream; 6 | import java.io.IOException; 7 | 8 | /** 9 | * Implements a default PNG decoder. 10 | */ 11 | public class DefaultDecoder implements ImageDecoder { 12 | 13 | public BufferedImage decode(ByteArrayInputStream stream) throws IOException { 14 | return ImageIO.read(stream); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/sshare/api/DefaultEncoder.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api; 2 | 3 | import javax.imageio.ImageIO; 4 | import java.awt.image.BufferedImage; 5 | import java.io.ByteArrayOutputStream; 6 | import java.io.IOException; 7 | 8 | /** 9 | * Implements a default PNG Encoder 10 | */ 11 | public class DefaultEncoder implements ImageEncoder{ 12 | 13 | public ByteArrayOutputStream encode(BufferedImage bufferedImage) { 14 | ByteArrayOutputStream baos = new ByteArrayOutputStream(); 15 | try { 16 | ImageIO.write(bufferedImage, "png", baos); 17 | } 18 | catch (IOException e) { 19 | e.printStackTrace(); 20 | baos = null; 21 | } 22 | return baos; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/sshare/api/ImageDecoder.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.ByteArrayInputStream; 5 | import java.io.IOException; 6 | 7 | /** 8 | * Image Decoder Interface use this interface if you want to change the default decoder 9 | * 10 | * @author Thiago Rocha Camargo 11 | */ 12 | public interface ImageDecoder { 13 | 14 | public BufferedImage decode(ByteArrayInputStream stream) throws IOException; 15 | } 16 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/sshare/api/ImageEncoder.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.mediaimpl.sshare.api; 2 | 3 | import java.awt.image.BufferedImage; 4 | import java.io.ByteArrayOutputStream; 5 | 6 | /** 7 | * Image Encoder Interface use this interface if you want to change the default encoder 8 | * 9 | * @author Thiago Rocha Camargo 10 | */ 11 | public interface ImageEncoder { 12 | public ByteArrayOutputStream encode(BufferedImage bufferedImage); 13 | } 14 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/nat/BasicTransportManager.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.nat; 2 | 3 | import org.jivesoftware.smackx.jingle.JingleSession; 4 | 5 | /** 6 | * $RCSfile: BasicTransportManager.java,v $ 7 | * $Revision: 1.1 $ 8 | * $Date: 15/11/2006 9 | * 10 | * Copyright 2003-2006 Jive Software. 11 | * 12 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | /** 26 | * A Basic Jingle Transport Manager implementation. 27 | * 28 | */ 29 | public class BasicTransportManager extends JingleTransportManager{ 30 | 31 | protected TransportResolver createResolver(JingleSession session) { 32 | return new BasicResolver(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/nat/DatagramListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: DatagramListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 15/11/2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.nat; 21 | 22 | import java.net.DatagramPacket; 23 | 24 | /** 25 | * Listener for datagram packets received. 26 | * 27 | * @author Thiago Camargo 28 | */ 29 | public interface DatagramListener { 30 | 31 | /** 32 | * Called when a datagram is received. If the method returns false, the 33 | * packet MUST NOT be resent from the received Channel. 34 | * 35 | * @param datagramPacket the datagram packet received. 36 | * @return ? 37 | */ 38 | public boolean datagramReceived(DatagramPacket datagramPacket); 39 | 40 | } -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/nat/ResultListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: ResultListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/07/02 17:41:07 $ 5 | * 6 | * Copyright 2003-2005 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.jingle.nat; 22 | 23 | /** 24 | * Listener for ECHO Test Results 25 | * 26 | * @author Thiago Camargo 27 | */ 28 | public interface ResultListener { 29 | 30 | public void testFinished(TestResult result, TransportCandidate candidate); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/jingle/nat/STUNTransportManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: STUNTransportManager.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 15/11/2006 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.jingle.nat; 21 | 22 | import org.jivesoftware.smack.XMPPException; 23 | import org.jivesoftware.smackx.jingle.JingleSession; 24 | 25 | /** 26 | * A Jingle Transport Manager implementation to be used on NAT networks with STUN Service NOT Blocked. 27 | * 28 | * @author Thiago Camargo 29 | */ 30 | public class STUNTransportManager extends JingleTransportManager { 31 | STUNResolver stunResolver = null; 32 | 33 | public STUNTransportManager() { 34 | stunResolver = new STUNResolver() { 35 | }; 36 | try { 37 | stunResolver.initializeAndWait(); 38 | } catch (XMPPException e) { 39 | e.printStackTrace(); 40 | } 41 | } 42 | 43 | protected TransportResolver createResolver(JingleSession session) { 44 | try { 45 | stunResolver.resolve(session); 46 | } catch (XMPPException e) { 47 | e.printStackTrace(); 48 | } 49 | return stunResolver; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/package.html: -------------------------------------------------------------------------------- 1 | Smack extensions API. -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/packet/package.html: -------------------------------------------------------------------------------- 1 | XML packets that are part of the XMPP extension protocols. -------------------------------------------------------------------------------- /jingle/extension/source/org/jivesoftware/smackx/provider/package.html: -------------------------------------------------------------------------------- 1 | Provides pluggable parsing logic for Smack extensions. -------------------------------------------------------------------------------- /jingle/extension/source/overview.html: -------------------------------------------------------------------------------- 1 | API specification for Smack, an Open Source XMPP client library. 2 |

3 | The {@link org.jivesoftware.smack.XMPPConnection} class is the main entry point for the API. 4 | 5 | -------------------------------------------------------------------------------- /jingle/extension/test/config/test-case.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | localhost 7 | 5222 8 | 9 | 10 | chat 11 | conference 12 | 13 | -------------------------------------------------------------------------------- /jingle/extension/test/org/jivesoftware/smackx/jingle/nat/LocalhostTest.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.nat; 2 | 3 | import junit.framework.TestCase; 4 | 5 | public class LocalhostTest extends TestCase { 6 | 7 | public void testGetLocalhost() { 8 | System.out.println(BridgedResolver.getLocalHost()); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /jingle/extension/test/org/jivesoftware/smackx/jingle/nat/TransportResolverTest.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.jingle.nat; 2 | 3 | import org.jivesoftware.smack.XMPPException; 4 | import org.jivesoftware.smack.test.SmackTestCase; 5 | 6 | public class TransportResolverTest extends SmackTestCase { 7 | 8 | public TransportResolverTest(final String arg) { 9 | super(arg); 10 | } 11 | 12 | public void testIsResolving() { 13 | final TransportResolver tr = new BasicResolver(); 14 | 15 | tr.addListener( 16 | new TransportResolverListener.Resolver() { 17 | public void candidateAdded(final TransportCandidate cand) { 18 | System.out.println("candidateAdded() called."); 19 | assertTrue(tr.isResolving() || (!tr.isResolving() && tr.isResolved())); 20 | } 21 | 22 | public void end() { 23 | System.out.println("end() called."); 24 | assertFalse(tr.isResolving()); 25 | assertTrue(tr.isResolved()); 26 | } 27 | 28 | public void init() { 29 | System.out.println("init() called."); 30 | assertTrue(tr.isResolving()); 31 | assertFalse(tr.isResolved()); 32 | } 33 | }); 34 | 35 | assertFalse(tr.isResolving()); 36 | assertFalse(tr.isResolved()); 37 | 38 | try { 39 | tr.resolve(null); 40 | } catch (XMPPException e) { 41 | e.printStackTrace(); 42 | fail("Error resolving"); 43 | } 44 | } 45 | 46 | protected int getMaxConnections() { 47 | return 0; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /sample/conf/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | Smack Client UI 9 | Smack sample UI 10 | 11 | 12 | 13 | login.jsp 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sample/web/css/general.css: -------------------------------------------------------------------------------- 1 | BODY 2 | { 3 | FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif; 4 | FONT-SIZE: 10px; 5 | margin-left: 0px; 6 | margin-right: 0px; 7 | margin-bottom: 0px; 8 | margin-top: 0px; 9 | background-color: #FFFFFF; 10 | } 11 | .text { 12 | FONT-FAMILY: Verdana, Geneva, Arial, Helvetica, sans-serif; 13 | FONT-SIZE: 10px; 14 | } 15 | input,textarea,select 16 | { 17 | font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 18 | font-size: 10px; 19 | } 20 | #black { 21 | color: #000000; 22 | font-weight: BOLD; 23 | } 24 | #white { 25 | color: FFFFFF; 26 | font-weight: BOLD; 27 | } 28 | #bigWhite { 29 | color: FFFFFF; 30 | font-weight: BOLD; 31 | font-size: 14px; 32 | } 33 | #bigBlack { 34 | font-weight: BOLD; 35 | font-size: 18px; 36 | } -------------------------------------------------------------------------------- /sample/web/images/address_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/address_book.png -------------------------------------------------------------------------------- /sample/web/images/businessman_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/businessman_add.png -------------------------------------------------------------------------------- /sample/web/images/businessman_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/businessman_delete.png -------------------------------------------------------------------------------- /sample/web/images/businessmen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/businessmen.png -------------------------------------------------------------------------------- /sample/web/images/garbage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/garbage.png -------------------------------------------------------------------------------- /sample/web/images/messages.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/messages.png -------------------------------------------------------------------------------- /sample/web/images/nav_right_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/nav_right_blue.png -------------------------------------------------------------------------------- /sample/web/images/plug_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/plug_delete.png -------------------------------------------------------------------------------- /sample/web/images/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/images/refresh.png -------------------------------------------------------------------------------- /sample/web/viewRoster.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/sample/web/viewRoster.jsp -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/AbstractConnectionListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smack; 15 | 16 | /** 17 | * The AbstractConnectionListener class provides an empty implementation for all 18 | * methods defined by the {@link ConnectionListener} interface. This is a 19 | * convenience class which should be used in case you do not need to implement 20 | * all methods. 21 | * 22 | * @author Henning Staib 23 | */ 24 | public class AbstractConnectionListener implements ConnectionListener { 25 | 26 | public void connectionClosed() { 27 | // do nothing 28 | } 29 | 30 | public void connectionClosedOnError(Exception e) { 31 | // do nothing 32 | } 33 | 34 | public void reconnectingIn(int seconds) { 35 | // do nothing 36 | } 37 | 38 | public void reconnectionFailed(Exception e) { 39 | // do nothing 40 | } 41 | 42 | public void reconnectionSuccessful() { 43 | // do nothing 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/ChatManagerListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: 2407 $ 4 | * $Date: 2004-11-02 15:37:00 -0800 (Tue, 02 Nov 2004) $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack; 22 | 23 | /** 24 | * A listener for chat related events. 25 | * 26 | * @author Alexander Wenckus 27 | */ 28 | public interface ChatManagerListener { 29 | 30 | /** 31 | * Event fired when a new chat is created. 32 | * 33 | * @param chat the chat that was created. 34 | * @param createdLocally true if the chat was created by the local user and false if it wasn't. 35 | */ 36 | void chatCreated(Chat chat, boolean createdLocally); 37 | } 38 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/ConnectionCreationListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack; 22 | 23 | /** 24 | * Implementors of this interface will be notified when a new {@link Connection} 25 | * has been created. The newly created connection will not be actually connected to 26 | * the server. Use {@link Connection#addConnectionCreationListener(ConnectionCreationListener)} 27 | * to add new listeners. 28 | * 29 | * @author Gaston Dombiak 30 | */ 31 | public interface ConnectionCreationListener { 32 | 33 | /** 34 | * Notification that a new connection has been created. The new connection 35 | * will not yet be connected to the server. 36 | * 37 | * @param connection the newly created connection. 38 | */ 39 | public void connectionCreated(Connection connection); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/MessageListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: 2407 $ 4 | * $Date: 2004-11-02 15:37:00 -0800 (Tue, 02 Nov 2004) $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack; 22 | 23 | import org.jivesoftware.smack.packet.Message; 24 | 25 | /** 26 | * 27 | */ 28 | public interface MessageListener { 29 | void processMessage(Chat chat, Message message); 30 | } 31 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/OpenTrustManager.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack; 22 | 23 | import javax.net.ssl.X509TrustManager; 24 | import java.security.cert.CertificateException; 25 | import java.security.cert.X509Certificate; 26 | 27 | /** 28 | * Dummy trust manager that trust all certificates presented by the server. This class 29 | * is used during old SSL connections. 30 | * 31 | * @author Gaston Dombiak 32 | */ 33 | class OpenTrustManager implements X509TrustManager { 34 | 35 | public OpenTrustManager() { 36 | } 37 | 38 | public X509Certificate[] getAcceptedIssuers() { 39 | return new X509Certificate[0]; 40 | } 41 | 42 | public void checkClientTrusted(X509Certificate[] arg0, String arg1) 43 | throws CertificateException { 44 | } 45 | 46 | public void checkServerTrusted(X509Certificate[] arg0, String arg1) 47 | throws CertificateException { 48 | } 49 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/PacketListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * Provides a mechanism to listen for packets that pass a specified filter. 27 | * This allows event-style programming -- every time a new packet is found, 28 | * the {@link #processPacket(Packet)} method will be called. This is the 29 | * opposite approach to the functionality provided by a {@link PacketCollector} 30 | * which lets you block while waiting for results. 31 | * 32 | * @see Connection#addPacketListener(PacketListener, org.jivesoftware.smack.filter.PacketFilter) 33 | * @author Matt Tucker 34 | */ 35 | public interface PacketListener { 36 | 37 | /** 38 | * Process the next packet sent to this packet listener.

39 | * 40 | * A single thread is responsible for invoking all listeners, so 41 | * it's very important that implementations of this method not block 42 | * for any extended period of time. 43 | * 44 | * @param packet the packet to process. 45 | */ 46 | public void processPacket(Packet packet); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/PrivacyList.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack; 2 | 3 | import org.jivesoftware.smack.packet.PrivacyItem; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * A privacy list represents a list of contacts that is a read only class used to represent a set of allowed or blocked communications. 9 | * Basically it can:

15 | * 16 | * {@link PrivacyItem Privacy Items} can handle different kind of blocking communications based on JID, group, 17 | * subscription type or globally. 18 | * 19 | * @author Francisco Vives 20 | */ 21 | public class PrivacyList { 22 | 23 | /** Holds if it is an active list or not **/ 24 | private boolean isActiveList; 25 | /** Holds if it is an default list or not **/ 26 | private boolean isDefaultList; 27 | /** Holds the list name used to print **/ 28 | private String listName; 29 | /** Holds the list of {@see PrivacyItem} **/ 30 | private List items; 31 | 32 | protected PrivacyList(boolean isActiveList, boolean isDefaultList, 33 | String listName, List privacyItems) { 34 | super(); 35 | this.isActiveList = isActiveList; 36 | this.isDefaultList = isDefaultList; 37 | this.listName = listName; 38 | this.items = privacyItems; 39 | } 40 | 41 | public boolean isActiveList() { 42 | return isActiveList; 43 | } 44 | 45 | public boolean isDefaultList() { 46 | return isDefaultList; 47 | } 48 | 49 | public List getItems() { 50 | return items; 51 | } 52 | 53 | public String toString() { 54 | return listName; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/PrivacyListListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2006-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smack; 21 | 22 | import org.jivesoftware.smack.packet.PrivacyItem; 23 | 24 | import java.util.List; 25 | 26 | /** 27 | * Interface to implement classes to listen for server events about privacy communication. 28 | * Listeners are registered with the {@link PrivacyListManager}. 29 | * 30 | * @see PrivacyListManager#addListener 31 | * 32 | * @author Francisco Vives 33 | */ 34 | public interface PrivacyListListener { 35 | 36 | /** 37 | * Set or update a privacy list with PrivacyItem. 38 | * 39 | * @param listName the name of the new or updated privacy list. 40 | * @param listItem the PrivacyItems that rules the list. 41 | */ 42 | public void setPrivacyList(String listName, List listItem); 43 | 44 | /** 45 | * A privacy list has been modified by another. It gets notified. 46 | * 47 | * @param listName the name of the updated privacy list. 48 | */ 49 | public void updatedPrivacyList(String listName); 50 | 51 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/RosterStorage.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack; 2 | 3 | import java.util.List; 4 | 5 | import org.jivesoftware.smack.packet.RosterPacket; 6 | 7 | /** 8 | * This is an interface for persistent roster storage needed to implement XEP-0237 9 | * @author Till Klocke 10 | * 11 | */ 12 | 13 | public interface RosterStorage { 14 | 15 | /** 16 | * This method returns a List object with all RosterEntries contained in this store. 17 | * @return List object with all entries in local roster storage 18 | */ 19 | public List getEntries(); 20 | /** 21 | * This method returns the RosterEntry which belongs to a specific user. 22 | * @param bareJid The bare JID of the RosterEntry 23 | * @return The RosterEntry which belongs to that user 24 | */ 25 | public RosterPacket.Item getEntry(String bareJid); 26 | /** 27 | * Returns the number of entries in this roster store 28 | * @return the number of entries 29 | */ 30 | public int getEntryCount(); 31 | /** 32 | * This methos returns the version number as specified by the "ver" attribute 33 | * of the local store. Should return an emtpy string if store is empty. 34 | * @return local roster version 35 | */ 36 | public String getRosterVersion(); 37 | /** 38 | * This method stores a new RosterEntry in this store or overrides an existing one. 39 | * If ver is null an IllegalArgumentException should be thrown. 40 | * @param entry the entry to save 41 | * @param ver the version this roster push contained 42 | */ 43 | public void addEntry(RosterPacket.Item item, String ver); 44 | /** 45 | * Removes an entry from the persistent storage 46 | * @param bareJid The bare JID of the entry to be removed 47 | */ 48 | public void removeEntry(String bareJid); 49 | /** 50 | * Update an entry which has been modified locally 51 | * @param entry the entry to be updated 52 | */ 53 | public void updateLocalEntry(RosterPacket.Item item); 54 | } 55 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/debugger/package.html: -------------------------------------------------------------------------------- 1 | Core debugger functionality. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/FromContainsFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * Filters for packets where the "from" field contains a specified value. 27 | * 28 | * @author Matt Tucker 29 | */ 30 | public class FromContainsFilter implements PacketFilter { 31 | 32 | private String from; 33 | 34 | /** 35 | * Creates a "from" contains filter using the "from" field part. 36 | * 37 | * @param from the from field value the packet must contain. 38 | */ 39 | public FromContainsFilter(String from) { 40 | if (from == null) { 41 | throw new IllegalArgumentException("Parameter cannot be null."); 42 | } 43 | this.from = from.toLowerCase(); 44 | } 45 | 46 | public boolean accept(Packet packet) { 47 | if (packet.getFrom() == null) { 48 | return false; 49 | } 50 | else { 51 | return packet.getFrom().toLowerCase().indexOf(from) != -1; 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/IQTypeFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smack.filter; 21 | 22 | import org.jivesoftware.smack.packet.IQ; 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * A filter for IQ packet types. Returns true only if the packet is an IQ packet 27 | * and it matches the type provided in the constructor. 28 | * 29 | * @author Alexander Wenckus 30 | * 31 | */ 32 | public class IQTypeFilter implements PacketFilter { 33 | 34 | private IQ.Type type; 35 | 36 | public IQTypeFilter(IQ.Type type) { 37 | this.type = type; 38 | } 39 | 40 | /* 41 | * (non-Javadoc) 42 | * 43 | * @see org.jivesoftware.smack.filter.PacketFilter#accept(org.jivesoftware.smack.packet.Packet) 44 | */ 45 | public boolean accept(Packet packet) { 46 | return (packet instanceof IQ && ((IQ) packet).getType().equals(type)); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/MessageTypeFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Message; 24 | import org.jivesoftware.smack.packet.Packet; 25 | 26 | /** 27 | * Filters for packets of a specific type of Message (e.g. CHAT). 28 | * 29 | * @see org.jivesoftware.smack.packet.Message.Type 30 | * @author Ward Harold 31 | */ 32 | public class MessageTypeFilter implements PacketFilter { 33 | 34 | private final Message.Type type; 35 | 36 | /** 37 | * Creates a new message type filter using the specified message type. 38 | * 39 | * @param type the message type. 40 | */ 41 | public MessageTypeFilter(Message.Type type) { 42 | this.type = type; 43 | } 44 | 45 | public boolean accept(Packet packet) { 46 | if (!(packet instanceof Message)) { 47 | return false; 48 | } 49 | else { 50 | return ((Message) packet).getType().equals(this.type); 51 | } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/NotFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * Implements the logical NOT operation on a packet filter. In other words, packets 27 | * pass this filter if they do not pass the supplied filter. 28 | * 29 | * @author Matt Tucker 30 | */ 31 | public class NotFilter implements PacketFilter { 32 | 33 | private PacketFilter filter; 34 | 35 | /** 36 | * Creates a NOT filter using the specified filter. 37 | * 38 | * @param filter the filter. 39 | */ 40 | public NotFilter(PacketFilter filter) { 41 | if (filter == null) { 42 | throw new IllegalArgumentException("Parameter cannot be null."); 43 | } 44 | this.filter = filter; 45 | } 46 | 47 | public boolean accept(Packet packet) { 48 | return !filter.accept(packet); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/PacketIDFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * Filters for packets with a particular packet ID. 27 | * 28 | * @author Matt Tucker 29 | */ 30 | public class PacketIDFilter implements PacketFilter { 31 | 32 | private String packetID; 33 | 34 | /** 35 | * Creates a new packet ID filter using the specified packet ID. 36 | * 37 | * @param packetID the packet ID to filter for. 38 | */ 39 | public PacketIDFilter(String packetID) { 40 | if (packetID == null) { 41 | throw new IllegalArgumentException("Packet ID cannot be null."); 42 | } 43 | this.packetID = packetID; 44 | } 45 | 46 | public boolean accept(Packet packet) { 47 | return packetID.equals(packet.getPacketID()); 48 | } 49 | 50 | public String toString() { 51 | return "PacketIDFilter by id: " + packetID; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/ThreadFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | import org.jivesoftware.smack.packet.Message; 25 | 26 | /** 27 | * Filters for message packets with a particular thread value. 28 | * 29 | * @author Matt Tucker 30 | */ 31 | public class ThreadFilter implements PacketFilter { 32 | 33 | private String thread; 34 | 35 | /** 36 | * Creates a new thread filter using the specified thread value. 37 | * 38 | * @param thread the thread value to filter for. 39 | */ 40 | public ThreadFilter(String thread) { 41 | if (thread == null) { 42 | throw new IllegalArgumentException("Thread cannot be null."); 43 | } 44 | this.thread = thread; 45 | } 46 | 47 | public boolean accept(Packet packet) { 48 | return packet instanceof Message && thread.equals(((Message) packet).getThread()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/ToContainsFilter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.filter; 22 | 23 | import org.jivesoftware.smack.packet.Packet; 24 | 25 | /** 26 | * Filters for packets where the "to" field contains a specified value. For example, 27 | * the filter could be used to listen for all packets sent to a group chat nickname. 28 | * 29 | * @author Matt Tucker 30 | */ 31 | public class ToContainsFilter implements PacketFilter { 32 | 33 | private String to; 34 | 35 | /** 36 | * Creates a "to" contains filter using the "to" field part. 37 | * 38 | * @param to the to field value the packet must contain. 39 | */ 40 | public ToContainsFilter(String to) { 41 | if (to == null) { 42 | throw new IllegalArgumentException("Parameter cannot be null."); 43 | } 44 | this.to = to.toLowerCase(); 45 | } 46 | 47 | public boolean accept(Packet packet) { 48 | if (packet.getTo() == null) { 49 | return false; 50 | } 51 | else { 52 | return packet.getTo().toLowerCase().indexOf(to) != -1; 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/filter/package.html: -------------------------------------------------------------------------------- 1 | Allows {@link org.jivesoftware.smack.PacketCollector} and {@link org.jivesoftware.smack.PacketListener} instances to filter for packets with particular attributes. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/package.html: -------------------------------------------------------------------------------- 1 | Core classes of the Smack API. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/packet/PacketExtension.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.packet; 22 | 23 | /** 24 | * Interface to represent packet extensions. A packet extension is an XML subdocument 25 | * with a root element name and namespace. Packet extensions are used to provide 26 | * extended functionality beyond what is in the base XMPP specification. Examples of 27 | * packet extensions include message events, message properties, and extra presence data. 28 | * IQ packets cannot contain packet extensions. 29 | * 30 | * @see DefaultPacketExtension 31 | * @see org.jivesoftware.smack.provider.PacketExtensionProvider 32 | * @author Matt Tucker 33 | */ 34 | public interface PacketExtension { 35 | 36 | /** 37 | * Returns the root element name. 38 | * 39 | * @return the element name. 40 | */ 41 | public String getElementName(); 42 | 43 | /** 44 | * Returns the root element XML namespace. 45 | * 46 | * @return the namespace. 47 | */ 48 | public String getNamespace(); 49 | 50 | /** 51 | * Returns the XML representation of the PacketExtension. 52 | * 53 | * @return the packet extension as XML. 54 | */ 55 | public String toXML(); 56 | } 57 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/packet/Session.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.packet; 22 | 23 | /** 24 | * IQ packet that will be sent to the server to establish a session.

25 | * 26 | * If a server supports sessions, it MUST include a session element in the 27 | * stream features it advertises to a client after the completion of stream authentication. 28 | * Upon being informed that session establishment is required by the server the client MUST 29 | * establish a session if it desires to engage in instant messaging and presence functionality.

30 | * 31 | * For more information refer to the following 32 | * link. 33 | * 34 | * @author Gaston Dombiak 35 | */ 36 | public class Session extends IQ { 37 | 38 | public Session() { 39 | setType(IQ.Type.SET); 40 | } 41 | 42 | public String getChildElementXML() { 43 | return ""; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/packet/package.html: -------------------------------------------------------------------------------- 1 | XML packets that are part of the XMPP protocol. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/provider/IQProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.provider; 22 | 23 | import org.jivesoftware.smack.packet.IQ; 24 | import org.xmlpull.v1.XmlPullParser; 25 | 26 | /** 27 | * An interface for parsing custom IQ packets. Each IQProvider must be registered with 28 | * the ProviderManager class for it to be used. Every implementation of this 29 | * interface must have a public, no-argument constructor. 30 | * 31 | * @author Matt Tucker 32 | */ 33 | public interface IQProvider { 34 | 35 | /** 36 | * Parse the IQ sub-document and create an IQ instance. Each IQ must have a 37 | * single child element. At the beginning of the method call, the xml parser 38 | * will be positioned at the opening tag of the IQ child element. At the end 39 | * of the method call, the parser must be positioned on the closing tag 40 | * of the child element. 41 | * 42 | * @param parser an XML parser. 43 | * @return a new IQ instance. 44 | * @throws Exception if an error occurs parsing the XML. 45 | */ 46 | public IQ parseIQ(XmlPullParser parser) throws Exception; 47 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/provider/PacketExtensionProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.provider; 22 | 23 | import org.jivesoftware.smack.packet.PacketExtension; 24 | import org.xmlpull.v1.XmlPullParser; 25 | 26 | /** 27 | * An interface for parsing custom packets extensions. Each PacketExtensionProvider must 28 | * be registered with the ProviderManager class for it to be used. Every implementation 29 | * of this interface must have a public, no-argument constructor. 30 | * 31 | * @author Matt Tucker 32 | */ 33 | public interface PacketExtensionProvider { 34 | 35 | /** 36 | * Parse an extension sub-packet and create a PacketExtension instance. At 37 | * the beginning of the method call, the xml parser will be positioned on the 38 | * opening element of the packet extension. At the end of the method call, the 39 | * parser must be positioned on the closing element of the packet extension. 40 | * 41 | * @param parser an XML parser. 42 | * @return a new IQ instance. 43 | * @throws java.lang.Exception if an error occurs parsing the XML. 44 | */ 45 | public PacketExtension parseExtension(XmlPullParser parser) throws Exception; 46 | } 47 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/provider/package.html: -------------------------------------------------------------------------------- 1 | Provides pluggable parsing of incoming IQ's and packet extensions. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/proxy/DirectSocketFactory.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack.proxy; 2 | 3 | import java.io.IOException; 4 | import java.net.InetAddress; 5 | import java.net.InetSocketAddress; 6 | import java.net.Proxy; 7 | import java.net.Socket; 8 | import java.net.UnknownHostException; 9 | import javax.net.SocketFactory; 10 | 11 | /** 12 | * SocketFactory for direct connection 13 | * 14 | * @author Atul Aggarwal 15 | */ 16 | class DirectSocketFactory 17 | extends SocketFactory 18 | { 19 | 20 | public DirectSocketFactory() 21 | { 22 | } 23 | 24 | public Socket createSocket(String host, int port) 25 | throws IOException, UnknownHostException 26 | { 27 | Socket newSocket = new Socket(Proxy.NO_PROXY); 28 | newSocket.connect(new InetSocketAddress(host,port)); 29 | return newSocket; 30 | } 31 | 32 | public Socket createSocket(String host ,int port, InetAddress localHost, 33 | int localPort) 34 | throws IOException, UnknownHostException 35 | { 36 | return new Socket(host,port,localHost,localPort); 37 | } 38 | 39 | public Socket createSocket(InetAddress host, int port) 40 | throws IOException 41 | { 42 | Socket newSocket = new Socket(Proxy.NO_PROXY); 43 | newSocket.connect(new InetSocketAddress(host,port)); 44 | return newSocket; 45 | } 46 | 47 | public Socket createSocket( InetAddress address, int port, 48 | InetAddress localAddress, int localPort) 49 | throws IOException 50 | { 51 | return new Socket(address,port,localAddress,localPort); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/proxy/ProxyException.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack.proxy; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * An exception class to handle exceptions caused by proxy. 7 | * 8 | * @author Atul Aggarwal 9 | */ 10 | public class ProxyException 11 | extends IOException 12 | { 13 | public ProxyException(ProxyInfo.ProxyType type, String ex, Throwable cause) 14 | { 15 | super("Proxy Exception " + type.toString() + " : "+ex+", "+cause); 16 | } 17 | 18 | public ProxyException(ProxyInfo.ProxyType type, String ex) 19 | { 20 | super("Proxy Exception " + type.toString() + " : "+ex); 21 | } 22 | 23 | public ProxyException(ProxyInfo.ProxyType type) 24 | { 25 | super("Proxy Exception " + type.toString() + " : " + "Unknown Error"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/sasl/SASLCramMD5Mechanism.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smack.sasl; 21 | 22 | import org.jivesoftware.smack.SASLAuthentication; 23 | 24 | /** 25 | * Implementation of the SASL CRAM-MD5 mechanism 26 | * 27 | * @author Jay Kline 28 | */ 29 | public class SASLCramMD5Mechanism extends SASLMechanism { 30 | 31 | public SASLCramMD5Mechanism(SASLAuthentication saslAuthentication) { 32 | super(saslAuthentication); 33 | } 34 | 35 | protected String getName() { 36 | return "CRAM-MD5"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/sasl/SASLDigestMD5Mechanism.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smack.sasl; 21 | 22 | import org.jivesoftware.smack.SASLAuthentication; 23 | 24 | /** 25 | * Implementation of the SASL DIGEST-MD5 mechanism 26 | * 27 | * @author Jay Kline 28 | */ 29 | public class SASLDigestMD5Mechanism extends SASLMechanism { 30 | 31 | public SASLDigestMD5Mechanism(SASLAuthentication saslAuthentication) { 32 | super(saslAuthentication); 33 | } 34 | 35 | protected String getName() { 36 | return "DIGEST-MD5"; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/sasl/SASLPlainMechanism.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software 10 | * distributed under the License is distributed on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing permissions and 13 | * limitations under the License. 14 | */ 15 | 16 | package org.jivesoftware.smack.sasl; 17 | 18 | import org.jivesoftware.smack.SASLAuthentication; 19 | 20 | /** 21 | * Implementation of the SASL PLAIN mechanism 22 | * 23 | * @author Jay Kline 24 | */ 25 | public class SASLPlainMechanism extends SASLMechanism { 26 | 27 | public SASLPlainMechanism(SASLAuthentication saslAuthentication) { 28 | super(saslAuthentication); 29 | } 30 | 31 | protected String getName() { 32 | return "PLAIN"; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/sasl/package.html: -------------------------------------------------------------------------------- 1 | SASL Mechanisms. -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/ReaderListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.util; 22 | 23 | /** 24 | * Interface that allows for implementing classes to listen for string reading 25 | * events. Listeners are registered with ObservableReader objects. 26 | * 27 | * @see ObservableReader#addReaderListener 28 | * @see ObservableReader#removeReaderListener 29 | * 30 | * @author Gaston Dombiak 31 | */ 32 | public interface ReaderListener { 33 | 34 | /** 35 | * Notification that the Reader has read a new string. 36 | * 37 | * @param str the read String 38 | */ 39 | public abstract void read(String str); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/WriterListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smack.util; 22 | 23 | /** 24 | * Interface that allows for implementing classes to listen for string writing 25 | * events. Listeners are registered with ObservableWriter objects. 26 | * 27 | * @see ObservableWriter#addWriterListener 28 | * @see ObservableWriter#removeWriterListener 29 | * 30 | * @author Gaston Dombiak 31 | */ 32 | public interface WriterListener { 33 | 34 | /** 35 | * Notification that the Writer has written a new string. 36 | * 37 | * @param str the written string 38 | */ 39 | public abstract void write(String str); 40 | 41 | } 42 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/collections/EmptyMapIterator.java: -------------------------------------------------------------------------------- 1 | // GenericsNote: Converted. 2 | /* 3 | * Copyright 2004 The Apache Software Foundation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jivesoftware.smack.util.collections; 18 | 19 | /** 20 | * Provides an implementation of an empty map iterator. 21 | * 22 | * @author Matt Hall, John Watkinson, Stephen Colebourne 23 | * @version $Revision: 1.1 $ $Date: 2005/10/11 17:05:24 $ 24 | * @since Commons Collections 3.1 25 | */ 26 | public class EmptyMapIterator extends AbstractEmptyIterator implements MapIterator, ResettableIterator { 27 | 28 | /** 29 | * Singleton instance of the iterator. 30 | * 31 | * @since Commons Collections 3.1 32 | */ 33 | public static final MapIterator INSTANCE = new EmptyMapIterator(); 34 | 35 | /** 36 | * Constructor. 37 | */ 38 | protected EmptyMapIterator() { 39 | super(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/collections/KeyValue.java: -------------------------------------------------------------------------------- 1 | // GenericsNote: Converted. 2 | /* 3 | * Copyright 2003-2004 The Apache Software Foundation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jivesoftware.smack.util.collections; 18 | 19 | /** 20 | * Defines a simple key value pair. 21 | *

22 | * A Map Entry has considerable additional semantics over and above a simple 23 | * key-value pair. This interface defines the minimum key value, with just the 24 | * two get methods. 25 | * 26 | * @author Matt Hall, John Watkinson, Stephen Colebourne 27 | * @version $Revision: 1.1 $ $Date: 2005/10/11 17:05:19 $ 28 | * @since Commons Collections 3.0 29 | */ 30 | public interface KeyValue { 31 | 32 | /** 33 | * Gets the key from the pair. 34 | * 35 | * @return the key 36 | */ 37 | K getKey(); 38 | 39 | /** 40 | * Gets the value from the pair. 41 | * 42 | * @return the value 43 | */ 44 | V getValue(); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/collections/ResettableIterator.java: -------------------------------------------------------------------------------- 1 | // GenericsNote: Converted. 2 | /* 3 | * Copyright 2003-2004 The Apache Software Foundation 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.jivesoftware.smack.util.collections; 18 | 19 | import java.util.Iterator; 20 | 21 | /** 22 | * Defines an iterator that can be reset back to an initial state. 23 | *

24 | * This interface allows an iterator to be repeatedly reused. 25 | * 26 | * @author Matt Hall, John Watkinson, Stephen Colebourne 27 | * @version $Revision: 1.1 $ $Date: 2005/10/11 17:05:19 $ 28 | * @since Commons Collections 3.0 29 | */ 30 | public interface ResettableIterator extends Iterator { 31 | 32 | /** 33 | * Resets the iterator back to the position at which the iterator 34 | * was created. 35 | */ 36 | public void reset(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smack/util/package.html: -------------------------------------------------------------------------------- 1 | Utility classes. -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/CapsVerListener.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx; 2 | 3 | public interface CapsVerListener { 4 | public void capsVerUpdated(String capsVer); 5 | } 6 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/ChatState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: 2407 $ 4 | * $Date: 2004-11-02 15:37:00 -0800 (Tue, 02 Nov 2004) $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx; 22 | 23 | /** 24 | * Represents the current state of a users interaction with another user. Implemented according to 25 | * XEP-0085. 26 | * 27 | * @author Alexander Wenckus 28 | */ 29 | public enum ChatState { 30 | /** 31 | * User is actively participating in the chat session. 32 | */ 33 | active, 34 | /** 35 | * User is composing a message. 36 | */ 37 | composing, 38 | /** 39 | * User had been composing but now has stopped. 40 | */ 41 | paused, 42 | /** 43 | * User has not been actively participating in the chat session. 44 | */ 45 | inactive, 46 | /** 47 | * User has effectively ended their participation in the chat session. 48 | */ 49 | gone 50 | } 51 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/ChatStateListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: 2407 $ 4 | * $Date: 2004-11-02 15:37:00 -0800 (Tue, 02 Nov 2004) $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx; 22 | 23 | import org.jivesoftware.smack.Chat; 24 | import org.jivesoftware.smack.MessageListener; 25 | 26 | /** 27 | * Events for when the state of a user in a chat changes. 28 | * 29 | * @author Alexander Wenckus 30 | */ 31 | public interface ChatStateListener extends MessageListener { 32 | 33 | /** 34 | * Fired when the state of a chat with another user changes. 35 | * 36 | * @param chat the chat in which the state has changed. 37 | * @param state the new state of the participant. 38 | */ 39 | void stateChanged(Chat chat, ChatState state); 40 | } 41 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/PEPListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile: PEPListener.java,v $ 3 | * $Revision: 1.1 $ 4 | * $Date: 2007/11/03 00:14:32 $ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx; 22 | 23 | import org.jivesoftware.smackx.packet.PEPEvent; 24 | 25 | 26 | /** 27 | * 28 | * A listener that is fired anytime a PEP event message is received. 29 | * 30 | * @author Jeff Williams 31 | */ 32 | public interface PEPListener { 33 | 34 | /** 35 | * Called when PEP events are received as part of a presence subscribe or message filter. 36 | * 37 | * @param from the user that sent the entries. 38 | * @param event the event contained in the message. 39 | */ 40 | public void eventReceived(String from, PEPEvent event); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/RosterExchangeListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx; 22 | 23 | import java.util.Iterator; 24 | 25 | /** 26 | * 27 | * A listener that is fired anytime a roster exchange is received. 28 | * 29 | * @author Gaston Dombiak 30 | */ 31 | public interface RosterExchangeListener { 32 | 33 | /** 34 | * Called when roster entries are received as part of a roster exchange. 35 | * 36 | * @param from the user that sent the entries. 37 | * @param remoteRosterEntries the entries sent by the user. The entries are instances of 38 | * RemoteRosterEntry. 39 | */ 40 | public void entriesReceived(String from, Iterator remoteRosterEntries); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/bookmark/SharedBookmark.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.bookmark; 21 | 22 | /** 23 | * Interface to indicate if a bookmark is shared across the server. 24 | * 25 | * @author Alexander Wenckus 26 | */ 27 | public interface SharedBookmark { 28 | 29 | /** 30 | * Returns true if this bookmark is shared. 31 | * 32 | * @return returns true if this bookmark is shared. 33 | */ 34 | public boolean isShared(); 35 | } 36 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.bytestreams.ibb; 15 | 16 | import org.jivesoftware.smackx.bytestreams.BytestreamListener; 17 | import org.jivesoftware.smackx.bytestreams.BytestreamRequest; 18 | 19 | /** 20 | * InBandBytestreamListener are informed if a remote user wants to initiate an In-Band Bytestream. 21 | * Implement this interface to handle incoming In-Band Bytestream requests. 22 | *

23 | * There are two ways to add this listener. See 24 | * {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and 25 | * {@link InBandBytestreamManager#addIncomingBytestreamListener(BytestreamListener, String)} for 26 | * further details. 27 | * 28 | * @author Henning Staib 29 | */ 30 | public abstract class InBandBytestreamListener implements BytestreamListener { 31 | 32 | 33 | 34 | public void incomingBytestreamRequest(BytestreamRequest request) { 35 | incomingBytestreamRequest((InBandBytestreamRequest) request); 36 | } 37 | 38 | /** 39 | * This listener is notified if an In-Band Bytestream request from another user has been 40 | * received. 41 | * 42 | * @param request the incoming In-Band Bytestream request 43 | */ 44 | public abstract void incomingBytestreamRequest(InBandBytestreamRequest request); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/bytestreams/ibb/provider/CloseIQProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.bytestreams.ibb.provider; 15 | 16 | import org.jivesoftware.smack.packet.IQ; 17 | import org.jivesoftware.smack.provider.IQProvider; 18 | import org.jivesoftware.smackx.bytestreams.ibb.packet.Close; 19 | import org.xmlpull.v1.XmlPullParser; 20 | 21 | /** 22 | * Parses a close In-Band Bytestream packet. 23 | * 24 | * @author Henning Staib 25 | */ 26 | public class CloseIQProvider implements IQProvider { 27 | 28 | public IQ parseIQ(XmlPullParser parser) throws Exception { 29 | String sid = parser.getAttributeValue("", "sid"); 30 | return new Close(sid); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/bytestreams/ibb/provider/OpenIQProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.bytestreams.ibb.provider; 15 | 16 | import org.jivesoftware.smack.packet.IQ; 17 | import org.jivesoftware.smack.provider.IQProvider; 18 | import org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager.StanzaType; 19 | import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; 20 | import org.xmlpull.v1.XmlPullParser; 21 | 22 | /** 23 | * Parses an In-Band Bytestream open packet. 24 | * 25 | * @author Henning Staib 26 | */ 27 | public class OpenIQProvider implements IQProvider { 28 | 29 | public IQ parseIQ(XmlPullParser parser) throws Exception { 30 | String sessionID = parser.getAttributeValue("", "sid"); 31 | int blockSize = Integer.parseInt(parser.getAttributeValue("", "block-size")); 32 | 33 | String stanzaValue = parser.getAttributeValue("", "stanza"); 34 | StanzaType stanza = null; 35 | if (stanzaValue == null) { 36 | stanza = StanzaType.IQ; 37 | } 38 | else { 39 | stanza = StanzaType.valueOf(stanzaValue.toUpperCase()); 40 | } 41 | 42 | return new Open(sessionID, blockSize, stanza); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/bytestreams/socks5/Socks5BytestreamListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.bytestreams.socks5; 15 | 16 | import org.jivesoftware.smackx.bytestreams.BytestreamListener; 17 | import org.jivesoftware.smackx.bytestreams.BytestreamRequest; 18 | 19 | /** 20 | * Socks5BytestreamListener are informed if a remote user wants to initiate a SOCKS5 Bytestream. 21 | * Implement this interface to handle incoming SOCKS5 Bytestream requests. 22 | *

23 | * There are two ways to add this listener. See 24 | * {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener)} and 25 | * {@link Socks5BytestreamManager#addIncomingBytestreamListener(BytestreamListener, String)} for 26 | * further details. 27 | * 28 | * @author Henning Staib 29 | */ 30 | public abstract class Socks5BytestreamListener implements BytestreamListener { 31 | 32 | public void incomingBytestreamRequest(BytestreamRequest request) { 33 | incomingBytestreamRequest((Socks5BytestreamRequest) request); 34 | } 35 | 36 | /** 37 | * This listener is notified if a SOCKS5 Bytestream request from another user has been received. 38 | * 39 | * @param request the incoming SOCKS5 Bytestream request 40 | */ 41 | public abstract void incomingBytestreamRequest(Socks5BytestreamRequest request); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/commands/LocalCommandFactory.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.commands; 2 | 3 | /** 4 | * A factory for creating local commands. It's useful in cases where instantiation 5 | * of a command is more complicated than just using the default constructor. For example, 6 | * when arguments must be passed into the constructor or when using a dependency injection 7 | * framework. When a LocalCommandFactory isn't used, you can provide the AdHocCommandManager 8 | * a Class object instead. For more details, see 9 | * {@link AdHocCommandManager#registerCommand(String, String, LocalCommandFactory)}. 10 | * 11 | * @author Matt Tucker 12 | */ 13 | public interface LocalCommandFactory { 14 | 15 | /** 16 | * Returns an instance of a LocalCommand. 17 | * 18 | * @return a LocalCommand instance. 19 | * @throws InstantiationException if creating an instance failed. 20 | * @throws IllegalAccessException if creating an instance is not allowed. 21 | */ 22 | public LocalCommand getInstance() throws InstantiationException, IllegalAccessException; 23 | 24 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/debugger/package.html: -------------------------------------------------------------------------------- 1 | Smack optional Debuggers. -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/filetransfer/FileTransferListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision: $ 4 | * $Date: $ 5 | * 6 | * Copyright 2003-2006 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.jivesoftware.smackx.filetransfer; 21 | 22 | /** 23 | * File transfers can cause several events to be raised. These events can be 24 | * monitored through this interface. 25 | * 26 | * @author Alexander Wenckus 27 | */ 28 | public interface FileTransferListener { 29 | /** 30 | * A request to send a file has been recieved from another user. 31 | * 32 | * @param request 33 | * The request from the other user. 34 | */ 35 | public void fileTransferRequest(final FileTransferRequest request); 36 | } 37 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/muc/DefaultUserStatusListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.muc; 22 | 23 | /** 24 | * Default implementation of the UserStatusListener interface.

25 | * 26 | * This class does not provide any behavior by default. It just avoids having 27 | * to implement all the inteface methods if the user is only interested in implementing 28 | * some of the methods. 29 | * 30 | * @author Gaston Dombiak 31 | */ 32 | public class DefaultUserStatusListener implements UserStatusListener { 33 | 34 | public void kicked(String actor, String reason) { 35 | } 36 | 37 | public void voiceGranted() { 38 | } 39 | 40 | public void voiceRevoked() { 41 | } 42 | 43 | public void banned(String actor, String reason) { 44 | } 45 | 46 | public void membershipGranted() { 47 | } 48 | 49 | public void membershipRevoked() { 50 | } 51 | 52 | public void moderatorGranted() { 53 | } 54 | 55 | public void moderatorRevoked() { 56 | } 57 | 58 | public void ownershipGranted() { 59 | } 60 | 61 | public void ownershipRevoked() { 62 | } 63 | 64 | public void adminGranted() { 65 | } 66 | 67 | public void adminRevoked() { 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/muc/InvitationRejectionListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.muc; 22 | 23 | /** 24 | * A listener that is fired anytime an invitee declines or rejects an invitation. 25 | * 26 | * @author Gaston Dombiak 27 | */ 28 | public interface InvitationRejectionListener { 29 | 30 | /** 31 | * Called when the invitee declines the invitation. 32 | * 33 | * @param invitee the invitee that declined the invitation. (e.g. hecate@shakespeare.lit). 34 | * @param reason the reason why the invitee declined the invitation. 35 | */ 36 | public abstract void invitationDeclined(String invitee, String reason); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/muc/SubjectUpdatedListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.muc; 22 | 23 | /** 24 | * A listener that is fired anytime a MUC room changes its subject. 25 | * 26 | * @author Gaston Dombiak 27 | */ 28 | public interface SubjectUpdatedListener { 29 | 30 | /** 31 | * Called when a MUC room has changed its subject. 32 | * 33 | * @param subject the new room's subject. 34 | * @param from the user that changed the room's subject (e.g. room@conference.jabber.org/nick). 35 | */ 36 | public abstract void subjectUpdated(String subject, String from); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/muc/package.html: -------------------------------------------------------------------------------- 1 | Classes and Interfaces that implement Multi-User Chat (MUC). -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/package.html: -------------------------------------------------------------------------------- 1 | Smack extensions API. -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/packet/Header.java: -------------------------------------------------------------------------------- 1 | /* 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.packet; 15 | 16 | import org.jivesoftware.smack.packet.PacketExtension; 17 | 18 | /** 19 | * Represents a Header entry as specified by the Stanza Headers and Internet Metadata (SHIM) 20 | 21 | * @author Robin Collier 22 | */ 23 | public class Header implements PacketExtension 24 | { 25 | private String name; 26 | private String value; 27 | 28 | public Header(String name, String value) 29 | { 30 | this.name = name; 31 | this.value = value; 32 | } 33 | 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | 39 | public String getValue() 40 | { 41 | return value; 42 | } 43 | 44 | public String getElementName() 45 | { 46 | return "header"; 47 | } 48 | 49 | public String getNamespace() 50 | { 51 | return HeadersExtension.NAMESPACE; 52 | } 53 | 54 | public String toXML() 55 | { 56 | return "

" + value + "
"; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/packet/PrivateData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.packet; 22 | 23 | /** 24 | * Interface to represent private data. Each private data chunk is an XML sub-document 25 | * with a root element name and namespace. 26 | * 27 | * @see org.jivesoftware.smackx.PrivateDataManager 28 | * @author Matt Tucker 29 | */ 30 | public interface PrivateData { 31 | 32 | /** 33 | * Returns the root element name. 34 | * 35 | * @return the element name. 36 | */ 37 | public String getElementName(); 38 | 39 | /** 40 | * Returns the root element XML namespace. 41 | * 42 | * @return the namespace. 43 | */ 44 | public String getNamespace(); 45 | 46 | /** 47 | * Returns the XML reppresentation of the PrivateData. 48 | * 49 | * @return the private data as XML. 50 | */ 51 | public String toXML(); 52 | } 53 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/packet/package.html: -------------------------------------------------------------------------------- 1 | XML packets that are part of the XMPP extension protocols. -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/provider/DelayInfoProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package org.jivesoftware.smackx.provider; 16 | 17 | import org.jivesoftware.smack.packet.PacketExtension; 18 | import org.jivesoftware.smackx.packet.DelayInfo; 19 | import org.jivesoftware.smackx.packet.DelayInformation; 20 | import org.xmlpull.v1.XmlPullParser; 21 | 22 | /** 23 | * This provider simply creates a {@link DelayInfo} decorator for the {@link DelayInformation} that 24 | * is returned by the superclass. This allows the new code using 25 | * Delay Information XEP-0203 to be 26 | * backward compatible with XEP-0091. 27 | * 28 | *

This provider must be registered in the smack.properties file for the element 29 | * delay with namespace urn:xmpp:delay

30 | * 31 | * @author Robin Collier 32 | */ 33 | public class DelayInfoProvider extends DelayInformationProvider 34 | { 35 | 36 | @Override 37 | public PacketExtension parseExtension(XmlPullParser parser) throws Exception 38 | { 39 | return new DelayInfo((DelayInformation)super.parseExtension(parser)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/provider/HeaderProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.provider; 15 | 16 | import org.jivesoftware.smack.packet.PacketExtension; 17 | import org.jivesoftware.smack.provider.PacketExtensionProvider; 18 | import org.jivesoftware.smackx.packet.Header; 19 | import org.xmlpull.v1.XmlPullParser; 20 | 21 | /** 22 | * Parses the header element as defined in Stanza Headers and Internet Metadata (SHIM). 23 | * 24 | * @author Robin Collier 25 | */ 26 | public class HeaderProvider implements PacketExtensionProvider 27 | { 28 | public PacketExtension parseExtension(XmlPullParser parser) throws Exception 29 | { 30 | String name = parser.getAttributeValue(null, "name"); 31 | String value = null; 32 | 33 | parser.next(); 34 | 35 | if (parser.getEventType() == XmlPullParser.TEXT) 36 | value = parser.getText(); 37 | 38 | while(parser.getEventType() != XmlPullParser.END_TAG) 39 | parser.next(); 40 | 41 | return new Header(name, value); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/provider/HeadersProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.provider; 15 | 16 | import java.util.Collection; 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | import org.jivesoftware.smack.packet.PacketExtension; 21 | import org.jivesoftware.smackx.packet.Header; 22 | import org.jivesoftware.smackx.packet.HeadersExtension; 23 | 24 | /** 25 | * Parses the headers element as defined in Stanza Headers and Internet Metadata (SHIM). 26 | * 27 | * @author Robin Collier 28 | */ 29 | public class HeadersProvider extends EmbeddedExtensionProvider 30 | { 31 | @Override 32 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 33 | { 34 | return new HeadersExtension((Collection
)content); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/provider/PrivateDataProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $RCSfile$ 3 | * $Revision$ 4 | * $Date$ 5 | * 6 | * Copyright 2003-2007 Jive Software. 7 | * 8 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | package org.jivesoftware.smackx.provider; 22 | 23 | import org.xmlpull.v1.XmlPullParser; 24 | import org.jivesoftware.smackx.packet.PrivateData; 25 | 26 | /** 27 | * An interface for parsing custom private data. Each PrivateDataProvider must 28 | * be registered with the PrivateDataManager class for it to be used. Every implementation 29 | * of this interface must have a public, no-argument constructor. 30 | * 31 | * @author Matt Tucker 32 | */ 33 | public interface PrivateDataProvider { 34 | 35 | /** 36 | * Parse the private data sub-document and create a PrivateData instance. At the 37 | * beginning of the method call, the xml parser will be positioned at the opening 38 | * tag of the private data child element. At the end of the method call, the parser 39 | * must be positioned on the closing tag of the child element. 40 | * 41 | * @param parser an XML parser. 42 | * @return a new PrivateData instance. 43 | * @throws Exception if an error occurs parsing the XML. 44 | */ 45 | public PrivateData parsePrivateData(XmlPullParser parser) throws Exception; 46 | } 47 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/provider/package.html: -------------------------------------------------------------------------------- 1 | Provides pluggable parsing logic for Smack extensions. -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/AccessModel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * This enumeration represents the access models for the pubsub node 18 | * as defined in the pubsub specification section 16.4.3 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum AccessModel 23 | { 24 | /** Anyone may subscribe and retrieve items */ 25 | open, 26 | 27 | /** Subscription request must be approved and only subscribers may retrieve items */ 28 | authorize, 29 | 30 | /** Anyone with a presence subscription of both or from may subscribe and retrieve items */ 31 | presence, 32 | 33 | /** Anyone in the specified roster group(s) may subscribe and retrieve items */ 34 | roster, 35 | 36 | /** Only those on a whitelist may subscribe and retrieve items */ 37 | whitelist; 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/ChildrenAssociationPolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * This enumeration represents the children association policy for associating leaf nodes 18 | * with collection nodes as defined in the pubsub specification section 16.4.3 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum ChildrenAssociationPolicy 23 | { 24 | /** Anyone may associate leaf nodes with the collection */ 25 | all, 26 | 27 | /** Only collection node owners may associate leaf nodes with the collection. */ 28 | owners, 29 | 30 | /** Only those on a whitelist may associate leaf nodes with the collection. */ 31 | whitelist; 32 | } 33 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/CollectionNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-07-13 3 | */ 4 | package org.jivesoftware.smackx.pubsub; 5 | 6 | import org.jivesoftware.smack.Connection; 7 | 8 | public class CollectionNode extends Node 9 | { 10 | CollectionNode(Connection connection, String nodeId) 11 | { 12 | super(connection, nodeId); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/ConfigurationEvent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | import java.util.Arrays; 17 | import java.util.Collections; 18 | import java.util.List; 19 | 20 | import org.jivesoftware.smack.packet.PacketExtension; 21 | 22 | /** 23 | * Represents the configuration element of a pubsub message event which 24 | * associates a configuration form to the node which was configured. The form 25 | * contains the current node configuration. 26 | * 27 | * @author Robin Collier 28 | */ 29 | public class ConfigurationEvent extends NodeExtension implements EmbeddedPacketExtension 30 | { 31 | private ConfigureForm form; 32 | 33 | public ConfigurationEvent(String nodeId) 34 | { 35 | super(PubSubElementType.CONFIGURATION, nodeId); 36 | } 37 | 38 | public ConfigurationEvent(String nodeId, ConfigureForm configForm) 39 | { 40 | super(PubSubElementType.CONFIGURATION, nodeId); 41 | form = configForm; 42 | } 43 | 44 | public ConfigureForm getConfiguration() 45 | { 46 | return form; 47 | } 48 | 49 | public List getExtensions() 50 | { 51 | if (getConfiguration() == null) 52 | return Collections.EMPTY_LIST; 53 | else 54 | return Arrays.asList(((PacketExtension)getConfiguration().getDataFormToSend())); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/EventElementType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * This enumeration defines the possible event types that are supported within pubsub 18 | * event messages. 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum EventElementType 23 | { 24 | /** A node has been associated or dissassociated with a collection node */ 25 | collection, 26 | 27 | /** A node has had its configuration changed */ 28 | configuration, 29 | 30 | /** A node has been deleted */ 31 | delete, 32 | 33 | /** Items have been published to a node */ 34 | items, 35 | 36 | /** All items have been purged from a node */ 37 | purge, 38 | 39 | /** A node has been subscribed to */ 40 | subscription 41 | } 42 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/FormNodeType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace; 17 | 18 | /** 19 | * The types of forms supported by the pubsub specification. 20 | * 21 | * @author Robin Collier 22 | */ 23 | public enum FormNodeType 24 | { 25 | /** Form for configuring an existing node */ 26 | CONFIGURE_OWNER, 27 | 28 | /** Form for configuring a node during creation */ 29 | CONFIGURE, 30 | 31 | /** Form for configuring subscription options */ 32 | OPTIONS, 33 | 34 | /** Form which represents the default node configuration options */ 35 | DEFAULT; 36 | 37 | public PubSubElementType getNodeElement() 38 | { 39 | return PubSubElementType.valueOf(toString()); 40 | } 41 | 42 | public static FormNodeType valueOfFromElementName(String elem, String configNamespace) 43 | { 44 | if ("configure".equals(elem) && PubSubNamespace.OWNER.getXmlns().equals(configNamespace)) 45 | { 46 | return CONFIGURE_OWNER; 47 | } 48 | return valueOf(elem.toUpperCase()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/FormType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | import org.jivesoftware.smackx.Form; 17 | 18 | /** 19 | * Defines the allowable types for a {@link Form} 20 | * 21 | * @author Robin Collier 22 | */ 23 | public enum FormType 24 | { 25 | form, submit, cancel, result; 26 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/ItemReply.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * These are the options for the node configuration setting {@link ConfigureForm#setItemReply(ItemReply)}, 18 | * which defines who should receive replies to items. 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum ItemReply 23 | { 24 | /** The node owner */ 25 | owner, 26 | 27 | /** The item publisher */ 28 | publisher; 29 | } 30 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/NodeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-05-12 3 | */ 4 | package org.jivesoftware.smackx.pubsub; 5 | 6 | abstract public class NodeEvent 7 | { 8 | private String nodeId; 9 | 10 | protected NodeEvent(String id) 11 | { 12 | nodeId = id; 13 | } 14 | 15 | public String getNodeId() 16 | { 17 | return nodeId; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/NodeType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * Defines the available types of nodes 18 | * 19 | * @author Robin Collier 20 | */ 21 | public enum NodeType 22 | { 23 | leaf, 24 | collection; 25 | } 26 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/PresenceState.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * Defines the possible valid presence states for node subscription via 18 | * {@link SubscribeForm#getShowValues()}. 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum PresenceState 23 | { 24 | chat, online, away, xa, dnd 25 | } 26 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/PublishModel.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * Determines who may publish to a node. Denotes possible values 18 | * for {@link ConfigureForm#setPublishModel(PublishModel)}. 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum PublishModel 23 | { 24 | /** Only publishers may publish */ 25 | publishers, 26 | 27 | /** Only subscribers may publish */ 28 | subscribers, 29 | 30 | /** Anyone may publish */ 31 | open; 32 | } 33 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/RetractItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | import org.jivesoftware.smack.packet.PacketExtension; 17 | import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace; 18 | 19 | /** 20 | * Represents and item that has been deleted from a node. 21 | * 22 | * @author Robin Collier 23 | */ 24 | public class RetractItem implements PacketExtension 25 | { 26 | private String id; 27 | 28 | /** 29 | * Construct a RetractItem with the specified id. 30 | * 31 | * @param itemId The id if the item deleted 32 | */ 33 | public RetractItem(String itemId) 34 | { 35 | if (itemId == null) 36 | throw new IllegalArgumentException("itemId must not be 'null'"); 37 | id = itemId; 38 | } 39 | 40 | public String getId() 41 | { 42 | return id; 43 | } 44 | 45 | public String getElementName() 46 | { 47 | return "retract"; 48 | } 49 | 50 | public String getNamespace() 51 | { 52 | return PubSubNamespace.EVENT.getXmlns(); 53 | } 54 | 55 | public String toXML() 56 | { 57 | return ""; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/SubscribeExtension.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub; 15 | 16 | /** 17 | * Represents a request to subscribe to a node. 18 | * 19 | * @author Robin Collier 20 | */ 21 | public class SubscribeExtension extends NodeExtension 22 | { 23 | protected String jid; 24 | 25 | public SubscribeExtension(String subscribeJid) 26 | { 27 | super(PubSubElementType.SUBSCRIBE); 28 | jid = subscribeJid; 29 | } 30 | 31 | public SubscribeExtension(String subscribeJid, String nodeId) 32 | { 33 | super(PubSubElementType.SUBSCRIBE, nodeId); 34 | jid = subscribeJid; 35 | } 36 | 37 | public String getJid() 38 | { 39 | return jid; 40 | } 41 | 42 | @Override 43 | public String toXML() 44 | { 45 | StringBuilder builder = new StringBuilder("<"); 46 | builder.append(getElementName()); 47 | 48 | if (getNode() != null) 49 | { 50 | builder.append(" node='"); 51 | builder.append(getNode()); 52 | builder.append("'"); 53 | } 54 | builder.append(" jid='"); 55 | builder.append(getJid()); 56 | builder.append("'/>"); 57 | 58 | return builder.toString(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/listener/ItemDeleteListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.listener; 15 | 16 | import org.jivesoftware.smackx.pubsub.ItemDeleteEvent; 17 | import org.jivesoftware.smackx.pubsub.LeafNode; 18 | 19 | /** 20 | * Defines the listener for item deletion events from a node. 21 | * 22 | * @see LeafNode#addItemDeleteListener(ItemDeleteListener) 23 | * 24 | * @author Robin Collier 25 | */ 26 | public interface ItemDeleteListener 27 | { 28 | /** 29 | * Called when items are deleted from a node the listener is 30 | * registered with. 31 | * 32 | * @param items The event with item deletion details 33 | */ 34 | void handleDeletedItems(ItemDeleteEvent items); 35 | 36 | /** 37 | * Called when all items are deleted from a node the listener is 38 | * registered with. 39 | */ 40 | void handlePurge(); 41 | } 42 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/listener/ItemEventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.listener; 15 | 16 | import org.jivesoftware.smackx.pubsub.Item; 17 | import org.jivesoftware.smackx.pubsub.ItemPublishEvent; 18 | import org.jivesoftware.smackx.pubsub.LeafNode; 19 | 20 | /** 21 | * Defines the listener for items being published to a node. 22 | * 23 | * @see LeafNode#addItemEventListener(ItemEventListener) 24 | * 25 | * @author Robin Collier 26 | */ 27 | public interface ItemEventListener 28 | { 29 | /** 30 | * Called whenever an item is published to the node the listener 31 | * is registered with. 32 | * 33 | * @param items The publishing details. 34 | */ 35 | void handlePublishedItems(ItemPublishEvent items); 36 | } 37 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/listener/NodeConfigListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.listener; 15 | 16 | import org.jivesoftware.smackx.pubsub.ConfigurationEvent; 17 | import org.jivesoftware.smackx.pubsub.LeafNode; 18 | 19 | /** 20 | * Defines the listener for a node being configured. 21 | * 22 | * @see LeafNode#addConfigurationListener(NodeConfigListener) 23 | * 24 | * @author Robin Collier 25 | */ 26 | public interface NodeConfigListener 27 | { 28 | /** 29 | * Called whenever the node the listener 30 | * is registered with is configured. 31 | * 32 | * @param config The configuration details. 33 | */ 34 | void handleNodeConfiguration(ConfigurationEvent config); 35 | } 36 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/packet/PubSubNamespace.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.packet; 15 | 16 | /** 17 | * Defines all the valid namespaces that are used with the {@link PubSub} packet 18 | * as defined by the specification. 19 | * 20 | * @author Robin Collier 21 | */ 22 | public enum PubSubNamespace 23 | { 24 | BASIC(null), 25 | ERROR("errors"), 26 | EVENT("event"), 27 | OWNER("owner"); 28 | 29 | private String fragment; 30 | 31 | private PubSubNamespace(String fragment) 32 | { 33 | this.fragment = fragment; 34 | } 35 | 36 | public String getXmlns() 37 | { 38 | String ns = "http://jabber.org/protocol/pubsub"; 39 | 40 | if (fragment != null) 41 | ns += '#' + fragment; 42 | 43 | return ns; 44 | } 45 | 46 | public String getFragment() 47 | { 48 | return fragment; 49 | } 50 | 51 | public static PubSubNamespace valueOfFromXmlns(String ns) 52 | { 53 | int index = ns.lastIndexOf('#'); 54 | 55 | if (index != -1) 56 | { 57 | String suffix = ns.substring(ns.lastIndexOf('#')+1); 58 | return valueOf(suffix.toUpperCase()); 59 | } 60 | else 61 | return BASIC; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/AffiliationProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.Affiliation; 22 | 23 | /** 24 | * Parses the affiliation element out of the reply stanza from the server 25 | * as specified in the affiliation schema. 26 | * 27 | * @author Robin Collier 28 | */ 29 | public class AffiliationProvider extends EmbeddedExtensionProvider 30 | { 31 | @Override 32 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 33 | { 34 | return new Affiliation(attributeMap.get("node"), Affiliation.Type.valueOf(attributeMap.get("affiliation"))); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/AffiliationsProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package org.jivesoftware.smackx.pubsub.provider; 16 | 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | import org.jivesoftware.smack.packet.PacketExtension; 21 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 22 | import org.jivesoftware.smackx.pubsub.Affiliation; 23 | import org.jivesoftware.smackx.pubsub.AffiliationsExtension; 24 | 25 | /** 26 | * Parses the affiliations element out of the reply stanza from the server 27 | * as specified in the affiliation schema. 28 | * 29 | * @author Robin Collier 30 | */public class AffiliationsProvider extends EmbeddedExtensionProvider 31 | { 32 | @Override 33 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 34 | { 35 | return new AffiliationsExtension((List)content); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/ConfigEventProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package org.jivesoftware.smackx.pubsub.provider; 16 | 17 | import java.util.List; 18 | import java.util.Map; 19 | 20 | import org.jivesoftware.smack.packet.PacketExtension; 21 | import org.jivesoftware.smackx.packet.DataForm; 22 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 23 | import org.jivesoftware.smackx.pubsub.ConfigurationEvent; 24 | import org.jivesoftware.smackx.pubsub.ConfigureForm; 25 | 26 | /** 27 | * Parses the node configuration element out of the message event stanza from 28 | * the server as specified in the configuration schema. 29 | * 30 | * @author Robin Collier 31 | */ 32 | public class ConfigEventProvider extends EmbeddedExtensionProvider 33 | { 34 | @Override 35 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attMap, List content) 36 | { 37 | if (content.size() == 0) 38 | return new ConfigurationEvent(attMap.get("node")); 39 | else 40 | return new ConfigurationEvent(attMap.get("node"), new ConfigureForm((DataForm)content.iterator().next())); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/EventProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.EventElement; 22 | import org.jivesoftware.smackx.pubsub.EventElementType; 23 | import org.jivesoftware.smackx.pubsub.NodeExtension; 24 | 25 | /** 26 | * Parses the event element out of the message stanza from 27 | * the server as specified in the event schema. 28 | * 29 | * @author Robin Collier 30 | */ 31 | public class EventProvider extends EmbeddedExtensionProvider 32 | { 33 | @Override 34 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attMap, List content) 35 | { 36 | return new EventElement(EventElementType.valueOf(content.get(0).getElementName()), (NodeExtension)content.get(0)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/FormNodeProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.Form; 21 | import org.jivesoftware.smackx.packet.DataForm; 22 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 23 | import org.jivesoftware.smackx.pubsub.FormNode; 24 | import org.jivesoftware.smackx.pubsub.FormNodeType; 25 | 26 | /** 27 | * Parses one of several elements used in pubsub that contain a form of some kind as a child element. The 28 | * elements and namespaces supported is defined in {@link FormNodeType}. 29 | * 30 | * @author Robin Collier 31 | */ 32 | public class FormNodeProvider extends EmbeddedExtensionProvider 33 | { 34 | @Override 35 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 36 | { 37 | return new FormNode(FormNodeType.valueOfFromElementName(currentElement, currentNamespace), attributeMap.get("node"), new Form((DataForm)content.iterator().next())); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/ItemsProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.ItemsExtension; 22 | 23 | /** 24 | * Parses the items element out of the message event stanza from 25 | * the server as specified in the items schema. 26 | * 27 | * @author Robin Collier 28 | */ 29 | public class ItemsProvider extends EmbeddedExtensionProvider 30 | { 31 | 32 | @Override 33 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 34 | { 35 | return new ItemsExtension(ItemsExtension.ItemsElementType.items, attributeMap.get("node"), content); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/RetractEventProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.RetractItem; 22 | 23 | /** 24 | * Parses the retract element out of the message event stanza from 25 | * the server as specified in the retract schema. 26 | * This element is a child of the items element. 27 | * 28 | * @author Robin Collier 29 | */ 30 | public class RetractEventProvider extends EmbeddedExtensionProvider 31 | { 32 | @Override 33 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 34 | { 35 | return new RetractItem(attributeMap.get("id")); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/SimpleNodeProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.NodeExtension; 22 | import org.jivesoftware.smackx.pubsub.PubSubElementType; 23 | 24 | /** 25 | * Parses simple elements that only contain a node attribute. This is common amongst many of the 26 | * elements defined in the pubsub specification. For this common case a {@link NodeExtension} is returned. 27 | * 28 | * @author Robin Collier 29 | */ 30 | public class SimpleNodeProvider extends EmbeddedExtensionProvider 31 | { 32 | @Override 33 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 34 | { 35 | return new NodeExtension(PubSubElementType.valueOfFromElemName(currentElement, currentNamespace), attributeMap.get("node")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/provider/SubscriptionsProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.provider; 15 | 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import org.jivesoftware.smack.packet.PacketExtension; 20 | import org.jivesoftware.smackx.provider.EmbeddedExtensionProvider; 21 | import org.jivesoftware.smackx.pubsub.Subscription; 22 | import org.jivesoftware.smackx.pubsub.SubscriptionsExtension; 23 | 24 | /** 25 | * Parses the subscriptions element out of the pubsub IQ message from 26 | * the server as specified in the subscriptions schema. 27 | * 28 | * @author Robin Collier 29 | */ 30 | public class SubscriptionsProvider extends EmbeddedExtensionProvider 31 | { 32 | @Override 33 | protected PacketExtension createReturnExtension(String currentElement, String currentNamespace, Map attributeMap, List content) 34 | { 35 | return new SubscriptionsExtension(attributeMap.get("node"), (List)content); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/pubsub/util/NodeUtils.java: -------------------------------------------------------------------------------- 1 | /** 2 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | package org.jivesoftware.smackx.pubsub.util; 15 | 16 | import org.jivesoftware.smack.packet.Packet; 17 | import org.jivesoftware.smackx.Form; 18 | import org.jivesoftware.smackx.pubsub.ConfigureForm; 19 | import org.jivesoftware.smackx.pubsub.FormNode; 20 | import org.jivesoftware.smackx.pubsub.PubSubElementType; 21 | 22 | /** 23 | * Utility for extracting information from packets. 24 | * 25 | * @author Robin Collier 26 | */ 27 | public class NodeUtils 28 | { 29 | /** 30 | * Get a {@link ConfigureForm} from a packet. 31 | * 32 | * @param packet 33 | * @param elem 34 | * @return The configuration form 35 | */ 36 | public static ConfigureForm getFormFromPacket(Packet packet, PubSubElementType elem) 37 | { 38 | FormNode config = (FormNode)packet.getExtension(elem.getElementName(), elem.getNamespace().getXmlns()); 39 | Form formReply = config.getForm(); 40 | return new ConfigureForm(formReply); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/WorkgroupInvitationListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup; 21 | 22 | /** 23 | * An interface which all classes interested in hearing about group chat invitations should 24 | * implement. 25 | * 26 | * @author loki der quaeler 27 | */ 28 | public interface WorkgroupInvitationListener { 29 | 30 | /** 31 | * The implementing class instance will be notified via this method when an invitation 32 | * to join a group chat has been received from the server. 33 | * 34 | * @param invitation an Invitation instance embodying the information pertaining to the 35 | * invitation 36 | */ 37 | public void invitationReceived(WorkgroupInvitation invitation); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/AgentRosterListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.agent; 21 | 22 | import org.jivesoftware.smack.packet.Presence; 23 | 24 | /** 25 | * 26 | * @author Matt Tucker 27 | */ 28 | public interface AgentRosterListener { 29 | 30 | public void agentAdded(String jid); 31 | 32 | public void agentRemoved(String jid); 33 | 34 | public void presenceChanged(Presence presence); 35 | } 36 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/InvitationRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.agent; 21 | 22 | /** 23 | * Request sent by an agent to invite another agent or user. 24 | * 25 | * @author Gaston Dombiak 26 | */ 27 | public class InvitationRequest extends OfferContent { 28 | 29 | private String inviter; 30 | private String room; 31 | private String reason; 32 | 33 | public InvitationRequest(String inviter, String room, String reason) { 34 | this.inviter = inviter; 35 | this.room = room; 36 | this.reason = reason; 37 | } 38 | 39 | public String getInviter() { 40 | return inviter; 41 | } 42 | 43 | public String getRoom() { 44 | return room; 45 | } 46 | 47 | public String getReason() { 48 | return reason; 49 | } 50 | 51 | boolean isUserRequest() { 52 | return false; 53 | } 54 | 55 | boolean isInvitation() { 56 | return true; 57 | } 58 | 59 | boolean isTransfer() { 60 | return false; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/OfferConfirmationListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | package org.jivesoftware.smackx.workgroup.agent; 20 | 21 | public interface OfferConfirmationListener { 22 | 23 | 24 | /** 25 | * The implementing class instance will be notified via this when the AgentSession has confirmed 26 | * the acceptance of the Offer. The instance will then have the ability to create the room and 27 | * send the service the room name created for tracking. 28 | * 29 | * @param confirmedOffer the ConfirmedOffer 30 | */ 31 | void offerConfirmed(OfferConfirmation confirmedOffer); 32 | } 33 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/OfferListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.agent; 21 | 22 | /** 23 | * An interface which all classes interested in hearing about chat offers associated to a particular 24 | * AgentSession instance should implement.
25 | * 26 | * @author Matt Tucker 27 | * @author loki der quaeler 28 | * @see org.jivesoftware.smackx.workgroup.agent.AgentSession 29 | */ 30 | public interface OfferListener { 31 | 32 | /** 33 | * The implementing class instance will be notified via this when the AgentSession has received 34 | * an offer for a chat. The instance will then have the ability to accept, reject, or ignore 35 | * the request (resulting in a revocation-by-timeout). 36 | * 37 | * @param request the Offer instance embodying the details of the offer 38 | */ 39 | public void offerReceived (Offer request); 40 | 41 | /** 42 | * The implementing class instance will be notified via this when the AgentSessino has received 43 | * a revocation of a previously extended offer. 44 | * 45 | * @param revokedOffer the RevokedOffer instance embodying the details of the revoked offer 46 | */ 47 | public void offerRevoked (RevokedOffer revokedOffer); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/TransferRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.agent; 21 | 22 | /** 23 | * Request sent by an agent to transfer a support session to another agent or user. 24 | * 25 | * @author Gaston Dombiak 26 | */ 27 | public class TransferRequest extends OfferContent { 28 | 29 | private String inviter; 30 | private String room; 31 | private String reason; 32 | 33 | public TransferRequest(String inviter, String room, String reason) { 34 | this.inviter = inviter; 35 | this.room = room; 36 | this.reason = reason; 37 | } 38 | 39 | public String getInviter() { 40 | return inviter; 41 | } 42 | 43 | public String getRoom() { 44 | return room; 45 | } 46 | 47 | public String getReason() { 48 | return reason; 49 | } 50 | 51 | boolean isUserRequest() { 52 | return false; 53 | } 54 | 55 | boolean isInvitation() { 56 | return false; 57 | } 58 | 59 | boolean isTransfer() { 60 | return true; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/agent/UserRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.agent; 21 | 22 | /** 23 | * Requests made by users to get support by some agent. 24 | * 25 | * @author Gaston Dombiak 26 | */ 27 | public class UserRequest extends OfferContent { 28 | // TODO Do we want to use a singleton? Should we store the userID here? 29 | private static UserRequest instance = new UserRequest(); 30 | 31 | public static OfferContent getInstance() { 32 | return instance; 33 | } 34 | 35 | boolean isUserRequest() { 36 | return true; 37 | } 38 | 39 | boolean isInvitation() { 40 | return false; 41 | } 42 | 43 | boolean isTransfer() { 44 | return false; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/ext/macros/Macro.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.ext.macros; 21 | 22 | /** 23 | * Macro datamodel. 24 | */ 25 | public class Macro { 26 | public static final int TEXT = 0; 27 | public static final int URL = 1; 28 | public static final int IMAGE = 2; 29 | 30 | 31 | private String title; 32 | private String description; 33 | private String response; 34 | private int type; 35 | 36 | public String getTitle() { 37 | return title; 38 | } 39 | 40 | public void setTitle(String title) { 41 | this.title = title; 42 | } 43 | 44 | public String getDescription() { 45 | return description; 46 | } 47 | 48 | public void setDescription(String description) { 49 | this.description = description; 50 | } 51 | 52 | public String getResponse() { 53 | return response; 54 | } 55 | 56 | public void setResponse(String response) { 57 | this.response = response; 58 | } 59 | 60 | public int getType() { 61 | return type; 62 | } 63 | 64 | public void setType(int type) { 65 | this.type = type; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/packet/MetaDataProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.packet; 21 | 22 | import java.util.Map; 23 | 24 | import org.jivesoftware.smackx.workgroup.MetaData; 25 | import org.jivesoftware.smackx.workgroup.util.MetaDataUtils; 26 | 27 | import org.jivesoftware.smack.packet.PacketExtension; 28 | import org.jivesoftware.smack.provider.PacketExtensionProvider; 29 | 30 | import org.xmlpull.v1.XmlPullParser; 31 | 32 | /** 33 | * This provider parses meta data if it's not contained already in a larger extension provider. 34 | * 35 | * @author loki der quaeler 36 | */ 37 | public class MetaDataProvider implements PacketExtensionProvider { 38 | 39 | /** 40 | * PacketExtensionProvider implementation 41 | */ 42 | public PacketExtension parseExtension (XmlPullParser parser) 43 | throws Exception { 44 | Map metaData = MetaDataUtils.parseMetaData(parser); 45 | 46 | return new MetaData(metaData); 47 | } 48 | } -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/settings/ChatSetting.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.settings; 21 | 22 | public class ChatSetting { 23 | private String key; 24 | private String value; 25 | private int type; 26 | 27 | public ChatSetting(String key, String value, int type){ 28 | setKey(key); 29 | setValue(value); 30 | setType(type); 31 | } 32 | 33 | public String getKey() { 34 | return key; 35 | } 36 | 37 | public void setKey(String key) { 38 | this.key = key; 39 | } 40 | 41 | public String getValue() { 42 | return value; 43 | } 44 | 45 | public void setValue(String value) { 46 | this.value = value; 47 | } 48 | 49 | public int getType() { 50 | return type; 51 | } 52 | 53 | public void setType(int type) { 54 | this.type = type; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /source/org/jivesoftware/smackx/workgroup/user/QueueListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Revision$ 3 | * $Date$ 4 | * 5 | * Copyright 2003-2007 Jive Software. 6 | * 7 | * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | */ 19 | 20 | package org.jivesoftware.smackx.workgroup.user; 21 | 22 | /** 23 | * Listener interface for those that wish to be notified of workgroup queue events. 24 | * 25 | * @see Workgroup#addQueueListener(QueueListener) 26 | * @author loki der quaeler 27 | */ 28 | public interface QueueListener { 29 | 30 | /** 31 | * The user joined the workgroup queue. 32 | */ 33 | public void joinedQueue(); 34 | 35 | /** 36 | * The user departed the workgroup queue. 37 | */ 38 | public void departedQueue(); 39 | 40 | /** 41 | * The user's queue position has been updated to a new value. 42 | * 43 | * @param currentPosition the user's current position in the queue. 44 | */ 45 | public void queuePositionUpdated(int currentPosition); 46 | 47 | /** 48 | * The user's estimated remaining wait time in the queue has been updated. 49 | * 50 | * @param secondsRemaining the estimated number of seconds remaining until the 51 | * the user is routed to the agent. 52 | */ 53 | public void queueWaitTimeUpdated(int secondsRemaining); 54 | 55 | } 56 | -------------------------------------------------------------------------------- /source/overview.html: -------------------------------------------------------------------------------- 1 | API specification for Smack, an Open Source XMPP client library. 2 |

3 | The {@link org.jivesoftware.smack.Connection} class is the main entry point for the API. 4 | 5 | -------------------------------------------------------------------------------- /test-unit/org/jivesoftware/smackx/bytestreams/ibb/IBBPacketUtils.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.bytestreams.ibb; 2 | 3 | import org.jivesoftware.smack.packet.IQ; 4 | import org.jivesoftware.smack.packet.XMPPError; 5 | 6 | /** 7 | * Utility methods to create packets. 8 | * 9 | * @author Henning Staib 10 | */ 11 | public class IBBPacketUtils { 12 | 13 | /** 14 | * Returns an error IQ. 15 | * 16 | * @param from the senders JID 17 | * @param to the recipients JID 18 | * @param xmppError the XMPP error 19 | * @return an error IQ 20 | */ 21 | public static IQ createErrorIQ(String from, String to, XMPPError xmppError) { 22 | IQ errorIQ = new IQ() { 23 | 24 | public String getChildElementXML() { 25 | return null; 26 | } 27 | 28 | }; 29 | errorIQ.setType(IQ.Type.ERROR); 30 | errorIQ.setFrom(from); 31 | errorIQ.setTo(to); 32 | errorIQ.setError(xmppError); 33 | return errorIQ; 34 | } 35 | 36 | /** 37 | * Returns a result IQ. 38 | * 39 | * @param from the senders JID 40 | * @param to the recipients JID 41 | * @return a result IQ 42 | */ 43 | public static IQ createResultIQ(String from, String to) { 44 | IQ result = new IQ() { 45 | 46 | public String getChildElementXML() { 47 | return null; 48 | } 49 | 50 | }; 51 | result.setType(IQ.Type.RESULT); 52 | result.setFrom(from); 53 | result.setTo(to); 54 | return result; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /test-unit/org/jivesoftware/smackx/bytestreams/ibb/IBBTestsSuite.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.bytestreams.ibb; 2 | 3 | import org.jivesoftware.smackx.bytestreams.ibb.packet.CloseTest; 4 | import org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtensionTest; 5 | import org.jivesoftware.smackx.bytestreams.ibb.packet.DataTest; 6 | import org.jivesoftware.smackx.bytestreams.ibb.packet.OpenTest; 7 | import org.jivesoftware.smackx.bytestreams.ibb.provider.OpenIQProviderTest; 8 | import org.junit.runner.RunWith; 9 | import org.junit.runners.Suite; 10 | 11 | @RunWith(Suite.class) 12 | @Suite.SuiteClasses( { CloseTest.class, DataPacketExtensionTest.class, DataTest.class, 13 | OpenTest.class, OpenIQProviderTest.class, CloseListenerTest.class, 14 | DataListenerTest.class, InBandBytestreamManagerTest.class, 15 | InBandBytestreamRequestTest.class, 16 | InBandBytestreamSessionMessageTest.class, 17 | InBandBytestreamSessionTest.class, InitiationListenerTest.class }) 18 | public class IBBTestsSuite { 19 | // the class remains completely empty, 20 | // being used only as a holder for the above annotations 21 | } 22 | -------------------------------------------------------------------------------- /test/config/test-case.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | localhost 7 | 5222 8 | 9 | 10 | user 11 | 12 | 13 | chat 14 | conference 15 | 16 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smack/PrivacyClient.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack; 2 | 3 | import java.util.List; 4 | 5 | import org.jivesoftware.smack.packet.Privacy; 6 | 7 | /** 8 | * This class supports automated tests about privacy communication from the 9 | * server to the client. 10 | * 11 | * @author Francisco Vives 12 | */ 13 | 14 | public class PrivacyClient implements PrivacyListListener { 15 | /** 16 | * holds if the receiver list was modified 17 | */ 18 | private boolean wasModified = false; 19 | 20 | /** 21 | * holds a privacy to hold server requests Clients should not use Privacy 22 | * class since it is private for the smack framework. 23 | */ 24 | private Privacy privacy = new Privacy(); 25 | 26 | public PrivacyClient(PrivacyListManager manager) { 27 | super(); 28 | } 29 | 30 | public void setPrivacyList(String listName, List listItem) { 31 | privacy.setPrivacyList(listName, listItem); 32 | } 33 | 34 | public void updatedPrivacyList(String listName) { 35 | this.wasModified = true; 36 | } 37 | 38 | public boolean wasModified() { 39 | return this.wasModified; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smack/RosterInitializedBeforeConnectTest.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smack; 2 | 3 | /** 4 | * Run all tests defined in RosterTest but initialize the roster before connection is logged in and 5 | * authenticated. 6 | * 7 | * @author Henning Staib 8 | */ 9 | public class RosterInitializedBeforeConnectTest extends RosterSmackTest { 10 | 11 | public RosterInitializedBeforeConnectTest(String name) { 12 | super(name); 13 | } 14 | 15 | protected boolean createOfflineConnections() { 16 | return true; 17 | } 18 | 19 | protected void setUp() throws Exception { 20 | super.setUp(); 21 | 22 | // initialize all rosters before login 23 | for (int i = 0; i < getMaxConnections(); i++) { 24 | XMPPConnection connection = getConnection(i); 25 | assertFalse(connection.isConnected()); 26 | 27 | Roster roster = connection.getRoster(); 28 | assertNotNull(roster); 29 | 30 | connectAndLogin(i); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/SharedGroupsTest.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx; 2 | 3 | import org.jivesoftware.smack.test.SmackTestCase; 4 | import org.jivesoftware.smack.XMPPException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Test cases for getting the shared groups of a user.

10 | * 11 | * Important note: This functionality is not part of the XMPP spec and it will only work 12 | * with Wildfire. 13 | * 14 | * @author Gaston Dombiak 15 | */ 16 | public class SharedGroupsTest extends SmackTestCase { 17 | 18 | public SharedGroupsTest(String arg0) { 19 | super(arg0); 20 | } 21 | 22 | public void testGetUserSharedGroups() throws XMPPException { 23 | List groups = SharedGroupManager.getSharedGroups(getConnection(0)); 24 | 25 | assertNotNull("User groups was null", groups); 26 | } 27 | 28 | protected int getMaxConnections() { 29 | return 1; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/packet/XHTMLExtensionTest.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rtreffer/smack/bf8516ae76464b9615332f34989e706b7660b83d/test/org/jivesoftware/smackx/packet/XHTMLExtensionTest.java -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/pubsub/CarExtension.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-05-05 3 | */ 4 | package org.jivesoftware.smackx.pubsub; 5 | 6 | import org.jivesoftware.smack.packet.PacketExtension; 7 | 8 | class CarExtension implements PacketExtension 9 | { 10 | private String color; 11 | private int numTires; 12 | 13 | public CarExtension(String col, int num) 14 | { 15 | color = col; 16 | numTires = num; 17 | } 18 | 19 | public String getColor() 20 | { 21 | return color; 22 | } 23 | 24 | public int getNumTires() 25 | { 26 | return numTires; 27 | } 28 | 29 | public String getElementName() 30 | { 31 | return "car"; 32 | } 33 | 34 | public String getNamespace() 35 | { 36 | return "pubsub:test:vehicle"; 37 | } 38 | 39 | public String toXML() 40 | { 41 | return "<" + getElementName() + " xmlns='" + getNamespace() + "'>"; 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/pubsub/CarExtensionProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-05-05 3 | */ 4 | package org.jivesoftware.smackx.pubsub; 5 | 6 | import org.jivesoftware.smack.packet.PacketExtension; 7 | import org.jivesoftware.smack.provider.PacketExtensionProvider; 8 | import org.xmlpull.v1.XmlPullParser; 9 | 10 | public class CarExtensionProvider implements PacketExtensionProvider 11 | { 12 | 13 | public PacketExtension parseExtension(XmlPullParser parser) throws Exception 14 | { 15 | String color = null; 16 | int numTires = 0; 17 | 18 | for (int i=0; i<2; i++) 19 | { 20 | while (parser.next() != XmlPullParser.START_TAG); 21 | 22 | if (parser.getName().equals("paint")) 23 | { 24 | color = parser.getAttributeValue(0); 25 | } 26 | else 27 | { 28 | numTires = Integer.parseInt(parser.getAttributeValue(0)); 29 | } 30 | } 31 | while (parser.next() != XmlPullParser.END_TAG); 32 | return new CarExtension(color, numTires); 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/pubsub/MultiUserSubscriptionUseCases.java: -------------------------------------------------------------------------------- 1 | package org.jivesoftware.smackx.pubsub; 2 | 3 | import java.util.Collection; 4 | import java.util.List; 5 | 6 | import org.jivesoftware.smack.XMPPException; 7 | import org.jivesoftware.smack.packet.XMPPError; 8 | import org.jivesoftware.smackx.pubsub.test.PubSubTestCase; 9 | 10 | public class MultiUserSubscriptionUseCases extends PubSubTestCase 11 | { 12 | 13 | @Override 14 | protected int getMaxConnections() 15 | { 16 | return 2; 17 | } 18 | 19 | public void testGetItemsWithSingleSubscription() throws XMPPException 20 | { 21 | LeafNode node = getRandomPubnode(getManager(0), true, false); 22 | node.send((Item)null); 23 | node.send((Item)null); 24 | node.send((Item)null); 25 | node.send((Item)null); 26 | node.send((Item)null); 27 | 28 | LeafNode user2Node = (LeafNode) getManager(1).getNode(node.getId()); 29 | user2Node.subscribe(getBareJID(1)); 30 | 31 | Collection items = user2Node.getItems(); 32 | assertTrue(items.size() == 5); 33 | } 34 | 35 | public void testGetItemsWithMultiSubscription() throws XMPPException 36 | { 37 | LeafNode node = getRandomPubnode(getManager(0), true, false); 38 | node.send((Item)null); 39 | node.send((Item)null); 40 | node.send((Item)null); 41 | node.send((Item)null); 42 | node.send((Item)null); 43 | 44 | LeafNode user2Node = (LeafNode) getManager(1).getNode(node.getId()); 45 | Subscription sub1 = user2Node.subscribe(getBareJID(1)); 46 | 47 | Subscription sub2 = user2Node.subscribe(getBareJID(1)); 48 | 49 | try 50 | { 51 | user2Node.getItems(); 52 | } 53 | catch (XMPPException exc) 54 | { 55 | assertEquals("bad-request", exc.getXMPPError().getCondition()); 56 | assertEquals(XMPPError.Type.MODIFY, exc.getXMPPError().getType()); 57 | } 58 | List items = user2Node.getItems(sub1.getId()); 59 | assertTrue(items.size() == 5); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/pubsub/TestAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-04-09 3 | */ 4 | package org.jivesoftware.smackx.pubsub; 5 | 6 | import org.jivesoftware.smack.XMPPException; 7 | import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase; 8 | 9 | public class TestAPI extends SingleUserTestCase 10 | { 11 | public void testGetNonexistentNode() 12 | { 13 | try 14 | { 15 | getManager().getNode("" + System.currentTimeMillis()); 16 | assertTrue(false); 17 | } 18 | catch (XMPPException e) 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/org/jivesoftware/smackx/pubsub/test/SingleUserTestCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Created on 2009-05-05 3 | */ 4 | package org.jivesoftware.smackx.pubsub.test; 5 | 6 | import org.jivesoftware.smack.XMPPException; 7 | import org.jivesoftware.smackx.pubsub.LeafNode; 8 | import org.jivesoftware.smackx.pubsub.PubSubManager; 9 | 10 | public class SingleUserTestCase extends PubSubTestCase 11 | { 12 | protected PubSubManager getManager() 13 | { 14 | return getManager(0); 15 | } 16 | 17 | protected LeafNode getPubnode(boolean persistItems, boolean deliverPayload) throws XMPPException 18 | { 19 | return getRandomPubnode(getManager(), persistItems, deliverPayload); 20 | } 21 | 22 | @Override 23 | protected int getMaxConnections() 24 | { 25 | return 1; 26 | } 27 | 28 | } 29 | --------------------------------------------------------------------------------