Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FourDService

Service containing useful methods to communicate with server.

Hierarchy

  • FourDService

Index

Constructors

constructor

  • Parameters

    • V: Vasat

    Returns FourDService

Properties

FILE_ADDED

FILE_ADDED: string = "file_added"

FILE_BEFORE_UL

FILE_BEFORE_UL: string = "file_before"

FILE_CNX

FILE_CNX: string = "file_cnx"

FILE_FAILED

FILE_FAILED: string = "file_failed"

FILE_PROGRESS

FILE_PROGRESS: string = "file_prog"

FILE_UPLOADED

FILE_UPLOADED: string = "file_uploaded"

FILTER_PLOTABLE

FILTER_PLOTABLE: string = "plotable"

V

V: Vasat

Private _accountChangeSubject

_accountChangeSubject: any = new Subject<Account>()

Private _accountsObservale

_accountsObservale: Observable<Account[]>

Private _activeAccountObservable

_activeAccountObservable: Observable<Account>

Private _runningTaskSubject

_runningTaskSubject: any = new Subject<TaskEvent>()

Private _socketCommands

_socketCommands: object

Type declaration

Private _socketObservable

_socketObservable: Observable<any> = this._socketSubject.asObservable().pipe(debounceTime(30000))

Private _socketSubject

_socketSubject: Subject<any> = new Subject()

Private _uploadsRunningSubject

_uploadsRunningSubject: any = new Subject<TaskEvent>()

account

account: Account

accountChangeObservable

accountChangeObservable: Observable<Account> = this._accountChangeSubject.asObservable()

activeDataset

activeDataset: Dataset

activeTeam

activeTeam: Account

activeUser

activeUser: User

apis

apis: ProcessorAPI[]

datasetTypes

datasetTypes: DatasetType[]

filters

filters: object

Type declaration

jobTypes

jobTypes: JobType[]

plans

plans: AccountPlan[]

playground

playground: Dataset[] = []

projects

projects: Project[]

roles

roles: Role[]

rootAccounts

rootAccounts: Account[]

runningTasks

runningTasks: ServerProcess[] = []

runningTasksMap

runningTasksMap: object

Type declaration

runningTasksObservable

runningTasksObservable: Observable<TaskEvent> = this._runningTaskSubject.asObservable()

sampleAccount

sampleAccount: Account

Private socket

socket: WebSocket

socketUp

socketUp: boolean

teams

teams: Account[]

testing

testing: string

transformTypes

transformTypes: TransformType[]

tryingAccount

tryingAccount: string

uploadChunkSize

uploadChunkSize: number = 5000000

uploadsQueued

uploadsQueued: ServerProcess[] = []

uploadsQueuedMap

uploadsQueuedMap: object

Type declaration

uploadsRunning

uploadsRunning: ServerProcess[] = []

uploadsRunningMap

uploadsRunningMap: object

Type declaration

uploadsRunningObservable

uploadsRunningObservable: Observable<TaskEvent> = this._uploadsRunningSubject.asObservable()

Methods

_deQueue

  • _deQueue(): void
  • Returns void

addTask

clearStates

  • clearStates(): void
  • Removes active team.

    Returns void

deinitSocket

  • deinitSocket(): void
  • Close WebSocket.

    Returns void

getApi

  • Return ProcessorAPI of given type.

    Parameters

    • apiType: string

      The type of transformation from this API.

    Returns ProcessorAPI

getQuotas

  • getQuotas(): any
  • Get Accounts where quota is true.

    Returns any

initSocket

  • initSocket(s: VasatSession): void
  • Initialise WebSocket.

    Parameters

    • s: VasatSession

    Returns void

logout

  • logout(): any
  • Logout of current user.

    Returns any

onActiveAccountReady

  • onActiveAccountReady(): Observable<Account>
  • Returns observable of Account if it exists. Else throws exception.

    Returns Observable<Account>

onReady

  • Returns an observable of an Account object. If it does not have a team or get sample Account.

    Note: throws exception if not logged in.

    Returns Observable<Account[]>

onSocketCommand

  • onSocketCommand(cmd: string): Observable<any>
  • If command does not exist, create one and return.

    Parameters

    • cmd: string

      Socket command.

    Returns Observable<any>

removeTask

  • Remove the ServerProcess task.

    Parameters

    • task: ServerProcess

      The task to remove.

    • Optional err: boolean

      if the task ended in error set to true.

    Returns void

retrySocket

  • retrySocket(s: VasatSession, e: any): void
  • Try to reinitialise WebSocket.

    Parameters

    • s: VasatSession

      An active Vasat Session.

    • e: any

      Error or exception.

    Returns void

searchFor

  • searchFor<T>(objectType: VasatModelClass<T>): any
  • Queries for Vasat Model class and returns a VasatSeachQuery.

    Type parameters

    Parameters

    • objectType: VasatModelClass<T>

      The Vasat model you want to query for.

    Returns any

sendSocket

  • sendSocket(a: any): void
  • Transmist data to server.

    Parameters

    • a: any

      Data to send.

    Returns void

setActiveTeam

  • setActiveTeam(accountId: string): Observable<Account>
  • Note that this is for advanced users with multiple teams. If you are a single user this does not apply.

    Sets the active team to given accountId, so all subsequent api calls that are made will return things that only this accountId can see.

    Parameters

    • accountId: string

    Returns Observable<Account>

uploadFile

  • Uploads file using ChunkedFileUploader.

    Parameters

    • ds: Dataset

      Dataset to upload associated file.

    • f: File

      File to be uploaded.

    • Default value filename: string = "data"

      Name of file.

    • Optional chunkSize: number

      Size of chunks when uploading.

    Returns ServerProcess

Generated using TypeDoc