Examples of UserSet


Examples of com.sun.grid.jgdi.configuration.UserSet

        if (o instanceof ComplexEntryImpl) {
            ComplexEntry ce = ((ComplexEntryImpl)o);
            return ce.getName()+"="+ce.getStringval();
        }
        if (o instanceof UserSetImpl) {
            UserSet us = ((UserSetImpl)o);
            return us.getName();
        }
        if (o instanceof String) {
            String str = (String) o;
            if (str.trim().length()==0) {
                return null;
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.UserSet

    @OptionAnnotation(value = "-au", min = 2, extra = MAX_ARG_VALUE)
    public void addUserSet(final OptionInfo oi) throws JGDIException {
        List<JGDIAnswer> answer = new LinkedList<JGDIAnswer>();
        final List<String> setList = oi.getLastOriginalArgList();
        final List<String> userList = oi.getArgs();
        UserSet obj;
        //This is the only call we want to make
        oi.optionDone();
        if (userList.size() == 0) {
            //We are missing the set list and used usernames as sets
            String msg = getErrorMessage("LessArguments", oi.getOd().getOption(), new ArrayList(setList));
            throw new JGDIException(msg, getCustomExitCode("LessArguments", oi.getOd().getOption()));
        }
        boolean isNew;
        //We add all the users to all the usersets
        for (String set : setList) {
            obj = jgdi.getUserSet(set);
            isNew = false;
            if (obj == null) {
                obj = new UserSetImpl(true);
                obj.setName(set);
                isNew = true;
            }
            for (String user: userList) {
                //TODO LP: CR XXXXXX addEntries curently add already existing elements
                //Missing messages added user to set
                obj.addEntries(user);
            }
            if (isNew) {
                jgdi.addUserSetWithAnswer(obj, answer);
            } else {
                jgdi.updateUserSetWithAnswer(obj, answer);
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.UserSet

    @OptionAnnotation(value = "-du", min = 2, extra = MAX_ARG_VALUE)
    public void deleteUserSet(final OptionInfo oi) throws JGDIException {
        List<JGDIAnswer> answer = new LinkedList<JGDIAnswer>();
        final List<String> setList = oi.getLastOriginalArgList();
        final List<String> userList = oi.getArgs();
        UserSet obj;
       
        //This is the only call we want to make
        oi.optionDone();
        if (userList.size() == 0) {
            //We are missing the set list and used usernames as sets
            String msg = getErrorMessage("LessArguments", oi.getOd().getOption(), new ArrayList(setList));
            throw new JGDIException(msg, getCustomExitCode("LessArguments", oi.getOd().getOption()));
        }
        //We delete form all the sets
        for (String set : setList) {
            obj = jgdi.getUserSetWithAnswer(set, answer);
            printAnswers(answer);
            answer.clear();
            if (obj == null) {
                err.println(getErrorMessage("InvalidObjectArgument", oi.getOd().getOption(), set));
                setExitCode(getCustomExitCode("InvalidObjectArgument", oi.getOd().getOption()));
                //TODO LP: Missing message about invalid name
                continue;
            }
            for (String user: userList) {
                //TODO LP: CR XXXXXX addEntries curently add already existing elements
                //Also messages are coming from the client!
                //user "user3" is not in access list "set1"
                //deleted user "user3" from access list "set2"
                obj.removeEntries(user);
            }
            jgdi.updateUserSetWithAnswer(obj, answer);
            printAnswers(answer);
            answer.clear();
        }
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.UserSet

    //-dul
    @OptionAnnotation(value = "-dul", min = 1, extra = MAX_ARG_VALUE)
    public void deleteUserSetList(final OptionInfo oi) throws JGDIException {
        List<JGDIAnswer> answer = new LinkedList<JGDIAnswer>();
        final String setName = oi.getFirstArg();
        UserSet obj = jgdi.getUserSetWithAnswer(setName, answer);
        printAnswers(answer);
        if (obj == null) {
            err.println(getErrorMessage("InvalidObjectArgument", oi.getOd().getOption(), setName));
            setExitCode(getCustomExitCode("InvalidObjectArgument", oi.getOd().getOption()));
            return;
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.UserSet

        hg1 = new HostgroupImpl("@hgroup1");
        if ((hg = jgdi.getHostgroup(hg1.getName())) != null) {
            jgdi.deleteHostgroup(hg);
        }
       
        UserSet us;
        us1 = new UserSetImpl("user1");
        us2 = new UserSetImpl("user2");
        us3 = new UserSetImpl("user3");
        if ((us = jgdi.getUserSet("user1")) != null) {
            jgdi.deleteUserSet(us);
View Full Code Here

Examples of com.sun.grid.jgdi.configuration.UserSet

    public void testQueueUserFilter() throws Exception {
       
        JGDI jgdi = createJGDI();
        try {
            ClusterQueueSummaryOptions options = new ClusterQueueSummaryOptions();
            UserSet userSet = ConfigurationFactory.createUserSet();
            userSet.setName("NoAccessUsers");
            userSet.addEntries("noaccess");
            jgdi.addUserSet(userSet);
            try {
                ClusterQueue cq = ConfigurationFactory.createClusterQueueWithDefaults();
                cq.setName("testQueueUserFilter");
                UserFilter uf = new UserFilter();
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    setSubject(entry.getSubject());
    setMessage(entry.getTextBody());
    // destination selection
    String destinationEmail = entry.getDestinationEmail();
    String destinationPersonalName = entry.getDestinationPersonalName();
    UserSet destinationUserSet = entry.getDestinationUserSet();
    User destinationUser = entry.getDestinationUser();
    if (destinationUser != null){
      destinationUserSet = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(2);
    } else if (destinationUserSet != null){
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(1);
    } else if (destinationEmail != null){
      destinationUserSet = null;
      destinationUser = null;
      setDestinationSelection(3);
    } else { // default: nothing selected
      destinationUserSet = null;
      destinationUser = null;
      destinationEmail = null;
      destinationPersonalName = null;
      setDestinationSelection(-1);
    }
    setToEmail(destinationEmail);
    setToPersonalName(destinationPersonalName);
    setUserId(destinationUser == null ? -1 : destinationUser.getId());
    setUserSetId(destinationUserSet == null ? -1 : destinationUserSet.getId());
    setGroupId(entry.getGroup().getId());
  }
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    Set<UserSet> userSets = user.getUserSets();
    Iterator<UserSet> iterator = userSets.iterator();

    while(iterator.hasNext()){
      UserSet set = iterator.next();
      if(set.getName().equals(setName)){
        isInSet = true;
        break;
      }
    }
    return isInSet;
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

    calendar.setTime(timerEvent.getScheduledTime());
    initializeSendDate(calendar);

    // requesting user / user set / owning user
    User requestingUser = timerEvent.getRequestingUser();
    UserSet requestingUserSet = timerEvent.getRequestingUserSet();
    f.setRequestingUserId(requestingUser != null ? requestingUser.getId() : -1);
    f.setRequestingUserSetId(requestingUserSet != null ? requestingUserSet.getId() : -1);
    f.setApplyToSelection(requestingUserSet == null ? 1 : 2);
    f.setOwningUserId(timerEvent.getOwningUser().getId());
   
    // repetition interval
    if (timerEvent.getIntervalInMillis() >= MILLIS_PER_WEEK){
View Full Code Here

Examples of evolaris.framework.um.datamodel.UserSet

      if (f.getApplyToSelection() != 2) { // user set
        throw new BugException("invalid apply-to flag: " + f.getApplyToSelection());
      }
      UserSetManager userSetManager = new UserSetManager(locale,session);
      timerEvent.setRequestingUser(null);
      UserSet requestingUserSet = userSetManager.getUserSet(f.getRequestingUserSetId());
      if (requestingUserSet == null){
        throw new InputException(resources.getMessage(locale,"smssvc.AnEntryNotAvailable"));
      }
      timerEvent.setRequestingUserSet(requestingUserSet);
    }
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.