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
ModifierConstructorDescriptionprotected
protected
AbstractServiceContext
(ServiceContext sc, String grantorUsername) protected
AbstractServiceContext
(String username, String grantorUsername) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addService
(String serviceName, Object service) Adds the specifiedService
to the service cache under theserviceName_
key specified.com.appiancorp.security.auth.AppianLoginContext
com.appiancorp.core.expr.portable.common.Session
getAttribute
(String key) Gets the attribute at the specified key.org.aopalliance.intercept.MethodInterceptor
getAuthorizationInterceptor
(String actionTargetName, Class<?> targetInterface) com.appiancorp.security.authz.AuthorizationProvider
Gets the calendar ID, which is used to calculate date in that calendar.com.appian.komodo.api.EngineCredentials
getEngineCredentials
(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) RetrievesService
specified 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.UserRef
boolean
boolean
boolean
boolean
boolean
isRtl()
boolean
boolean
removeAttribute
(String key) Removes the attribute at the specified key from the attribute map.void
removeService
(String serviceName) Removes the specified service from the service cache.void
setAttribute
(String key, Object o) Sets the attribute at the specified key to the specified value.void
setAuthorizationProvider
(com.appiancorp.security.authz.AuthorizationProvider authzProvider) void
setCalendarID
(String calendarID) Sets the ID of the calendar, which is used to calculate date in that calendar.void
Sets the locale, which affects which language the database will return for multilingual strings.void
setTimeZone
(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, wait
Methods 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:
getAuthorizationInterceptor
in interfacecom.appiancorp.services.AuthorizationInterceptorProvider
-
getName
Description copied from interface:ServiceContext
Returns the username of the user represented by this context.- Specified by:
getName
in interfacePrincipal
- Specified by:
getName
in interfaceServiceContext
- Returns:
- the username for this context
-
getUserRef
public com.appiancorp.type.refs.UserRef getUserRef()- Specified by:
getUserRef
in interfacecom.appiancorp.security.auth.SecurityContext
-
isUserRefNull
public boolean isUserRefNull()- Specified by:
isUserRefNull
in interfacecom.appiancorp.security.auth.SecurityContext
-
getUserUuid
- Specified by:
getUserUuid
in interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupUuids
- Specified by:
getMemberGroupUuids
in interfacecom.appiancorp.security.auth.SecurityContext
-
getMemberGroupRefs
- Specified by:
getMemberGroupRefs
in interfacecom.appiancorp.security.auth.SecurityContext
-
getRoles
- Specified by:
getRoles
in interfacecom.appiancorp.security.auth.SecurityContext
-
isAuthenticatedByAppianInternalProvider
public boolean isAuthenticatedByAppianInternalProvider()- Specified by:
isAuthenticatedByAppianInternalProvider
in interfacecom.appiancorp.security.auth.SecurityContext
-
isLoggedInThroughSaml
public boolean isLoggedInThroughSaml()- Specified by:
isLoggedInThroughSaml
in interfacecom.appiancorp.security.auth.SecurityContext
-
getAppianLoginContext
public com.appiancorp.security.auth.AppianLoginContext getAppianLoginContext()- Specified by:
getAppianLoginContext
in interfacecom.appiancorp.security.auth.SecurityContext
-
isSysAdmin
public boolean isSysAdmin()- Specified by:
isSysAdmin
in interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorName
- Specified by:
getGrantorName
in interfacecom.appiancorp.security.auth.SecurityContext
-
getGrantorRoles
- Specified by:
getGrantorRoles
in interfacecom.appiancorp.security.auth.SecurityContext
-
addService
Description copied from interface:ServiceContext
Adds the specifiedService
to the service cache under theserviceName_
key specified. If the key already exists, then it is overwritten with the new value.- Specified by:
addService
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
addService
in interfaceServiceContext
- Parameters:
serviceName
- the name of the serviceservice
- the service- See Also:
-
getService
Description copied from interface:ServiceContext
RetrievesService
specified by the given service name from cache.- Specified by:
getService
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
getService
in interfaceServiceContext
- Parameters:
serviceName
- the service name- Returns:
- the service
- See Also:
-
removeService
Description copied from interface:ServiceContext
Removes the specified service from the service cache.- Specified by:
removeService
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
removeService
in interfaceServiceContext
- Parameters:
serviceName
- the name of the service- See Also:
-
setAttribute
Description copied from interface:ServiceContext
Sets the attribute at the specified key to the specified value.- Specified by:
setAttribute
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
setAttribute
in interfaceServiceContext
- Parameters:
key
- the keyo
- the value- See Also:
-
getAttribute
Description copied from interface:ServiceContext
Gets the attribute at the specified key.- Specified by:
getAttribute
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
getAttribute
in interfaceServiceContext
- Parameters:
key
- the key- Returns:
- the attribute value
- See Also:
-
removeAttribute
Description copied from interface:ServiceContext
Removes the attribute at the specified key from the attribute map.- Specified by:
removeAttribute
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
removeAttribute
in interfaceServiceContext
- Parameters:
key
- the key- Returns:
- the attribute value before it was removed
- See Also:
-
getLocale
Description copied from interface:ServiceContext
Gets the locale, which affects which language the database will return for multilingual strings.- Specified by:
getLocale
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
getLocale
in interfaceServiceContext
- Returns:
- the locale
- See Also:
-
setLocale
Description copied from interface:ServiceContext
Sets the locale, which affects which language the database will return for multilingual strings.- Specified by:
setLocale
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
setLocale
in interfaceServiceContext
- Parameters:
locale
- the locale- See Also:
-
isRtl
public boolean isRtl()- Specified by:
isRtl
in 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:
getOverrideLocale
in interfacecom.appiancorp.security.auth.SecurityContext
- Returns:
- the locale already stored in this class derived from the original
SecurityContext
-
isAllowOverrideForDisabledLocale
public boolean isAllowOverrideForDisabledLocale()- Specified by:
isAllowOverrideForDisabledLocale
in interfacecom.appiancorp.security.auth.SecurityContext
-
isAdsSuperUser
public boolean isAdsSuperUser()- Specified by:
isAdsSuperUser
in interfacecom.appiancorp.security.auth.SecurityContext
-
getTimeZone
Description copied from interface:ServiceContext
Gets the timezone, which the database uses for time conversions to and from GMT.- Specified by:
getTimeZone
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
getTimeZone
in interfaceServiceContext
- Returns:
- the timezone
- See Also:
-
setTimeZone
Description copied from interface:ServiceContext
Sets the timezone, which the database uses for time conversions to and from GMT.- Specified by:
setTimeZone
in interfacecom.appiancorp.asl3.servicefw.connect.ServiceContext
- Specified by:
setTimeZone
in interfaceServiceContext
- Parameters:
timeZone
- the timezone- See Also:
-
getCalendarID
Description copied from interface:ServiceContext
Gets the calendar ID, which is used to calculate date in that calendar.- Specified by:
getCalendarID
in interfaceServiceContext
- Returns:
- the Calendar ID
- See Also:
-
#setCalendar(String)
-
setCalendarID
Description copied from interface:ServiceContext
Sets the ID of the calendar, which is used to calculate date in that calendar.- Specified by:
setCalendarID
in 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:
getEngineCredentials
in interfaceKougarServiceContext
- Parameters:
svcConn
- the connection for which we need the credentials- Returns:
- an
Object
representing the credentials.
-
getAppianSession
public com.appiancorp.core.expr.portable.common.Session getAppianSession() -
toString
-