Examples of IdentitySession


Examples of org.jboss.identity.idm.api.IdentitySession

  public Object construct(WireContext wireContext) {
 
    IdentitySessionFactory identitySessionFactory = Environment.getFromCurrent(IdentitySessionFactory.class);
    try {
      IdentitySession identitySession = identitySessionFactory.createIdentitySession(realmName);
     
      Environment environment = Environment.getCurrent();
        StandardTransaction transaction = environment.get(StandardTransaction.class);
        if (transaction != null) {
          IdentitySessionResource identitySessionResource = new IdentitySessionResource(identitySession);
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

        return jbpmContext;
    }

    public IdentitySession getIdentitySession() {
        if (identitySession==null) {
          identitySession = new IdentitySession(getJbpmContext().getSession());
        }
        return identitySession;
    }
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            if (userNameExpression == null) {
                context.setError("Error creating user", "The user name expression is missing");
                return;
            }
            final Object userNameValue = userNameExpression.getValue(elContext);
            if (userNameValue == null) {
                context.setError("Error creating user", "The user name value is null");
                return;
            }
            final User user = new User(userNameValue.toString());
            if (passwordExpression != null) {
                final Object passwordValue = passwordExpression.getValue(elContext);
                if (passwordValue == null) {
                    context.setError("Error creating user", "The password value is null");
                    return;
                }
                if (passwordConfirmExpression != null) {
                    final Object passwordConfirmValue = passwordConfirmExpression.getValue(elContext);
                    if (! passwordValue.equals(passwordConfirmValue)) {
                        context.setError("Error creating user", "The password confirmation value does not match the password value");
                        return;
                    }
                }
                user.setPassword(passwordValue.toString());
            }
            if (emailExpression != null) {
                final Object emailValue = emailExpression.getValue(elContext);
                if (emailValue == null) {
                    context.setError("Error creating user", "The email value is null");
                    return;
                }
                user.setEmail(emailValue.toString());
            }
            identitySession.saveUser(user);
            if (targetExpression != null) {
                targetExpression.setValue(elContext, user);
            }
            context.selectOutcome("success");
            context.addSuccessMessage("User created successfully");
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            targetExpression.setValue(elContext, identitySession.getUsers());
            context.selectOutcome("success");
        } catch (Exception ex) {
            context.setError("Error loading user list", ex);
            return;
        }
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            final Object userNameValue = userNameExpression.getValue(elContext);
            if (userNameValue == null) {
                context.setError("Error verifying user", "User name is null");
                return;
            }
            final Object passwordValue = passwordExpression.getValue(elContext);
            if (passwordValue == null) {
                context.setError("Error verifying user", "Password is null");
                return;
            }
            final Object id = identitySession.verify(userNameValue.toString(), passwordValue.toString());
            if (id == null) {
                context.setError("Invalid user name or password");
                return;
            }
            if (userIdTargetExpression != null) {
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final Object idValue = idExpression.getValue(elContext);
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            if (idValue == null) {
                context.setError("Error loading user", "The ID value is null");
                return;
            }
            final long id;
            if (idValue instanceof Long) {
                id = ((Long)idValue).longValue();
            } else {
                id = Long.valueOf(idValue.toString()).longValue();
            }
            final User user = identitySession.loadUser(id);
            if (user == null) {
                context.setError("Error loading user", "No user was found with an ID of " + id);
                return;
            }
            targetExpression.setValue(elContext, user);
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final Object nameValue = groupNameExpression.getValue(elContext);
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            if (nameValue == null) {
                context.setError("Error loading group", "The group name value is null");
                return;
            }
            final String groupName = nameValue.toString();
            final Group group = identitySession.getGroupByName(groupName);
            if (group == null) {
                context.setError("Error loading group", "No group was found named '" + groupName + "'");
                return;
            }
            targetExpression.setValue(elContext, group);
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            if (groupNameExpression == null) {
                context.setError("Error creating group", "The group name expression is missing");
                return;
            }
            final Object groupNameValue = groupNameExpression.getValue(elContext);
            if (groupNameValue == null) {
                context.setError("Error creating group", "The group name value is null");
                return;
            }
            final Group group = new Group(groupNameValue.toString());
            if (parentGroupExpression != null) {
                final Object parentGroupValue = parentGroupExpression.getValue(elContext);
                if (parentGroupValue instanceof Group) {
                    group.setParent((Group)parentGroupValue);
                } else if (parentGroupValue != null) {
                    context.setError("Error creating group", "The parent group is not a Group instance");
                    return;
                }
            }
            if (typeExpression != null) {
                final Object typeValue = typeExpression.getValue(elContext);
                if (typeValue == null) {
                    context.setError("Error creating group", "The type value is null");
                    return;
                }
                group.setType(typeValue.toString());
            }
            identitySession.saveGroup(group);
            if (targetExpression != null) {
                targetExpression.setValue(elContext, group);
            }
            context.selectOutcome("success");
            context.addSuccessMessage("Group created successfully");
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

    public void handleAction(JbpmJsfContext context, ActionEvent event) {
        try {
            final FacesContext facesContext = FacesContext.getCurrentInstance();
            final ELContext elContext = facesContext.getELContext();
            final Object idValue = idExpression.getValue(elContext);
            final IdentitySession identitySession = new IdentitySession(context.getJbpmContext().getSession());
            if (idValue == null) {
                context.setError("Error loading group", "The ID value is null");
                return;
            }
            final long id;
            if (idValue instanceof Long) {
                id = ((Long)idValue).longValue();
            } else {
                id = Long.valueOf(idValue.toString()).longValue();
            }
            final Group group = identitySession.loadGroup(id);
            if (group == null) {
                context.setError("Error loading group", "No group was found with an ID of " + id);
                return;
            }
            targetExpression.setValue(elContext, group);
View Full Code Here

Examples of org.jbpm.identity.hibernate.IdentitySession

  protected ExpressionSession getExpressionSession() {
    JbpmContext jbpmContext = JbpmContext.getCurrentJbpmContext();
    if (jbpmContext==null) {
      throw new RuntimeException("no active JbpmContext for resolving assignment expression'"+expression+"'");
    }
    return new IdentitySession(jbpmContext.getSession());
  }
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.