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

java.lang.Object
  extended by com.microsoft.tfs.core.clients.webservices.IdentityManagementService
All Implemented Interfaces:
IIdentityManagementService
Direct Known Subclasses:
IdentityManagementService2

public class IdentityManagementService
extends java.lang.Object
implements IIdentityManagementService

A client for the TFS 2012 _IdentityManagementWebServiceSoap.

Unlike the VS implementation, it does not support pre-TFS 2010 servers.

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

Constructor Summary
IdentityManagementService(TFSConnection connection)
           
 
Method Summary
 void addMemberToApplicationGroup(IdentityDescriptor groupDescriptor, IdentityDescriptor descriptor)
          Add member to TFS Group.
 IdentityDescriptor createApplicationGroup(java.lang.String projectUri, java.lang.String groupName, java.lang.String groupDescription)
          Creates a TFS application group
 void deleteApplicationGroup(IdentityDescriptor groupDescriptor)
          Deletes a TFS application group
 java.lang.String getIdentityDomainScope()
           
static java.lang.String getIdentityDomainScope(com.microsoft.tfs.util.GUID hostID)
           
 java.lang.String getScopeName(java.lang.String scopeId)
          Gets the scope name for the provided scope id.
 boolean isMember(IdentityDescriptor groupDescriptor, IdentityDescriptor descriptor)
          Expanded membership query for direct or nested member.
 boolean isOwnedWellKnownGroup(IdentityDescriptor descriptor)
          Check if the given descriptor is of TeamFoundation type, belongs to this IMS host and is a well-known group.
 boolean isOwner(IdentityDescriptor descriptor)
          Check if the given descriptor is of TeamFoundation type, and belongs to this IMS host.
 TeamFoundationIdentity[] listApplicationGroups(java.lang.String projectUri, ReadIdentityOptions readOptions)
          Lists all TFS application groups within the specified scope
 TeamFoundationIdentity[] readIdentities(com.microsoft.tfs.util.GUID[] teamFoundationIds, MembershipQuery queryMembership)
          Read identities by Team Foundation Id.
 TeamFoundationIdentity[] readIdentities(IdentityDescriptor[] descriptors, MembershipQuery queryMembership, ReadIdentityOptions readOptions)
          Read identities for given descriptors.
 TeamFoundationIdentity[][] readIdentities(IdentitySearchFactor searchFactor, java.lang.String[] factorValues, MembershipQuery queryMembership, ReadIdentityOptions readOptions)
          Read identities based on search factor.
 TeamFoundationIdentity readIdentity(IdentityDescriptor descriptor, MembershipQuery queryMembership, ReadIdentityOptions readOptions)
          Overload that takes a single descriptor.
 TeamFoundationIdentity readIdentity(IdentitySearchFactor searchFactor, java.lang.String factorValue, MembershipQuery queryMembership, ReadIdentityOptions readOptions)
          Overload that takes a single search factor and returns match following this order.
 boolean refreshIdentity(IdentityDescriptor descriptor)
          Refresh identity properties from provider now.
 void removeMemberFromApplicationGroup(IdentityDescriptor groupDescriptor, IdentityDescriptor descriptor)
          Remove member from TFS Group.
 void updateApplicationGroup(IdentityDescriptor groupDescriptor, GroupProperty property, java.lang.String newValue)
          Updates a property of a TFS application group
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityManagementService

public IdentityManagementService(TFSConnection connection)
Method Detail

getIdentityDomainScope

public static java.lang.String getIdentityDomainScope(com.microsoft.tfs.util.GUID hostID)

readIdentities

public TeamFoundationIdentity[] readIdentities(IdentityDescriptor[] descriptors,
                                               MembershipQuery queryMembership,
                                               ReadIdentityOptions readOptions)
Description copied from interface: IIdentityManagementService
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 IIdentityManagementService
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)
Description copied from interface: IIdentityManagementService
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 IIdentityManagementService
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)
Description copied from interface: IIdentityManagementService
Read identities by Team Foundation Id. Note - performance will be fastest when no membership information is requested.

Specified by:
readIdentities in interface IIdentityManagementService
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[] factorValues,
                                                 MembershipQuery queryMembership,
                                                 ReadIdentityOptions readOptions)
Description copied from interface: IIdentityManagementService
Read identities based on search factor. First read from IMS store, then (optionally) read from source like AD.

