Tigase XMPP Server Board

API and development: RE: supElementNamePaths not working correctly in Postprocessor

Fri, 10/20/2017 - 04:41

Interfaces XMPPPreprocessorIfc and XMPPPostprocessorIfc, do not have methods supNamespaces() and supElementNamePaths() defined and as a result they are not supported. In methods like preProcess() and postProcess() you will receive every packet which is processed without any filters, so you need to filter those packets on your own.

Methods supNamespaces() and supElementNamePaths() are part of XMPPProcessor interface and are used to filter only packets being delivered to process() method.

Categories: Tigase Forums

API and development: RE: supElementNamePaths not working correctly in Postprocessor

Fri, 10/20/2017 - 02:08

Ok, thank you for the clarification

Categories: Tigase Forums

API and development: RE: supElementNamePaths not working correctly in Postprocessor

Fri, 10/20/2017 - 02:04

Yes, in this case, implementation of those methods has no effect.

Categories: Tigase Forums

API and development: RE: supElementNamePaths not working correctly in Postprocessor

Fri, 10/20/2017 - 02:02

Ok. I simply looked at this code as a base to implement my own postProcessor:

https://github.com/kontalk/tigase-extension/blob/master/src/main/java/org/kontalk/xmppserver/KontalkPushNotifications.java

As you can see, they also use supElementNamePaths to filter only message elements. But their postProcessor method also checks to make sure the element is a message. So it means that the supElementNamePaths and supNameSpaces they are using have no effect?

Categories: Tigase Forums

API and development: RE: supElementNamePaths not working correctly in Postprocessor

Fri, 10/20/2017 - 01:41

Interfaces XMPPPreprocessorIfc and XMPPPostprocessorIfc, do not have methods supNamespaces() and supElementNamePaths() defined and as a result they are not supported. In methods like preProcess() and postProcess() you will receive every packet which is processed without any filters, so you need to filter those packets on your own.

Methods supNamespaces() and supElementNamePaths() are part of XMPPProcessor interface and are used to filter only packets being delivered to process() method.

Categories: Tigase Forums

API and development: supElementNamePaths not working correctly in Postprocessor

Thu, 10/19/2017 - 23:58

I have a post processor, and I want to intercept all account registration packets. However, using the Iq.IQ_QUERY_PATH value in supElementNamePaths is not working correctly (it is intercepting all packets). Here is my code:

public class RegistrationInterceptor extends XMPPProcessor implements XMPPPostprocessorIfc { private static Logger log = Logger.getLogger(RegistrationInterceptor.class.getName()); public static final String ID = "myapp:iq:registrationinterceptor"; private static final String[][] ELEMENT_NAME_PATHS = new String[][]{ Iq.IQ_QUERY_PATH }; private static final String[] XMLNSS = new String[]{ "jabber:iq:register" }; @Override public String id() { return ID; } @Override public String[][] supElementNamePaths() { return ELEMENT_NAME_PATHS; } @Override public String[] supNamespaces() { return XMLNSS; } @Override public void postProcess(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) { // every packet (iq, message, presence, etc.) is being logged here if (log.isLoggable(Level.FINEST)) { log.finest("Processing packet: " + packet.toString()); } } }
Categories: Tigase Forums

API and development: supElementNamePaths not working correctly in Postprocessor

Thu, 10/19/2017 - 20:58

I have a post processor, and I want to intercept all account registration packets. However, using the Iq.IQ_QUERY_PATH value in supElementNamePaths is not working correctly (it is intercepting all packets). Here is my code:

public class RegistrationInterceptor extends XMPPProcessor implements XMPPPostprocessorIfc { private static Logger log = Logger.getLogger(RegistrationInterceptor.class.getName()); public static final String ID = "myapp:iq:registrationinterceptor"; private static final String[][] ELEMENT_NAME_PATHS = new String[][]{ Iq.IQ_QUERY_PATH }; private static final String[] XMLNSS = new String[]{ "jabber:iq:register" }; @Override public String id() { return ID; } @Override public String[][] supElementNamePaths() { return ELEMENT_NAME_PATHS; } @Override public String[] supNamespaces() { return XMLNSS; } @Override public void postProcess(Packet packet, XMPPResourceConnection session, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) { // every packet (iq, message, presence, etc.) is being logged here if (log.isLoggable(Level.FINEST)) { log.finest("Processing packet: " + packet.toString()); } } }
Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Thu, 10/19/2017 - 14:44

Matt Q Public wrote:

Just got it working. Thanks. The Developer Guide was written for Eclipse, and I tried to approximate those instructions for IntelliJ. Big fail.

Developer guide was written in an universal way. There is a chapter how to execute and debug project in Eclipse but that's a special case.

I still don't understand where to create my new classes, etc. And when I build the project, can I just build my new component, and add it to an existing install of Tigase Server?

Yes, that's the idea.
In principle how you should go about working with Tigase (creating new component / plugin):
  • create new project in IDEA;
  • add tigase-server as dependency - depending whether you use build tool (for example maven, gradle) or use only IDEA to handle builds this is a bit different; we recommend using Maven and you simply add:
    <dependency> <groupId>tigase</groupId> <artifactId>tigase-server</artifactId> <version>8.0.0-SNAPSHOT</version> </dependency>

And then create your component/plugin following appropriate guide from the Developer documentation.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Thu, 10/19/2017 - 11:44

Matt Q Public wrote:

Just got it working. Thanks. The Developer Guide was written for Eclipse, and I tried to approximate those instructions for IntelliJ. Big fail.

Developer guide was written in an universal way. There is a chapter how to execute and debug project in Eclipse but that's a special case.

I still don't understand where to create my new classes, etc. And when I build the project, can I just build my new component, and add it to an existing install of Tigase Server?

Yes, that's the idea.
In principle how you should go about working with Tigase (creating new component / plugin):
  • create new project in IDEA;
  • add tigase-server as dependency - depending whether you use build tool (for example maven, gradle) or use only IDEA to handle builds this is a bit different; we recommend using Maven and you simply add:
    <dependency> <groupId>tigase</groupId> <artifactId>tigase-server</artifactId> <version>8.0.0-SNAPSHOT</version> </dependency>

And then create your component/plugin following appropriate guide from the Developer documentation.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 22:51

Just got it working. Thanks. The Developer Guide was written for Eclipse, and I tried to approximate those instructions for IntelliJ. Big fail.

I still don't understand where to create my new classes, etc. And when I build the project, can I just build my new component, and add it to an existing install of Tigase Server?

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 21:56

Okay, that's great. I was reading section 2 of the Developer Docs, and it sounded like a much bigger problem than it actually was. I have cloned the tigase-server code into a folder, and opened that as a project. It seems to see everything, and I don't have any errors.

I would like to develop a Component. How do I do that?
Right now if I create a new module, then create a new class, and type something like "import tigase.server.AbstractMessageReceiver;" it doesn't know what that means.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 21:34

Matt Q Public wrote:

Normally I just add the maven repo to my gradle build file and start coding. No problem.

Could you elaborate? You add it as a dependency? What you add exactly?

I have read section 2 of the Development Docs and gotten the server code to load into IntelliJ, but there's always something missing, it throws a ton of errors, and even the documentation doesn't say where to create your classes, etc.

Sharing what errors are thrown would be helpful :-)

Also - what are you trying to achieve? Build the server? Add functionality? Customise it?

Is anyone else developing for Tigase with IntelliJ, and if so, how are you accomplishing this?

It turned out we mostly use Jetbrains IDEA so yeah - it works (there is also highlighter for new configuration file format).

You simply:
  • clone the tigase-server repository
  • open the project in idea - it will add all maven modules.
Categories: Tigase Forums

API and development: Developing with IntelliJ?

Wed, 10/18/2017 - 20:44

I'm new at this. I apologize in advance...

Normally I just add the maven repo to my gradle build file and start coding. No problem.

I have read section 2 of the Development Docs and gotten the server code to load into IntelliJ, but there's always something missing, it throws a ton of errors, and even the documentation doesn't say where to create your classes, etc.

Is anyone else developing for Tigase with IntelliJ, and if so, how are you accomplishing this?

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 19:51

Just got it working. Thanks. The Developer Guide was written for Eclipse, and I tried to approximate those instructions for IntelliJ. Big fail.

I still don't understand where to create my new classes, etc. And when I build the project, can I just build my new component, and add it to an existing install of Tigase Server?

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 18:56

Okay, that's great. I was reading section 2 of the Developer Docs, and it sounded like a much bigger problem than it actually was. I have cloned the tigase-server code into a folder, and opened that as a project. It seems to see everything, and I don't have any errors.

I would like to develop a Component. How do I do that?
Right now if I create a new module, then create a new class, and type something like "import tigase.server.AbstractMessageReceiver;" it doesn't know what that means.

Categories: Tigase Forums

API and development: RE: Developing with IntelliJ?

Wed, 10/18/2017 - 18:34

Matt Q Public wrote:

Normally I just add the maven repo to my gradle build file and start coding. No problem.

Could you elaborate? You add it as a dependency? What you add exactly?

I have read section 2 of the Development Docs and gotten the server code to load into IntelliJ, but there's always something missing, it throws a ton of errors, and even the documentation doesn't say where to create your classes, etc.

Sharing what errors are thrown would be helpful :-)

Also - what are you trying to achieve? Build the server? Add functionality? Customise it?

Is anyone else developing for Tigase with IntelliJ, and if so, how are you accomplishing this?

It turned out we mostly use Jetbrains IDEA so yeah - it works (there is also highlighter for new configuration file format).

You simply:
  • clone the tigase-server repository
  • open the project in idea - it will add all maven modules.
Categories: Tigase Forums

API and development: Developing with IntelliJ?

Wed, 10/18/2017 - 17:44

I'm new at this. I apologize in advance...

Normally I just add the maven repo to my gradle build file and start coding. No problem.

I have read section 2 of the Development Docs and gotten the server code to load into IntelliJ, but there's always something missing, it throws a ton of errors, and even the documentation doesn't say where to create your classes, etc.

Is anyone else developing for Tigase with IntelliJ, and if so, how are you accomplishing this?

Categories: Tigase Forums

API and development: RE: Ater setting up tigase server in eclipse, how do i develop and complie m...

Wed, 10/18/2017 - 15:35

I am a new developer and have the same question as Adetunji. I just cloned from your GIT and the XML says:

<groupId>tigase</groupId>
<artifactId>tigase-server-master</artifactId>
<version>8.0.0-SNAPSHOT</version>

Categories: Tigase Forums

Installation and maintenance: RE: Administration Guide Documentation issue (Install Error)

Fri, 10/13/2017 - 08:54

Now Here is where I am stuck. was I supposed to pre install MySQL? If I wasn't supposed to then I'm very stuck as to why this didn't work.

It's explained in the "Installing Using Console Installer
":http://docs.tigase.org/tigase-server/7.1.0/Administration_Guide/html_chunk/consoleinstall.html

Important notice: Tigase installer doesn’t contain the actual databases, only drivers allowing db access. One exception is Derby database, which is included in JDK. It is automatically configured by installer, in case of other databases you will need to configure them by yourself.

Also saying the install was successful when it wasn't is a bit misleading.

Yes, this is a bug in the installer logic. As explained in #6213 we won't fix this issue as we are switching to and recommending using WebInstaller.

Any pointers on this would be great!

I would recommend our documentation, especially Quick Start Guide section, which covers steps how to quickly get up and running with the Tigase. What's more, currently we are phasing out IzPack installer in favour of WebInstaller described in Installation Using Web Installer chapter.

Categories: Tigase Forums

Pages

Get in touch

We provide software products, consulting and custom development services

Tigase, Inc.
100 Pine Street, Suite 1250
San Francisco, CA 94111, USA
Phone: (415) 315 9771

Follow us on:

Twitter

Back to Top