BiodbConnBase-class {biodb}R Documentation

Base class of BiodbConn for encapsulating all needed information for database access.

Description

This is the base class for BiodbConn and BiodbDbInfo. When defining a new connector class, your class must not inherit from BiodbBaseConn but at least from BiodbConn (or BiodbRemoteConn or any subclass of BiodbConn). Its main purpose is to store property values. Those values are initialized from YAML files. The default definition file is located inside the package in "inst/definitions.yml" and is loaded at Biodb startup. However you can define your own files and load them using the BiodbMain::loadDefinitions() method.

Details

Arguments to the contructor are:

other: Another object inheriting from BiodbBaseConn, and from which property values will be copied.

db.class: The class of the database ("mass.csv.file", "comp.csv.file", ...).

properties: Some properties to set at initialization.

Methods

getBaseUrl()

Returns the base URL.

getConnClass()

:

Gets the associated connector OOP class.

Returned value: Returns the connector OOP class.

getConnClassName()

:

Gets the name of the associated connector OOP class.

Returned value: Returns the connector OOP class name.

getDbClass()

:

Gets the Biodb name of the database associated with this connector.

Returned value: A character value containing the Biodb database name.

getEntryClass()

:

Gets the associated entry class.

Returned value: Returns the associated entry class.

getEntryClassName()

:

Gets the name of the associated entry class.

Returned value: Returns the name of the associated entry class.

getEntryContentType()

Returns the entry content type.

getEntryFileExt()

:

Returns the entry file extension used by this connector.

Returned value: A character value containing the file extension.

getEntryIdField()

:

Gets the name of the corresponding database ID field in entries.

Returned value: Returns the name of the database ID field.

getName()

Returns the full database name.

getPropertyValue(name)

:

Gets a property value.

name: The name of the property.

Returned value: The value of the property.

getPropSlots(name)

:

Gets the slot fields of a property.

name: The name of a property.

Returned value: Returns a character vector containing all slot names defined.

getPropValSlot(name, slot)

:

Retrieve the value of a slot of a property.

name: The name of a property.

slot: The slot name inside the property.

Returned value: The value of the slot 'slot' of the property 'name'.

getSchedulerNParam()

Returns the N parameter for the scheduler.

getSchedulerTParam()

Returns the T parameter for the scheduler.

getToken()

Returns the access token.

getUrl(name)

Returns a URL.

getUrls()

Returns the URLs.

getWsUrl()

Returns the web sevices URL.

getXmlNs()

Returns the XML namespace.

hasProp(name)

:

Tests if this connector has a property.

name: The name of the property to check.

Returned value: Returns true if the property 'name' exists.

hasPropSlot(name, slot)

:

Tests if a slot property has a specific slot.

name: The name of a property.

slot: The slot name to check.

Returned value: Returns TRUE if the property 'name' exists and has the slot 'slot' defined, and FALSE otherwise.

isSlotProp(name)

:

Tests if a property is a slot property.

name: The name of a property.

Returned value: Returns TRUE if the property is a slot propert, FALSE otherwise.

propExists(name)

:

Checks if property exists.

name: The name of a property.

Returned value: Returns TRUE if the property 'name' exists, and FALSE otherwise.

setBaseUrl(url)

Sets the base URL.

setPropertyValue(name, value)

:

Sets the value of a property.

name: The name of the property.

value: The new value to set the property to.

Returned value: None.

setPropValSlot(name, slot, value)

:

Set the value of the slot of a property.

name: The name of the property.

slot: The name of the property's slot.

value: The new value to set the property's slot to.

Returned value: None.

setSchedulerNParam(n)

Sets the N parameter for the scheduler.

setSchedulerTParam(t)

Sets the T parameter for the scheduler.

setToken(token)

Sets the access token.

setUrl(name, url)

Returns a URL.

setWsUrl(ws.url)

Sets the web sevices URL.

updatePropertiesDefinition(def)

:

Update the definition of properties.

def: A named list of property definitions. The names of the list must be the property names.

Returned value: None.

See Also

Sub-classes BiodbDbInfo and BiodbConn.

Examples

# Create an instance with default settings:
mybiodb <- biodb::newInst()

# Accessing BiodbConnBase methods when using a BiodbDbInfo object
dbinf <- mybiodb$getDbsInfo()$get('comp.csv.file')

# Test if a property exists
dbinf$hasProp('name')

# Get a property value
dbinf$getPropertyValue('name')

# Get a property value slot
dbinf$getPropValSlot('urls', 'base.url')

# Terminate instance.
mybiodb$terminate()


[Package biodb version 1.0.4 Index]