|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.drupal.project.computing.DSite
public abstract class DSite
This is the super class to any Drupal site. A Drupal Hybrid Computing application will use this class and sub-classes to connect to Drupal sites. The suggested way to pass data between applications and Drupal site is through the DRecord objects (maps to a record in the {computing_record} table. You would have your Drupal module write input data to a record, and then your application read it and write results back to the output field in the record, and your Drupal module can read data back to the database.
It doesn't handle deleting of old records, which is handled by Drupal. Here we don't require DSite to offer nodeLoad(), nodeSave(), or userLoad(), etc, because of security concerns. If your application needs to read nodes, the Drupal part of your application will write the node info into the "input" field of computing_record, and then your Java application can read it. However, we don't prevent subclasses to provide a nodeLoad() method. If you use DDrushSite in particular, you can call any Drupal API with drush. Also, you can use DDatabase to access Drupal database directly, but it's not recommended.
A Drupal site doesn't need to know the DApplication, or DConfig.
Some sub-class implementations:
Field Summary | |
---|---|
protected java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
DSite()
|
Method Summary | |
---|---|
boolean |
checkConnection()
Check whether connection to Drupal site is established. |
abstract java.lang.String |
getDrupalVersion()
|
DRecord |
getNextRecord(java.lang.String appName)
The first active record for the application. |
abstract long |
getTimestamp()
|
abstract DRecord |
loadRecord(long id)
Load one record according to its ID. |
abstract java.util.List<DRecord> |
queryActiveRecords(java.lang.String appName)
Active records are those without a "status" code. |
abstract long |
saveRecord(DRecord record)
Save the new record in the database using the data in the parameter. |
abstract void |
updateRecord(DRecord record)
Save the updated record in the database. |
abstract void |
updateRecordField(DRecord record,
java.lang.String fieldName)
Update only the specified field of the record. |
abstract java.lang.Object |
variableGet(java.lang.String name,
java.lang.Object defaultValue)
Execute Drupal API "variable_get()" |
abstract void |
variableSet(java.lang.String name,
java.lang.Object value)
Execute Drupal API "variable_set()" |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.logging.Logger logger
Constructor Detail |
---|
public DSite()
Method Detail |
---|
public DRecord getNextRecord(java.lang.String appName) throws DConnectionException
appName
-
DConnectionException
public abstract java.util.List<DRecord> queryActiveRecords(java.lang.String appName) throws DConnectionException
appName
-
DConnectionException
public abstract void updateRecord(DRecord record) throws DConnectionException
record
-
DConnectionException
public abstract void updateRecordField(DRecord record, java.lang.String fieldName) throws DConnectionException
record
- fieldName
-
DConnectionException
public abstract long saveRecord(DRecord record) throws DConnectionException
record
- The newly created record. record.isSave() has too be true.
DConnectionException
public abstract DRecord loadRecord(long id) throws DConnectionException
id
-
DConnectionException
public boolean checkConnection()
public abstract java.lang.String getDrupalVersion() throws DConnectionException
DConnectionException
public abstract java.lang.Object variableGet(java.lang.String name, java.lang.Object defaultValue) throws DConnectionException
name
- defaultValue
-
DConnectionException
public abstract void variableSet(java.lang.String name, java.lang.Object value) throws DConnectionException
name
- value
-
DConnectionException
public abstract long getTimestamp() throws DConnectionException
DConnectionException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |