agave-apps/clients/AuthService.java
/**
	 * Renews the given token for another 2 hours.
	 * 
	 * @param token token to refresh
	 * @param username api username
	 * @param password api password. Note that tokens can be used to refresh themselves.
	 * 
	 * @return renewed AuthenticationToken
	 * @throws APIClientException
	 * @throws AuthenticationException
	 */
Renews the given token for another 2 hours.

@param token token to refresh
@param username api username
@param password api password. Note that tokens can be used to refresh themselves.


Renews the given token for another 2 hours . @param token token to refresh @param username api username @param password api password . Note that tokens can be used to refresh themselves .
public AuthenticationToken renew(AuthenticationToken token, String username, String password) 
	throws APIClientException, AuthenticationException
	{
		if (StringUtils.isEmpty(username)) {
			throw new APIClientException("No username provided.");
		}
		if (StringUtils.isEmpty(password)) {
			throw new APIClientException("No password provided.");
		}
		if (token == null) {
			throw new APIClientException("No token provided.");
		}
		APIResponse response = null;
		try 
		{
			List <NameValuePair> nvps = new ArrayList<NameValuePair>();
			nvps.add(new BasicNameValuePair("token", token.getToken()));
			token.setUsername(username);
			token.setToken(password);
			response = post( Settings.SERVICE_BASE_URL + "auth-v1/renew.php", token, nvps );
		} 
		catch (APIClientException e) {
			throw new AuthenticationException("Error authenticating to service.", e);
		}
		if (response.isSuccess()) {
			return parseToken(response.getResult());
		} else {
			throw new AuthenticationException(response.getMessage());
		}
	}
public AuthenticationToken renew ( AuthenticationToken token , String username , String password ) throws APIClientException , AuthenticationException { if ( StringUtils . isEmpty ( username ) ) { throw new APIClientException ( "No username provided." ) ; } if ( StringUtils . isEmpty ( password ) ) { throw new APIClientException ( "No password provided." ) ; } if ( token == null ) { throw new APIClientException ( "No token provided." ) ; } APIResponse response = null ; try { List < NameValuePair > nvps = new ArrayList < NameValuePair > ( ) ; nvps . add ( new BasicNameValuePair ( "token" , token . getToken ( ) ) ) ; token . setUsername ( username ) ; token . setToken ( password ) ; response = post ( Settings . SERVICE_BASE_URL + "auth-v1/renew.php" , token , nvps ) ; } catch ( APIClientException e ) { throw new AuthenticationException ( "Error authenticating to service." , e ) ; } if ( response . isSuccess ( ) ) { return parseToken ( response . getResult ( ) ) ; } else { throw new AuthenticationException ( response . getMessage ( ) ) ; } }
Renews the given token for another 2 hours.
Renews the given token for another 2 hours .