src/java.base/share/classes/java/net/SecureCacheResponse.java
changeset 52474 13266dac5fdb
parent 47216 71c04702a3d5
child 52499 768b1c612100
equal deleted inserted replaced
52473:a8389aeabf90 52474:13266dac5fdb
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package java.net;
    26 package java.net;
    27 
    27 
    28 import java.security.cert.Certificate;
    28 import java.security.cert.Certificate;
       
    29 import javax.net.ssl.SSLSession;
    29 import javax.net.ssl.SSLPeerUnverifiedException;
    30 import javax.net.ssl.SSLPeerUnverifiedException;
    30 import java.security.Principal;
    31 import java.security.Principal;
    31 import java.util.List;
    32 import java.util.List;
       
    33 import java.util.Optional;
    32 
    34 
    33 /**
    35 /**
    34  * Represents a cache response originally retrieved through secure
    36  * Represents a cache response originally retrieved through secure
    35  * means, such as TLS.
    37  * means, such as TLS.
    36  *
    38  *
   103       *
   105       *
   104       * @see #getLocalCertificateChain()
   106       * @see #getLocalCertificateChain()
   105       * @see #getPeerPrincipal()
   107       * @see #getPeerPrincipal()
   106       */
   108       */
   107      public abstract Principal getLocalPrincipal();
   109      public abstract Principal getLocalPrincipal();
       
   110 
       
   111     /**
       
   112      * Returns an {@link Optional} containing the {@code SSLSession} in
       
   113      * use on the original connection that retrieved the network resource.
       
   114      * Returns an empty {@code Optional} if the underlying implementation
       
   115      * does not support this method.
       
   116      *
       
   117      * @implSpec For compatibility, the default implementation of this
       
   118      *           method returns an empty {@code Optional}.  Subclasses
       
   119      *           should override this method with an appropriate
       
   120      *           implementation since an application may need to access
       
   121      *           additional parameters associated with the SSL session.
       
   122      *
       
   123      * @return   an {@link Optional} containing the {@code SSLSession} in
       
   124      *           use on the original connection
       
   125      *
       
   126      * @see SSLSession
       
   127      *
       
   128      * @since 12
       
   129      */
       
   130     public Optional<SSLSession> getSSLSession() {
       
   131         return Optional.empty();
       
   132     }
   108 }
   133 }