Options
All
  • Public
  • Public/Protected
  • All
Menu

A base actor for listening to Rule parse events that has fixed media types.

Actor types:

  • Input: IActionRuleParseOrMediaType: A parse input or a media type input.
  • Test:
  • Output: IActorOutputRuleParseOrMediaType: The parsed quads.
see

IActionInit

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly beforeActors

beforeActors: Actor<IActionAbstractMediaTyped<IActionRuleParse>, IActorTestAbstractMediaTyped<IActorTest>, IActorOutputAbstractMediaTyped<IActorRuleParseOutput>>[]

Actor that must be registered in the bus before this actor.

Readonly bus

bus: Bus<Actor<IActionAbstractMediaTyped<IActionRuleParse>, IActorTestAbstractMediaTyped<IActorTest>, IActorOutputAbstractMediaTyped<IActorRuleParseOutput>>, IActionAbstractMediaTyped<IActionRuleParse>, IActorTestAbstractMediaTyped<IActorTest>, IActorOutputAbstractMediaTyped<IActorRuleParseOutput>>

The bus this actor subscribes to.

Readonly mediaTypeFormats

mediaTypeFormats: Record<string, string>

A record of media types, with media type name as key, and its format IRI as value.

Readonly mediaTypePriorities

mediaTypePriorities: Record<string, number>

A record of media types, with media type name as key, and its priority as value. Priorities are numbers between [0, 1].

Readonly name

name: string

The name for this actor.

Readonly priorityScale

priorityScale: number

A multiplier for media type priorities. This can be used for keeping the original media types in place, but scaling all of their scores with a certain value.

Methods

deinitialize

  • deinitialize(): Promise<any>
  • Deinitialize this actor. This should be used for cleaning up things when the application is shut down, such as closing files and removing temporary files.

    Returns Promise<any>

    A promise that resolves when the actor has been deinitialized.

Protected getDefaultLogData

  • getDefaultLogData(context: IActionContext, data?: () => any): any
  • Parameters

    • context: IActionContext
    • Optional data: () => any
        • (): any
        • Returns any

    Returns any

getMediaTypeFormats

  • getMediaTypeFormats(context: IActionContext): Promise<Record<string, string>>
  • Parameters

    • context: IActionContext

    Returns Promise<Record<string, string>>

getMediaTypes

  • getMediaTypes(context: IActionContext): Promise<Record<string, number>>
  • Parameters

    • context: IActionContext

    Returns Promise<Record<string, number>>

initialize

  • initialize(): Promise<any>
  • Initialize this actor. This should be used for doing things that take a while, such as opening files.

    Returns Promise<any>

    A promise that resolves when the actor has been initialized.

Protected logDebug

  • logDebug(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logError

  • logError(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logFatal

  • logFatal(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logInfo

  • logInfo(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logTrace

  • logTrace(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

Protected logWarn

  • logWarn(context: IActionContext, message: string, data?: () => any): void
  • Parameters

    • context: IActionContext
    • message: string
    • Optional data: () => any
        • (): any
        • Returns any

    Returns void

run

  • Parameters

    Returns Promise<IActorOutputAbstractMediaTyped<IActorRuleParseOutput>>

Abstract runHandle

  • Run the given handle action on this actor.

    Parameters

    • action: IActionRuleParse

      The handle action to run.

    • mediaType: undefined | string

      The media type to run with.

    • context: IActionContext

      An optional context.

    Returns Promise<IActorRuleParseOutput>

    A promise that resolves to the handle run result.

runObservable

  • Run the given action on this actor AND invokes the {@link Bus#onRun} method.

    Parameters

    Returns Promise<IActorOutputAbstractMediaTyped<IActorRuleParseOutput>>

    A promise that resolves to the run result.

test

  • test(action: IActionAbstractMediaTyped<IActionRuleParse>): Promise<IActorTestAbstractMediaTyped<IActorTest>>
  • Parameters

    Returns Promise<IActorTestAbstractMediaTyped<IActorTest>>

testHandle

  • testHandle(action: IActionRuleParse, mediaType: string, context: IActionContext): Promise<IActorTest>
  • Parameters

    Returns Promise<IActorTest>

testHandleChecked

testMediaType

  • testMediaType(context: IActionContext): Promise<boolean>
  • Parameters

    • context: IActionContext

    Returns Promise<boolean>

testMediaTypeFormats

  • testMediaTypeFormats(context: IActionContext): Promise<boolean>
  • Parameters

    • context: IActionContext

    Returns Promise<boolean>

Static getContextLogger

  • getContextLogger(context: IActionContext): undefined | Logger
  • Get the logger from the given context.

    Parameters

    • context: IActionContext

      An optional context.

    Returns undefined | Logger

    The logger or undefined.

Generated using TypeDoc