Codota Logo
IdentityObject
Code IndexAdd Codota to your IDE (free)

How to use
IdentityObject
in
org.jboss.identity.idm.spi.model

Best Java code snippets using org.jboss.identity.idm.spi.model.IdentityObject (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: org.jboss.identity.idm/idm-core

protected boolean hasIdentityObject(IdentityStoreInvocationContext ctx, IdentityStore is, IdentityObject io) throws IdentityException
{
 try
 {
   if (is.findIdentityObject(ctx, io.getName(), io.getIdentityType()) != null)
   {
    return true;
   }
 }
 catch (IdentityException e)
 {
   //store may throw exception if there is no identity so do nothing
   //TODO: should have isIdentityPresent method
    }
 return false;
}
origin: org.jboss.identity.idm/idm-core

IdentityStore resolveIdentityStore(IdentityObject io) throws IdentityException
{
 return resolveIdentityStore(io.getIdentityType());
}
origin: org.jboss.identity.idm/idm-core

  public int compare(IdentityObject o1, IdentityObject o2)
  {
   if (ascending)
   {
     return o1.getName().compareTo(o2.getName());
   }
   else
   {
     return o2.getName().compareTo(o1.getName());
   }
  }
});
origin: org.jboss.identity.idm/idm-hibernate

public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext ctx, IdentityObject identity) throws IdentityException
{
 HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
 Set<HibernateIdentityObjectAttribute> storeAttributes =  hibernateObject.getAttributes();
 Map<String, IdentityObjectAttribute> result = new HashMap<String, IdentityObjectAttribute>();
 // Remap the names
 for (HibernateIdentityObjectAttribute attribute : storeAttributes)
 {
   String name = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), attribute.getName());
   if (name != null)
   {
    result.put(name, attribute);
   }
 }
 return result;
}
origin: org.jboss.identity.idm/idm-core

protected User createUser(IdentityObject identityObject)
{
 return new SimpleUser(identityObject.getName());
}
origin: org.jboss.identity.idm/idm-core

  public Map<String, IdentityObjectAttribute> getAttributes(IdentityStoreInvocationContext invocationContext,
                               IdentityObject identity) throws IdentityException
  {
   Map<String, IdentityObjectAttribute> results = cacheSupport.getAttributesFromCache(identity.getName(), identity.getIdentityType());

   if (results == null)
   {
     results = attributeStore.getAttributes(invocationContext, identity);

     if (results != null && results.size() > 0)
     {
      //TODO:FIXME
//            cacheSupport.putIntoCache(identity, results);
     }
   }

   return results;
  }

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

public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext ctx, IdentityObject identity, String name) throws IdentityException
{
 HibernateIdentityObject hibernateObject = safeGet(ctx, identity);
 Set<HibernateIdentityObjectAttribute> storeAttributes =  hibernateObject.getAttributes();
 // Remap the names
 for (HibernateIdentityObjectAttribute attribute : storeAttributes)
 {
   String mappedName = resolveAttributeNameFromStoreMapping(identity.getIdentityType(), name);
   if (mappedName != null)
   {
    return attribute;
   }
 }
 return null;
}
origin: org.jboss.identity.idm/idm-core

public IdentityObjectAttribute getAttribute(IdentityStoreInvocationContext invocationContext,
                      IdentityObject identity,
                      String name) throws IdentityException
{
 Map<String, IdentityObjectAttribute> results = cacheSupport.getAttributesFromCache(identity.getName(), identity.getIdentityType());
 if (results != null && results.containsKey(name))
 {
   return results.get(name);
 }
 else
 {
   return attributeStore.getAttribute(invocationContext, identity, name);
   //TODO: add this attribute to the node map
 }
}
origin: org.jboss.identity.idm/idm-core

Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());
Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
for (String name : leftAttrs)
origin: org.jboss.identity.idm/idm-hibernate

