/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.3.0
 *
 * Do not make changes to this file unless you know what you are doing - modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.chilkatsoft;

public class CkCache {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected CkCache(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(CkCache obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected static long swigRelease(CkCache obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        chilkatJNI.delete_CkCache(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CkCache() {
    this(chilkatJNI.new_CkCache(), true);
  }

  public void LastErrorXml(CkString str) {
    chilkatJNI.CkCache_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorHtml(CkString str) {
    chilkatJNI.CkCache_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void LastErrorText(CkString str) {
    chilkatJNI.CkCache_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public void get_DebugLogFilePath(CkString str) {
    chilkatJNI.CkCache_get_DebugLogFilePath(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String debugLogFilePath() {
    return chilkatJNI.CkCache_debugLogFilePath(swigCPtr, this);
  }

  public void put_DebugLogFilePath(String newVal) {
    chilkatJNI.CkCache_put_DebugLogFilePath(swigCPtr, this, newVal);
  }

  public void get_LastErrorHtml(CkString str) {
    chilkatJNI.CkCache_get_LastErrorHtml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorHtml() {
    return chilkatJNI.CkCache_lastErrorHtml(swigCPtr, this);
  }

  public void get_LastErrorText(CkString str) {
    chilkatJNI.CkCache_get_LastErrorText(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorText() {
    return chilkatJNI.CkCache_lastErrorText(swigCPtr, this);
  }

  public void get_LastErrorXml(CkString str) {
    chilkatJNI.CkCache_get_LastErrorXml(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastErrorXml() {
    return chilkatJNI.CkCache_lastErrorXml(swigCPtr, this);
  }

  public void get_LastEtagFetched(CkString str) {
    chilkatJNI.CkCache_get_LastEtagFetched(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastEtagFetched() {
    return chilkatJNI.CkCache_lastEtagFetched(swigCPtr, this);
  }

  public void get_LastExpirationFetchedStr(CkString str) {
    chilkatJNI.CkCache_get_LastExpirationFetchedStr(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastExpirationFetchedStr() {
    return chilkatJNI.CkCache_lastExpirationFetchedStr(swigCPtr, this);
  }

  public boolean get_LastHitExpired() {
    return chilkatJNI.CkCache_get_LastHitExpired(swigCPtr, this);
  }

  public void get_LastKeyFetched(CkString str) {
    chilkatJNI.CkCache_get_LastKeyFetched(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String lastKeyFetched() {
    return chilkatJNI.CkCache_lastKeyFetched(swigCPtr, this);
  }

  public boolean get_LastMethodSuccess() {
    return chilkatJNI.CkCache_get_LastMethodSuccess(swigCPtr, this);
  }

  public void put_LastMethodSuccess(boolean newVal) {
    chilkatJNI.CkCache_put_LastMethodSuccess(swigCPtr, this, newVal);
  }

  public int get_Level() {
    return chilkatJNI.CkCache_get_Level(swigCPtr, this);
  }

  public void put_Level(int newVal) {
    chilkatJNI.CkCache_put_Level(swigCPtr, this, newVal);
  }

  public int get_NumRoots() {
    return chilkatJNI.CkCache_get_NumRoots(swigCPtr, this);
  }

  public boolean get_VerboseLogging() {
    return chilkatJNI.CkCache_get_VerboseLogging(swigCPtr, this);
  }

  public void put_VerboseLogging(boolean newVal) {
    chilkatJNI.CkCache_put_VerboseLogging(swigCPtr, this, newVal);
  }

  public void get_Version(CkString str) {
    chilkatJNI.CkCache_get_Version(swigCPtr, this, CkString.getCPtr(str), str);
  }

  public String version() {
    return chilkatJNI.CkCache_version(swigCPtr, this);
  }

  public void AddRoot(String path) {
    chilkatJNI.CkCache_AddRoot(swigCPtr, this, path);
  }

  public int DeleteAll() {
    return chilkatJNI.CkCache_DeleteAll(swigCPtr, this);
  }

  public int DeleteAllExpired() {
    return chilkatJNI.CkCache_DeleteAllExpired(swigCPtr, this);
  }

  public boolean DeleteFromCache(String key) {
    return chilkatJNI.CkCache_DeleteFromCache(swigCPtr, this, key);
  }

  public int DeleteOlderDt(CkDateTime dateTime) {
    return chilkatJNI.CkCache_DeleteOlderDt(swigCPtr, this, CkDateTime.getCPtr(dateTime), dateTime);
  }

  public int DeleteOlderStr(String dateTimeStr) {
    return chilkatJNI.CkCache_DeleteOlderStr(swigCPtr, this, dateTimeStr);
  }

  public boolean FetchBd(String key, CkBinData bd) {
    return chilkatJNI.CkCache_FetchBd(swigCPtr, this, key, CkBinData.getCPtr(bd), bd);
  }

  public boolean FetchFromCache(String key, CkByteData outBytes) {
    return chilkatJNI.CkCache_FetchFromCache(swigCPtr, this, key, CkByteData.getCPtr(outBytes), outBytes);
  }

  public boolean FetchSb(String key, CkStringBuilder sb) {
    return chilkatJNI.CkCache_FetchSb(swigCPtr, this, key, CkStringBuilder.getCPtr(sb), sb);
  }

  public boolean FetchText(String key, CkString outStr) {
    return chilkatJNI.CkCache_FetchText(swigCPtr, this, key, CkString.getCPtr(outStr), outStr);
  }

  public String fetchText(String key) {
    return chilkatJNI.CkCache_fetchText(swigCPtr, this, key);
  }

  public boolean GetEtag(String key, CkString outStr) {
    return chilkatJNI.CkCache_GetEtag(swigCPtr, this, key, CkString.getCPtr(outStr), outStr);
  }

  public String getEtag(String key) {
    return chilkatJNI.CkCache_getEtag(swigCPtr, this, key);
  }

  public String etag(String key) {
    return chilkatJNI.CkCache_etag(swigCPtr, this, key);
  }

  public CkDateTime GetExpirationDt(String key) {
    long cPtr = chilkatJNI.CkCache_GetExpirationDt(swigCPtr, this, key);
    return (cPtr == 0) ? null : new CkDateTime(cPtr, true);
  }

  public boolean GetExpirationStr(String url, CkString outStr) {
    return chilkatJNI.CkCache_GetExpirationStr(swigCPtr, this, url, CkString.getCPtr(outStr), outStr);
  }

  public String getExpirationStr(String url) {
    return chilkatJNI.CkCache_getExpirationStr(swigCPtr, this, url);
  }

  public String expirationStr(String url) {
    return chilkatJNI.CkCache_expirationStr(swigCPtr, this, url);
  }

  public boolean GetFilename(String key, CkString outStr) {
    return chilkatJNI.CkCache_GetFilename(swigCPtr, this, key, CkString.getCPtr(outStr), outStr);
  }

  public String getFilename(String key) {
    return chilkatJNI.CkCache_getFilename(swigCPtr, this, key);
  }

  public String filename(String key) {
    return chilkatJNI.CkCache_filename(swigCPtr, this, key);
  }

  public boolean GetRoot(int index, CkString outStr) {
    return chilkatJNI.CkCache_GetRoot(swigCPtr, this, index, CkString.getCPtr(outStr), outStr);
  }

  public String getRoot(int index) {
    return chilkatJNI.CkCache_getRoot(swigCPtr, this, index);
  }

  public String root(int index) {
    return chilkatJNI.CkCache_root(swigCPtr, this, index);
  }

  public boolean IsCached(String key) {
    return chilkatJNI.CkCache_IsCached(swigCPtr, this, key);
  }

  public boolean SaveBd(String key, String expiration, String etag, CkBinData bd) {
    return chilkatJNI.CkCache_SaveBd(swigCPtr, this, key, expiration, etag, CkBinData.getCPtr(bd), bd);
  }

  public boolean SaveTextDt(String key, CkDateTime expireDateTime, String eTag, String itemTextData) {
    return chilkatJNI.CkCache_SaveTextDt(swigCPtr, this, key, CkDateTime.getCPtr(expireDateTime), expireDateTime, eTag, itemTextData);
  }

  public boolean SaveTextNoExpire(String key, String eTag, String itemTextData) {
    return chilkatJNI.CkCache_SaveTextNoExpire(swigCPtr, this, key, eTag, itemTextData);
  }

  public boolean SaveTextStr(String key, String expireDateTime, String eTag, String itemTextData) {
    return chilkatJNI.CkCache_SaveTextStr(swigCPtr, this, key, expireDateTime, eTag, itemTextData);
  }

  public boolean SaveToCacheDt(String key, CkDateTime expireDateTime, String eTag, CkByteData itemData) {
    return chilkatJNI.CkCache_SaveToCacheDt(swigCPtr, this, key, CkDateTime.getCPtr(expireDateTime), expireDateTime, eTag, CkByteData.getCPtr(itemData), itemData);
  }

  public boolean SaveToCacheNoExpire(String key, String eTag, CkByteData itemData) {
    return chilkatJNI.CkCache_SaveToCacheNoExpire(swigCPtr, this, key, eTag, CkByteData.getCPtr(itemData), itemData);
  }

  public boolean SaveToCacheStr(String key, String expireDateTime, String eTag, CkByteData itemData) {
    return chilkatJNI.CkCache_SaveToCacheStr(swigCPtr, this, key, expireDateTime, eTag, CkByteData.getCPtr(itemData), itemData);
  }

  public boolean UpdateExpirationDt(String key, CkDateTime expireDateTime) {
    return chilkatJNI.CkCache_UpdateExpirationDt(swigCPtr, this, key, CkDateTime.getCPtr(expireDateTime), expireDateTime);
  }

  public boolean UpdateExpirationStr(String key, String expireDateTime) {
    return chilkatJNI.CkCache_UpdateExpirationStr(swigCPtr, this, key, expireDateTime);
  }

}
