View Javadoc

1   package org.modeshape.jcr;
2   
3   import javax.jcr.Credentials;
4   import org.modeshape.graph.SecurityContext;
5   
6   public class JcrSecurityContextCredentials implements Credentials {
7       private static final long serialVersionUID = 1L;
8       private final SecurityContext securityContext;
9   
10      /**
11       * Initializes the class with an existing {@link SecurityContext security context}.
12       * 
13       * @param securityContext the security context; may not be null
14       */
15      public JcrSecurityContextCredentials( final SecurityContext securityContext ) {
16          assert securityContext != null;
17  
18          this.securityContext = securityContext;
19      }
20  
21      /**
22       * Returns the {@link SecurityContext security context} for this instance.
23       * 
24       * @return the {@link SecurityContext security context} for this instance; never null
25       */
26      public final SecurityContext getSecurityContext() {
27          return this.securityContext;
28      }
29  
30  }