Interface ServiceContext

All Superinterfaces:
Principal, com.appiancorp.asl3.servicefw.connect.ServiceContext
All Known Subinterfaces:
KougarServiceContext
All Known Implementing Classes:
AbstractServiceContext, EscalatedServiceContext, UserServiceContext, WebServiceContext

public interface ServiceContext extends Principal, com.appiancorp.asl3.servicefw.connect.ServiceContext
The context used to borrow services from the service provider. The context contains the following user information which sent to the database:
  • Username
  • Locale
  • Timezone
The service context also provides attribute storage and retrieval and a caching mechanism for reusing service instances obtained multiple times with the same service context.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addService(String serviceName_, Object service_)
    Adds the specified Service to the service cache under the serviceName_ key specified.
    Gets the attribute at the specified key.
    Gets the calendar ID, which is used to calculate date in that calendar.
    com.appiancorp.asl3.servicefw.connect.ASLIdentity
    Deprecated.
    Use getName() instead.
    Gets the locale, which affects which language the database will return for multilingual strings.
    Returns the username of the user represented by this context.
    getService(String serviceName_)
    Retrieves Service specified by the given service name from cache.
    Gets the timezone, which the database uses for time conversions to and from GMT.
    boolean
    Whether this service context has been designated for migration of objects in the system.
    boolean
     
    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 value_)
    Sets the attribute at the specified key to the specified value.
    void
    setCalendarID(String calendarID_)
    Sets the ID of the calendar, which is used to calculate date in that calendar.
    void
    setLocale(Locale locale_)
    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.

    Methods inherited from interface java.security.Principal

    equals, hashCode, implies, toString
  • Method Details

    • getName

      String getName()
      Returns the username of the user represented by this context.
      Specified by:
      getName in interface Principal
      Returns:
      the username for this context
    • getService

      Object getService(String serviceName_)
      Retrieves Service specified by the given service name from cache.
      Specified by:
      getService in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      serviceName_ - the service name
      Returns:
      the service
      See Also:
    • addService

      void addService(String serviceName_, Object service_)
      Adds the specified Service to the service cache under the serviceName_ key specified. If the key already exists, then it is overwritten with the new value.
      Specified by:
      addService in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      serviceName_ - the name of the service
      service_ - the service
      See Also:
    • removeService

      void removeService(String serviceName_)
      Removes the specified service from the service cache.
      Specified by:
      removeService in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      serviceName_ - the name of the service
      See Also:
    • getIdentity

      @Deprecated com.appiancorp.asl3.servicefw.connect.ASLIdentity getIdentity()
      Deprecated.
      Use getName() instead.
      Returns the ASLIdentity object that was used to create the ServiceContext.
      Specified by:
      getIdentity in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Returns:
      the ASLIdentity used to create the ServiceContext
    • setAttribute

      void setAttribute(String key_, Object value_)
      Sets the attribute at the specified key to the specified value.
      Specified by:
      setAttribute in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      key_ - the key
      value_ - the value
      See Also:
    • getAttribute

      Object getAttribute(String key_)
      Gets the attribute at the specified key.
      Specified by:
      getAttribute in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      key_ - the key
      Returns:
      the attribute value
      See Also:
    • removeAttribute

      Object removeAttribute(String key_)
      Removes the attribute at the specified key from the attribute map.
      Specified by:
      removeAttribute in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      key_ - the key
      Returns:
      the attribute value before it was removed
      See Also:
    • setLocale

      void setLocale(Locale locale_)
      Sets the locale, which affects which language the database will return for multilingual strings.
      Specified by:
      setLocale in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      locale_ - the locale
      See Also:
    • getLocale

      Locale getLocale()
      Gets the locale, which affects which language the database will return for multilingual strings.
      Specified by:
      getLocale in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Returns:
      the locale
      See Also:
    • setTimeZone

      void setTimeZone(TimeZone timeZone_)
      Sets the timezone, which the database uses for time conversions to and from GMT.
      Specified by:
      setTimeZone in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Parameters:
      timeZone_ - the timezone
      See Also:
    • getTimeZone

      TimeZone getTimeZone()
      Gets the timezone, which the database uses for time conversions to and from GMT.
      Specified by:
      getTimeZone in interface com.appiancorp.asl3.servicefw.connect.ServiceContext
      Returns:
      the timezone
      See Also:
    • setCalendarID

      void setCalendarID(String calendarID_)
      Sets the ID of the calendar, which is used to calculate date in that calendar.
      Parameters:
      calendar_ - the calendarID
      See Also:
      • #getCalendar()
    • getCalendarID

      String getCalendarID()
      Gets the calendar ID, which is used to calculate date in that calendar.
      Returns:
      the Calendar ID
      See Also:
      • #setCalendar(String)
    • isDesignatedForMigration

      boolean isDesignatedForMigration()
      Whether this service context has been designated for migration of objects in the system.
      Returns:
      whether the service context is designated for migration
    • isRtl

      boolean isRtl()