Package org.jboss.identity.idm.exception

Examples of org.jboss.identity.idm.exception.IdentityException


            {
               //TODO: maybe perform a schema check if this attribute is not required on the LDAP level
               IdentityObjectAttributeMetaData amd = mdMap.get(name);
               if (amd != null && amd.isRequired())
               {
                  throw new IdentityException("Cannot remove required attribute: " + name);
               }
            }



            Attributes attrs = new BasicAttributes(true);
            Attribute attr = new BasicAttribute(attributeName);
            attrs.put(attr);

            try
            {
               ldapContext.modifyAttributes(dn, DirContext.REMOVE_ATTRIBUTE, attrs);
            }
            catch (NamingException e)
            {
               throw new IdentityException("Cannot remove attribute", e);
            }

         }
      }
      finally
      {
         try
         {
            ldapContext.close();
         }
         catch (NamingException e)
         {
            throw new IdentityException("Failed to close LDAP connection", e);
         }
      }
   }
View Full Code Here


         String idAttrName = getTypeConfiguration(ctx, type).getIdAttributeName();

         Attribute ida = attrs.get(idAttrName);
         if (ida == null)
         {
            throw new IdentityException("LDAP entry doesn't contain proper attribute:" + idAttrName);
         }

         //make DN as user ID
         ldapio = new LDAPIdentityObjectImpl(dn, ida.get().toString(), type);

      }
      catch (Exception e)
      {
         throw new IdentityException("Couldn't create LDAPIdentityObjectImpl object from ldap entry (SearchResult)", e);
      }

      return ldapio;
   }
View Full Code Here

         {
            return (LDAPIdentityObjectImpl)findIdentityObject(ctx, io.getName(), io.getIdentityType());
         }
         catch (IdentityException e)
         {
            throw new IdentityException("Provided IdentityObject is not present in the store. Cannot operate on not stored objects.", e);
         }
      }

   }
View Full Code Here

         throw new IllegalArgumentException("IdentityObjectType is null");
      }

      if (!getSupportedFeatures().isIdentityObjectTypeSupported(iot))
      {
         throw new IdentityException("IdentityType not supported by this IdentityStore implementation: " + iot);
      }
   }
View Full Code Here

      {
         return (LdapContext)ctx.getIdentityStoreSession().getSessionContext();
      }
      catch (Exception e)
      {
         throw new IdentityException("Could not obtain LDAP connection: ", e);
      }
   }
View Full Code Here

      {
         for (IdentityObjectSearchControl control : controls)
         {
            if (!supportedSearchControls.contains(control.getClass()))
            {
               throw new IdentityException("IdentityObjectSearchControl not supported by this IdentityStore: " + control.getClass());
            }
         }
      }
   }
View Full Code Here

         //Handle only those credentials that implement SPI

         if (!(credential instanceof IdentityObjectCredential))
         {
            throw new IdentityException("Unsupported Credential implementation: " + credential.getClass());
         }

         // All credentials must pass

         if (!getRepository().validateCredential(getInvocationContext(), createIdentityObject(identity), ioc))
View Full Code Here

      {
         getRepository().updateCredential(getInvocationContext(), createIdentityObject(identity), (IdentityObjectCredential)credential);
      }
      else
      {
         throw new IdentityException("Unsupported Credential implementation: " + credential.getClass());
      }
   }
View Full Code Here

      {
         roleType = getRepository().createRelationshipName(getInvocationContext(), name);
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }

      return new SimpleRoleType(roleType);
   }
View Full Code Here

      {
         getRepository().removeRelationshipName(getInvocationContext(), name);
      }
      catch (OperationNotSupportedException e)
      {
         throw new IdentityException("Role management not supported");
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.identity.idm.exception.IdentityException

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.