Specified by:
readIdentities in interface IIdentityManagementService
Parameters:
searchFactor - how search is specified (by account name, etc.)
factorValues - 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 factorValue,
                                           MembershipQuery queryMembership,
                                           ReadIdentityOptions readOptions)
Description copied from interface: IIdentityManagementService
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 IIdentityManagementService
Parameters:
searchFactor - how search is specified (by account name, etc.)
factorValue - 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

createApplicationGroup

public IdentityDescriptor createApplicationGroup(java.lang.String projectUri,
                                                 java.lang.String groupName,
                                                 java.lang.String groupDescription)
Description copied from interface: IIdentityManagementService
Creates a TFS application group

Specified by:
createApplicationGroup in interface IIdentityManagementService
Parameters:
projectUri - Scope Uri, specifying whether group scope is project level or global to this host. Null or empty value signifies global scope
groupName - name
groupDescription - description. can be null
Returns:
IdentityDescriptor of the created group

listApplicationGroups

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

Specified by:
listApplicationGroups in interface IIdentityManagementService
Parameters:
projectUri - Scope Uri, specifying whether group scope is project level or global to this host. Null or empty value signifies global scope
readOptions - read options
Returns:
Application groups as an array of identities

getScopeName

public java.lang.String getScopeName(java.lang.String scopeId)
Description copied from interface: IIdentityManagementService
Gets the scope name for the provided scope id.

Specified by:
getScopeName in interface IIdentityManagementService
Parameters:
scopeId - scope id, which is the project or domain Uri
Returns:
The scope name.

updateApplicationGroup

public void updateApplicationGroup(IdentityDescriptor groupDescriptor,
                                   GroupProperty property,
                                   java.lang.String newValue)
Description copied from interface: IIdentityManagementService
Updates a property of a TFS application group

Specified by:
updateApplicationGroup in interface IIdentityManagementService
property - which property to update
newValue - the new value for the property

deleteApplicationGroup

public void deleteApplicationGroup(IdentityDescriptor groupDescriptor)
Description copied from interface: IIdentityManagementService
Deletes a TFS application group

Specified by:
deleteApplicationGroup in interface IIdentityManagementService
Parameters:
groupDescriptor - groupDescriptor

addMemberToApplicationGroup

public void addMemberToApplicationGroup(IdentityDescriptor groupDescriptor,
                                        IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Add member to TFS Group.

Specified by:
addMemberToApplicationGroup in interface IIdentityManagementService
Parameters:
groupDescriptor - groupDescriptor
descriptor - member

removeMemberFromApplicationGroup

public void removeMemberFromApplicationGroup(IdentityDescriptor groupDescriptor,
                                             IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Remove member from TFS Group.

Specified by:
removeMemberFromApplicationGroup in interface IIdentityManagementService
Parameters:
groupDescriptor - groupDescriptor
descriptor - member

isMember

public boolean isMember(IdentityDescriptor groupDescriptor,
                        IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Expanded membership query for direct or nested member.

Specified by:
isMember in interface IIdentityManagementService
Parameters:
groupDescriptor - group
descriptor - member

refreshIdentity

public boolean refreshIdentity(IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Refresh identity properties from provider now. This identity must already be in the IMS store. If identity is a group, its DIRECT members and their properties will also be refreshed (asynchronously).

Identity properties, such as display name, are synced from the provider over a 24h cylce, by default. Use this API to sync now.

Specified by:
refreshIdentity in interface IIdentityManagementService
Parameters:
descriptor - identity specification. Null implies caller
Returns:
True if identity is in IMS (in which case will be refreshed now), else false.

isOwner

public boolean isOwner(IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Check if the given descriptor is of TeamFoundation type, and belongs to this IMS host. This does not confirm that such a group actually exists, just that the Sid pattern belongs to this host.

Specified by:
isOwner in interface IIdentityManagementService
Returns:
True if owner, else false.

isOwnedWellKnownGroup

public boolean isOwnedWellKnownGroup(IdentityDescriptor descriptor)
Description copied from interface: IIdentityManagementService
Check if the given descriptor is of TeamFoundation type, belongs to this IMS host and is a well-known group. This does not confirm that such a group actually exists, just that the Sid pattern meets these requirements.

Specified by:
isOwnedWellKnownGroup in interface IIdentityManagementService
Returns:
True if owned and is well-known group.

getIdentityDomainScope

public java.lang.String getIdentityDomainScope()
Specified by:
getIdentityDomainScope in interface IIdentityManagementService
Returns:
Return the Scope Uri for global Groups in the domain


© 2015 Microsoft. All rights reserved.