package org.jivesoftware.smack.iqrequest;

import org.jivesoftware.smack.packet.IQ;

public abstract class AbstractIqRequestHandler implements IQRequestHandler {
   private final String element;
   private final String namespace;
   private final IQ.Type type;
   private final IQRequestHandler.Mode mode;

   protected AbstractIqRequestHandler(String element, String namespace, IQ.Type type, IQRequestHandler.Mode mode) {
      switch(type) {
      case set:
      case get:
         this.element = element;
         this.namespace = namespace;
         this.type = type;
         this.mode = mode;
         return;
      default:
         throw new IllegalArgumentException("Only get and set IQ type allowed");
      }
   }

   public abstract IQ handleIQRequest(IQ var1);

   public IQRequestHandler.Mode getMode() {
      return this.mode;
   }

   public IQ.Type getType() {
      return this.type;
   }

   public String getElement() {
      return this.element;
   }

   public String getNamespace() {
      return this.namespace;
   }
}
