This page tells you how to update your SOAP based-client application code to the new REST client when updating from Crowd 2.0.x to Crowd 2.1.0 or later.
SOAP API is no longer available
SOAP API has been removed in Crowd 5.0. For information on how to migrate to REST API, see Crowd SOAP to REST migration guide.
Add a dependency on crowd-integration-client-rest
. Remove the previous dependency on crowd-integration-client-api
.
1 2<dependencies> <dependency> <groupId>com.atlassian.crowd</groupId> <artifactId>crowd-integration-client-rest</artifactId> </dependency> </dependencies>
1 2final ClientProperties clientProperties = ClientPropertiesImpl.newInstanceFromProperties(properties); final CrowdClient crowdClient = com.atlassian.crowd.integration.rest.service.factory.RestCrowdClientFactory.newInstance(clientProperties); final CrowdHttpAuthenticator crowdHttpAuthenticator = new CrowdHttpAuthenticatorImpl(crowdClient, clientProperties, CrowdHttpTokenHelperImpl.getInstance());
New classes and interfaces replace the functionality of the older classes that were tied to the SOAP API. A list of some of the common classes and their mappings appear below. This list is by no means exhaustive - we encourage developers to move away from SOAP specific classes to the generic interfaces and move to using REST instead of SOAP.
Update |
---|
Old Class: com.atlassian.crowd.integration.service.soap.client.SecurityServerClient New Class: com.atlassian.crowd.service.client.CrowdClient |
Old Class: com.atlassian.crowd.integration.http.HttpAuthenticator New Class: com.atlassian.crowd.integration.http.CrowdHttpAuthenticator |
Old Class: com.atlassian.crowd.integration.http.VerifyTokenFilter New Class: com.atlassian.crowd.integration.http.filter.CrowdSecurityFilter |
Old Class: com.atlassian.crowd.integration.soap.SOAPPrincipal New Class: com.atlassian.crowd.model.user.User |
Old Class: com.atlassian.crowd.integration.soap.SOAPGroup New Class: com.atlassian.crowd.model.group.Group |
Other changes to note:
CrowdClient
and CrowdHttpAuthenticator
.CrowdHttpAuthenticator
should be familiar from using HttpAuthenticator
with only minor changes in the methods. E.g. getUser
instead of getPrincipal
and logout
instead of logoff
.CrowdClient
allows for more powerful searching capabilities than ever before. Membership queries are now possible with CrowdClient. To perform a search, create a SearchRestriction
using the com.atlassian.crowd.search.builder.Combine
and com.atlassian.crowd.search.builder.Restriction
classes.
Important search classes:
For example, to find a user with a first name of "Bob" and an email address starting with "b", you can do the following:
1 2Combine.allOf(Restriction.on(UserTermKeys.FIRST_NAME).exactlyMatching("Bob"), Restriction.on(UserTermKeys.EMAIL).startingWith("b"));
More examples can be found on the QueryBuilder API Javadocs.
Rate this page: