com.atlassian.bamboo.plugins.rest.common
Class RestHelper

java.lang.Object
  extended by com.atlassian.bamboo.plugins.rest.common.RestHelper

public final class RestHelper
extends java.lang.Object


Method Summary
static javax.ws.rs.core.UriInfo addAutoExpand(javax.ws.rs.core.UriInfo uriInfo, java.lang.String expandable)
           
static void assertExecutePermission(java.lang.String planKey)
           
static void assertGlobalAdminReadPermission()
           
static void assertPlanExistsAndVisible(PlanManager planManager, PlanKey planKey)
          Checks if Plan exists and is visible for calling user
static void assertReadPermission()
           
static java.lang.String formatDateTime(long datetime)
           
static BuildState getBuildStateQueryParam(javax.ws.rs.core.UriInfo uriInfo)
           
static Chain getChainByKey(PlanManager planManager, PlanKey planKey)
          Returns a Plan if plan exists and is visible for calling user
static boolean getFavouriteQueryParam(javax.ws.rs.core.UriInfo uriInfo)
           
static java.util.Map<java.lang.String,java.lang.String> getFormParamsMap(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> formParams)
          Returns first occurrence of parameters map
static I18nBean getI18nBean()
           
static Plan getPlanByKey(PlanManager planManager, PlanKey planKey)
          Returns a Plan if plan exists and is visible for calling user
static java.lang.Class getPlanType(javax.ws.rs.core.UriInfo uriInfo)
           
static java.util.List<java.lang.String> getQueryParamAsList(javax.ws.rs.core.UriInfo uriInfo, java.lang.String key)
           
static java.util.Map<java.lang.String,java.lang.String> getQueryParamsMap(javax.ws.rs.core.UriInfo uriInfo)
          Returns first occurrence of parameters map
static java.net.URI getReturnUri(javax.ws.rs.core.UriInfo uriInfo)
          Content of 'returnUrl' request parameter or null if empty.
static boolean hasCloverEnabledQueryParam(javax.ws.rs.core.UriInfo uriInfo)
           
static boolean hasQueryParam(javax.ws.rs.core.UriInfo uriInfo, java.lang.String param)
           
static boolean hasWithBuildPermissionOnlyParam(javax.ws.rs.core.UriInfo uriInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getI18nBean

public static I18nBean getI18nBean()

addAutoExpand

public static javax.ws.rs.core.UriInfo addAutoExpand(javax.ws.rs.core.UriInfo uriInfo,
                                                     java.lang.String expandable)

getFavouriteQueryParam

public static boolean getFavouriteQueryParam(javax.ws.rs.core.UriInfo uriInfo)

getPlanType

public static java.lang.Class getPlanType(javax.ws.rs.core.UriInfo uriInfo)

hasCloverEnabledQueryParam

public static boolean hasCloverEnabledQueryParam(javax.ws.rs.core.UriInfo uriInfo)

hasWithBuildPermissionOnlyParam

public static boolean hasWithBuildPermissionOnlyParam(javax.ws.rs.core.UriInfo uriInfo)

hasQueryParam

public static boolean hasQueryParam(javax.ws.rs.core.UriInfo uriInfo,
                                    java.lang.String param)

getQueryParamAsList

@Nullable
public static java.util.List<java.lang.String> getQueryParamAsList(javax.ws.rs.core.UriInfo uriInfo,
                                                                            java.lang.String key)

getQueryParamsMap

@NotNull
public static java.util.Map<java.lang.String,java.lang.String> getQueryParamsMap(javax.ws.rs.core.UriInfo uriInfo)
Returns first occurrence of parameters map

Parameters:
uriInfo -
Returns:

getFormParamsMap

@NotNull
public static java.util.Map<java.lang.String,java.lang.String> getFormParamsMap(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> formParams)
Returns first occurrence of parameters map

Parameters:
formParams -
Returns:

getBuildStateQueryParam

public static BuildState getBuildStateQueryParam(@NotNull
                                                 javax.ws.rs.core.UriInfo uriInfo)

getPlanByKey

public static Plan getPlanByKey(PlanManager planManager,
                                PlanKey planKey)
Returns a Plan if plan exists and is visible for calling user

Parameters:
planManager -
planKey -
Returns:
Throws:
NotFoundException, - AccessDeniedException

getChainByKey

public static Chain getChainByKey(PlanManager planManager,
                                  PlanKey planKey)
Returns a Plan if plan exists and is visible for calling user

Parameters:
planManager -
planKey -
Returns:
Throws:
NotFoundException, - AccessDeniedException

assertPlanExistsAndVisible

public static void assertPlanExistsAndVisible(PlanManager planManager,
                                              PlanKey planKey)
Checks if Plan exists and is visible for calling user

Parameters:
planManager -
planKey -
Throws:
NotFoundException, - AccessDeniedException

formatDateTime

public static java.lang.String formatDateTime(long datetime)

getReturnUri

@Nullable
public static java.net.URI getReturnUri(javax.ws.rs.core.UriInfo uriInfo)
Content of 'returnUrl' request parameter or null if empty.

Parameters:
uriInfo -
Returns:

assertReadPermission

public static void assertReadPermission()

assertExecutePermission

public static void assertExecutePermission(java.lang.String planKey)

assertGlobalAdminReadPermission

public static void assertGlobalAdminReadPermission()


Copyright © 2012 Atlassian. All Rights Reserved.