Android Open Source - geocamTalkAndroid I Site Auth






From Project

Back to project page geocamTalkAndroid.

License

The source code is released under:

NASA OPEN SOURCE AGREEMENT VERSION 1.3 THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORI...

If you think the Android project geocamTalkAndroid 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

// __BEGIN_LICENSE__
// Copyright (C) 2008-2010 United States Government as represented by
// the Administrator of the National Aeronautics and Space Administration.
// All Rights Reserved.
// __END_LICENSE__
// w ww.  j a  v  a 2s  .c om
package gov.nasa.arc.geocam.talk.service;

import gov.nasa.arc.geocam.talk.bean.ServerResponse;
import gov.nasa.arc.geocam.talk.exception.AuthenticationFailedException;

import java.io.IOException;
import java.security.InvalidParameterException;
import java.util.Map;

import org.apache.http.client.ClientProtocolException;

// TODO: Auto-generated Javadoc
/**
 * The Interface ISiteAuth.
 */
public interface ISiteAuth {
  
  /**
   * Sets the root.
   *
   * @param siteRoot the new root
   */
  public void setRoot(String siteRoot);

  /**
   * Post the message to the server if no audio file is present if the 
   * user is logged in.
   *
   * @param relativePath the relative path
   * @param params the params
   * @return the server response
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   * @throws ClientProtocolException the client protocol exception
   * @throws InvalidParameterException the invalid parameter exception
   */
  public ServerResponse post(String relativePath, Map<String, String> params)
      throws AuthenticationFailedException, IOException, ClientProtocolException,
      InvalidParameterException;

  /**
   * Post the message to the server if there is an audio file present and we are currently 
   * logged in.
   *
   * @param relativePath the relative path
   * @param params the params
   * @param audioBytes the audio bytes
   * @return the server response
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   * @throws ClientProtocolException the client protocol exception
   * @throws InvalidParameterException the invalid parameter exception
   */
  public ServerResponse post(String relativePath, Map<String, String> params, byte[] audioBytes)
      throws AuthenticationFailedException, IOException, ClientProtocolException,
      InvalidParameterException;

  /**
   * Creates a HTTP get call to retrieve information from the server.
   *
   * @param relativePath the relative path
   * @param params the params
   * @return the server response
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   * @throws ClientProtocolException the client protocol exception
   */
  public ServerResponse get(String relativePath, Map<String, String> params)
      throws AuthenticationFailedException, IOException, ClientProtocolException;

    /**
     * Gets the audio file from a message on the server.
     *
     * @param relativePath the relative path
     * @param params the params
     * @return The filename of the audio retrieved from the server
     * @throws AuthenticationFailedException the authentication failed exception
     * @throws IOException Signals that an I/O exception has occurred.
     * @throws ClientProtocolException the client protocol exception
     */
    public String getAudioFile(String relativePath, Map<String, String> params) 
      throws AuthenticationFailedException, IOException, ClientProtocolException;  
  
  /**
   * Set the session cookie to null and force a new login.
   *
   * @throws ClientProtocolException the client protocol exception
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public void reAuthenticate() 
      throws ClientProtocolException, AuthenticationFailedException, IOException;
  
  /**
   * Logout the user from the server and unregister from the C2DM.
   *
   * @throws ClientProtocolException the client protocol exception
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public void logoutAndUnregister()
      throws ClientProtocolException, AuthenticationFailedException, IOException;
  
  /**
   * Login to the server with the supplied username and password.
   *
   * @throws ClientProtocolException the client protocol exception
   * @throws AuthenticationFailedException the authentication failed exception
   * @throws IOException Signals that an I/O exception has occurred.
   */
  public void login()
      throws ClientProtocolException, AuthenticationFailedException, IOException;
  
  /**
   * Checks if the user logged in.
   *
   * @return true, if the user is logged in
   */
  public boolean isLoggedIn();
}

class AuthorizationFailedException extends Exception {
  private static final long serialVersionUID = 1L;
}




Java Source Code List

gov.nasa.arc.geocam.talk.GeoCamTalkModule.java
gov.nasa.arc.geocam.talk.GeoCamTalkRoboApplication.java
gov.nasa.arc.geocam.talk.UIUtils.java
gov.nasa.arc.geocam.talk.activity.AuthenticatedBaseActivity.java
gov.nasa.arc.geocam.talk.activity.GeoCamTalkActivity.java
gov.nasa.arc.geocam.talk.activity.GeoCamTalkCreateActivity.java
gov.nasa.arc.geocam.talk.activity.GeoCamTalkLogon.java
gov.nasa.arc.geocam.talk.activity.GeoCamTalkMapActivity.java
gov.nasa.arc.geocam.talk.activity.GeoCamTalkMessageAdapter.java
gov.nasa.arc.geocam.talk.activity.SettingsActivity.java
gov.nasa.arc.geocam.talk.bean.GeoCamTalkMessage.java
gov.nasa.arc.geocam.talk.bean.ServerResponse.java
gov.nasa.arc.geocam.talk.bean.TalkServerIntent.java
gov.nasa.arc.geocam.talk.exception.AuthenticationFailedException.java
gov.nasa.arc.geocam.talk.service.AudioPlayer.java
gov.nasa.arc.geocam.talk.service.AudioRecorder.java
gov.nasa.arc.geocam.talk.service.C2DMReciever.java
gov.nasa.arc.geocam.talk.service.DatabaseHelper.java
gov.nasa.arc.geocam.talk.service.GeoCamSynchronizationTimerTask.java
gov.nasa.arc.geocam.talk.service.GeoLocationListener.java
gov.nasa.arc.geocam.talk.service.IAudioPlayer.java
gov.nasa.arc.geocam.talk.service.IAudioRecorder.java
gov.nasa.arc.geocam.talk.service.IDatabaseHelper.java
gov.nasa.arc.geocam.talk.service.IGeoCamSynchronizationTimerTask.java
gov.nasa.arc.geocam.talk.service.IIntentHelper.java
gov.nasa.arc.geocam.talk.service.IMessageStore.java
gov.nasa.arc.geocam.talk.service.ISiteAuth.java
gov.nasa.arc.geocam.talk.service.ITalkJsonConverter.java
gov.nasa.arc.geocam.talk.service.ITalkServer.java
gov.nasa.arc.geocam.talk.service.IntentHelper.java
gov.nasa.arc.geocam.talk.service.MessageStore.java
gov.nasa.arc.geocam.talk.service.SiteAuthCookie.java
gov.nasa.arc.geocam.talk.service.TalkJsonConverter.java
gov.nasa.arc.geocam.talk.service.TalkMapOverlay.java
gov.nasa.arc.geocam.talk.service.TalkServer.java