Пример #1
0
  /**
   * Adds the specified <tt>childExtension</tt> to the list of extensions registered with this
   * packet.
   *
   * <p>Overriding extensions may need to override this method if they would like to have anything
   * more elaborate than just a list of extensions (e.g. casting separate instances to more
   * specific.
   *
   * @param childExtension the extension we'd like to add here.
   */
  @Override
  public void addChildExtension(PacketExtension childExtension) {
    super.addChildExtension(childExtension);

    if (childExtension instanceof CryptoPacketExtension) {
      this.addCrypto(((CryptoPacketExtension) childExtension));
    }
  }
Пример #2
0
 /**
  * Specifies whether encryption is required for this session or not.
  *
  * @param required <tt>true</tt> if encryption is required for this session and <tt>false</tt>
  *     otherwise.
  */
 public void setRequired(boolean required) {
   if (required) super.setAttribute(REQUIRED_ATTR_NAME, required);
   else super.removeAttribute(REQUIRED_ATTR_NAME);
 }