Tabnine Logo
IdentityException
Code IndexAdd Tabnine to your IDE (free)

How to use
IdentityException
in
org.jboss.identity.idm.common.exception

Best Java code snippets using org.jboss.identity.idm.common.exception.IdentityException (Showing top 20 results out of 315)

origin: org.jboss.identity.idm/idm-core

public Object getObject(String name) throws IdentityException
{
 Object o = registry.getRegistration(name);
 if (o == null)
 {
   throw new IdentityException("No such mapping in IdentityContext: " + name);
 }
 return o;
}
origin: org.jboss.identity.idm/idm-hibernate

public IdentityStoreSession createIdentityStoreSession() throws IdentityException
{
 try
 {
   return new HibernateIdentityStoreSessionImpl(sessionFactory);
 }
 catch (Exception e)
 {
   throw new IdentityException("Failed to obtain Hibernate SessionFactory",e);
 }
}
origin: org.jboss.identity.idm/idm-core

public void register(Object object, String name) throws IdentityException
{
 if (!registry.register(name, object))
 {
   throw new IdentityException("Cannot register object in IdentityContext with name: " + name);
 }
 if (log.isLoggable(Level.FINER)) log.finer("registering object: " + name + " ; " + object.getClass());
}
origin: org.jboss.identity.idm/idm-hibernate

public IdentityObject findIdentityObject(IdentityStoreInvocationContext ctx, String id) throws IdentityException
{
 if (id == null)
 {
   throw new IllegalArgumentException("id is null");
 }
 HibernateIdentityObject hibernateObject;
 try
 {
   hibernateObject = (HibernateIdentityObject)getHibernateSession(ctx).get(HibernateIdentityObject.class, new Long(id));
 }
 catch(Exception e)
 {
   throw new IdentityException("Cannot find IdentityObject with id: " + id, e);
 }
 return hibernateObject;
}
origin: org.jboss.identity.idm/idm-hibernate

protected Session getHibernateSession(IdentityStoreInvocationContext ctx) throws IdentityException
{
 try
 {
   return ((Session)ctx.getIdentityStoreSession().getSessionContext());
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot obtain Hibernate Session", e);
 }
}
origin: org.jboss.identity.idm/idm-hibernate

public void addRealm(Session hibernateSession, String realmName) throws IdentityException
{
 try
 {
   HibernateRealm realm = new HibernateRealm(realmName);
   hibernateSession.persist(realm);
 }
 catch (Exception e)
 {
   throw new IdentityException("Failed to create store realm", e);
 }
}
origin: org.jboss.identity.idm/idm-hibernate

public Map<String, String> getRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name) throws IdentityException, OperationNotSupportedException
{
 if (name == null)
 {
   throw new IllegalArgumentException("name is null");
 }
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
    .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
   if (hiorn == null)
   {
    throw new IdentityException("Relationship name doesn't exist");
   }
   return new HashMap<String, String>(hiorn.getProperties());
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot get relationship name properties: " + name, e);
 }
}
origin: org.jboss.identity.idm/idm-hibernate

public void setRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name, Map<String, String> properties) throws IdentityException, OperationNotSupportedException
{
 if (name == null)
 {
   throw new IllegalArgumentException("name is null");
 }
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
    .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
   if (hiorn == null)
   {
    throw new IdentityException("Relationship name doesn't exist");
   }
   hiorn.getProperties().putAll(properties);
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot set relationship name properties: " + name, e);
 }
}
origin: org.jboss.identity.idm/idm-hibernate

public String removeRelationshipName(IdentityStoreInvocationContext ctx, String name)  throws IdentityException, OperationNotSupportedException
{
 if (name == null)
 {
   throw new IllegalArgumentException("name is null");
 }
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
    .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
   if (hiorn == null)
   {
    throw new IdentityException("Relationship name doesn't exist");
   }
   getHibernateSession(ctx).delete(hiorn);
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot create new relationship name: " + name, e);
 }
 return name;
}
origin: org.jboss.identity.idm/idm-hibernate

