public class

DrupalRestClient

extends Object
implements DrupalClient
java.lang.Object
   ↳ org.mule.modules.drupal.client.DrupalRestClient

Class Overview

Drupal client to interact with the rest server provided with the service modulo.

Summary

Constants
String ACTION_GETTREE
String ACTION_SELECTNODES
String COUNT_ALL
String COUNT_NEW
String LOGIN
String LOGOUT
String REGISTER
String RELATIONSHIP_COMMENTS
String RELATIONSHIP_FILES
Fields
private String apiUrl
private Client client
private String password
private int port
private String server
private NewCookie sessionId
private String username
Public Constructors
DrupalRestClient(String server, int port, String apiUrl)
Public Methods
String connectionId()
int countAllComments(int nodeId)
int countNewComments(int nodeId, int since)
DrupalEntity create(DrupalCollection collection, DrupalEntity entity)
Generic method to create entities in dynamic collections
Comment createComment(Comment comment)
File createFile(File file)
Node createNode(Node node)
TaxonomyTerm createTaxonomyTerm(TaxonomyTerm taxonomyTerm)
TaxonomyVocabulary createTaxonomyVocabulary(TaxonomyVocabulary taxonomyVocabulary)
User createUser(User user)
void deleteComment(int commentId)
void deleteFile(int fileId)
void deleteNode(int nodeId)
void deleteTaxonomyTerm(int taxonomyTermId)
void deleteTaxonomyVocabulary(int taxonomyVocId)
void deleteUser(int userId)
Client getClient()
List<Comment> getCommentsForNode(int nodeId)
List<File> getFilesForNode(int nodeId)
List<Node> getNodesWithTerm(int termId)
List<TaxonomyTerm> getTaxonomyVocabularyTree(int vocabularyId, int parent, int maxdepth)
List<Comment> indexComments(List<String> fields, int startPage, int pagesize)
List<File> indexFiles(List<String> fields, int startPage, int pagesize)
List<Node> indexNodes(List<String> fields, int startPage, int pagesize)
List<TaxonomyTerm> indexTaxonomyTerms(List<String> fields, int startPage, int pagesize)
List<TaxonomyVocabulary> indexTaxonomyVocabulary(List<String> fields, int startPage, int pagesize)
List<User> indexUsers(List<String> fields, int startPage, int pagesize)
boolean isConnected()
void login(String username, String password)
void logout()
Comment readComment(String commentId)
File readFile(String fileId)
Node readNode(String nodeId)
DrupalEntity readOne(DrupalCollection collection, String objectId)
Generic method to read entities from dynamic collections
TaxonomyTerm readTaxonomyTerm(String taxonomyTermId)
TaxonomyVocabulary readTaxonomyVocabulary(String taxonomyVocabularyId)
User readUser(String userId)
User registerUser(User user)
DrupalEntity update(DrupalCollection collection, String objectId, DrupalEntity entity)
Generic method to update entities from dynamic collections
Comment updateComment(Comment comment)
File updateFile(File file)
Node updateNode(Node node)
TaxonomyTerm updateTaxonomyTerm(TaxonomyTerm taxonomyTerm)
TaxonomyVocabulary updateTaxonomyVocabulary(TaxonomyVocabulary taxonomyVocabulary)
User updateUser(User user)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.modules.drupal.client.DrupalClient

Constants

private static final String ACTION_GETTREE

Constant Value: "getTree"

private static final String ACTION_SELECTNODES

Constant Value: "selectNodes"

private static final String COUNT_ALL

Constant Value: "countAll"

private static final String COUNT_NEW

Constant Value: "countNew"

private static final String LOGIN

Constant Value: "login"

private static final String LOGOUT

Constant Value: "logout"

private static final String REGISTER

Constant Value: "register"

private static final String RELATIONSHIP_COMMENTS

Constant Value: "comments"

private static final String RELATIONSHIP_FILES

Constant Value: "files"

Fields

private String apiUrl

private Client client

private String password

private int port

private String server

private NewCookie sessionId

private String username

Public Constructors

public DrupalRestClient (String server, int port, String apiUrl)

Parameters
server
port
apiUrl

Public Methods

public String connectionId ()

public int countAllComments (int nodeId)

Parameters
nodeId

public int countNewComments (int nodeId, int since)

Parameters
nodeId
since

public DrupalEntity create (DrupalCollection collection, DrupalEntity entity)

Generic method to create entities in dynamic collections

Parameters
collection A member of the DrupalCollection enum representing the collection that owns the entity
entity A subclass instance of DrupalEntity
Returns

public Comment createComment (Comment comment)

Parameters
comment

public File createFile (File file)

Parameters
file

public Node createNode (Node node)

Parameters
node

public TaxonomyTerm createTaxonomyTerm (TaxonomyTerm taxonomyTerm)

Parameters
taxonomyTerm

public TaxonomyVocabulary createTaxonomyVocabulary (TaxonomyVocabulary taxonomyVocabulary)

Parameters
taxonomyVocabulary

public User createUser (User user)

Parameters
user

public void deleteComment (int commentId)

Parameters
commentId

public void deleteFile (int fileId)

Parameters
fileId

public void deleteNode (int nodeId)

Parameters
nodeId

public void deleteTaxonomyTerm (int taxonomyTermId)

Parameters
taxonomyTermId

public void deleteTaxonomyVocabulary (int taxonomyVocId)

Parameters
taxonomyVocId

public void deleteUser (int userId)

Parameters
userId

public Client getClient ()

public List<Comment> getCommentsForNode (int nodeId)

Parameters
nodeId

public List<File> getFilesForNode (int nodeId)

Parameters
nodeId

public List<Node> getNodesWithTerm (int termId)

Parameters
termId

public List<TaxonomyTerm> getTaxonomyVocabularyTree (int vocabularyId, int parent, int maxdepth)

Parameters
vocabularyId
parent
maxdepth

public List<Comment> indexComments (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public List<File> indexFiles (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public List<Node> indexNodes (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public List<TaxonomyTerm> indexTaxonomyTerms (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public List<TaxonomyVocabulary> indexTaxonomyVocabulary (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public List<User> indexUsers (List<String> fields, int startPage, int pagesize)

Parameters
fields
startPage
pagesize

public boolean isConnected ()

public void login (String username, String password)

Parameters
username
password
Throws
ConnectionException

public void logout ()

Throws
ConnectionException

public Comment readComment (String commentId)

Parameters
commentId

public File readFile (String fileId)

Parameters
fileId

public Node readNode (String nodeId)

Parameters
nodeId

public DrupalEntity readOne (DrupalCollection collection, String objectId)

Generic method to read entities from dynamic collections

Parameters
collection A member of the DrupalCollection enum representing the collection that owns the entity
objectId The id of the entity you want to get
Returns

public TaxonomyTerm readTaxonomyTerm (String taxonomyTermId)

Parameters
taxonomyTermId

public TaxonomyVocabulary readTaxonomyVocabulary (String taxonomyVocabularyId)

Parameters
taxonomyVocabularyId

public User readUser (String userId)

Parameters
userId

public User registerUser (User user)

Parameters
user

public DrupalEntity update (DrupalCollection collection, String objectId, DrupalEntity entity)

Generic method to update entities from dynamic collections

Parameters
collection A member of the DrupalCollection enum representing the collection that owns the entity
objectId The id of the entity you want to get
entity A subclass instance of DrupalEntity with the entitie's new state
Returns

public Comment updateComment (Comment comment)

Parameters
comment

public File updateFile (File file)

Parameters
file

public Node updateNode (Node node)

Parameters
node

public TaxonomyTerm updateTaxonomyTerm (TaxonomyTerm taxonomyTerm)

Parameters
taxonomyTerm

public TaxonomyVocabulary updateTaxonomyVocabulary (TaxonomyVocabulary taxonomyVocabulary)

Parameters
taxonomyVocabulary

public User updateUser (User user)

Parameters
user