Package com.sun.enterprise.security.auth.realm.file

Examples of com.sun.enterprise.security.auth.realm.file.FileRealm


     */
    public String[] getUserNames() throws MBeanConfigException
    {
        checkFileTypeRealm();
       
        FileRealm realm = getRealmKeyFile();
        try
        {
            return convertEnumerationToStringArray(realm.getUserNames());
        }
        catch(BadRealmException bre)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.bad_realm", mInstanceName);
            throw new MBeanConfigException(bre.getMessage());
View Full Code Here


     */
    public String[] getGroupNames() throws MBeanConfigException
    {
        checkFileTypeRealm();
       
        FileRealm realm = getRealmKeyFile();
        try
        {
            return convertEnumerationToStringArray(realm.getGroupNames());
        }
        catch(BadRealmException bre)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.bad_realm", mInstanceName);
            throw new MBeanConfigException(bre.getMessage());
View Full Code Here

        if(userName==null)
           return getGroupNames();

        checkFileTypeRealm();
       
        FileRealm realm = getRealmKeyFile();
        try
        {
            return convertEnumerationToStringArray(realm.getGroupNames(userName));
        }
        catch(NoSuchUserException nse)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.no_such_user", mInstanceName, userName);
            throw new MBeanConfigException(nse.getMessage());
View Full Code Here

    public void addUser(String userName, String password, String[] groupList)
                throws MBeanConfigException
    {
        checkFileTypeRealm();
       
        FileRealm realm = getRealmKeyFile();
        try
        {
            realm.addUser(userName, password, groupList);
            saveInstanceRealmKeyFile(realm);
        }
        catch(BadRealmException bre)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.bad_realm", mInstanceName);
View Full Code Here

            String msg = localStrings.getString("authRealmMBean.removeLastAdminUser",
                                        AdminConstants.DOMAIN_ADMIN_GROUP_NAME);
            throw new MBeanConfigException(msg);
        }
           
        FileRealm realm = getRealmKeyFile();
        try
        {
            realm.removeUser(userName);
            saveInstanceRealmKeyFile(realm);
        }
        catch(NoSuchUserException nse)
        {
            //String msg =  localStrings.getString( "admin.server.core.mbean.config.no_such_user", mInstanceName, userName);
View Full Code Here

            String msg = localStrings.getString("authRealmMBean.removeLastAdminUser",
                                        AdminConstants.DOMAIN_ADMIN_GROUP_NAME);
            throw new MBeanConfigException(msg);
        }

        FileRealm realm = getRealmKeyFile();
        try
        {
            realm.updateUser(userName, userName, password, groupList);
            saveInstanceRealmKeyFile(realm);
      logDetailsIfAdminRealm();
        }
        catch(BadRealmException bre)
        {
View Full Code Here

                String msg = localStrings.getString("authRealmMBean.unsupported_type");
                throw new MBeanConfigException(msg);
            }
            return (FileRealm)realm;
            */
            return new FileRealm(getRealmKeyFileName());
        }
//       catch(MBeanConfigException mce)
//       {
//           throw mce;
//       }
View Full Code Here

     */
    private boolean isUserLastInGroup(String userName, String groupName) throws MBeanConfigException
    {
        checkFileTypeRealm();
       
        FileRealm realm = getRealmKeyFile();

        try
        {
            if(!isBelogsTo(realm.getGroupNames(userName), groupName))
                return false; // user not in the group at all
           
            Enumeration users = realm.getUserNames();
            while(users.hasMoreElements())
            {
                String user = (String)users.nextElement();
                if(!userName.equals(user) &&
                    isBelogsTo(realm.getGroupNames(user), groupName))
                   return false;
            }
        }
        catch(Exception nse)
        {
View Full Code Here

    private void modifyKeyFile(File keyFile, String user, String password) throws
    IOException, BadRealmException, IASSecurityException,
        NoSuchRealmException
    {
        final String keyFilePath = keyFile.getAbsolutePath();
        final FileRealm fileRealm = new FileRealm(keyFilePath);      
        final String[] group =
            new String[]{AdminConstants.DOMAIN_ADMIN_GROUP_NAME};
        fileRealm.addUser(user, password, group);
        fileRealm.writeKeyFile(keyFilePath);
        appendKeyFileComment(keyFilePath);
    }
View Full Code Here

    getRealmKeyFile()
        throws MBeanConfigException
    {
        try
        {
            return new FileRealm( mFile );
        }
        catch(Exception e)
        {
            throw new MBeanConfigException( e.getMessage() );
        }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.security.auth.realm.file.FileRealm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.