Java Code Examples for sun.security.util.Cache#newNullCache()

The following examples show how to use sun.security.util.Cache#newNullCache() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LDAPCertStoreImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 */
LDAPCertStoreImpl(String serverName, int port)
    throws InvalidAlgorithmParameterException {
    createInitialDirContext(serverName, port);
    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 2
Source File: LDAPCertStore.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 3
Source File: LDAPCertStore.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 4
Source File: LDAPCertStore.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 5
Source File: LDAPCertStore.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 6
Source File: LDAPCertStore.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 7
Source File: LDAPCertStore.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 8
Source File: LDAPCertStore.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 9
Source File: LDAPCertStore.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 10
Source File: LDAPCertStore.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 11
Source File: LDAPCertStore.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 12
Source File: LDAPCertStore.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
Example 13
Source File: LDAPCertStore.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}