public void removeRelationshipNameProperties(IdentityStoreInvocationContext ctx, String name, Set<String> properties) throws IdentityException, OperationNotSupportedException
{
 if (name == null)
 {
   throw new IllegalArgumentException("name is null");
 }
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
    .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", getRealm(hibernateSession, ctx))).uniqueResult();
   if (hiorn == null)
   {
    throw new IdentityException("Relationship name doesn't exist");
   }
   for (String property : properties)
   {
    hiorn.getProperties().remove(property);
   }
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot remove relationship name properties: " + name, e);
 }
}
origin: org.jboss.identity.idm/idm-core

public IdentitySession createIdentitySession(String realmName) throws IdentityException
{
 if (!sessionContextMap.containsKey(realmName))
 {
   throw new IdentityException("Cannot find configured realm with a given name: " + realmName);
 }
 //IdentitySession session = new IdentitySessionImpl(realmName, repo, mapper);
 IdentitySessionConfigurationContext sessionConfigCtx = sessionContextMap.get(realmName);
 IdentitySession newSession =
   new IdentitySessionImpl(sessionConfigCtx.getRealmName(),
    sessionConfigCtx.getRepository(), sessionConfigCtx.getTypeMapper());
 realmMap.put(realmName, newSession);
 return newSession;
}
origin: org.jboss.identity.idm/idm-core

public IdentityStore getIdentityStore(IdentityObjectType identityObjectType) throws IdentityException
{
 IdentityStore store = identityStoreMappings.get(identityObjectType.getName());
 if (store == null)
 {
   String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
   if (option != null && option.equalsIgnoreCase("true"))
   {
    return defaultIdentityStore;
   }
   else
   {
    throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
   }
 }
 return store;
}
origin: org.jboss.identity.idm/idm-hibernate

private void checkIOType(IdentityObjectType iot) throws IdentityException
{
 if (iot == null)
 {
   throw new IllegalArgumentException("IdentityObjectType is null");
 }
 if (!getSupportedFeatures().isIdentityObjectTypeSupported(iot))
 {
   if (!isAllowNotDefinedIdentityObjectTypes())
   {
    throw new IdentityException("IdentityType not supported by this IdentityStore implementation: " + iot);
   }
 }
}
origin: org.jboss.identity.idm/idm-core

public AttributeStore getAttributeStore(IdentityObjectType identityObjectType) throws IdentityException
{
 AttributeStore store = attributeStoreMappings.get(identityObjectType.getName());
 if (store == null)
 {
   String option = configurationContext.getRepositoryConfigurationMetaData().getOptionSingleValue(ALLOW_NOT_DEFINED_IDENTITY_OBJECT_TYPES_OPTION);
   if (option != null && option.equalsIgnoreCase("true"))
   {
    return defaultIdentityStore;
   }
   else
   {
    throw new IdentityException("IdentityObjectType not mapped in the configuration: " + identityObjectType);
   }
 }
 return store;
}
origin: org.jboss.identity.idm/idm-hibernate

private HibernateIdentityObjectCredentialType getHibernateIdentityObjectCredentialType(IdentityStoreInvocationContext ctx, IdentityObjectCredentialType credentialType) throws IdentityException
{
 Session session = getHibernateSession(ctx);
 HibernateIdentityObjectCredentialType hibernateType = null;
 try
 {
   hibernateType = (HibernateIdentityObjectCredentialType)session.
      createCriteria(HibernateIdentityObjectCredentialType.class).add(Restrictions.eq("name", credentialType.getName())).uniqueResult();
 }
 catch (HibernateException e)
 {
   throw new IdentityException("IdentityObjectCredentialType[ " + credentialType.getName() + "] not present in the store.");
 }
 return hibernateType;
}
origin: org.jboss.identity.idm/idm-hibernate

