ManagedSecurityServicepublic class ManagedSecurityService extends ConfigMBeanBase implements ConfigAttributeName.SecurityServiceThis Config MBean represents a SecurityService.
It extends ConfigMBeanBase class which provides get/set attribute(s) and getMBeanInfo services according to text descriptions.
ObjectName of this MBean is:
ias: type=security-service, instance-name= |
Fields Summary |
---|
private static final String[] | MAPLISTMAPLIST array defines mapping between "external" name and its location in XML relatively base node | private static final String[] | ATTRIBUTESATTRIBUTES array specifies attributes descriptions in format defined for MBeanEasyConfig | private static final String[] | OPERATIONSOPERATIONS array specifies operations descriptions in format defined for MBeanEasyConfig | private static com.sun.enterprise.util.i18n.StringManager | localStrings |
Constructors Summary |
---|
public ManagedSecurityService()Default constructor sets MBean description tables
this.setDescriptions(MAPLIST, ATTRIBUTES, OPERATIONS);
| public ManagedSecurityService(String instanceName)Constructs Config MBean for Security Service Component.
this(); //set description tables
initialize(ObjectNames.kSecurityServiceType, new String[]{instanceName});
|
Methods Summary |
---|
public void | createAuthRealm(java.lang.String name, java.lang.String classname)This operation creates AuthRealm according to attributes and adds(links) it to current SecurityService;
If attribute is 'null' then default value will be set.
AuthRealm authRealm = new AuthRealm();
if(name!=null)
authRealm.setName(name);
if(classname!=null)
authRealm.setClassname(classname);
SecurityService securityService = (SecurityService)getConfigBeanByXPath( ServerXPathHelper.getSecurityServiceXpath() );
securityService.addAuthRealm(authRealm);
getConfigContext().flush();
| public void | deleteAuthRealm(java.lang.String id)This operation deletes AuthRealm according to id if it connected to current SecurityService.
SecurityService securityService = (SecurityService)getConfigBeanByXPath( ServerXPathHelper.getSecurityServiceXpath() );
AuthRealm authRealm = securityService.getAuthRealmByName(id);
if(((String) getAttribute(kDefaultRealm)).equals(id)){
String msg = localStrings.getString( "admin.server.core.mbean.config.default_realm_cannot_delete", id );
throw new ConfigException( msg );
}
if(authRealm!=null)
securityService.removeAuthRealm(authRealm);
getConfigContext().flush();
| public java.lang.String[] | listAuthRealms()This operation returns list of AuthRealm's ids connected to current SecurityService.
SecurityService securityService = (SecurityService)getConfigBeanByXPath( ServerXPathHelper.getSecurityServiceXpath() );
AuthRealm[] authRealms = securityService.getAuthRealm();
String[] res = new String[authRealms.length];
for(int i=0; i<authRealms.length; i++)
{
res[i] = authRealms[i].getName();
}
return res;
|
|