Android Open Source - dandy Drupal Services Request Manager






From Project

Back to project page dandy.

License

The source code is released under:

GNU General Public License

If you think the Android project dandy listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.workhabit.drupal.http;
/* ww  w .ja va2 s.  c om*/
import org.workhabit.drupal.api.site.impl.DrupalSiteContextInstanceState;
import org.workhabit.drupal.api.site.support.GenericCookie;

import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Copyright 2009 - WorkHabit, Inc. - acs
 * Date: Oct 22, 2010, 10:12:37 PM
 */
public interface DrupalServicesRequestManager {
    /**
     * Make a request to the remote site with content type application/json
     *
     * @param path path, including http:// to the remote request (excludes query string)
     * @param data a String representing the data to post.
     *
     * <b>Note:</b> In this implementation the content type is set to application/json, so the data
     * to post should be a json object and not key/value pairs.
     *
     * If you need to post key/value pairs, {@see DrupalServicesRequestManager#post}
     *
     * @return a string representing the response
     * @throws IOException if there's a problem making the request.
     */
    public ServicesResponse post(String path, String data) throws IOException;

    /**
     * make a POST request to the server with content type application/x-www-form-urlencoded
     *
     *
     * @param path path, including http:// to the remote request (may include query string parameters if there is a need)
     * @param data map of key value pairs corresponding to query string parameters
     * @return a string representing the response.
     * @throws IOException if there's a problem making the request.
     */
    public org.workhabit.drupal.http.ServicesResponse post(String path, Map<String, Object> data) throws IOException;

    /**
     * Make a PUT request to the server with content type application/x-www-form-urlencoded
     *
     * @param path the path to the request (including querystring if any)
     * @param data the data to post as key/value pairs
     *
     * @return a service response representing the result of the request.
     *
     * @throws IOException
     */
    @SuppressWarnings({"UnusedDeclaration"})
    public ServicesResponse put(String path, Map<String, Object> data) throws IOException;

    /**
     * Make a PUT request to the server with content type application/x-www-form-urlencoded
     *
     * @param path the path to the request (including querystring if any)
     * @param data the data to PUT as a string.
     *
     * * <b>Note:</b> In this implementation the content type is set to application/json, so the data
     * to PUT should be a json object and not key/value pairs.
     *
     * If you need to PUT key/value pairs, {@see DrupalServicesRequestManager#put(String path, Map data)}

     * @return a service response representing the result of the request.
     *
     * @throws IOException if there's a problem making the request
     */
    public ServicesResponse put(String path, String data) throws IOException;

    @SuppressWarnings({"UnusedDeclaration"})
    public ServicesResponse delete(String path) throws IOException;

    /** make a GET request to the remote site for the specified path
     *
     * @param path full URL to the remote server.
     * @return input stream corresponding to the response data.
     *
     * @throws IOException if there was a problem parsing the response.
     */
    @SuppressWarnings({"UnusedDeclaration"})
    public InputStream getStream(String path) throws IOException;

    public ServicesResponse getString(String path) throws IOException;

    ArrayList<GenericCookie> getCookies();

    @SuppressWarnings({"UnusedDeclaration"})
    public ServicesResponse postFile(String path, String fieldName, InputStream inputStream, String fileName) throws IOException;

    void initializeSavedState(DrupalSiteContextInstanceState state);
}




Java Source Code List

com.workhabit.drupal.publisher.AbstractDandyActivity.java
com.workhabit.drupal.publisher.AbstractDandyListActivity.java
com.workhabit.drupal.publisher.AbstractDrupalNodeListActivity.java
com.workhabit.drupal.publisher.DandyApplication.java
com.workhabit.drupal.publisher.DrupalHeadlineNodeListActivity.java
com.workhabit.drupal.publisher.DrupalLoginActivity.java
com.workhabit.drupal.publisher.DrupalNodeActivity.java
com.workhabit.drupal.publisher.DrupalNodeListViewActivity.java
com.workhabit.drupal.publisher.DrupalTaxonomyListActivity.java
com.workhabit.drupal.publisher.NewCommentActivity.java
com.workhabit.drupal.publisher.support.BottomNavClickHandler.java
com.workhabit.drupal.publisher.support.DrupalDialogHandler.java
com.workhabit.drupal.publisher.support.DrupalNodeArrayAdapter.java
com.workhabit.drupal.publisher.support.DrupalTaxonomyAdapter.java
org.workhabit.drupal.api.annotations.IdFieldName.java
org.workhabit.drupal.api.entity.drupal7.DrupalBody.java
org.workhabit.drupal.api.entity.drupal7.DrupalComment.java
org.workhabit.drupal.api.entity.drupal7.DrupalEntity.java
org.workhabit.drupal.api.entity.drupal7.DrupalField.java
org.workhabit.drupal.api.entity.drupal7.DrupalFile.java
org.workhabit.drupal.api.entity.drupal7.DrupalNode.java
org.workhabit.drupal.api.entity.drupal7.DrupalTaxonomyTerm.java
org.workhabit.drupal.api.entity.drupal7.DrupalUser.java
org.workhabit.drupal.api.entity.drupal7.ReadItLater.java
org.workhabit.drupal.api.json.BooleanAdapter.java
org.workhabit.drupal.api.json.DrupalFieldAdapter.java
org.workhabit.drupal.api.json.DrupalJsonObjectSerializerFactory.java
org.workhabit.drupal.api.json.DrupalJsonObjectSerializer.java
org.workhabit.drupal.api.json.UnixTimeDateAdapter.java
org.workhabit.drupal.api.site.CalendarFactory.java
org.workhabit.drupal.api.site.Drupal7SiteContext.java
org.workhabit.drupal.api.site.DrupalSiteContext.java
org.workhabit.drupal.api.site.NonceFactory.java
org.workhabit.drupal.api.site.exceptions.DrupalFetchException.java
org.workhabit.drupal.api.site.exceptions.DrupalLoginException.java
org.workhabit.drupal.api.site.exceptions.DrupalLogoutException.java
org.workhabit.drupal.api.site.exceptions.DrupalSaveException.java
org.workhabit.drupal.api.site.exceptions.DrupalServicesResponseException.java
org.workhabit.drupal.api.site.impl.DrupalSiteContextInstanceStateImpl.java
org.workhabit.drupal.api.site.impl.DrupalSiteContextInstanceState.java
org.workhabit.drupal.api.site.impl.v3.Drupal6SiteContextImpl.java
org.workhabit.drupal.api.site.impl.v3.Drupal7SiteContextImpl.java
org.workhabit.drupal.api.site.impl.v3.DrupalSiteContextBridge.java
org.workhabit.drupal.api.site.support.AndroidDrupalServicesRequestManagerImpl.java
org.workhabit.drupal.api.site.support.GenericCookie.java
org.workhabit.drupal.api.site.support.HttpUrlConnectionFactoryImpl.java
org.workhabit.drupal.api.site.support.HttpUrlConnectionFactory.java
org.workhabit.drupal.api.site.support.NonceFactoryImpl.java
org.workhabit.drupal.http.DrupalServicesRequestManager.java
org.workhabit.drupal.http.ServicesResponse.java