public IdentitySession getIdentitySession() throws Exception { return identitySessionFactory.getCurrentIdentitySession(realmName); }
@Produces @RequestScoped IdentitySession createIdentitySession(IdentitySessionFactory factory) throws IdentityException { if (metadata.getRepositories() == null || metadata.getRepositories().size() == 0) { throw new IdentityException("Error creating IdentitySession - no PicketLink IdentityStore repositories have been configured."); } Map<String, Object> sessionOptions = new HashMap<String, Object>(); if (!entityManagerInstance.isUnsatisfied() && !entityManagerInstance.isAmbiguous()) { sessionOptions.put(SESSION_OPTION_ENTITY_MANAGER, entityManagerInstance.get()); sessionOptions.put(SESSION_OPTION_IDENTITY_OBJECT_CREATED_EVENT, identityObjectCreatedEvent); } IdentitySession session = factory.createIdentitySession(getDefaultRealm(), sessionOptions); session.registerListener(this); return session; }
public IdentitySession getIdentitySession(String realm) throws Exception { if (realm == null) { throw new IllegalArgumentException("Realm name cannot be null"); } return getIdentitySessionFactory().getCurrentIdentitySession(realm); }
public IdentitySession getIdentitySession() throws Exception { return getIdentitySessionFactory().getCurrentIdentitySession(realmName); }