com.evolveum.midpoint.schema.util
Class UserTypeUtil

java.lang.Object
  extended by com.evolveum.midpoint.schema.util.UserTypeUtil

public class UserTypeUtil
extends java.lang.Object

Utility class for easier manipulation of UserType. This exists because UserType is generated from XML (JAXB) and it is not practical to add methods there. So the methods that should be in UserType are here. Ugly, but work.

Author:
semancik

Constructor Summary
UserTypeUtil()
           
 
Method Summary
static ObjectReferenceType findAccountRef(UserType user, java.lang.String resourceOid)
          Returns accountRef for supplied OID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserTypeUtil

public UserTypeUtil()
Method Detail

findAccountRef

public static ObjectReferenceType findAccountRef(UserType user,
                                                 java.lang.String resourceOid)
Returns accountRef for supplied OID. If there is appopriate account object, it will get converted to the reference and returned as well. So this may be used to check if user has an account already.

Parameters:
oid - OID of resource to look up in user accounts (must no be null)
Returns:
object reference describing the appropriate accountRef or account, null if nothing was found
Throws:
java.lang.IllegalStateException - if more than one reference exists for a resource


Copyright © 2011 evolveum. All Rights Reserved.