public class ServiceContextFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ADMIN_USERNAME |
Constructor and Description |
---|
ServiceContextFactory() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areI18nSettingsPopulated(ServiceContext sc) |
static EscalatedServiceContext |
createEscalatedServiceContext(ServiceContext sc,
java.lang.String grantorUsername)
Create ServiceContext based on sc that is escalated with the privileges of grantorUsername
|
static EscalatedServiceContext |
createEscalatedServiceContext(java.lang.String username,
java.lang.String grantorUsername)
Similar to
getServiceContext(String) , but also populates the grantor |
static ServiceContext |
getAdministratorServiceContext()
Retrieves a service context for an anonymous system administrator.
|
static ServiceContext |
getAdministratorServiceContextForMigration()
Retrieves a service context for an anonymous system administrator, to be used for migration of
EXISTING objects in the system.
|
static User |
getAdministratorUser()
Retrieves the user that is the system administrator.
|
static ServiceContext |
getServiceContext(com.appiancorp.services.ASLIdentity id)
Gets a service context for the ASLIdentity passed in.
|
static ServiceContext |
getServiceContext(java.lang.String username)
Gets a service context for the username passed in.
|
static User |
getUser(java.lang.String userName_)
Creates a user object whose username is the given name.
|
static ServiceContext |
populateServiceContextI18nSettings(ServiceContext sc)
Populates the i18n fields (locale, time zone, and calendar id) on the given service context object.
|
static ServiceContext |
populateServiceContextI18nSettings(ServiceContext sc,
java.util.Locale overrideLocale)
Populates the i18n fields (locale, time zone, and calendar id) on the given service context object.
|
public static final java.lang.String ADMIN_USERNAME
public static User getAdministratorUser()
public static ServiceContext getAdministratorServiceContext()
public static ServiceContext getAdministratorServiceContextForMigration()
public static User getUser(java.lang.String userName_)
ServiceContext
.userName_
- the username to useUser
with the given usernamepublic static ServiceContext getServiceContext(com.appiancorp.services.ASLIdentity id)
id
- the ASLIdentity for which to create the service contextpublic static ServiceContext getServiceContext(java.lang.String username)
username
- the username of the user for which to create the service contextpublic static EscalatedServiceContext createEscalatedServiceContext(java.lang.String username, java.lang.String grantorUsername)
getServiceContext(String)
, but also populates the grantorusername
- the username of the user for which to create the service contextgrantorUsername
- the username of the user granting permissions to the main user for privilege escalationpublic static EscalatedServiceContext createEscalatedServiceContext(ServiceContext sc, java.lang.String grantorUsername)
sc
- original ServiceContext where identity, locale, timezone and calendarId are copied fromgrantorUsername
- the name of the grantor for privilege escalationpublic static ServiceContext populateServiceContextI18nSettings(ServiceContext sc, java.util.Locale overrideLocale)
sc
- A service context object.public static ServiceContext populateServiceContextI18nSettings(ServiceContext sc)
sc
- A service context object.public static boolean areI18nSettingsPopulated(ServiceContext sc)
Copyright © 2003-2024 Appian Corporation. All Rights Reserved.