Commit Graph

150 Commits

Author SHA1 Message Date
Florian Schmaus 4e90db3191 [gitlab-ci] Also check with Java 15 2021-02-15 13:12:24 +01:00
Florian Schmaus a7b3303f3e Bump ErrorProne to 2.5.1 and refactor Providers a bit
This also resulted in a refactoring of the Providers and parsing
Exceptions. NumberFormatException and ParseException can now be thrown
directly, the wrapping in a SmackParsingException is down at a higher
layer, i.e. in AbstractProvider.
2021-01-29 09:26:15 +01:00
Guus der Kinderen 55d7b9d4eb Fix pubsub options rendering
The exiting code generates an unintentional nested 'options' child element:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options node='sinttest-multisubscribe-nodename-13pnc'>
      <options jid='smack-inttest-two-13pnc@example.org'
               node='sinttest-multisubscribe-nodename-13pnc'/>
    </options>
  </pubsub>
</iq>
```

This commit removes the undesired nesting, resulting in:

```
<iq to='pubsub.example.org' id='FQTHU-126' type='get'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <options jid='smack-inttest-two-13pnc@example.org'
             node='sinttest-multisubscribe-nodename-13pnc'/>
  </pubsub>
</iq>
```
2020-10-27 10:23:17 +01:00
Paul Schaub 99cb60dac7
Add missing rightangle bracket to FormNode addXml() 2020-06-15 16:15:27 +02:00
Florian Schmaus 9d6665735f [pubsub] Rework NodeExtension.toXML() 2020-06-14 16:52:13 +02:00
Florian Schmaus 9fd5bc7873 [pubsub] Make Fillable(Configure|Subscribe)Form constructors package-private
Those are not meant to be used directly.
2020-05-15 11:54:49 +02:00
Florian Schmaus fec928ffe7 [pubsub] Add missing "FillableSubscribeForm SubscribeForm.getFillableForm()" 2020-05-15 11:54:49 +02:00
Florian Schmaus 565397f632 [pubsub] Make FillableSubscribeForm implement SubscribeFormReader 2020-05-15 11:54:49 +02:00
Florian Schmaus c5212c20b6 [xdata] Rename FormReader.read(String) to getField(String)
Now that FormWriter, with its write() method, is gone, there is no
reason the FormReader method should still be named read(). Renaming to
getField() as this is what DataForm also uses.
2020-05-14 17:13:01 +02:00
Florian Schmaus 77e26fc575 Re-work data form API
Apply builder pattern to form fields and replace getVariable() with
getFieldName(). Refer to the field name as "field name" instead of
"variable" everyone, just as XEP-0004 does.

Improve the high-level form API: introduce FilledForm and FillableForm
which perform stronger validation and consistency checks.

Also add FormFieldRegistry to enable processing of 'submit' forms
where the form field types are omitted.

Smack also now does omit the form field type declaration on 'submit'
type forms, as it is allowed by XEP-0004.
2020-05-13 20:14:41 +02:00
Florian Schmaus 2c39dff653 pubsub: remove 'replyto' and 'replyroom' configure settings
Those configurations where removed with version 1.13 (2010-07-12) of
XEP-0060.

This change is part of the effort to upgrade Smack's PubSub
implementation (SMACK-364).
2020-05-04 10:55:36 +02:00
Florian Schmaus 2c6f444bab pubsub: Add EventItemsExtensionFilter 2020-04-13 22:37:54 +02:00
Florian Schmaus 340bcb2d12 pep: improve API, add PepEventListener
The geoloc, mood and usertune PEP users showed a pattern. Instead of
repeating this pattern every time, let PepManager do the hard work
2020-04-13 15:26:46 +02:00
Florian Schmaus 7c2f9e3603 pep: cleanup pep users API
Use EntityBareJid just as its done within PepManager. There is no need
for AsyncButOrdered in the PEP user managers, as PepManager already
takes care of that. Also the message carrying the PEP event should
always be the last parameter of the callbacks, as it is the least
important piece of information.
2020-04-13 12:14:32 +02:00
Florian Schmaus 7a57bb7c09 Rename Stanza.getExtension(String, String) to getExtensionElement() 2020-04-12 12:09:04 +02:00
Florian Schmaus 0479a75d1d Remove unnecessarily suppressed warnings 2020-04-12 12:07:59 +02:00
Florian Schmaus 07da9ffb48 Do not have Stanza.getExtension(String, String) return a generic type
Returning a generic would allow for

List<ExtensionElement> list = stanza.getExtension("foo", "bar");

to compile (Note the we are calling getExtension(), not
getExtension*s*()).

Users are encouraged to use the type safe getExtension(Class<? extends
ExtensionElement) variant instead.

Fixes SMACK-825.
2020-04-05 22:10:05 +02:00
Florian Schmaus e2223254cf Organize imports everywhere 2019-10-29 21:12:22 +01:00
Florian Schmaus 6e32305987 Apply builder pattern to DiscoverInfo
This is the first transformation of an IQ type to the builder type.
2019-10-29 11:14:55 +01:00
Florian Schmaus afd61670a4 pubsub: Add removal comment in ConfigureForm 2019-09-16 22:04:57 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus 4249c1a845 Improve PepManager.publish()
by using PubSubManager.tryToPublishAndPossibleAutoCreate().

This also swaps the parameters of the method.

Thanks to Guus der Kinderen for suggesting this.
2019-08-28 22:59:30 +02:00
Florian Schmaus 4ca2c7cc69 Enable MissingJavadocPackage and UnnecessaryParentheses checkstyle checks 2019-07-24 09:18:39 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Florian Schmaus fda9408cf3 Use XmlStringBuilder in PubSub's SubscribeExtension 2019-07-05 11:31:12 +02:00
Florian Schmaus 9c0da3ed07 Change SubscribeExtension's jid field type from String to Jid
and make it final.
2019-07-05 11:24:02 +02:00
Florian Schmaus a3f6fa65a4 Disallow null or empty string in PubSubManager.getNode(String) 2019-06-12 22:31:55 +02:00
Florian Schmaus 4d36e3b521 Introduce FormFieldChildElement and make FormField immutable 2019-06-11 12:47:39 +02:00
Florian Schmaus 726a2de273 Deprecate ParserUtils.getQName() 2019-06-02 10:44:50 +02:00
Florian Schmaus 4133eb175c Replace XPP3 by XmlPullParser interface wrapping StAX and XPP3
Introducing Smack's own XmlPullParser interface which tries to stay as
compatible as possible to XPP3. The interface is used to either wrap
StAX's XMLStreamReader if Smack is used on Java SE, and XPP3's
XmlPullParser if Smack is used on on Android.

Fixes SMACK-591.

Also introduce JUnit 5 and non-strict javadoc projects.
2019-05-06 22:10:50 +02:00
Florian Schmaus d97fb126a1 Add PubSubManager.getInstanceFor() just like all other Managers
and deprecate PubSubManager.getInstance().
2019-04-16 11:21:22 +02:00
Florian Schmaus 8df69bd3ce Use XmlEnvironment in parsing/provider subsystem 2019-02-15 23:21:30 +01:00
Florian Schmaus 7dee3b88a2 Introduce SmackParsingException 2019-02-10 19:01:47 +01:00
Florian Schmaus 083dac8b83 Rework exceptions in the parsing / provider subsystem 2019-02-05 13:18:03 +01:00
Florian Schmaus fee3ed81ca Introduce XmlEnvironment 2019-02-05 13:18:03 +01:00
Florian Schmaus b7ea226c56 Bump "Error Prone" to 2.3.2
and gradle-errorprone-plugin to 0.6.
2018-10-31 16:06:31 +01:00
Florian Schmaus 0e847f34f3 Remove unused method in pubsub.Subscription 2018-08-21 12:51:52 +02:00
Florian Schmaus 27164f4c06 Do not use a generic return parameter in PubSubManager.getNode() 2018-08-16 17:23:15 +02:00
Florian Schmaus 4b3f757ed9 Add a PEP PubSubManager to PEPManager 2018-08-15 20:13:40 +02:00
Florian Schmaus a1d4a91fa0 Make PubSubManager.deleteNode(String) "node did not exists" aware 2018-08-15 17:48:54 +02:00
Paul Schaub 74bebc13e6
requireNotNullOrEmpty -> requireNotNullNorEmpty 2018-07-17 15:10:39 +02:00
Florian Schmaus 23bb5c5625 Add XMPPErrorException.getStanzaError()
Also deprecate getXMPPError and let StanzaError implement
ExtensionElement.
2018-06-20 22:17:11 +02:00
Florian Schmaus e8923b9d16 Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
2018-05-09 23:26:39 +02:00
Florian Schmaus 5ab2903c32 Change Element.toXml() to toXml(String enclosingNamespace) 2018-04-27 10:05:25 +02:00
Florian Schmaus 6c4a02691e Make PubSub's SimplePayload infer the XML Element name and namespace
Fixes SMACK-816.
2018-04-23 22:00:12 +02:00
Florian Schmaus 31244ae982 Make PubSub elements namespace aware
Also fixes SMACK-814.
2018-04-23 20:36:41 +02:00
Timothy Pitt d5aaf8fdab Notification type for pubsub node config 2018-04-16 16:03:02 +02:00
Timothy Pitt 832c0a92aa Added pubsub Node.modifySubscriptionsAsOwner with test 2018-04-09 18:03:53 +02:00
Florian Schmaus 476fdf99a1 Inroduce AsyncButOrdered 2018-04-08 21:21:50 +02:00
Florian Schmaus 2efec89050 Rename XMPPError to StanzaError
Fixes SMACK-769.
2018-04-07 22:59:25 +02:00