Implementing the storage configuration class

Feedback


After implementing the extended json storage method, you also need to implement a configuration class for specifying the json storage configuration, including the disk storage location. When you use the extended json storage method in iServer, you can specify this configuration class to make the extension take effect. iServer provides a custom storage extension configuration interface CustomSecurityInfoStorageSetting, which can be used to customize the storage configuration class.

The extended form is such as:

public class JsonStorageSetting extends CustomSecurityInfoStorageSetting{
...
}

To specify the expansion type and json storage location, it needs to achieve two parameters:

  1. Specifies the storage type to a custom storage
    public JsonStorageSetting() {
        super();
        this.type = SecurityInfoStorageType.CUSTOM;
    }
  1. The outputDirectory parameter to specify the json storage position
    public JsonStorageSetting(JsonStorageSetting jsonStorageSetting) {
        super(jsonStorageSetting);
        this.outputDirectory = jsonStorageSetting.outputDirectory;
    }
    @Override
    public SecurityInfoStorageSetting copy() {
        return new JsonStorageSetting(this);
    }

 

The complete extension sample code is as follows:

JsonStorageSetting.java