\App\IqrfNetModule\ModelsApiSchemaManager

IQRF Gateway Daemon API message JSON schema manager

Summary

Methods
Properties
Constants
__construct()
setSchema()
validate()
delete()
exists()
read()
write()
getDirectory()
setSchemaForRequest()
setSchemaForResponse()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(  directory) : 

Constructor

Parameters

directory

Directory with files

Returns

setSchema()

setSchema(  fileName) : 

Sets the JSON schema file name

Parameters

fileName

JSON schema file name

Returns

validate()

validate(  json,   tryFix = false) : 

Validates JSON

Parameters

json

JSON to validate

tryFix

Try fix JSON?

Throws

\App\CoreModule\Models\InvalidJsonException
\App\CoreModule\Models\JsonException

Returns

Is the JSON valid?

delete()

delete(  fileName) : 

Deletes the file

Parameters

fileName

File name

Throws

\App\CoreModule\Models\IOException

Returns

exists()

exists(  fileName) : 

Checks if the file exists

Parameters

fileName

File name

Returns

Is file exists?

read()

read(  fileName) : 

Reads the file

Parameters

fileName

File name

Throws

\App\CoreModule\Models\IOException

Returns

File content

write()

write(  fileName,   content) : 

Writes into the file

Parameters

fileName

File name

content

File content

Throws

\App\CoreModule\Models\IOException

Returns

getDirectory()

getDirectory() : 

Returns the directory with files

Returns

Directory with files

setSchemaForRequest()

setSchemaForRequest(  mType) : 

Sets the file name of JSON schema from the API message type

Parameters

mType

Message type

Throws

\App\IqrfNetModule\Models\NonExistingJsonSchemaException

Returns

setSchemaForResponse()

setSchemaForResponse(  mType) : 

Sets the file name of JSON schema from the API message type

Parameters

mType

Message type

Throws

\App\IqrfNetModule\Models\NonExistingJsonSchemaException

Returns