Package tigase.vhosts

# Interface VHostItemExtensionIfc<T extends VHostItemExtensionIfc<T>>

Type Parameters:
  `T` - - should be provided the same class as we are defining!

All Known Subinterfaces:
  `VHostItemExtensionBackwardCompatible<T>`

All Known Implementing Classes:
  `AbstractVHostItemExtension`, `BasicComponent.ServerInfoVHostItemExtension`, `BruteForceLockerBean.BruteForceLockerVHostExtension`, `ClientTrustManagerFactory.ClientTrustVHostItemExtension`, `PresenceSubscription.PresenceSubscriptionVHostItemExtension`, `SeeOtherHost.SeeOtherHostVHostItemExtension`, `SSLContextContainer.HardenedModeVHostItemExtension`, `VHostItemExtension`

public interface VHostItemExtensionIfc<T extends VHostItemExtensionIfc<T>>
Interface required to be implemented by all extensions adding additional configuration options for the virtual host configuration items. WARNING: This is just an interface and you have to use `VHostItemExtension` class as a base class for your extension.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addCommandFields(String prefix, Packet packet, boolean forDefault)`
  Method adds custom extension fields to the ad-hoc form which will be sent to the user for filling with data required to create or update the VHost details.
  `String`
  `getId()`
  Unique identifier of the extension.
  `void`
  `initFromCommand(String prefix, Packet packet)`
  Method initializes instance of a class with values provided by the user using ad-hoc command.
  `void`
  `initFromElement(Element item)`
  Method initializes instances of a class with values from the element which contains configuration loaded from the database.
  `String`
  `toDebugString()`
  Returns a string containing all information about the instance of the extension useful for debugging.
  `Element`
  `toElement()`
  Method serializes data stored by this instance to element which will be then stored in the database.

- ## Method Details

  - ### getId

    String getId()
    Unique identifier of the extension. It has to be a valid XML element name!

  - ### initFromElement

    void initFromElement(Element item)
    Method initializes instances of a class with values from the element which contains configuration loaded from the database. see VHostItemExtensionIfc::toElement()
    Parameters:
      `item` - - provided element with data

  - ### initFromCommand

    void initFromCommand(String prefix, Packet packet) throws IllegalArgumentException
    Method initializes instance of a class with values provided by the user using ad-hoc command.
    Parameters:
      `prefix` - - prefix for data for fields added by this extension
      `packet` - - stanza with submitted ad-hoc command form
    Throws:
      `IllegalArgumentException`

  - ### toElement

    Element toElement()
    Method serializes data stored by this instance to element which will be then stored in the database. Element name should be equal to the extension id.

  - ### addCommandFields

    void addCommandFields(String prefix, Packet packet, boolean forDefault)
    Method adds custom extension fields to the ad-hoc form which will be sent to the user for filling with data required to create or update the VHost details.
    Parameters:
      `prefix` - - prefix which should be used by each added field
      `packet` - - packet which will be sent to the user
      `forDefault` - - if true, we are preparing form for "default" configuration used by default by all vhosts.

  - ### toDebugString

    String toDebugString()
    Returns a string containing all information about the instance of the extension useful for debugging.