public String createRelationshipName(IdentityStoreInvocationContext ctx, String name) throws IdentityException, OperationNotSupportedException
{
 if (name == null)
 {
   throw new IllegalArgumentException("name is null");
 }
 Session hibernateSession = getHibernateSession(ctx);
 HibernateRealm realm = getRealm(hibernateSession, ctx);
 try
 {
   HibernateIdentityObjectRelationshipName hiorn = (HibernateIdentityObjectRelationshipName)hibernateSession.createCriteria(HibernateIdentityObjectRelationshipName.class)
    .add(Restrictions.eq("name", name)).add(Restrictions.eq("realm", realm)).uniqueResult();
   if (hiorn != null)
   {
    throw new IdentityException("Relationship name already exists");
   }
   hiorn = new HibernateIdentityObjectRelationshipName(name, realm);
   getHibernateSession(ctx).persist(hiorn);
 }
 catch (Exception e)
 {
   throw new IdentityException("Cannot create new relationship name: " + name, e);
 }
 return name;
}
origin: org.jboss.identity.idm/idm-hibernate

private HibernateIdentityObjectRelationshipType getHibernateIdentityObjectRelationshipType(IdentityStoreInvocationContext ctx, IdentityObjectRelationshipType iot) throws IdentityException
{
 HibernateIdentityObjectRelationshipType relationshipType = null;
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   relationshipType = (HibernateIdentityObjectRelationshipType)hibernateSession.
    createQuery(HibernateIdentityObjectRelationshipType.findIdentityObjectRelationshipTypeByName)
    .setParameter("name", iot.getName())
    .uniqueResult();
 }
 catch (Exception e)
 {
   throw new IdentityException("IdentityObjectRelationshipType[ " + iot.getName() + "] not present in the store.");
 }
 return relationshipType;
}
origin: org.jboss.identity.idm/idm-hibernate

public IdentityObject findIdentityObjectByUniqueAttribute(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityObjectType, IdentityObjectAttribute attribute) throws IdentityException
{
 if (attribute == null)
 {
   throw new IllegalArgumentException("attribute is null");
 }
 checkIOType(identityObjectType);
 String attrMappedName = resolveAttributeStoreMapping(identityObjectType, attribute.getName());
 HibernateIdentityObjectType hiot = getHibernateIdentityObjectType(invocationCtx, identityObjectType);
 Session session = getHibernateSession(invocationCtx);
 Query q = session.createQuery("select a from HibernateIdentityObjectTextAttribute a where a.identityObject.identityType = :identityType " +
   "and a.name like :attributeName and :value = any elements(a.values)");
 Set attrValues = new HashSet();
 attrValues.addAll(attribute.getValues());
  List<HibernateIdentityObjectAttribute> attrs = (List<HibernateIdentityObjectAttribute>)
   q.setParameter("identityType", hiot)
    .setParameter("attributeName", attrMappedName)
    .setParameter("value", attribute.getValue()).list();
 if (attrs.size() == 0)
 {
   return null;
 }
 if (attrs.size() > 1)
 {
   throw new IdentityException("Illegal state - more than one IdentityObject with the same unique attribute value: " + attribute);
 }
 return attrs.get(0).getIdentityObject();
}
origin: org.jboss.identity.idm/idm-core

public Collection<RoleType> findRoleTypes(IdentitySearchCriteria criteria) throws IdentityException
{
 
 try
 {
   Set<String> names = getRepository().getRelationshipNames(getInvocationContext(), convertSearchControls(criteria));
   Set<RoleType> types = new HashSet<RoleType>();
   for (String name : names)
   {
    types.add(new SimpleRoleType(name));
   }
   return types;
 }
 catch (OperationNotSupportedException e)
 {
   throw new IdentityException("Role management not supported");
 }
}
origin: org.jboss.identity.idm/idm-core

public void removeRoleType(String name) throws IdentityException
{
 checkNotNullArgument(name, "RoleType name");
 try
 {
   getRepository().removeRelationshipName(getInvocationContext(), name);
 }
 catch (OperationNotSupportedException e)
 {
   throw new IdentityException("Role management not supported");
 }
}
org.jboss.identity.idm.common.exceptionIdentityException

Most used methods

  • <init>

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now