| <!DOCTYPE HTML> |
| <html lang="fr"> |
| <head> |
| <title>Source code</title> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| </head> |
| <body> |
| <main role="main"> |
| <div class="sourceContainer"> |
| <pre><span class="sourceLineNo">001</span><a id="line.1">/*</a> |
| <span class="sourceLineNo">002</span><a id="line.2"> * Licensed to the Apache Software Foundation (ASF) under one</a> |
| <span class="sourceLineNo">003</span><a id="line.3"> * or more contributor license agreements. See the NOTICE file</a> |
| <span class="sourceLineNo">004</span><a id="line.4"> * distributed with this work for additional information</a> |
| <span class="sourceLineNo">005</span><a id="line.5"> * regarding copyright ownership. The ASF licenses this file</a> |
| <span class="sourceLineNo">006</span><a id="line.6"> * to you under the Apache License, Version 2.0 (the</a> |
| <span class="sourceLineNo">007</span><a id="line.7"> * "License"); you may not use this file except in compliance</a> |
| <span class="sourceLineNo">008</span><a id="line.8"> * with the License. You may obtain a copy of the License at</a> |
| <span class="sourceLineNo">009</span><a id="line.9"> *</a> |
| <span class="sourceLineNo">010</span><a id="line.10"> * http://www.apache.org/licenses/LICENSE-2.0</a> |
| <span class="sourceLineNo">011</span><a id="line.11"> *</a> |
| <span class="sourceLineNo">012</span><a id="line.12"> * Unless required by applicable law or agreed to in writing,</a> |
| <span class="sourceLineNo">013</span><a id="line.13"> * software distributed under the License is distributed on an</a> |
| <span class="sourceLineNo">014</span><a id="line.14"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</a> |
| <span class="sourceLineNo">015</span><a id="line.15"> * KIND, either express or implied. See the License for the</a> |
| <span class="sourceLineNo">016</span><a id="line.16"> * specific language governing permissions and limitations</a> |
| <span class="sourceLineNo">017</span><a id="line.17"> * under the License.</a> |
| <span class="sourceLineNo">018</span><a id="line.18"> */</a> |
| <span class="sourceLineNo">019</span><a id="line.19">package org.apache.shiro.mgt;</a> |
| <span class="sourceLineNo">020</span><a id="line.20"></a> |
| <span class="sourceLineNo">021</span><a id="line.21">import org.apache.shiro.subject.Subject;</a> |
| <span class="sourceLineNo">022</span><a id="line.22"></a> |
| <span class="sourceLineNo">023</span><a id="line.23">/**</a> |
| <span class="sourceLineNo">024</span><a id="line.24"> * A {@code SubjectDAO} is responsible for persisting a Subject instance's internal state such that the Subject instance</a> |
| <span class="sourceLineNo">025</span><a id="line.25"> * can be recreated at a later time if necessary.</a> |
| <span class="sourceLineNo">026</span><a id="line.26"> * <p/></a> |
| <span class="sourceLineNo">027</span><a id="line.27"> * Shiro's default {@code SecurityManager} implementations typically use a {@code SubjectDAO} in conjunction</a> |
| <span class="sourceLineNo">028</span><a id="line.28"> * with a {@link SubjectFactory}: after the {@code SubjectFactory} creates a {@code Subject} instance, the</a> |
| <span class="sourceLineNo">029</span><a id="line.29"> * {@code SubjectDAO} is used to persist that subject's state such that it can be accessed later if necessary.</a> |
| <span class="sourceLineNo">030</span><a id="line.30"> * <h3>Usage</h3></a> |
| <span class="sourceLineNo">031</span><a id="line.31"> * It should be noted that this component is used by {@code SecurityManager} implementations to manage Subject</a> |
| <span class="sourceLineNo">032</span><a id="line.32"> * state persistence. It does <em>not</em> make Subject instances accessible to the</a> |
| <span class="sourceLineNo">033</span><a id="line.33"> * application (e.g. via {@link org.apache.shiro.SecurityUtils#getSubject() SecurityUtils.getSubject()}).</a> |
| <span class="sourceLineNo">034</span><a id="line.34"> *</a> |
| <span class="sourceLineNo">035</span><a id="line.35"> * @see DefaultSubjectDAO</a> |
| <span class="sourceLineNo">036</span><a id="line.36"> * @since 1.2</a> |
| <span class="sourceLineNo">037</span><a id="line.37"> */</a> |
| <span class="sourceLineNo">038</span><a id="line.38">public interface SubjectDAO {</a> |
| <span class="sourceLineNo">039</span><a id="line.39"></a> |
| <span class="sourceLineNo">040</span><a id="line.40"> /**</a> |
| <span class="sourceLineNo">041</span><a id="line.41"> * Persists the specified Subject's state for later access. If there is a no existing state persisted, this</a> |
| <span class="sourceLineNo">042</span><a id="line.42"> * persists it if possible (i.e. a create operation). If there is existing state for the specified {@code Subject},</a> |
| <span class="sourceLineNo">043</span><a id="line.43"> * this method updates the existing state to reflect the current state (i.e. an update operation).</a> |
| <span class="sourceLineNo">044</span><a id="line.44"> *</a> |
| <span class="sourceLineNo">045</span><a id="line.45"> * @param subject the Subject instance for which its state will be created or updated.</a> |
| <span class="sourceLineNo">046</span><a id="line.46"> * @return the Subject instance to use after persistence is complete. This can be the same as the method argument</a> |
| <span class="sourceLineNo">047</span><a id="line.47"> * if the underlying implementation does not need to make any Subject changes.</a> |
| <span class="sourceLineNo">048</span><a id="line.48"> */</a> |
| <span class="sourceLineNo">049</span><a id="line.49"> Subject save(Subject subject);</a> |
| <span class="sourceLineNo">050</span><a id="line.50"></a> |
| <span class="sourceLineNo">051</span><a id="line.51"> /**</a> |
| <span class="sourceLineNo">052</span><a id="line.52"> * Removes any persisted state for the specified {@code Subject} instance. This is a delete operation such that</a> |
| <span class="sourceLineNo">053</span><a id="line.53"> * the Subject's state will not be accessible at a later time.</a> |
| <span class="sourceLineNo">054</span><a id="line.54"> *</a> |
| <span class="sourceLineNo">055</span><a id="line.55"> * @param subject the Subject instance for which any persistent state should be deleted.</a> |
| <span class="sourceLineNo">056</span><a id="line.56"> */</a> |
| <span class="sourceLineNo">057</span><a id="line.57"> void delete(Subject subject);</a> |
| <span class="sourceLineNo">058</span><a id="line.58">}</a> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| </pre> |
| </div> |
| </main> |
| </body> |
| </html> |