private HibernateIdentityObject getHibernateIdentityObject(IdentityStoreInvocationContext ctx, IdentityObject io) throws IdentityException
{
 HibernateIdentityObject hibernateObject = null;
 Session hibernateSession = getHibernateSession(ctx);
 try
 {
   hibernateObject = (HibernateIdentityObject)hibernateSession.createQuery(HibernateIdentityObject.findIdentityObjectByNameAndType)
    .setParameter("name", io.getName())
    .setParameter("typeName", io.getIdentityType().getName())
    .setParameter("realm", getRealm(hibernateSession, ctx))
    .uniqueResult();
 }
 catch (Exception e)
 {
   throw new IdentityException("IdentityObject[ " + io.getName() + " | " + io.getIdentityType().getName() + "] not present in the store.", e);
 }
 return hibernateObject;
}
origin: org.jboss.identity.idm/idm-core

public void removeIdentityObject(IdentityStoreInvocationContext invocationCtx,
                IdentityObject identity) throws IdentityException
{
 identityStore.removeIdentityObject(invocationCtx, identity);
 cacheSupport.removeFromCache(identity);
 cacheSupport.invalidateCachedIdentityObjectSearches(identity);
 cacheSupport.invalidateCachedIdentityObjectCount(identity.getIdentityType());
}
origin: org.jboss.identity.idm/idm-core

protected Group createGroup(IdentityObject identityObject)
{
 String groupType = getSessionContext().getIdentityObjectTypeMapper().getGroupType(identityObject.getIdentityType());
 return new SimpleGroup(identityObject.getName(), groupType);
}
origin: org.jboss.identity.idm/idm-hibernate

String name = resolveAttributeStoreMapping(identity.getIdentityType(), attributes[i]);
mappedAttributes[i] = name;
Map<String, IdentityObjectAttributeMetaData> mdMap = attributesMetaData.get(identity.getIdentityType().getName());
origin: org.jboss.identity.idm/idm-core

public void removeRelationships(IdentityStoreInvocationContext invocationCtx, IdentityObject identity1, IdentityObject identity2, boolean named) throws IdentityException
{
 IdentityStore fromStore = resolveIdentityStore(identity1);
 IdentityStore toStore = resolveIdentityStore(identity2);
 IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCtx);
 IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCtx);
 if (fromStore == toStore)
 {
   fromStore.removeRelationships(toTargetCtx, identity1, identity2, named);
   return;
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity1))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity1.getName(),  identity1.getIdentityType());
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, identity2))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, identity2.getName(),  identity2.getIdentityType());
 }
 defaultIdentityStore.removeRelationships(defaultTargetCtx, identity1, identity2, named);
}
origin: org.jboss.identity.idm/idm-core

public Map<String, AttributeDescription> getSupportedAttributesDescriptions(IdentityType identityType)
{
 checkNotNullArgument(identityType, "IdentityType");
 Map<String, IdentityObjectAttributeMetaData> mdMap =
   getRepository().getAttributesMetaData(getInvocationContext(), createIdentityObject(identityType).getIdentityType());
 Map<String, AttributeDescription> descriptionMap = new HashMap<String, AttributeDescription>();
 if (mdMap != null)
 {
   for (IdentityObjectAttributeMetaData attributeMD : mdMap.values())
   {
    if (attributeMD instanceof AttributeDescription)
    {
      descriptionMap.put(attributeMD.getName(), (AttributeDescription)attributeMD);
    }
    else
    {
      descriptionMap.put(attributeMD.getName(), new IdentityObjectAttributeMetaDataImpl(attributeMD));
    }
   }
 }
 return descriptionMap;
}
origin: org.jboss.identity.idm/idm-core

public IdentityObjectRelationship createRelationship(IdentityStoreInvocationContext invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType relationshipType, String relationshipName, boolean createNames) throws IdentityException
{
 IdentityStore fromStore = resolveIdentityStore(fromIdentity);
 IdentityStore toStore = resolveIdentityStore(toIdentity);
 IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt);
 IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt);
 if (fromStore == toStore)
 {
   // If relationship is named and target store doesn't support named relationships it need to be put in default store anyway
   if (relationshipName == null ||
    (relationshipName != null && fromStore.getSupportedFeatures().isNamedRelationshipsSupported()))
   {
    return fromStore.createRelationship(toTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName, createNames);
   }
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(),  fromIdentity.getIdentityType());
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(),  toIdentity.getIdentityType());
 }
 return defaultIdentityStore.createRelationship(defaultTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName, createNames);
}
origin: org.jboss.identity.idm/idm-core

