com.atlassian.crowd.plugin.rest.util
Class LinkUriHelper

java.lang.Object
  extended by com.atlassian.crowd.plugin.rest.util.LinkUriHelper

public class LinkUriHelper
extends Object

Helper for creating URI links to resources.

Since:
v2.1

Method Summary
static URI buildDirectChildGroupUri(URI baseURI, String groupName, String childGroupName)
          Returns the URI to the group direct child group resource.
static URI buildDirectParentGroupOfUserUri(URI baseURI, String userName, String parentGroupName)
          Returns the URI to the direct group parent of a user resource.
static URI buildDirectParentGroupUri(URI baseURI, String groupName, String parentGroupName)
          Returns the URI to the group direct parent group resource.
static URI buildDirectUserGroupUri(URI baseURI, String groupName, String username)
          Returns the URI to the group direct user group resource.
static URI buildEntityAttributeListUri(URI entityUri)
          Returns the URI to the entity attribute list resource.
static URI buildEntityAttributeUri(URI attributesUri, String attributeName)
          Returns the URI to the entity attribute resource.
static com.atlassian.plugins.rest.common.Link buildGroupLink(URI baseUri, String groupName)
          Returns the Link to the Group resource.
static URI buildGroupUri(URI baseURI, String groupName)
          Returns the URI to the Group resource.
static com.atlassian.plugins.rest.common.Link buildSessionLink(URI baseUri, String token)
          Returns the link to the session resource.
static URI buildSessionUri(URI baseUri, String token)
          Returns the URI to the session resource.
static com.atlassian.plugins.rest.common.Link buildUserLink(URI baseUri, String username)
          Returns the Link to the User resource.
static URI buildUserPasswordUri(URI userUri)
          Returns the URI to the user password resource.
static URI buildUserUri(URI baseUri, String username)
          Returns the URI to the User resource.
static com.atlassian.plugins.rest.common.Link updateGroupLink(com.atlassian.plugins.rest.common.Link groupLink, String groupName)
          Returns an updated group Link with the specified group name.
static URI updateGroupUri(URI groupUri, String groupName)
          Returns an updated group URI with the specified group name.
static com.atlassian.plugins.rest.common.Link updateUserLink(com.atlassian.plugins.rest.common.Link userLink, String username)
          Returns an updated user Link with the specified username.
static URI updateUserUri(URI userUri, String username)
          Returns an updated user URI with the specified username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

buildUserLink

public static com.atlassian.plugins.rest.common.Link buildUserLink(URI baseUri,
                                                                   String username)
Returns the Link to the User resource.

Parameters:
baseUri - base URI of the REST service
username - Username
Returns:
URI to the user resource.

buildUserUri

public static URI buildUserUri(URI baseUri,
                               String username)
Returns the URI to the User resource.

Parameters:
baseUri - base URI of the REST service
username - Username
Returns:
URI to the user resource.

buildDirectUserGroupUri

public static URI buildDirectUserGroupUri(URI baseURI,
                                          String groupName,
                                          String username)
Returns the URI to the group direct user group resource.

Parameters:
baseURI - base URI of the REST service
groupName - Group name
username - username
Returns:
URI to the group direct user resource.

updateUserLink

public static com.atlassian.plugins.rest.common.Link updateUserLink(com.atlassian.plugins.rest.common.Link userLink,
                                                                    String username)
Returns an updated user Link with the specified username.

Parameters:
userLink - current user Link
username - new username
Returns:
updated user Link.

updateUserUri

public static URI updateUserUri(URI userUri,
                                String username)
Returns an updated user URI with the specified username.

Parameters:
userUri - current user URI
username - new username
Returns:
updated user URI.

buildGroupLink

public static com.atlassian.plugins.rest.common.Link buildGroupLink(URI baseUri,
                                                                    String groupName)
Returns the Link to the Group resource.

Parameters:
baseUri - base URI of the REST service
groupName - group name
Returns:
URI to the user resource.

buildGroupUri

public static URI buildGroupUri(URI baseURI,
                                String groupName)
Returns the URI to the Group resource.

Parameters:
baseURI - base URI of the REST service
groupName - Group name
Returns:
URI to the group resource.

buildDirectChildGroupUri

public static URI buildDirectChildGroupUri(URI baseURI,
                                           String groupName,
                                           String childGroupName)
Returns the URI to the group direct child group resource.

Parameters:
baseURI - base URI of the REST service
groupName - group name
childGroupName - child group name
Returns:
URI to the group direct child group resource.

buildDirectParentGroupUri

public static URI buildDirectParentGroupUri(URI baseURI,
                                            String groupName,
                                            String parentGroupName)
Returns the URI to the group direct parent group resource.

Parameters:
baseURI - base URI of the REST service
groupName - group name
parentGroupName - parent group name
Returns:
URI to the group direct parent group resource.

buildDirectParentGroupOfUserUri

public static URI buildDirectParentGroupOfUserUri(URI baseURI,
                                                  String userName,
                                                  String parentGroupName)
Returns the URI to the direct group parent of a user resource.

Parameters:
baseURI - base URI of the REST service
userName - user name
parentGroupName - parent group name
Returns:
URI to the direct parent group of a user resource.

updateGroupLink

public static com.atlassian.plugins.rest.common.Link updateGroupLink(com.atlassian.plugins.rest.common.Link groupLink,
                                                                     String groupName)
Returns an updated group Link with the specified group name.

Parameters:
groupLink - current group Link
groupName - new group name
Returns:
updated group Link.

updateGroupUri

public static URI updateGroupUri(URI groupUri,
                                 String groupName)
Returns an updated group URI with the specified group name.

Parameters:
groupUri - current group URI
groupName - new group name
Returns:
updated group URI.

buildEntityAttributeListUri

public static URI buildEntityAttributeListUri(URI entityUri)
Returns the URI to the entity attribute list resource.

Parameters:
entityUri - URI to the entity.
Returns:
URI to the entity attributes resource.

buildEntityAttributeUri

public static URI buildEntityAttributeUri(URI attributesUri,
                                          String attributeName)
Returns the URI to the entity attribute resource.

Parameters:
attributesUri - URI to the entity attributes.
attributeName - name of the attribute
Returns:
URI to the entity attributes resource.

buildUserPasswordUri

public static URI buildUserPasswordUri(URI userUri)
Returns the URI to the user password resource.

Parameters:
userUri - URI to the user.
Returns:
URI to the user password resource.

buildSessionUri

public static URI buildSessionUri(URI baseUri,
                                  String token)
Returns the URI to the session resource.

Parameters:
baseUri - base URI of the REST service
Returns:
URI to the session resource

buildSessionLink

public static com.atlassian.plugins.rest.common.Link buildSessionLink(URI baseUri,
                                                                      String token)
Returns the link to the session resource.

Parameters:
baseUri - base URI of the REST service
Returns:
link to the session resource


Copyright © 2012 Atlassian. All Rights Reserved.