// Path: java/src/org/drupal/project/computing/exception/DConfigException.java
// public class DConfigException extends Exception {
//     public DConfigException() {
//     }
// 
//     public DConfigException(String s) {
//         super(s);
//     }
// 
//     public DConfigException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DConfigException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DNotFoundException.java
// public class DNotFoundException extends Exception {
//     public DNotFoundException() {}
// 
//     public DNotFoundException(String s) {
//         super(s);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DSiteException.java
// public class DSiteException extends Exception {
//     public DSiteException() {
//         super();
//     }
// 
//     public DSiteException(String s) {
//         super(s);
//     }
// 
//     public DSiteException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DSiteException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     /**
//      * The error code is arbitrary by the caller which sets it.
//      */
//     private int errorCode = 0;
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// 
//     public void setErrorCode(int errorCode) {
//         this.errorCode = errorCode;
//     }
// 
// }


import org.apache.commons.lang3.StringUtils;
import org.drupal.project.computing.exception.DConfigException;
import org.drupal.project.computing.exception.DNotFoundException;
import org.drupal.project.computing.exception.DSiteException;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import java.util.ArrayList;
import java.util.List;
package org.drupal.project.computing;



/**
 * Uses Drupal Services REST Server to access Drupal. This class has connect() and close() which are not defined in
 * DSite. The DApplication is responsible to connect() and close() the connection. However, here we try "connect()" for
 * all operations that require user login.
 *
 * BUG: DApplication doesn't explicitly run "close()" for DServicesSite.
 */
public class DServicesSite extends DSite implements DSiteExtended {

    protected DRestfulJsonServices services;

    public DServicesSite(DRestfulJsonServices services) {
        this.services = services;
    }

// Path: java/src/org/drupal/project/computing/exception/DConfigException.java
// public class DConfigException extends Exception {
//     public DConfigException() {
//     }
// 
//     public DConfigException(String s) {
//         super(s);
//     }
// 
//     public DConfigException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DConfigException(Throwable throwable) {
//         super(throwable);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DNotFoundException.java
// public class DNotFoundException extends Exception {
//     public DNotFoundException() {}
// 
//     public DNotFoundException(String s) {
//         super(s);
//     }
// }
// 
// Path: java/src/org/drupal/project/computing/exception/DSiteException.java
// public class DSiteException extends Exception {
//     public DSiteException() {
//         super();
//     }
// 
//     public DSiteException(String s) {
//         super(s);
//     }
// 
//     public DSiteException(String s, Throwable throwable) {
//         super(s, throwable);
//     }
// 
//     public DSiteException(Throwable throwable) {
//         super(throwable);
//     }
// 
//     /**
//      * The error code is arbitrary by the caller which sets it.
//      */
//     private int errorCode = 0;
// 
//     public int getErrorCode() {
//         return errorCode;
//     }
// 
//     public void setErrorCode(int errorCode) {
//         this.errorCode = errorCode;
//     }
// 
// }


// Path: java/src/org/drupal/project/computing/DServicesSite.java
import org.apache.commons.lang3.StringUtils;
import org.drupal.project.computing.exception.DConfigException;
import org.drupal.project.computing.exception.DNotFoundException;
import org.drupal.project.computing.exception.DSiteException;
import javax.script.Bindings;
import javax.script.SimpleBindings;
import java.util.ArrayList;
import java.util.List;

package org.drupal.project.computing;



/**
 * Uses Drupal Services REST Server to access Drupal. This class has connect() and close() which are not defined in
 * DSite. The DApplication is responsible to connect() and close() the connection. However, here we try "connect()" for
 * all operations that require user login.
 *
 * BUG: DApplication doesn't explicitly run "close()" for DServicesSite.
 */
public class DServicesSite extends DSite implements DSiteExtended {

    protected DRestfulJsonServices services;

    public DServicesSite(DRestfulJsonServices services) {
        this.services = services;
    }

    public static DServicesSite loadDefault() throws DConfigException {