Package com.sun.appserv.management.config

Examples of com.sun.appserv.management.config.SecurityMapConfig


  ensureDefaultInstance( final DomainConfig domainConfig )
  {
      final ConnectorConnectionPoolConfig ccpc    =
          ConnectorConnectionPoolConfigTest.ensureDefaultInstance( domainConfig );
     
      SecurityMapConfig   result  =
          ccpc.getSecurityMapConfigMap().get( getDefaultInstanceName() );
      if ( result == null )
      {
          result  = createInstance( ccpc,
              getDefaultInstanceName(),
View Full Code Here


      final String    backendPrincipalUsername,
      final String    backendPrincipalPassword,
      final String[]  principals,
      final String[]  userGroups )
  {
        final SecurityMapConfig  smc =
            ccpc.createSecurityMapConfig( name,
                backendPrincipalUsername, backendPrincipalPassword,
                principals, userGroups);
       
        return smc;
View Full Code Here

          try
          {
              final String smcName    = TEST_NAME;
              final String[]  principals  = new String[] { TEST_NAME };
              final String[]  userGroups  = new String[ 0 ];
              final SecurityMapConfig  smc = createInstance(
                  ccpc,
                  smcName,
                  DEFAULT_BACKEND_PRINCIPAL,
                  DEFAULT_BACKEND_PASSWORD,
                  principals,
                  null );
              try
              {
                  assert( smcName.equals( smc.getName() ) );
                  assert( smc == ccpc.getSecurityMapConfigMap().get( smc.getName() ) );
                  testGetters( smc );
                 
                  final Set<String> principalsBefore  = GSetUtil.newSet( smc.getPrincipalNames() );
                  final String    PRINCIPAL1  = "testCreateRemove.test1";
                  smc.createPrincipal( PRINCIPAL1 );
                 
                  final Set<String> principalsAfter  = GSetUtil.newSet( smc.getPrincipalNames() );
                  assert( principalsAfter.contains( PRINCIPAL1 ) );
                 
                  smc.removePrincipal( PRINCIPAL1 );
                  assert( principalsBefore.equals( GSetUtil.newSet( smc.getPrincipalNames() ) ) );
                 
              }
              finally
              {
                  ccpc.removeSecurityMapConfig( smc.getName() );
              }             
          }
          finally
          {
              getDomainConfig().removeConnectorConnectionPoolConfig( ccpc.getName() );
View Full Code Here

  ensureDefaultInstance( final DomainConfig domainConfig )
  {
      final ConnectorConnectionPoolConfig ccpc    =
          ConnectorConnectionPoolConfigTest.ensureDefaultInstance( domainConfig );
     
      SecurityMapConfig   result  =
          ccpc.getSecurityMapConfigMap().get( getDefaultInstanceName() );
      if ( result == null )
      {
          result  = createInstance( ccpc,
              getDefaultInstanceName(),
View Full Code Here

      final String    backendPrincipalUsername,
      final String    backendPrincipalPassword,
      final String[]  principals,
      final String[]  userGroups )
  {
        final SecurityMapConfig  smc =
            ccpc.createSecurityMapConfig( name,
                backendPrincipalUsername, backendPrincipalPassword,
                principals, userGroups);
       
        return smc;
View Full Code Here

          try
          {
              final String smcName    = "SecurityMapConfigTest.testCreateRemove";
              final String[]  principals  = new String[] { "SecurityMapConfigTest.testCreateRemove" };
              final String[]  userGroups  = new String[ 0 ];
              final SecurityMapConfig  smc = createInstance(
                  ccpc,
                  smcName,
                  DEFAULT_BACKEND_PRINCIPAL,
                  DEFAULT_BACKEND_PASSWORD,
                  principals,
                  null );
              try
              {
                  assert( smcName.equals( smc.getName() ) );
                  assert( smc == ccpc.getSecurityMapConfigMap().get( smc.getName() ) );
                  testGetters( smc );
                 
                  final Set<String> principalsBefore  = GSetUtil.newSet( smc.getPrincipalNames() );
                  final String    PRINCIPAL1  = "testCreateRemove.test1";
                  smc.createPrincipal( PRINCIPAL1 );
                 
                  final Set<String> principalsAfter  = GSetUtil.newSet( smc.getPrincipalNames() );
                  assert( principalsAfter.contains( PRINCIPAL1 ) );
                 
                  smc.removePrincipal( PRINCIPAL1 );
                  assert( principalsBefore.equals( GSetUtil.newSet( smc.getPrincipalNames() ) ) );
                 
              }
              finally
              {
                  ccpc.removeSecurityMapConfig( smc.getName() );
              }             
          }
          finally
          {
              getDomainConfig().removeConnectorConnectionPoolConfig( ccpc.getName() );
View Full Code Here

        if (pool == null){
            GuiUtil.handleError(handlerCtx, GuiUtil.getMessage("msg.NoSuchConnectorConnectionPool"));
            return;
        }
        String securityMapName = (String) handlerCtx.getInputValue("securityMapName");
        SecurityMapConfig securityMap = pool.getSecurityMapConfigMap().get(securityMapName);
       
        String[] groups = securityMap.getUserGroupNames();
        if (groups != null && groups.length >0){
            String userGroups = groups[0];
            for(int i=1; i<groups.length; i++){
                userGroups=userGroups.concat("," + groups[i]);
            }
            handlerCtx.setOutputValue("userGroups", userGroups);
            handlerCtx.setOutputValue("hasUserGroups", true);
        }else{
            handlerCtx.setOutputValue("hasUserGroups", false);
            handlerCtx.setOutputValue("userGroups", "");
        }
       
        String[] principalNames = securityMap.getPrincipalNames();
        if (principalNames != null && principalNames.length >0){
            String principals = principalNames[0];
            for(int i=1; i<principalNames.length; i++){
                principals=principals.concat(","+ principalNames[i]);
            }
            handlerCtx.setOutputValue("principals", principals);
        }else{
            handlerCtx.setOutputValue("hasUserGroups", true);
            handlerCtx.setOutputValue("principals", "");
        }
       
        BackendPrincipalConfig bpc = securityMap.getBackendPrincipalConfig();
        if (bpc != null){
            handlerCtx.setOutputValue("userName", bpc.getUserName());
            handlerCtx.setOutputValue("password", bpc.getPassword());
        }
    }
View Full Code Here

                pool.createSecurityMapConfig(securityMapName, userName, password,
                   (usePrincipals)? str : null, (usePrincipals)? null: str);
                return;
             }
       
            SecurityMapConfig securityMap = pool.getSecurityMapConfigMap().get(securityMapName);

            //Remove all the old user groups and principals and add them back
            String[] oldGroups = securityMap.getUserGroupNames();
            if (oldGroups != null && oldGroups.length >0){
                for(int i=0; i<oldGroups.length; i++)
                    securityMap.removeUserGroup(oldGroups[i]);
            }

            String[] oldPrincipals = securityMap.getPrincipalNames();
            if (oldPrincipals != null && oldPrincipals.length >0){
                for(int i=0; i<oldPrincipals.length; i++)
                    securityMap.removePrincipal(oldPrincipals[i]);
            }

            if(usePrincipals){
                for(int i=0; i<str.length; i++)
                    securityMap.createPrincipal(str[i]);
            }else{
                for(int i=0; i<str.length; i++)
                    securityMap.createUserGroup(str[i]);
            }

            BackendPrincipalConfig bpc = securityMap.getBackendPrincipalConfig();
            if (bpc != null){
                bpc.setUserName(userName);
                bpc.setPassword(password);
            }
        }catch(Exception ex){
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.config.SecurityMapConfig

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.