Package com.appiancorp.services
Class AbstractServiceContext
java.lang.Object
com.appiancorp.services.AbstractServiceContext
- All Implemented Interfaces:
com.appiancorp.asl3.servicefw.connect.ServiceContext,com.appiancorp.security.auth.SecurityContext,com.appiancorp.services.AuthorizationInterceptorProvider,KougarServiceContext,ServiceContext,Principal
- Direct Known Subclasses:
UserServiceContext,WebServiceContext
public abstract class AbstractServiceContext
extends Object
implements KougarServiceContext, com.appiancorp.security.auth.SecurityContext, com.appiancorp.services.AuthorizationInterceptorProvider
Represents a service context for use with the service framework. This class
defines the common methods that all service contexts would otherwise have to
implement, but that don't vary much from service context to service context.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractServiceContext(ServiceContext sc, String grantorUsername) protectedAbstractServiceContext(String username, String grantorUsername) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddService(String serviceName, Object service) Adds the specifiedServiceto the service cache under theserviceName_key specified.com.appiancorp.security.auth.AppianLoginContextcom.appiancorp.core.expr.portable.common.SessiongetAttribute(String key) Gets the attribute at the specified key.org.aopalliance.intercept.MethodInterceptorgetAuthorizationInterceptor(String actionTargetName, Class<?> targetInterface) com.appiancorp.security.authz.AuthorizationProviderGets the calendar ID, which is used to calculate date in that calendar.com.appian.komodo.api.EngineCredentialsgetEngineCredentials(com.appiancorp.kougar.services.ServiceConnection svcConn) Returns the credentials to be used for calls with the specifiedKougarConnection.Gets the locale, which affects which language the database will return for multilingual strings.Set<com.appiancorp.type.refs.GroupRef>getName()Returns the username of the user represented by this context.Necessary since this class implementsSecurityContext.getRoles()getService(String serviceName) RetrievesServicespecified by the given service name from cache.Gets the timezone, which the database uses for time conversions to and from GMT.com.appiancorp.type.refs.UserRefbooleanbooleanbooleanbooleanbooleanisRtl()booleanbooleanremoveAttribute(String key) Removes the attribute at the specified key from the attribute map.voidremoveService(String serviceName) Removes the specified service from the service cache.voidsetAttribute(String key, Object o) Sets the attribute at the specified key to the specified value.voidsetAuthorizationProvider(com.appiancorp.security.authz.AuthorizationProvider authzProvider) voidsetCalendarID(String calendarID) Sets the ID of the calendar, which is used to calculate date in that calendar.voidSets the locale, which affects which language the database will return for multilingual strings.voidsetTimeZone(TimeZone timeZone) Sets the timezone, which the database uses for time conversions to and from GMT.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.appiancorp.services.ServiceContext
getIdentity, isDesignatedForMigration
-
Constructor Details
-
AbstractServiceContext
protected AbstractServiceContext() -
AbstractServiceContext
-
AbstractServiceContext
-
-
Method Details
-
getAuthorizationProvider
public com.appiancorp.security.authz.AuthorizationProvider getAuthorizationProvider() -
setAuthorizationProvider
public void setAuthorizationProvider(com.appiancorp.security.authz.AuthorizationProvider authzProvider) -
getAuthorizationInterceptor
public org.aopalliance.intercept.MethodInterceptor getAuthorizationInterceptor(String actionTargetName, Class<?> targetInterface) - Specified by:
getAuthorizationInterceptorin interfacecom.appiancorp.services.AuthorizationInterceptorProvider
-
getName
Description copied from interface:ServiceContextReturns the username of the user represented by this context.- Specified by:
getNamein interfacePrincipal- Specified by:
getNamein interfaceServiceContext- Returns:
- the username for this context
-
getUserRef
public com.appiancorp.type.refs.UserRef getUserRef()- Specified by:
getUserRefin interfacecom.appiancorp.security.auth.SecurityContext
-
isUserRefNull
public boolean isUserRefNull()- Specified by:
isUserRefNullin interfacecom.appiancorp.security.auth.SecurityContext
-
getUserUuid
- Specified by:
getUserUuidin interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupUuids
- Specified by:
getMemberGroupUuidsin interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupRefs
- Specified by:
getMemberGroupRefsin interfacecom.appiancorp.security.auth.SecurityContext
-
getRoles
- Specified by:
getRolesin interfacecom.appiancorp.security.auth.SecurityContext
-
isAuthenticatedByAppianInternalProvider
public boolean isAuthenticatedByAppianInternalProvider()- Specified by:
isAuthenticatedByAppianInternalProviderin interfacecom.appiancorp.security.auth.SecurityContext
-
isLoggedInThroughSaml
public boolean isLoggedInThroughSaml()- Specified by:
isLoggedInThroughSamlin interfacecom.appiancorp.security.auth.SecurityContext
-
getAppianLoginContext
public com.appiancorp.security.auth.AppianLoginContext getAppianLoginContext()- Specified by:
getAppianLoginContextin interfacecom.appiancorp.security.auth.SecurityContext
-
isSysAdmin
public boolean isSysAdmin()- Specified by:
isSysAdminin interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorName
- Specified by:
getGrantorNamein interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorRoles
- Specified by:
getGrantorRolesin interfacecom.appiancorp.security.auth.SecurityContext
-
addService
Description copied from interface:ServiceContextAdds the specifiedServiceto the service cache under theserviceName_key specified. If the key already exists, then it is overwritten with the new value.- Specified by:
addServicein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
addServicein interfaceServiceContext- Parameters:
serviceName- the name of the serviceservice- the service- See Also:
-
getService
Description copied from interface:ServiceContextRetrievesServicespecified by the given service name from cache.- Specified by:
getServicein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
getServicein interfaceServiceContext- Parameters:
serviceName- the service name- Returns:
- the service
- See Also:
-
removeService
Description copied from interface:ServiceContextRemoves the specified service from the service cache.- Specified by:
removeServicein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
removeServicein interfaceServiceContext- Parameters:
serviceName- the name of the service- See Also:
-
setAttribute
Description copied from interface:ServiceContextSets the attribute at the specified key to the specified value.- Specified by:
setAttributein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
setAttributein interfaceServiceContext- Parameters:
key- the keyo- the value- See Also:
-
getAttribute
Description copied from interface:ServiceContextGets the attribute at the specified key.- Specified by:
getAttributein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
getAttributein interfaceServiceContext- Parameters:
key- the key- Returns:
- the attribute value
- See Also:
-
removeAttribute
Description copied from interface:ServiceContextRemoves the attribute at the specified key from the attribute map.- Specified by:
removeAttributein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
removeAttributein interfaceServiceContext- Parameters:
key- the key- Returns:
- the attribute value before it was removed
- See Also:
-
getLocale
Description copied from interface:ServiceContextGets the locale, which affects which language the database will return for multilingual strings.- Specified by:
getLocalein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
getLocalein interfaceServiceContext- Returns:
- the locale
- See Also:
-
setLocale
Description copied from interface:ServiceContextSets the locale, which affects which language the database will return for multilingual strings.- Specified by:
setLocalein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
setLocalein interfaceServiceContext- Parameters:
locale- the locale- See Also:
-
isRtl
public boolean isRtl()- Specified by:
isRtlin interfaceServiceContext
-
getOverrideLocale
Necessary since this class implementsSecurityContext. In this case, since this is derived from the originalSecurityContext, just return the same locale asgetLocale()- Specified by:
getOverrideLocalein interfacecom.appiancorp.security.auth.SecurityContext- Returns:
- the locale already stored in this class derived from the original
SecurityContext
-
isAllowOverrideForDisabledLocale
public boolean isAllowOverrideForDisabledLocale()- Specified by:
isAllowOverrideForDisabledLocalein interfacecom.appiancorp.security.auth.SecurityContext
-
isAdsSuperUser
public boolean isAdsSuperUser()- Specified by:
isAdsSuperUserin interfacecom.appiancorp.security.auth.SecurityContext
-
getTimeZone
Description copied from interface:ServiceContextGets the timezone, which the database uses for time conversions to and from GMT.- Specified by:
getTimeZonein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
getTimeZonein interfaceServiceContext- Returns:
- the timezone
- See Also:
-
setTimeZone
Description copied from interface:ServiceContextSets the timezone, which the database uses for time conversions to and from GMT.- Specified by:
setTimeZonein interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext- Specified by:
setTimeZonein interfaceServiceContext- Parameters:
timeZone- the timezone- See Also:
-
getCalendarID
Description copied from interface:ServiceContextGets the calendar ID, which is used to calculate date in that calendar.- Specified by:
getCalendarIDin interfaceServiceContext- Returns:
- the Calendar ID
- See Also:
-
#setCalendar(String)
-
setCalendarID
Description copied from interface:ServiceContextSets the ID of the calendar, which is used to calculate date in that calendar.- Specified by:
setCalendarIDin interfaceServiceContext- See Also:
-
#getCalendar()
-
getEngineCredentials
public com.appian.komodo.api.EngineCredentials getEngineCredentials(com.appiancorp.kougar.services.ServiceConnection svcConn) Returns the credentials to be used for calls with the specifiedKougarConnection. The connection may be configured to pass full credentials, or not.- Specified by:
getEngineCredentialsin interfaceKougarServiceContext- Parameters:
svcConn- the connection for which we need the credentials- Returns:
- an
Objectrepresenting the credentials.
-
getAppianSession
public com.appiancorp.core.expr.portable.common.Session getAppianSession() -
toString
-