public Collection<Group> findAssociatedGroups(User user, IdentitySearchCriteria criteria) throws IdentityException
{
 checkNotNullArgument(user, "User");
 List<Group> identities = new LinkedList<Group>();
 Collection<IdentityObject> ios = getRepository().findIdentityObject(getInvocationContext(), createIdentityObject(user), MEMBER, false, convertSearchControls(criteria));
 String userTypeName = getUserObjectType().getName();
 for (IdentityObject io : ios)
 {
   // Filter out users
   if (!io.getIdentityType().getName().equals(userTypeName))
    identities.add(createGroup(io));
 }
 return identities;
}
origin: org.jboss.identity.idm/idm-core

public void removeRelationship(IdentityStoreInvocationContext invocationCxt, IdentityObject fromIdentity, IdentityObject toIdentity, IdentityObjectRelationshipType relationshipType, String relationshipName) throws IdentityException
{
 IdentityStore fromStore = resolveIdentityStore(fromIdentity);
 IdentityStore toStore = resolveIdentityStore(toIdentity);
 IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt);
 IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt);
 if (fromStore == toStore)
 {
   if (relationshipName == null ||
    (relationshipName != null && fromStore.getSupportedFeatures().isNamedRelationshipsSupported()))
   {
    fromStore.removeRelationship(toTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName);
    return;
   }
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(),  fromIdentity.getIdentityType());
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(),  toIdentity.getIdentityType());
 }
 defaultIdentityStore.removeRelationship(defaultTargetCtx, fromIdentity, toIdentity, relationshipType, relationshipName);
}
origin: org.jboss.identity.idm/idm-core

Set<String> supportedAttrs = toStore.getSupportedAttributeNames(targetCtx, identity.getIdentityType());
Set<String> supportedAttrs = defaultAttributeStore.getSupportedAttributeNames(defaultCtx, identity.getIdentityType());
for (IdentityObjectAttribute entry : attributesToAdd)
origin: org.jboss.identity.idm/idm-core

public Set<IdentityObjectRelationship> resolveRelationships(IdentityStoreInvocationContext invocationCxt,
                              IdentityObject fromIdentity,
                              IdentityObject toIdentity,
                              IdentityObjectRelationshipType relationshipType) throws IdentityException
{
 IdentityStore fromStore = resolveIdentityStore(fromIdentity);
 IdentityStore toStore = resolveIdentityStore(toIdentity);
 IdentityStoreInvocationContext toTargetCtx = resolveInvocationContext(toStore, invocationCxt);
 IdentityStoreInvocationContext defaultTargetCtx = resolveInvocationContext(defaultIdentityStore, invocationCxt);
 if (fromStore == toStore &&
   (!RoleManagerImpl.ROLE.getName().equals(relationshipType.getName()) ||
   fromStore.getSupportedFeatures().isNamedRelationshipsSupported()))
 {
   return fromStore.resolveRelationships(toTargetCtx, fromIdentity, toIdentity, relationshipType);
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, fromIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, fromIdentity.getName(),  fromIdentity.getIdentityType());
 }
 if (!hasIdentityObject(defaultTargetCtx, defaultIdentityStore, toIdentity))
 {
   defaultIdentityStore.createIdentityObject(defaultTargetCtx, toIdentity.getName(),  toIdentity.getIdentityType());
 }
 return defaultIdentityStore.resolveRelationships(defaultTargetCtx, fromIdentity, toIdentity, relationshipType);
}
org.jboss.identity.idm.spi.modelIdentityObject

Most used methods

  • getIdentityType
  • getName

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • putExtra (Intent)
  • startActivity (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now