Package wt.org

Interface OrganizationServicesManager

All Known Implementing Classes:
StandardOrganizationServicesManager

@RemoteInterface public interface OrganizationServicesManager
This interface provides API definitions to manage participants in LDAP and database.

Supported API: true

Extendable: false
  • Method Details

    • getPrincipal

      WTPrincipal getPrincipal(ObjectIdentifier reference) throws WTException
      Gets the user or group for the specified principal reference.

      Supported API: true
      Parameters:
      reference -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • getPrincipal

      Enumeration getPrincipal(String name, DirectoryContextProvider context) throws WTException
      This method will search for principals with the given name in the given organization.

      Supported API: true
      Parameters:
      name -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • getPrincipal

      WTPrincipal getPrincipal(String name, Class type, DirectoryContextProvider context) throws WTException
      This method will search for a principal with the given name in the given organization. If more than one principal is found, an exception is thrown.

      Supported API: true
      Parameters:
      name -
      type -
      context -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • getPrincipalByDN

      WTPrincipal getPrincipalByDN(String dn) throws WTException
      Returns the principal identified by a specific LDAP distinguished name, or null if no such principal exists.

      If a principal is not found in LDAP, nothing is returned.
      If a principal is found in LDAP but not in the database, this creates a new entry in the database and returns the principal with both LDAP and database values populated.
      If a principal is found in LDAP and in the database, this returns the principal with both LDAP and database values populated.

      Supported API: true
      Parameters:
      dn -
      Returns:
      WTPrincipal
      Throws:
      WTException
      See Also:
    • getPrincipalReference

      Enumeration getPrincipalReference(String name, DirectoryContextProvider context) throws WTException
      This method will search for principals with the given name in the given organization, and references to them will be returned.

      Supported API: true
      Parameters:
      name -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • getPrincipalReference

      WTPrincipalReference getPrincipalReference(String name, Class type, DirectoryContextProvider context) throws WTException
      Returns a reference to a principal, given the name, Class type and DirectoryContextProvider. If more than one principal is found, an exception is thrown.

      Supported API: true
      Parameters:
      name -
      type -
      context -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • getPrincipalReference

      WTPrincipalReference getPrincipalReference(String name, Class type) throws WTException
      Returns a reference to a principal, given the name and Class type. If more than one principal is found, an exception is thrown.

      Supported API: true
      Parameters:
      name -
      type -
      Returns:
      WTPrincipalReference
      Throws:
      WTException
    • queryPrincipals

      Enumeration queryPrincipals(Class principalClass, Map<String,List<String>> criteriaMap, DirectoryContextProvider context) throws WTException


      Supported API: true
      Parameters:
      principalClass -
      criteriaMap -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • queryPrincipals

      Enumeration queryPrincipals(Class principalClass, Map<String,List<String>> criteriaMap) throws WTException


      Supported API: true
      Parameters:
      principalClass -
      criteria -
      Returns:
      Enumeration
      Throws:
      WTException
    • queryPrincipals

      Enumeration queryPrincipals(Class principalClass, Map<String,List<String>> criteriaMap, DirectoryContextProvider[] contexts) throws WTException


      Supported API: true
      Parameters:
      principalClass -
      criteriaMap -
      contexts -
      Returns:
      Enumeration
      Throws:
      WTException
    • createPrincipal

      WTPrincipal createPrincipal(WTPrincipal principal) throws WTException
      This API persists the principal object in the database. In addition it also creates a corresponding entry in LDAP if necessary.

      Supported API: true
      Parameters:
      principal -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • disablePrincipal

      WTPrincipal disablePrincipal(WTPrincipal principal) throws WTException
      This API is used to disable a principal in the database. When a principal is deleted, it is not completely removed from the database. Instead it is disabled in the database. The process of disabling the principal object is by renaming the principal in the database to its object identifier and setting the disabled bit.

      Supported API: true
      Parameters:
      principal -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • enablePrincipal

      WTPrincipal enablePrincipal(WTPrincipal principal) throws WTException
      This API is used to enable a previously disabled principal. The API renames the principal in the database from the current object identifier name to the actual name of the principal that needs to be displayed on the UI. In addition it also resets the disabled bit in the database. NOTE: This API does not recreate a previously deleted entry in LDAP corresponding to this principal. The API should only be used to enable the database entry for the principal after verifying that a corresponding entry for the principal exists in LDAP. Once the principal is enabled, the Principal Administrator maintenance page should be used to reconnect the principal to the corresponding LDAP node.

      Supported API: true
      Parameters:
      principal -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • updatePrincipal

      WTPrincipal updatePrincipal(WTPrincipal principal) throws WTException


      Supported API: true
      Parameters:
      principal -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • rename

      WTPrincipal rename(WTPrincipal principal, String newName) throws WTException


      Supported API: true
      Parameters:
      principal -
      newName -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • move

      WTPrincipal move(WTPrincipal principal, DirectoryContextProvider newContext) throws WTException


      Supported API: true
      Parameters:
      principal -
      newContext -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • getAuthenticatedUser

      WTUser getAuthenticatedUser(String auth_name) throws WTException


      Supported API: true
      Parameters:
      auth_name -
      Returns:
      WTUser
      Throws:
      WTException
    • getUser

      WTUser getUser(String name) throws WTException
      Gets the first user matched with the name passed as argument. Returns null if there is no such user.

      Supported API: true
      Parameters:
      name -
      Returns:
      WTUser
      Throws:
      WTException
    • getUser

      WTUser getUser(String name, DirectoryContextProvider context) throws WTException
      This API will search and return the first user whose name attribute value matches the given name in the specified DirectoryContext(s).

      A few behaviors to note:

      • All directory contexts (i.e. LDAP services) specified in the given DirectoryContextProvider will be searched
      • If the directory context provider does not identify any specific service, then all registered services will be searched
      • The search is performed on the name attribute in LDAP and an exact match is expected. If user has multiple names in LDAP (aliases, alternate names), any of those can be considered a match
      • The first matching user record will be returned. This API will NOT continue to look for additional matches
      • A user that is only as-yet in LDAP and not yet persisted in Windchill can also be found and returned by this API. The Persistence attributes of the user can be checked to determine if this is a persisted user or not
      • Since the search for a match occurs on the LDAP end, a Windchill user whose LDAP record is missing (e.g user has been disabled) or has been renamed (user is in a repair-needed state), will not be found. For the same reason, Internal users (users that are in Pending or Replicated states) will not be found, since they do not have corresponding LDAP records
      • This API makes use of caching and is suitable for repeat lookups

      Also see other related APIs that can be used to find principals, to know if there's a more suitable API: getUsers(String, DirectoryContextProvider) findLikeDisabledUsers(String) findActiveAndDisabledUsersByName(Class, String, DirectoryContextProvider[]) findUserAnyState(String) findLikeUsers(String, String, DirectoryContextProvider) getPrincipal(String, DirectoryContextProvider) getPrincipal(String, Class, DirectoryContextProvider) getPrincipalByDN(String)

      Supported API: true

      Parameters:
      name - - Name of the user
      context - - Required parameter. May not be null.
      Returns:
      WTUser - The user found, or null if none found with that name
      Throws:
      WTException
    • getUsers

      Enumeration getUsers(String name, DirectoryContextProvider context) throws WTException
      This API will search and return all users whose name attribute value matches the given name in the specified DirectoryContext(s).

      A few behaviors to note:

      • All directory contexts (i.e. LDAP services) specified in the given DirectoryContextProvider will be searched
      • If the directory context provider does not identify any specific service, then all registered services will be searched
      • The search is performed on the name attribute in LDAP and an exact match is expected. If user has multiple names in LDAP (aliases, alternate names), any of those can be considered a match
      • A user that is only as-yet in LDAP and not yet persisted in Windchill can also be found and returned by this API. The Persistence attributes of the user can be checked to determine if this is a persisted user or not
      • Since the search for a match occurs on the LDAP end, a Windchill user whose LDAP record is missing (e.g user has been disabled) or has been renamed (user is in a repair-needed state), will not be found. For the same reason, Internal users (users that are in Pending or Replicated states) will not be found, since they do not have corresponding LDAP records
      • This API makes use of caching and is suitable for repeat lookups

      Also see other related APIs that can be used to find principals, to know if there's a more suitable API: getUser(String, DirectoryContextProvider) findLikeDisabledUsers(String) findActiveAndDisabledUsersByName(Class, String, DirectoryContextProvider[]) findUserAnyState(String) findLikeUsers(String, String, DirectoryContextProvider) getPrincipal(String, DirectoryContextProvider) getPrincipal(String, Class, DirectoryContextProvider) getPrincipalByDN(String)

      Supported API: true

      Parameters:
      name - - Name of the user
      context - - Required parameter. May not be null.
      Returns:
      WTUser - The user found, or null if none found with that name
      Throws:
      WTException
    • getUsers

      Enumeration getUsers(String name) throws WTException
      This API will search and return all users whose name attribute value matches the given name

      A few behaviors to note:

      • All configured Idp services will be searched.
      • The search is performed on the name attribute in Idp and an exact match is expected. If user has multiple names in Idp (aliases, alternate names), any of those can be considered a match
      • A user that is only as-yet in Idp and not yet persisted in Windchill can also be found and returned by this API. The Persistence attributes of the user can be checked to determine if this is a persisted user or not
      • Since the search for a match occurs on the Idp end, a Windchill user whose Idp record is missing (e.g user has been disabled) or has been renamed (user is in a repair-needed state), will not be found. For the same reason, Internal users (users that are in Pending or Replicated states) will not be found, since they do not have corresponding Idp records
      • This API makes use of caching and is suitable for repeat lookups

      Also see other related APIs that can be used to find principals, to know if there's a more suitable API: getUser(String, DirectoryContextProvider) findLikeDisabledUsers(String) findActiveAndDisabledUsersByName(Class, String, DirectoryContextProvider[]) findUserAnyState(String) findLikeUsers(String, String, DirectoryContextProvider) getPrincipal(String, DirectoryContextProvider) getPrincipal(String, Class, DirectoryContextProvider) getPrincipalByDN(String)

      Supported API: true

      Parameters:
      name - - Name of the user
      Returns:
      WTUser - The user found, or null if none found with that name
      Throws:
      WTException
    • findLikeUsers

      Enumeration findLikeUsers(String attributeName, String pattern, DirectoryContextProvider context) throws WTException
      This API returns all the users matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the user name that is being searched for. The pattern would also accept a wild card search. Org services package documentation has a detailed description on how to create a DirectoryContexttProvider that needs to be passed into this API.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeUsers

      Enumeration findLikeUsers(String attributeName, String pattern) throws WTException
      This API returns all the users matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the user name that is being searched for. The pattern would also accept a wild card search.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      Returns:
      Enumeration
      Throws:
      WTException
    • findUserAnyState

      WTUser findUserAnyState(String name) throws WTException
      This API will search and return the first user whose name attribute value matches the given name. The search first occurs for an active user, and if no match is found, then for a user in a disconnected or disabled state. At any point, if a match if found, that is returned.

      A few behaviors to note:

      • All directory contexts (i.e. LDAP services) specified in the given DirectoryContextProvider will be searched
      • If the directory context provider does not identify any specific service, then all registered services will be searched
      • The search is performed on the name attribute in LDAP and an exact match is expected. If user has multiple names in LDAP (aliases, alternate names), any of those can be considered a match
      • The first matching user record will be returned. This API will NOT continue to look for additional matches
      • A user that is only as-yet in LDAP and not yet persisted in Windchill can also be found and returned by this API. The Persistence attributes of the user can be checked to determine if this is a persisted user or not
      • If no match occurs in LDAP, the database is searched for a user that is in a disconnected or disabled state
      • This API makes use of caching for the predominant case (active user) and is suitable for repeat lookups. However, if looking mainly for disconnected or disabled users, this may not be the best API choice. Check options below for more suitable APIs

      Also see other related APIs that can be used to find principals, to know if there's a more suitable API: getUser(String, DirectoryContextProvider) getUsers(String, DirectoryContextProvider) findLikeDisabledUsers(String) findActiveAndDisabledUsersByName(Class, String, DirectoryContextProvider[]) findLikeUsers(String, String, DirectoryContextProvider) getPrincipal(String, DirectoryContextProvider) getPrincipal(String, Class, DirectoryContextProvider) getPrincipalByDN(String)

      Supported API: true

      Parameters:
      name - - Name of the user
      context - - Required parameter. May not be null.
      Returns:
      WTUser - The user found, or null if none found with that name
      Throws:
      WTException
    • delete

      WTUser delete(WTUser user) throws WTException
      The API is used to delete a user object from the database and its corresponding entry in LDAP. Users are not completely deleted from the database. Instead when a user object is deleted, the correspodning user name in the database is renamed to the format of the user's object identifier and the disabled bit is set.

      Supported API: true
      Parameters:
      user -
      Returns:
      WTUser
      Throws:
      WTException
    • getGroup

      @Deprecated WTGroup getGroup(String name) throws WTException
      Deprecated.
      Gets the group with the name passed as argument. Returns null if there is no such group.

      Supported API: true
      Parameters:
      name -
      Returns:
      WTGroup
      Throws:
      WTException - {@link Deprecated. Use #getPrincipal(String name, WTContainer container, boolean persist) }
    • getGroup

      WTGroup getGroup(String name, DirectoryContextProvider context) throws WTException
      This method will search for groups whose name attribute matches the given name in the given directory context.

      Supported API: true
      Parameters:
      name -
      context -
      Returns:
      WTGroup
      Throws:
      WTException
    • getGroups

      Enumeration getGroups(String name, DirectoryContextProvider context) throws WTException


      Supported API: true
      Parameters:
      name -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • getGroups

      Enumeration getGroups(String name) throws WTException


      Supported API: true
      Parameters:
      name -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeGroups

      Enumeration findLikeGroups(String pattern, DirectoryContextProvider context) throws WTException
      This method will search the given directory context for groups whose name matches the name pattern provided. The "pattern" parameter could be something like "name=group1" or "name=g*.

      Supported API: true
      Parameters:
      pattern -
      context -
      Returns:
      Enumeration returns the groups whose name matches the pattern that is specified for name
      Throws:
      WTException
    • findLikeGroups

      Enumeration findLikeGroups(String pattern) throws WTException
      This method will search for groups whose name matches the name pattern provided. The "pattern" parameter could be something like "name=group1" or "name=g*.

      Supported API: true
      Parameters:
      pattern -
      Returns:
      Enumeration returns the groups whose name matches the pattern that is specified for name
      Throws:
      WTException
    • delete

      WTGroup delete(WTGroup group) throws WTException
      The API is used to delete a group from the database and its corresponding entry in LDAP. Groups are not completely deleted from the database. Instead when a group is deleted, the corresponding group name in the database is renamed to the format of the groups's object identifier and the disabled bit is set..

      Supported API: true
      Parameters:
      group -
      Returns:
      WTGroup
      Throws:
      WTException
    • addMember

      boolean addMember(WTGroup group, WTPrincipal principal) throws WTException, UserNotFoundException
      Adds a principal to a group. Returns 'true' if principal was successfully added to the group, 'false' otherwise.

      Supported API: true
      Parameters:
      group -
      principal -
      Returns:
      boolean
      Throws:
      WTException
      UserNotFoundException
    • addMembers

      WTPrincipal[] addMembers(WTGroup group, WTPrincipal[] principals) throws WTException
      Adds principals to a group. Returns an array containing principals that were newly added as members of the group..

      Supported API: true
      Parameters:
      group -
      principals -
      Returns:
      WTPrincipal[]
      Throws:
      WTException
    • removeMember

      boolean removeMember(WTGroup group, WTPrincipal principal) throws WTException, UserNotFoundException
      Removes a principal from a group. Returns true if principal belonged to the group, false otherwise.

      Supported API: true
      Parameters:
      group -
      principal -
      Returns:
      boolean
      Throws:
      WTException
      UserNotFoundException
    • isMember

      boolean isMember(LicenseGroups licenseGroup, WTPrincipal principal) throws WTException
      Check if this user is a member of this LicenseGroups instance.

      Supported API: true
      Parameters:
      licenseGroup - the LicenseGroups instance
      principal - the user
      Returns:
      boolean
      Throws:
      WTException
    • isMember

      boolean isMember(WTGroup group, WTPrincipal principal) throws WTException


      Supported API: true
      Parameters:
      group -
      principal -
      Returns:
      boolean
      Throws:
      WTException
    • isMember

      boolean isMember(WTPrincipalReference group, WTPrincipal principal) throws WTException


      Supported API: true
      Parameters:
      group -
      principal -
      Returns:
      boolean
      Throws:
      WTException
    • isMember

      boolean isMember(ObjectIdentifier group, WTPrincipal principal, boolean cacheUser) throws WTException


      Supported API: true
      Parameters:
      group - the ObjectIdentifier instance
      principal -
      cacheUser - Decides if the principal should be stored in cache
      Returns:
      boolean
      Throws:
      WTException
    • members

      Enumeration members(WTGroup group) throws WTException
      This API takes a set of groups and retrieves all of the direct members from the MembershipLink table. returns members in given group to reflect the user’s current membership. Enumeration the members of the given group

      Supported API: true
      Parameters:
      group -
      Returns:
      Enumeration the members of the given group
      Throws:
      WTException
    • members

      Enumeration members(WTGroup group, boolean flatten) throws WTException
      This API takes a set of groups and retrieves all of the direct members from the MembershipLink table. returns members in given group to to reflect the user’s current membership. If parameter flatten is true, it will recursively query all children or sub groups, but only return all WTUsers. If parameter flatten is false, it will return all the first level members, including WTUsers and WTGroups. Enumeration the members of the given group

      Supported API: true
      Parameters:
      group -
      flatten -
      Returns:
      Enumeration the members of the given group
      Throws:
      WTException
    • parentGroups

      @Deprecated Enumeration parentGroups(WTPrincipal principal) throws WTException
      Deprecated.


      Supported API: true
      Parameters:
      principal -
      Returns:
      Enumeration
      Throws:
      WTException
      See Also:
    • getOrganization

      WTOrganization getOrganization(WTPrincipal principal) throws WTException
      Returns the organization associated to the principal, if the organization is found and the session user has access to the organization If the organization is not found it return null. If the organization is found, but the session user does not have access to the organization, this method throws an AccessControlException

      Supported API: true
      Parameters:
      principal -
      Returns:
      WTOrganization
      Throws:
      WTException
    • getOrganization

      WTOrganization getOrganization(String name) throws WTException
      Get the organization by providing its name

      Supported API: true
      Parameters:
      name -
      Returns:
      WTOrganization
      Throws:
      WTException
    • findLikeOrganizations

      Enumeration findLikeOrganizations(String attributeName, String pattern) throws WTException
      This API returns all the organizations matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the organization name that is being searched for. The pattern would also accept a wild card search.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeOrganizations

      @Deprecated Enumeration findLikeOrganizations(String attributeName, String pattern, DirectoryContextProvider context) throws WTException
      Deprecated.
      deprecated in release 12.1
      This API returns all the organizations matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the organization name that is being searched for. The pattern would also accept a wild card search.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      context -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeOrganizations

      Enumeration findLikeOrganizations(String attributeName, String pattern, DirectoryContextProvider context, boolean querySubtree) throws WTException
      This API returns all the organizations matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the organization name that is being searched for. The pattern also accepts a wild card search. Typically organizations are stored directly in the default search base i.e. within a one level search scope of the base where organizations are searched. On some occasions, there could be a new search base that may be created as a sub node of the default search base, to hold all the organizations. In this case a subtree search scope is necessary to retrieve the organizations. So if the parameter querySubTree is set to true, it seaches with the search scope of subtree, else it searches with a default search scope of one-level.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      context -
      querySubtree -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeOrganizations

      Enumeration findLikeOrganizations(String attributeName, String pattern, DirectoryContextProvider context, boolean querySubtree, boolean applyAccessFilter) throws WTException
      This API returns all the organizations matching the name provided as a pattern. For this API the attribute name would typically be "name". The pattern would be the organization name that is being searched for. The pattern also accepts a wild card search. Typically organizations are stored directly in the default search base i.e. within a one level search scope of the base where organizations are searched. On some occasions, there could be a new search base that may be created as a sub node of the default search base, to hold all the organizations. In this case a subtree search scope is necessary to retrieve the organizations. So if the parameter querySubTree is set to true, it seaches with the search scope of subtree, else it searches with a default search scope of one-level. If the boolean value applyAccessFilter is set to true, then the only organizations that the user has access to would be returned, else all organizations that match the search criteria would be returned.

      Supported API: true
      Parameters:
      attributeName -
      pattern -
      context -
      querySubtree -
      applyAccessFilter -
      Returns:
      Enumeration
      Throws:
      WTException
    • getDirectoryServiceNames

      String[] getDirectoryServiceNames() throws WTException


      Supported API: true
      Returns:
      String []
      Throws:
      WTException
    • repairPrincipal

      WTPrincipal repairPrincipal(String oldName, String newDn, String oldEnteredDn) throws WTException
      This method tries and repairs the principal given the "oldName" (name that is currently in the database and possibly will continue to be -- ie. only the UFID has changed) and the new DN (Distinguished name in the DIrectory).

      Supported API: true
      Parameters:
      oldName -
      newDn -
      oldEnteredDn -
      Returns:
      WTPrincipal
      Throws:
      WTException
    • listOfInvalidPrincipals

      Vector listOfInvalidPrincipals() throws WTException
      This method returns a list of all principals that are disconnected in Windchill Principals are considered disconnected in Windchill if 1) The corresponding LDAP entry is missing OR 2) If the Remote information in the windchill database is missing.

      Supported API: true
      Returns:
      Vector
      Throws:
      WTException
    • newDirectoryContextProvider

      DirectoryContextProvider newDirectoryContextProvider(DirectoryContextProvider baseContext, String[] searchScopes) throws WTException


      Supported API: true
      Parameters:
      baseContext -
      searchScopes -
      Returns:
      DirectoryContextProvider
      Throws:
      WTException
    • newDirectoryContextProvider

      DirectoryContextProvider newDirectoryContextProvider(String[] services, String[] searchScopes) throws WTException


      Supported API: true
      Parameters:
      services -
      searchScopes -
      Returns:
      DirectoryContextProvider
      Throws:
      WTException
    • parentGroups

      Enumeration parentGroups(WTPrincipal principal, boolean flatten) throws WTException
      Returns groups that the argument principal is a member of. If the flatten variable is false, this will return only the immediate parent groups, otherwise all nested parent groups will be returned.

      Supported API: true
      Parameters:
      principal -
      flatten - If false, only immediate parent groups will be returned If true, all nested groups for which principal is a member will be returned, e.g. the parent groups of principal's parent groups, and the parent groups of those groups, etc.,
      Returns:
      Enumeration
      Throws:
      WTException
    • removeMembers

      boolean removeMembers(WTGroup group, WTPrincipal[] principals) throws WTException, UserNotFoundException
      Removes principals from a group. Returns true if principals belonged to the group, false otherwise.

      Supported API: true
      Parameters:
      group -
      principals -
      Returns:
      boolean
      Throws:
      WTException
      UserNotFoundException
    • findLikeActiveAndDisabledUsers

      Enumeration findLikeActiveAndDisabledUsers(Class principalClass, Map<String,List<String>> criteriaMap, DirectoryContextProvider[] contexts) throws WTException
      This API returns an enumeration containing all the active and disabled users. 'criteriaMap' parameter has info similar to criteria but in a map format which supports multiple ; separated values and quoting is not needed The "criteria" parameter in deprecated API was something like "name=user1" or email="user1@email.com". Note that this parameter must use proper quoting (like name="some user") where spaces are involved and proper escaping when special characters are involved. Org services package documentation has a detailed description on how to create a DirectoryContextProvider that needs to be passed into this API.

      Supported API: true
      Parameters:
      principalClass -
      criteriaMap -
      contexts -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeActiveAndDisabledUsers

      Enumeration findLikeActiveAndDisabledUsers(Class principalClass, Map<String,List<String>> criteriaMap) throws WTException
      This API returns an enumeration containing all the active and disabled users. 'criteriaMap' parameter has info similar to criteria but in a map format which supports multiple ; separated values and quoting is not needed The "criteria" parameter of deprecated API was something like "name=user1" or email="user1@email.com". Note that this parameter must use proper quoting (like name="some user") where spaces are involved and proper escaping when special characters are involved.

      Supported API: true
      Parameters:
      principalClass -
      criteriaMap -
      Returns:
      Enumeration
      Throws:
      WTException
    • findActiveAndDisabledUsersByName

      Enumeration findActiveAndDisabledUsersByName(Class<?> principalClass, String name, DirectoryContextProvider[] contexts) throws WTException
      This API returns an enumeration containing all the active and disabled users with the given name. This is an easier-to-use convenience method wrapping findActiveAndDisabledUsersByName(java.lang.Class, java.lang.String, wt.org.DirectoryContextProvider[]) and doing all necessary quoting and escaping internally. Org services package documentation has a detailed description on how to create a DirectoryContextProvider that needs to be passed into this API.

      Supported API: true
      Parameters:
      principalClass -
      name -
      contexts -
      Returns:
      Enumeration
      Throws:
      WTException
    • findActiveAndDisabledUsersByName

      Enumeration findActiveAndDisabledUsersByName(Class<?> principalClass, String name) throws WTException
      This API returns an enumeration containing all the active and disabled users with the given name.

      Supported API: true
      Parameters:
      principalClass -
      name -
      Returns:
      Enumeration
      Throws:
      WTException
    • findLikeDisabledUsers

      Enumeration findLikeDisabledUsers(String criteria) throws WTException
      Provides a result set of all disabled users that match the search criteria provided as a parameter. The search crteira should be along the lines "name = user1" or "name = u*" or "name=*"

      Supported API: true
      Parameters:
      criteria -
      Returns:
      Enumeration
      Throws:
      WTException
    • removeMember

      boolean removeMember(WTGroup group, WTPrincipal principal, boolean bValidate) throws WTException, UserNotFoundException
      Removes a principal from a group. Returns true if principal belonged to the group, false otherwise.

      Supported API: true
      Parameters:
      group -
      principal -
      bValidate -
      Returns:
      boolean
      Throws:
      WTException
      UserNotFoundException
    • removeMembers

      boolean removeMembers(WTGroup group, WTPrincipal[] principals, boolean bValidate) throws WTException, UserNotFoundException
      Removes principals from a group. Returns true if principals belonged to the group, false otherwise.

      Supported API: true
      Parameters:
      group -
      principals -
      bValidate -
      Returns:
      boolean
      Throws:
      WTException
      UserNotFoundException
    • findDisabledUser

      WTUser findDisabledUser(long key) throws WTException
      This API can be used to query for a disabled user given the id value associated to the user object.

      Supported API: true
      Parameters:
      key -
      Returns:
      WTUser
      Throws:
      WTException
    • getPrincipalByDN

      WTPrincipal getPrincipalByDN(String dn, String service) throws WTException
      Returns the principal identified by a specific distinguished name in a specific service, or null if no such principal exists.

      If a principal is not found in LDAP, nothing is returned.
      If a principal is found in LDAP but not in the database, this creates a new entry in the database and returns the principal with both LDAP and database values populated.
      If a principal is found in LDAP and in the database, this returns the principal with both LDAP and database values populated.

      Supported API: true
      Parameters:
      dn -
      service -
      Returns:
      WTPrincipal
      Throws:
      WTException
      See Also:
    • getPrincipalByDN

      WTPrincipal getPrincipalByDN(String dn, String service, boolean createNew) throws WTException
      Returns the principal identified by a specific distinguished name in a specific service, or null if no such principal exists.

      If a principal is not found in LDAP, nothing is returned.
      If a principal is found in LDAP but not in the database, then the behavior depends on the value of the createNew flag. If createNew is true, this creates a new entry in the database and returns the principal with both LDAP and database values populated. If createNew is false, this returns the principal with just the LDAP values populated.
      If a principal is found in LDAP and in the database, this returns the principal with both LDAP and database values populated.

      Supported API: true
      Parameters:
      dn -
      service -
      createNew - - If true, creates a new database entry for the principal if none exist. If false, does not create a new database entry for the principal even if none exist
      Returns:
      WTPrincipal
      Throws:
      WTException
    • listofInvalidPrincipals

      Vector listofInvalidPrincipals(Class principalClass, String principalName) throws WTException
      This method provides an option to query all disconnected principals in Windchill associated to a specific principal type and/or a specific principal name. Principals are considered disconnected in Windchill if 1) The corresponding LDAP entry is missing OR 2) If the Remote information in the windchill database is missing.

      Supported API: true
      Parameters:
      principalClass - -
      principalName -
      Returns:
      Vector
      Throws:
      WTException
    • listofInvalidPrincipals

      Vector listofInvalidPrincipals(Class principalClass, String principalName, boolean alwaysReconnect) throws WTException
      This method created for EnableDisableduser utility only. It will reconnect disabled users always inspite of autoreconnect option is not enabled. This method provides an option to query all disconnected principals in Windchill associated to a specific principal type and/or a specific principal name. Principals are considered disconnected in Windchill if 1) The corresponding LDAP entry is missing OR 2) If the Remote information in the windchill database is missing.

      Supported API: true
      Parameters:
      principalClass - -
      principalName -
      alwaysReconnect -
      Returns:
      Vector
      Throws:
      WTException
    • findPersistedUsers

      Enumeration findPersistedUsers(String[] userNames, String email, String fullName, String lastName, PrincipalStatus status, Boolean internal, Boolean disabled) throws WTException
      Returns persisted users matching the given characteristics. Only exact match is checked (no wildcards).

      Arguments to this API are optional but at least one of either userNames array or email must be provided.
      To explicitly check for blank or null values for full name, email or last name, use the constant OrganizationServicesHelper.QUERY_CRITERIA_BLANK_VALUE when providing values for these criteria. Otherwise, blank or null criteria will be ignored.

      Supported API: true
      Parameters:
      userNames - - array of user's names (primary and alternate). At least one of either userNames array or email must be provided
      email - - At least one of either userNames array or email must be provided
      fullName -
      lastName -
      status -
      internal -
      disabled -
      Returns:
      Enumeration of resulting WTUser entries
      Throws:
      WTException