All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ironcorelabs.sdk.PolicyCachingConfig Maven / Gradle / Ivy

There is a newer version: 0.16.0
Show newest version
// Automatically generated by rust_swig
package com.ironcorelabs.sdk;

/**
 * Policy evaluation caching config
 * 
 * Since policies are evaluated by the webservice, caching the result can greatly speed
 * up encrypting a document with a PolicyGrant.
 */
public final class PolicyCachingConfig {
    /**
     * @param maxEntries  maximum number of policy evaluations that will be cached by the SDK.
     * If the maximum number is exceeded, the cache will be cleared prior to storing the next entry.
     */
    public PolicyCachingConfig(long maxEntries) {
        mNativeObj = init(maxEntries);
    }
    private static native long init(long maxEntries);

    public PolicyCachingConfig() {
        mNativeObj = init();
    }
    private static native long init();

    public final long getMaxEntries() {
        long ret = do_getMaxEntries(mNativeObj);

        return ret;
    }
    private static native long do_getMaxEntries(long self);

    public synchronized void delete() {
        if (mNativeObj != 0) {
            do_delete(mNativeObj);
            mNativeObj = 0;
       }
    }
    @Override
    protected void finalize() throws Throwable {
        try {
            delete();
        }
        finally {
             super.finalize();
        }
    }
    private static native void do_delete(long me);
    /*package*/ PolicyCachingConfig(InternalPointerMarker marker, long ptr) {
        assert marker == InternalPointerMarker.RAW_PTR;
        this.mNativeObj = ptr;
    }
    /*package*/ long mNativeObj;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy