View Javadoc

1   /*
2    * $Id: SecurityManager.java 19191 2010-08-25 21:05:23Z tcarlson $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.api.security;
12  
13  import org.mule.api.EncryptionStrategy;
14  import org.mule.api.lifecycle.Initialisable;
15  
16  import java.util.Collection;
17  
18  /**
19   * <code>SecurityManager</code> is responsible for managing one or more
20   * security providers.
21   */
22  
23  public interface SecurityManager extends Initialisable
24  {
25      
26      Authentication authenticate(Authentication authentication)
27          throws SecurityException, SecurityProviderNotFoundException;
28  
29      void addProvider(SecurityProvider provider);
30  
31      SecurityProvider getProvider(String name);
32  
33      SecurityProvider removeProvider(String name);
34  
35      Collection<SecurityProvider> getProviders();
36  
37      void setProviders(Collection<SecurityProvider> providers);
38  
39      SecurityContext createSecurityContext(Authentication authentication)
40          throws UnknownAuthenticationTypeException;
41  
42      EncryptionStrategy getEncryptionStrategy(String name);
43  
44      void addEncryptionStrategy(EncryptionStrategy strategy);
45  
46      EncryptionStrategy removeEncryptionStrategy(String name);
47  
48      Collection<EncryptionStrategy> getEncryptionStrategies();
49  
50      void setEncryptionStrategies(Collection<EncryptionStrategy> strategies);
51  
52  }