Back to index

d-push  2.0
Public Member Functions | Public Attributes
IStateMachine Interface Reference
Inheritance diagram for IStateMachine:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GetStateHash ($devid, $type, $key=false, $counter=false)
 Constructor.
 GetState ($devid, $type, $key=false, $counter=false, $cleanstates=true)
 Gets a state for a specified key and counter.
 SetState ($state, $devid, $type, $key=false, $counter=false)
 Writes ta state to for a key and counter.
 CleanStates ($devid, $type, $key, $counter=false)
 Cleans up all older states If called with a $counter, all states previous state counter can be removed If called without $counter, all keys (independently from the counter) can be removed.
 LinkUserDevice ($username, $devid)
 Links a user to a device.
 UnLinkUserDevice ($username, $devid)
 Unlinks a device from a user.
 GetAllDevices ($username=false)
 Returns an array with all device ids for a user.

Public Attributes

const DEFTYPE = ""
const DEVICEDATA = "devicedata"
const FOLDERDATA = "fd"
const FAILSAVE = "fs"
const HIERARCHY = "hc"
const BACKENDSTORAGE = "bs"

Detailed Description

Definition at line 56 of file istatemachine.php.


Member Function Documentation

IStateMachine::CleanStates ( devid,
type,
key,
counter = false 
)

Cleans up all older states If called with a $counter, all states previous state counter can be removed If called without $counter, all keys (independently from the counter) can be removed.

Parameters:
string$devidthe device id
string$typethe state type
string$key
string$counter(opt)

public

Returns:
Exceptions:
StateInvalidException

Implemented in FileStateMachine.

IStateMachine::GetAllDevices ( username = false)

Returns an array with all device ids for a user.

If no user is set, all device ids should be returned

Parameters:
string$username(opt)

public

Returns:
array

Implemented in FileStateMachine.

IStateMachine::GetState ( devid,
type,
key = false,
counter = false,
cleanstates = true 
)

Gets a state for a specified key and counter.

This method sould call IStateMachine->CleanStates() to remove older states (same key, previous counters)

Parameters:
string$devidthe device id
string$typethe state type
string$key(opt)
string$counter(opt)
string$cleanstates(opt)

public

Returns:
mixed
Exceptions:
StateNotFoundException,StateInvalidException

Implemented in FileStateMachine.

IStateMachine::GetStateHash ( devid,
type,
key = false,
counter = false 
)

Constructor.

Exceptions:
FatalMisconfigurationExceptionGets a hash value indicating the latest dataset of the named state with a specified key and counter. If the state is changed between two calls of this method the returned hash should be different
Parameters:
string$devidthe device id
string$typethe state type
string$key(opt)
string$counter(opt)

public

Returns:
string
Exceptions:
StateNotFoundException,StateInvalidException

Implemented in FileStateMachine.

IStateMachine::LinkUserDevice ( username,
devid 
)

Links a user to a device.

Parameters:
string$username
string$devidpublic
Returns:
array

Implemented in FileStateMachine.

IStateMachine::SetState ( state,
devid,
type,
key = false,
counter = false 
)

Writes ta state to for a key and counter.

Parameters:
mixed$state
string$devidthe device id
string$typethe state type
string$key(opt)
int$counter(opt)

public

Returns:
boolean
Exceptions:
StateInvalidException

Implemented in FileStateMachine.

IStateMachine::UnLinkUserDevice ( username,
devid 
)

Unlinks a device from a user.

Parameters:
string$username
string$devidpublic
Returns:
array

Implemented in FileStateMachine.


Member Data Documentation

Definition at line 62 of file istatemachine.php.

Definition at line 57 of file istatemachine.php.

const IStateMachine::DEVICEDATA = "devicedata"

Definition at line 58 of file istatemachine.php.

Definition at line 60 of file istatemachine.php.

Definition at line 59 of file istatemachine.php.

Definition at line 61 of file istatemachine.php.


The documentation for this interface was generated from the following file: