org.drupal.project.computing
Class DServicesSite

java.lang.Object
  extended by org.drupal.project.computing.DSite
      extended by org.drupal.project.computing.DServicesSite

public class DServicesSite
extends DSite

Connects to Drupal site via the "services" module.

See Also:
http://drupal.org/project/services

Field Summary
 
Fields inherited from class org.drupal.project.computing.DSite
logger
 
Constructor Summary
DServicesSite()
           
 
Method Summary
 java.lang.String getDrupalVersion()
           
 long getTimestamp()
           
 DRecord loadRecord(long id)
          Load one record according to its ID.
 java.util.List<DRecord> queryActiveRecords(java.lang.String appName)
          Active records are those without a "status" code.
 long saveRecord(DRecord record)
          Save the new record in the database using the data in the parameter.
 void updateRecord(DRecord record)
          Save the updated record in the database.
 void updateRecordField(DRecord record, java.lang.String fieldName)
          Update only the specified field of the record.
 java.lang.Object variableGet(java.lang.String name, java.lang.Object defaultValue)
          Execute Drupal API "variable_get()"
 void variableSet(java.lang.String name, java.lang.Object value)
          Execute Drupal API "variable_set()"
 
Methods inherited from class org.drupal.project.computing.DSite
checkConnection, getNextRecord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DServicesSite

public DServicesSite()
Method Detail

queryActiveRecords

public java.util.List<DRecord> queryActiveRecords(java.lang.String appName)
                                           throws DConnectionException
Description copied from class: DSite
Active records are those without a "status" code. All handled records has a status code. Usually, you would process the active records that has "REDY" control code. Other records might have other control code, and would be processed differently.

Specified by:
queryActiveRecords in class DSite
Returns:
All active records that are not handled.
Throws:
DConnectionException

updateRecord

public void updateRecord(DRecord record)
                  throws DConnectionException
Description copied from class: DSite
Save the updated record in the database.

Specified by:
updateRecord in class DSite
Throws:
DConnectionException

updateRecordField

public void updateRecordField(DRecord record,
                              java.lang.String fieldName)
                       throws DConnectionException
Description copied from class: DSite
Update only the specified field of the record.

Specified by:
updateRecordField in class DSite
Throws:
DConnectionException

saveRecord

public long saveRecord(DRecord record)
                throws DConnectionException
Description copied from class: DSite
Save the new record in the database using the data in the parameter.

Specified by:
saveRecord in class DSite
Parameters:
record - The newly created record. record.isSave() has too be true.
Returns:
The database record ID of the newly created record.
Throws:
DConnectionException

loadRecord

public DRecord loadRecord(long id)
                   throws DConnectionException
Description copied from class: DSite
Load one record according to its ID.

Specified by:
loadRecord in class DSite
Returns:
Throws:
DConnectionException

getDrupalVersion

public java.lang.String getDrupalVersion()
                                  throws DConnectionException
Specified by:
getDrupalVersion in class DSite
Returns:
The version of Drupal for this site.
Throws:
DConnectionException

variableGet

public java.lang.Object variableGet(java.lang.String name,
                                    java.lang.Object defaultValue)
                             throws DConnectionException
Description copied from class: DSite
Execute Drupal API "variable_get()"

Specified by:
variableGet in class DSite
Returns:
Throws:
DConnectionException

variableSet

public void variableSet(java.lang.String name,
                        java.lang.Object value)
                 throws DConnectionException
Description copied from class: DSite
Execute Drupal API "variable_set()"

Specified by:
variableSet in class DSite
Throws:
DConnectionException

getTimestamp

public long getTimestamp()
                  throws DConnectionException
Specified by:
getTimestamp in class DSite
Returns:
Drupal site's current timestamp. Equivalent to PHP time().
Throws:
DConnectionException