Methods Summary |
---|
public void | disable()
listenerWrapper.disable();
|
public java.lang.String | getAppContextID()
return appCtxt;
|
protected javax.security.auth.message.config.AuthConfig | getAuthConfig(javax.security.auth.message.config.AuthConfigProvider p, boolean isServer)
AuthConfig c = null;
if (p != null) {
if (isServer) {
c = p.getServerAuthConfig(layer, appCtxt, cbh);
} else {
c = p.getClientAuthConfig(layer, appCtxt, cbh);
}
}
return c;
|
protected javax.security.auth.message.config.AuthConfig | getAuthConfig(boolean isServer)
ConfigData d = null;
AuthConfig c = null;
boolean disabled = false;
AuthConfigProvider lastP = null;
try {
rLock.lock();
disabled = (!listenerWrapper.isEnabled());
if (!disabled) {
d = listenerWrapper.getConfigData();
if (d != null) {
c = (isServer ? d.sConfig : d.cConfig);
lastP = d.provider;
}
}
} finally {
rLock.unlock();
if (disabled || c != null || (d != null && lastP == null)) {
return c;
}
}
// d == null || (d != null && lastP != null && c == null)
if (d == null) {
try {
wLock.lock();
if (listenerWrapper.getConfigData()== null) {
AuthConfigProvider nextP =
factory.getConfigProvider(layer,appCtxt,this.getRegistrationListener());
if (nextP != null) {
listenerWrapper.setConfigData(new ConfigData(nextP,getAuthConfig(nextP,isServer)));
} else {
listenerWrapper.setConfigData(new ConfigData());
}
}
d = listenerWrapper.getConfigData();
} finally {
wLock.unlock();
}
}
return ((isServer)? d.sConfig : d.cConfig);
|
private javax.security.auth.callback.CallbackHandler | getCallbackHandler()Get the callback default handler
CallbackHandler rvalue = AuthMessagePolicy.getDefaultCallbackHandler();
if (rvalue instanceof CallbackHandlerConfig) {
((CallbackHandlerConfig)rvalue).setHandlerContext
(getHandlerContext(map));
}
return rvalue;
|
public javax.security.auth.message.config.ClientAuthConfig | getClientAuthConfig()
return (ClientAuthConfig)getAuthConfig(false);
|
public javax.security.auth.message.config.ClientAuthContext | getClientAuthContext(javax.security.auth.message.MessageInfo info, javax.security.auth.Subject s)
ClientAuthConfig c = (ClientAuthConfig)getAuthConfig(false);
if (c != null) {
return c.getAuthContext(c.getAuthContextID(info),s,map);
}
return null;
|
protected com.sun.enterprise.security.jmac.config.HandlerContext | getHandlerContext(java.util.Map map)This method is invoked by the constructor and should be
overrided by subclass.
return null;
|
public java.lang.Object | getProperty(java.lang.String key)
return map == null ? null : map.get(key);
|
public AuthConfigRegistrationWrapper.AuthConfigRegistrationListener | getRegistrationListener()
return this.listenerWrapper.getListener();
|
public com.sun.enterprise.security.jmac.config.ConfigHelper$AuthConfigRegistrationWrapper | getRegistrationWrapper()
return this.listenerWrapper;
|
public javax.security.auth.message.config.ServerAuthConfig | getServerAuthConfig()
return (ServerAuthConfig)getAuthConfig(true);
|
public javax.security.auth.message.config.ServerAuthContext | getServerAuthContext(javax.security.auth.message.MessageInfo info, javax.security.auth.Subject s)
ServerAuthConfig c = (ServerAuthConfig)getAuthConfig(true);
if (c != null) {
return c.getAuthContext(c.getAuthContextID(info),s,map);
}
return null;
|
protected boolean | hasExactMatchAuthProvider()Check if there is a provider register for a given layer and appCtxt.
boolean exactMatch = false;
// XXX this may need to be optimized
AuthConfigProvider p =
factory.getConfigProvider(layer, appCtxt, null);
if (p != null) {
String[] IDs = factory.getRegistrationIDs(p);
for (String i : IDs) {
RegistrationContext c = factory.getRegistrationContext(i);
if (layer.equals(c.getMessageLayer()) &&
appCtxt.equals(c.getAppContext())) {
exactMatch = true;
break;
}
}
}
return exactMatch;
|
protected void | init(java.lang.String layer, java.lang.String appContext, java.util.Map map, javax.security.auth.callback.CallbackHandler cbh)
this.layer = layer;
this.appCtxt = appContext;
this.map = map;
this.cbh = cbh;
if (this.cbh == null) {
this.cbh = getCallbackHandler();
}
this.rwLock = new ReentrantReadWriteLock(true);
this.rLock = rwLock.readLock();
this.wLock = rwLock.writeLock();
listenerWrapper = new AuthConfigRegistrationWrapper(this.layer, this.appCtxt);
|
public void | setJmacProviderRegisID(java.lang.String jmacProviderRegisID)
this.listenerWrapper.setJmacProviderRegisID(jmacProviderRegisID);
|
public void | setRegistrationWrapper(com.sun.enterprise.security.jmac.config.ConfigHelper$AuthConfigRegistrationWrapper wrapper)
this.listenerWrapper = wrapper;
|