Class MockPluginContext

  • All Implemented Interfaces:
    sailpoint.plugin.PluginContext, sailpoint.web.UserContext

    public class MockPluginContext
    extends sailpoint.rest.plugin.BasePluginResource
    A mock plugin resource to use in any situation where an API requires one but your code is not running in a plugin context.

    This must be associated with a real plugin (by name).

    In particular, ThingAccessUtils requires a plugin context, which this can provide.

    • Field Summary

      • Fields inherited from class sailpoint.rest.BaseListResource

        CALCULATED_COLUMN_PREFIX, colKey, exclude, excludedIds, filters, groupBy, limit, PARAM_COL_KEY, PARAM_DIR, PARAM_EXCLUDED_IDS, PARAM_GROUP_BY, PARAM_LIMIT, PARAM_QUERY, PARAM_SELECT_ALL, PARAM_SELECTED, PARAM_SORT, PARAM_START, query, selectAll, selectedIds, sortBy, sortDirection, STANDARD_PARAMS, start
      • Fields inherited from class sailpoint.rest.BaseResource

        authnPassword, authnUsername, headers, request, uriInfo
    • Constructor Summary

      Constructors 
      Constructor Description
      MockPluginContext​(sailpoint.api.SailPointContext context, sailpoint.object.Identity loggedInUser, String pluginName)
      Constructor for the mock plugin context
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      sailpoint.api.SailPointContext getContext()
      Returns the context previously passed to the contructor
      protected String[] getCredentials()  
      Locale getLocale()
      Returns the default system Locale
      sailpoint.object.Identity getLoggedInUser()  
      List<sailpoint.object.Capability> getLoggedInUserCapabilities()  
      String getLoggedInUserName()  
      Collection<String> getLoggedInUserRights()  
      String getPluginName()
      Returns the name of the real plugin we are simulating
      javax.servlet.http.HttpServletRequest getRequest()
      Not implemented
      javax.servlet.http.HttpSession getSession()
      Not implemented
      TimeZone getUserTimeZone()
      Returns the default system time zone
      • Methods inherited from class sailpoint.rest.plugin.BasePluginResource

        authorize, getConnection, prepareStatement
      • Methods inherited from class sailpoint.rest.BaseListResource

        calculateColumn, calculateColumns, convertColumn, convertObject, convertObject, convertRow, convertRow, countResults, fixSortBy, getColKey, getColumnKey, getColumns, getExcludedIds, getFilters, getGroupBy, getLimit, getListResult, getListResultFromObjects, getListResultFromObjects, getOtherQueryParams, getProjectionColumns, getQuery, getQueryOptions, getQueryOptions, getRawResults, getResults, getSelectAll, getSelectedIds, getSelectionQuery, getSingleFormValue, getSortBy, getSortDirection, getSorters, getStart, handleOrdering, init, objectToMap, parseSorters, processForm, setColKey, setExcludedIds, setFilters, setGroupBy, setLimit, setQuery, setSelectAll, setSelectedIds, setSortBy, setSortDirection, setStart, trimAndSortResults
      • Methods inherited from class sailpoint.rest.BaseResource

        convertIdentity, createListResult, createListResult, decodeRestUriComponent, decodeRestUriComponent, fixCSV, getContext, getHandler, getHandler, getLoggedInUserDynamicScopeNames, getMatchedUri, getNotary, getQueryParamMap, getSignature, getSignatureAccountId, isAuthorized, isMobileLogin, isObjectInUserScope, isObjectInUserScope, isPreAuth, isScopingEnabled, isSsoAuthenticated, localize, makeJsonSafeKeys, parseDateRange, reportDetailedLoginErrors, saveSignatureAccountId, setPreAuth, throwWebApplicationException
      • Methods inherited from interface sailpoint.plugin.PluginContext

        getSettingBool, getSettingInt, getSettingLong, getSettingMultiObject, getSettingMultiString, getSettingObject, getSettingSecret, getSettingString
    • Constructor Detail

      • MockPluginContext

        public MockPluginContext​(sailpoint.api.SailPointContext context,
                                 sailpoint.object.Identity loggedInUser,
                                 String pluginName)
                          throws sailpoint.tools.GeneralException
        Constructor for the mock plugin context
        Parameters:
        context - The Sailpoint context to use
        loggedInUser - The logged in user to simulate
        pluginName - The plugin name, which must be real
        Throws:
        sailpoint.tools.GeneralException - if any failures occur finding the plugin
    • Method Detail

      • getContext

        public sailpoint.api.SailPointContext getContext()
        Returns the context previously passed to the contructor
        Specified by:
        getContext in interface sailpoint.web.UserContext
        Overrides:
        getContext in class sailpoint.rest.BaseResource
        Returns:
        The context
      • getCredentials

        protected String[] getCredentials()
        Overrides:
        getCredentials in class sailpoint.rest.BaseResource
      • getLocale

        public Locale getLocale()
        Returns the default system Locale
        Specified by:
        getLocale in interface sailpoint.web.UserContext
        Overrides:
        getLocale in class sailpoint.rest.BaseResource
        Returns:
        The default system locale
      • getLoggedInUser

        public sailpoint.object.Identity getLoggedInUser()
        Specified by:
        getLoggedInUser in interface sailpoint.web.UserContext
        Overrides:
        getLoggedInUser in class sailpoint.rest.BaseResource
      • getLoggedInUserCapabilities

        public List<sailpoint.object.Capability> getLoggedInUserCapabilities()
        Specified by:
        getLoggedInUserCapabilities in interface sailpoint.web.UserContext
        Overrides:
        getLoggedInUserCapabilities in class sailpoint.rest.BaseResource
      • getLoggedInUserName

        public String getLoggedInUserName()
        Specified by:
        getLoggedInUserName in interface sailpoint.web.UserContext
        Overrides:
        getLoggedInUserName in class sailpoint.rest.BaseResource
      • getLoggedInUserRights

        public Collection<StringgetLoggedInUserRights()
        Specified by:
        getLoggedInUserRights in interface sailpoint.web.UserContext
        Overrides:
        getLoggedInUserRights in class sailpoint.rest.BaseResource
      • getPluginName

        public String getPluginName()
        Returns the name of the real plugin we are simulating
        Specified by:
        getPluginName in interface sailpoint.plugin.PluginContext
        Specified by:
        getPluginName in class sailpoint.rest.plugin.BasePluginResource
        Returns:
        The name of the plugin provided in the constructor
      • getRequest

        public javax.servlet.http.HttpServletRequest getRequest()
        Not implemented
        Overrides:
        getRequest in class sailpoint.rest.BaseResource
        Throws:
        UnsupportedOperationException - on any invocation
      • getSession

        public javax.servlet.http.HttpSession getSession()
        Not implemented
        Overrides:
        getSession in class sailpoint.rest.BaseResource
        Throws:
        UnsupportedOperationException - on any invocation
      • getUserTimeZone

        public TimeZone getUserTimeZone()
        Returns the default system time zone
        Specified by:
        getUserTimeZone in interface sailpoint.web.UserContext
        Overrides:
        getUserTimeZone in class sailpoint.rest.BaseResource
        Returns:
        The default system time zone