Methods Summary |
---|
public abstract void | addIdentity(java.security.Identity identity)Adds an {@code Identity} to this {@code IdentityScope}.
|
public abstract java.security.Identity | getIdentity(java.lang.String name)Returns the {@code Identity} with the specified name or {@code null} if
no {@code Identity} with the specified name is present in this scope.
|
public java.security.Identity | getIdentity(java.security.Principal principal)Returns the {@code Identity} with the name of the specified principal or
{@code null} if no {@code Identity} with the name of the specified
principal is present in this scope.
return getIdentity(principal.getName());
|
public abstract java.security.Identity | getIdentity(java.security.PublicKey key)Returns the {@code Identity} which is associated with the specified key
or {@code null} if no {@code Identity} associated with the specified key
is present in this scope.
|
public static java.security.IdentityScope | getSystemScope()Returns the system's scope.
/*
* Test shows that the implementation class name is read from security property
* "system.scope", and the class is only loaded from boot classpath. No default
* implementation as fallback, i.e., return null if fails to init an instance.
*/
if (systemScope == null) {
String className = AccessController.doPrivileged(new PrivilegedAction<String>(){
public String run() {
return Security.getProperty("system.scope"); //$NON-NLS-1$
}
});
if(className != null){
try {
systemScope = (IdentityScope) Class.forName(className).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
}
return systemScope;
|
public abstract java.util.Enumeration | identities()Returns an {@code Enumeration} over the {@code Identity} objects in this
{@code IdentityScope}.
|
public abstract void | removeIdentity(java.security.Identity identity)Removes an {@code Identity} from this {@code IdentityScope}.
|
protected static void | setSystemScope(java.security.IdentityScope scope)Sets the system's scope.
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkSecurityAccess("setSystemScope"); //$NON-NLS-1$
}
systemScope = scope;
|
public abstract int | size()Returns the number of {@code Identity} objects in this scope.
|
public java.lang.String | toString()Returns a string containing a concise, human-readable description of this
{@code IdentityScope}.
return new StringBuffer(super.toString())
.append("[").append(size()).append("]").toString(); //$NON-NLS-1$ //$NON-NLS-2$
|