com.microsoft.tfs.core.clients.webservices
Class IdentityManagementService2

java.lang.Object
  extended by com.microsoft.tfs.core.clients.webservices.IdentityManagementService
      extended by com.microsoft.tfs.core.clients.webservices.IdentityManagementService2
All Implemented Interfaces:
IIdentityManagementService, IIdentityManagementService2

public class IdentityManagementService2
extends IdentityManagementService
implements IIdentityManagementService2

A client for the TFS 2012 IdentityManagementService2.

Since:
TEE-SDK-11.0
Thread-safety:
thread-compatible

Constructor Summary
IdentityManagementService2(TFSConnection connection)
           
 
Method Summary
 void addRecentUser(TeamFoundationIdentity identity)
          Adds the specified identity to MRU list of users for the current user.
 void clearCustomDisplayName()
          Clears the custom display name for the current user, returning to using the display name from the external identity provider (Active Directory, Live, etc).
 TeamFoundationIdentity[] getMostRecentlyUsedUsers()
          Get the set of identities which have been recently accessed by the current user
 boolean isSupported()
           
 TeamFoundationIdentity[] listApplicationGroups(java.lang.String scopeId, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Lists all TFS application groups within the specified scope
 FilteredIdentitiesList readFilteredIdentities(java.lang.String expression, int suggestedPageSize, java.lang.String lastSearchResult, boolean lookForward, int queryMembership)
          ReadFilteredIdentities is used to retrieve a set of identities based on an expression.
 TeamFoundationIdentity[] readIdentities(com.microsoft.tfs.util.GUID[] teamFoundationIds, MembershipQuery queryMembership, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Read identities by Team Foundation Id.
 TeamFoundationIdentity[] readIdentities(IdentityDescriptor[] descriptors, MembershipQuery queryMembership, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Read identities for given descriptors.
 TeamFoundationIdentity[][] readIdentities(IdentitySearchFactor searchFactor, java.lang.String[] searchFactorValues, MembershipQuery queryMembership, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Read identities based on search factor.
 TeamFoundationIdentity readIdentity(IdentityDescriptor descriptor, MembershipQuery queryMembership, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Overload that takes a single descriptor.
 TeamFoundationIdentity readIdentity(IdentitySearchFactor searchFactor, java.lang.String searchFactorValue, MembershipQuery queryMembership, ReadIdentityOptions readOptions, java.lang.String[] propertyNameFilters, IdentityPropertyScope propertyScope)
          Overload that takes a single search factor and returns match following this order.
 TeamFoundationIdentity readIdentity(java.lang.String generalSearchValue)
          Read an identity using the General search factor.
 void setCustomDisplayName(java.lang.String customDisplayName)
          Sets the display name for the current user in a sticky manner, overriding any display name returned by an external identity provider (Active Directory, Live, etc).
 void updateExtendedProperties(TeamFoundationIdentity identity)
          Save changes to extended properties.
 
Methods inherited from class com.microsoft.tfs.core.clients.webservices.IdentityManagementService
addMemberToApplicationGroup, createApplicationGroup, deleteApplicationGroup, getIdentityDomainScope, getIdentityDomainScope, getScopeName, isMember, isOwnedWellKnownGroup, isOwner, listApplicationGroups, readIdentities, readIdentities, readIdentities, readIdentity, readIdentity, refreshIdentity, removeMemberFromApplicationGroup, updateApplicationGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.microsoft.tfs.core.clients.webservices.IIdentityManagementService
addMemberToApplicationGroup, createApplicationGroup, deleteApplicationGroup, getIdentityDomainScope, getScopeName, isMember, isOwnedWellKnownGroup, isOwner, listApplicationGroups, readIdentities, readIdentities, readIdentities, readIdentity, readIdentity, refreshIdentity, removeMemberFromApplicationGroup, updateApplicationGroup
 

Constructor Detail

IdentityManagementService2

public IdentityManagementService2(TFSConnection connection)
Method Detail

isSupported

public boolean isSupported()

getMostRecentlyUsedUsers

public TeamFoundationIdentity[] getMostRecentlyUsedUsers()
Description copied from interface: IIdentityManagementService2
Get the set of identities which have been recently accessed by the current user

Specified by:
getMostRecentlyUsedUsers in interface IIdentityManagementService2

addRecentUser

public void addRecentUser(TeamFoundationIdentity identity)
Description copied from interface: IIdentityManagementService2
Adds the specified identity to MRU list of users for the current user.

Specified by:
addRecentUser in interface IIdentityManagementService2

readFilteredIdentities

public FilteredIdentitiesList readFilteredIdentities(java.lang.String expression,
                                                     int suggestedPageSize,
                                                     java.lang.String lastSearchResult,
                                                     boolean lookForward,
                                                     int queryMembership)
Description copied from interface: IIdentityManagementService2
ReadFilteredIdentities is used to retrieve a set of identities based on an expression. The expression is a syntax that resembles a SQL WHERE clause. For full details on the expressions capabilities see documentation on the QueryExpression class.

Specified by:
readFilteredIdentities in interface IIdentityManagementService2
Returns:

readIdentity

public TeamFoundationIdentity readIdentity(java.lang.String generalSearchValue)
Description copied from interface: IIdentityManagementService2
Read an identity using the General search factor.

Equivalent to ReadIdentity(IdentitySearchFactor.General, generalSearchValue, MembershipQuery.None, ReadIdentityOptions.None).

You can use this to find an identity by one of the following properties:

UniqueName may be easier to type than display name. It can also be used to find a single identity when two or more identities share the same display name (e.g. "John Smith")

Specified by:
readIdentity in interface IIdentityManagementService2
Parameters:
generalSearchValue - The search string
Returns:

listApplicationGroups

public TeamFoundationIdentity[] listApplicationGroups(java.lang.String scopeId,
                                                      ReadIdentityOptions readOptions,
                                                      java.lang.String[] propertyNameFilters,
                                                      IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Lists all TFS application groups within the specified scope

Specified by:
listApplicationGroups in interface IIdentityManagementService2
Parameters:
scopeId - Scope Uri, specifying whether group scope is project level or global to this host. Null or empty value signifies global scope
readOptions - read options
propertyNameFilters - extended properties to retrieve with application groups
propertyScope - indicates where to read extended properties from
Returns:
Application groups as an array of identities

setCustomDisplayName

public void setCustomDisplayName(java.lang.String customDisplayName)
Description copied from interface: IIdentityManagementService2
Sets the display name for the current user in a sticky manner, overriding any display name returned by an external identity provider (Active Directory, Live, etc).

TFS 2010 would automatically disambiguate users with the same display name by appending the domain and account name. TFS 2012 does not disambiguate display names. SetCustomDisplayName can be used instead to make a display name unique.

"John Q. Smith, Sr."

"John Smith (Contoso, Human Resources)"

Specified by:
setCustomDisplayName in interface IIdentityManagementService2
Parameters:
customDisplayName - The new display name

clearCustomDisplayName

public void clearCustomDisplayName()
Description copied from interface: IIdentityManagementService2
Clears the custom display name for the current user, returning to using the display name from the external identity provider (Active Directory, Live, etc).

Specified by:
clearCustomDisplayName in interface IIdentityManagementService2

readIdentities

public TeamFoundationIdentity[] readIdentities(IdentityDescriptor[] descriptors,
                                               MembershipQuery queryMembership,
                                               ReadIdentityOptions readOptions,
                                               java.lang.String[] propertyNameFilters,
                                               IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Read identities for given descriptors. First try IMS store. If not found, optionally try source like AD. Note - performance will be fastest when no membership information is requested.

Specified by:
readIdentities in interface IIdentityManagementService2
Parameters:
descriptors - descriptors (descriptor is identity type + identifier)
queryMembership - none, direct or expanded membership information
readOptions - read options, such as reading from source
Returns:
Array of identities, corresponding 1 to 1 with input descriptor array

readIdentity

public TeamFoundationIdentity readIdentity(IdentityDescriptor descriptor,
                                           MembershipQuery queryMembership,
                                           ReadIdentityOptions readOptions,
                                           java.lang.String[] propertyNameFilters,
                                           IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Overload that takes a single descriptor. Read identity for given descriptor. First try IMS store. If not found, optionally try source like AD. Note - performance will be fastest when no membership information is requested.

Specified by:
readIdentity in interface IIdentityManagementService2
Parameters:
descriptor - identity type + identifier
queryMembership - none, direct or expanded membership information
readOptions - read options, such as reading from source
Returns:
identity if found, else null

readIdentities

public TeamFoundationIdentity[] readIdentities(com.microsoft.tfs.util.GUID[] teamFoundationIds,
                                               MembershipQuery queryMembership,
                                               ReadIdentityOptions readOptions,
                                               java.lang.String[] propertyNameFilters,
                                               IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Read identities by Team Foundation Id. Note - performance will be fastest when no membership information is requested.

Specified by:
readIdentities in interface IIdentityManagementService2
Parameters:
teamFoundationIds - identity ids
queryMembership - none, direct or expanded membership information
Returns:
Array of identities, corresponding 1 to 1 with input array

readIdentities

public TeamFoundationIdentity[][] readIdentities(IdentitySearchFactor searchFactor,
                                                 java.lang.String[] searchFactorValues,
                                                 MembershipQuery queryMembership,
                                                 ReadIdentityOptions readOptions,
                                                 java.lang.String[] propertyNameFilters,
                                                 IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Read identities based on search factor. First read from IMS store, then (optionally) read from source like AD.

Specified by:
readIdentities in interface IIdentityManagementService2
Parameters:
searchFactor - how search is specified (by account name, etc.)
searchFactorValues - actual search strings (account names, etc.)
queryMembership - none, direct or expanded membership information
readOptions - readOptions, such as reading from source
Returns:
Arrays of identities. Inner array corresponds 1 to 1 with search factor values

readIdentity

public TeamFoundationIdentity readIdentity(IdentitySearchFactor searchFactor,
                                           java.lang.String searchFactorValue,
                                           MembershipQuery queryMembership,
                                           ReadIdentityOptions readOptions,
                                           java.lang.String[] propertyNameFilters,
                                           IdentityPropertyScope propertyScope)
Description copied from interface: IIdentityManagementService2
Overload that takes a single search factor and returns match following this order.
  1. With multiple matches, active identity if exists, else first match.
  2. When there is a single match, the match.
  3. When there is no match, null.
Read identity based on search factor. First read from IMS store, then (optionally) read from source like AD.

Specified by:
readIdentity in interface IIdentityManagementService2
Parameters:
searchFactor - how search is specified (by account name, etc.)
searchFactorValue - actual search string (account name, etc.)
queryMembership - none, direct or expanded membership information
readOptions - readOptions, such as reading from source
Returns:
Array of matching identities

updateExtendedProperties

public void updateExtendedProperties(TeamFoundationIdentity identity)
Description copied from interface: IIdentityManagementService2
Save changes to extended properties.

Specified by:
updateExtendedProperties in interface IIdentityManagementService2
Parameters:
identity - Identity with extended property changes


© 2015 Microsoft. All rights reserved.