Package org.jbpm.pvm.internal.identity.spi

Examples of org.jbpm.pvm.internal.identity.spi.IdentitySession


public class FindUsersCmd implements Command<List<User>> {

  private static final long serialVersionUID = 1L;
 
  public List<User> execute(Environment environment) {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    return identitySession.findUsers();
  }
View Full Code Here


        throw new JbpmException("failed to add " + addresses + " to senders", e);
      }
    }

    Environment environment = Environment.getCurrent();
    IdentitySession identitySession = environment.get(IdentitySession.class);
    AddressResolver addressResolver = environment.get(AddressResolver.class);

    // resolve and tokenize users
    String userList = fromTemplate.getUsers();
    if (userList != null) {
      String[] userIds = tokenizeActors(userList, execution);
      List<User> users = identitySession.findUsersById(userIds);
      addSenders(resolveAddresses(users, addressResolver), email);
    }

    // resolve and tokenize groups
    String groupList = fromTemplate.getGroups();
    if (groupList != null) {
      for (String groupId : tokenizeActors(groupList, execution)) {
        Group group = identitySession.findGroupById(groupId);
        addSenders(addressResolver.resolveAddresses(group), email);
      }
    }
  }
View Full Code Here

            + recipientType, e);
      }
    }

    Environment environment = Environment.getCurrent();
    IdentitySession identitySession = environment.get(IdentitySession.class);
    AddressResolver addressResolver = environment.get(AddressResolver.class);

    // resolve and tokenize users
    String userList = addressTemplate.getUsers();
    if (userList != null) {
      String[] userIds = tokenizeActors(userList, execution);
      List<User> users = identitySession.findUsersById(userIds);
      addRecipients(resolveAddresses(users, addressResolver), email, recipientType);
    }

    // resolve and tokenize groups
    String groupList = addressTemplate.getGroups();
    if (groupList != null) {
      for (String groupId : tokenizeActors(groupList, execution)) {
        Group group = identitySession.findGroupById(groupId);
        addRecipients(addressResolver.resolveAddresses(group), email, recipientType);
      }
    }
  }
View Full Code Here

    this.groupId = groupId;
    this.role = role;
  }

  public Object execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    identitySession.createMembership(userId, groupId, role);
    return null;
  }
View Full Code Here

  public FindGroupCmd(String groupId) {
    this.groupId = groupId;
  }

  public Group execute(Environment environment) {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    return identitySession.findGroupById(groupId);
  }
View Full Code Here

  public DeleteGroupCmd(String groupId) {
    this.groupId = groupId;
  }

  public Void execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    identitySession.deleteGroup(groupId);
    return null;
  }
View Full Code Here

    this.userId = userId;
    this.groupType = groupType;
  }

  public List<Group> execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    if (groupType!=null) {
      return identitySession.findGroupsByUserAndGroupType(userId, groupType);
    }
    return identitySession.findGroupsByUser(userId);
  }
View Full Code Here

public class FindUsersCmd implements Command<List<User>> {

  private static final long serialVersionUID = 1L;
 
  public List<User> execute(Environment environment) {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    return identitySession.findUsers();
  }
View Full Code Here

    this.groupId = groupId;
    this.role = role;
  }

  public Object execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    identitySession.deleteMembership(userId, groupId, role);
    return null;
  }
View Full Code Here

    this.familyName = familyName;
    this.businessEmail = businessEmail;
  }

  public Void execute(Environment environment) throws Exception {
    IdentitySession identitySession = environment.get(IdentitySession.class);
    identitySession.createUser(userId, givenName, familyName, businessEmail);
    return null;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.identity.spi.IdentitySession

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.