Examples of UserConfig


Examples of org.apache.helix.api.config.UserConfig

        // set up some participants
        for (String nodeName : _liveNodes) {
          ParticipantId participantId = ParticipantId.from(nodeName);
          Participant participant =
              new Participant(participantId, "hostname", 0, true, disabledPartitionIdSet, tags,
                  null, currentStateMap, messageMap, new UserConfig(
                      Scope.participant(participantId)));
          liveParticipantMap.put(participantId, participant);
        }
        List<ParticipantId> participantPreferenceList =
            Lists.transform(listResult.get(partition), new Function<String, ParticipantId>() {
View Full Code Here

Examples of org.apache.helix.api.config.UserConfig

   * @param mapKey
   * @param keyValues
   * @return
   */
  private UserConfig userConfig(Scope<?> scope, String mapKey, String[] keyValues) {
    UserConfig userConfig = new UserConfig(scope);

    for (String keyValue : keyValues) {
      String[] splits = keyValue.split("=");
      String key = splits[0];
      String value = splits[1];
      if (mapKey == null) {
        userConfig.setSimpleField(key, value);
      } else {
        if (userConfig.getMapField(mapKey) == null) {
          userConfig.setMapField(mapKey, new TreeMap<String, String>());
        }
        userConfig.getMapField(mapKey).put(key, value);
      }
    }
    return userConfig;
  }
View Full Code Here

Examples of org.apache.helix.api.config.UserConfig

    Map<String, String> results = new HashMap<String, String>();
    switch (scopeType) {
    case CLUSTER: {
      ClusterAccessor accessor = clusterAccessor(clusterName);
      Scope<ClusterId> scope = Scope.cluster(ClusterId.from(clusterName));
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(userConfig);
      break;
    }
    case PARTICIPANT: {
      ParticipantId participantId = ParticipantId.from(scopeArgs[1]);
      ParticipantAccessor accessor = participantAccessor(clusterName);
      Scope<ParticipantId> scope = Scope.participant(participantId);
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(participantId, userConfig);
      break;
    }
    case RESOURCE: {
      ResourceId resourceId = ResourceId.from(scopeArgs[1]);
      ResourceAccessor accessor = resourceAccessor(clusterName);
      Scope<ResourceId> scope = Scope.resource(resourceId);
      UserConfig userConfig = userConfig(scope, null, keyValues);
      accessor.setUserConfig(resourceId, userConfig);
      break;
    }
    case PARTITION: {
      ResourceId resourceId = ResourceId.from(scopeArgs[1]);
      String partitionId = scopeArgs[2];
      ResourceAccessor accessor = resourceAccessor(clusterName);
      Scope<ResourceId> scope = Scope.resource(resourceId);
      UserConfig userConfig = userConfig(scope, partitionId, keyValues);
      accessor.setUserConfig(resourceId, userConfig);
      break;
    }
    default:
      System.err.println("Non-recognized scopeType: " + scopeType);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.user.UserConfig

            providers.add(new TypeValidatorProvider());
            providers.add(new ConflictValidatorProvider());
            providers.add(new PermissionValidatorProvider());
            providers.add(new AccessControlValidatorProvider());
            // FIXME: retrieve from user context
            providers.add(new UserValidatorProvider(new UserConfig("admin")));
            providers.add(new PrivilegeValidatorProvider());
            return new CompositeValidatorProvider(providers);
        }
View Full Code Here

Examples of org.eclipse.jgit.lib.UserConfig

    private UserInfo getCommitter( ScmProviderRepository repo, Git git )
    {
        boolean forceMvnUser = git.getRepository().getConfig().getBoolean( GIT_MAVEN_SECTION, GIT_FORCE, false );

        // git config
        UserConfig user = git.getRepository().getConfig().get( UserConfig.KEY );
        String committerName = null;
        if ( !forceMvnUser && !user.isCommitterNameImplicit() )
        {
            committerName = user.getCommitterName();
        }

        // mvn parameter
        if ( StringUtils.isBlank( committerName ) )
        {
            committerName = repo.getUser();
        }

        // git default
        if ( StringUtils.isBlank( committerName ) )
        {
            committerName = user.getCommitterName();
        }

        // git config
        String committerMail = null;
        if ( !user.isCommitterEmailImplicit() )
        {
            committerMail = user.getCommitterEmail();
        }

        if ( StringUtils.isBlank( committerMail ) )
        {
            String defaultDomain = git.getRepository().getConfig().getString( GIT_MAVEN_SECTION, null, GIT_MAILDOMAIN );
            defaultDomain = StringUtils.isNotBlank( defaultDomain ) ? defaultDomain : getHostname();

            // mvn parameter (constructed with username) or git default
            committerMail =
                StringUtils.isNotBlank( repo.getUser() ) ? repo.getUser() + "@" + defaultDomain
                                : user.getCommitterEmail();
        }

        return new UserInfo( committerName, committerMail );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.