src/org/ohmage/request/observer/StreamReadRequest.java
private StringBuilder buildNextAndPrevUrl() {
		StringBuilder result = new StringBuilder();
		
		// Add the protocol and FQDN.
		try {
			result.append(CookieUtils.buildServerRootUrl().toString());
		}
		catch(DomainException e) {
			LOGGER.error("Error building the next and previous URLs.");
			return null;
		}
		
		// Add the stream/read URI.
		result.append(RequestBuilder.getInstance().getApiStreamRead());
		
		// Add the parameters.
		result.append('?');
		
		// If the token was provided as a parameter, add it as a 
		// parameter. If it was not, we don't want to start echoing 
		// back passwords, so we will make it a requirement that the 
		// caller re-supply the password.
		String token = getUser().getToken();
		if(token != null) {
			result
				.append(InputKeys.AUTH_TOKEN)
				.append('=')
				.append(token)
				// This is so that the next component doesn't have to
				// worry about checking if this exists or not.
				.append('&');
		}
		
		// Add the client value.
		result.append(InputKeys.CLIENT).append('=').append(getClient());
		
		// Add the observer ID.
		result
			.append('&')
			.append(InputKeys.OBSERVER_ID)
			.append('=')
			.append(observerId);
		
		// Add the observer version if it was given.
		if(observerVersion != null) {
			result
				.append('&')
				.append(InputKeys.OBSERVER_VERSION)
				.append('=')
				.append(observerVersion);
		}
		
		// Add the stream ID and version.
		result
			.append('&')
			.append(InputKeys.STREAM_ID)
			.append('=')
			.append(streamId);
		result
			.append('&')
			.append(InputKeys.STREAM_VERSION)
			.append('=')
			.append(streamVersion);
		
		// Add the start date if it was given.
		if(startDate != null) {
			result
				.append('&')
				.append(InputKeys.START_DATE)
				.append('=')
				.append(ISODateTimeFormat.dateTime().print(startDate));
		}

		// Add the end date if it was given.
		if(endDate != null) {
			result
				.append('&')
				.append(InputKeys.END_DATE)
				.append('=')
				.append(ISODateTimeFormat.dateTime().print(endDate));
		}
		
		// Add the columns list if it was given.
		if(! columnsRoot.isLeaf()) {
			result
				.append('&')
				.append(InputKeys.COLUMN_LIST)
				.append('=')
				.append(columnsRoot.toListString());
		}
		
		return result;
	}
/**
	 * Generates a URL for the "previous" and "next" URLs in the result's 
	 * meta-data. This includes all of the given parameters except the number 
	 * of results to skip and return. These should be computed and added before
	 * adding this URL to the result's meta-data.
	 * 
	 * @return The URL for the "previous" and "next" URLs without the number of
	 * 		   results to skip or return.
	 */
Generates a URL for the "previous" and "next" URLs in the result's
meta-data. This includes all of the given parameters except the number
of results to skip and return. These should be computed and added before
adding this URL to the result's meta-data.

@return The URL for the "previous" and "next" URLs without the number of
results to skip or return.
Generates a URL for the " previous " and " next " URLs in the result ' s meta - data . This includes all of the given parameters except the number of results to skip and return . These should be computed and added before adding this URL to the result ' s meta - data . @return The URL for the " previous " and " next " URLs without the number of results to skip or return .
private StringBuilder buildNextAndPrevUrl() {
		StringBuilder result = new StringBuilder();
		try {
			result.append(CookieUtils.buildServerRootUrl().toString());
		}
		catch(DomainException e) {
			LOGGER.error("Error building the next and previous URLs.");
			return null;
		}
		result.append(RequestBuilder.getInstance().getApiStreamRead());
		result.append('?');
		String token = getUser().getToken();
		if(token != null) {
			result
				.append(InputKeys.AUTH_TOKEN)
				.append('=')
				.append(token)
				.append('&');
		}
		result.append(InputKeys.CLIENT).append('=').append(getClient());
		result
			.append('&')
			.append(InputKeys.OBSERVER_ID)
			.append('=')
			.append(observerId);
		if(observerVersion != null) {
			result
				.append('&')
				.append(InputKeys.OBSERVER_VERSION)
				.append('=')
				.append(observerVersion);
		}
		result
			.append('&')
			.append(InputKeys.STREAM_ID)
			.append('=')
			.append(streamId);
		result
			.append('&')
			.append(InputKeys.STREAM_VERSION)
			.append('=')
			.append(streamVersion);
		if(startDate != null) {
			result
				.append('&')
				.append(InputKeys.START_DATE)
				.append('=')
				.append(ISODateTimeFormat.dateTime().print(startDate));
		}
		if(endDate != null) {
			result
				.append('&')
				.append(InputKeys.END_DATE)
				.append('=')
				.append(ISODateTimeFormat.dateTime().print(endDate));
		}
		if(! columnsRoot.isLeaf()) {
			result
				.append('&')
				.append(InputKeys.COLUMN_LIST)
				.append('=')
				.append(columnsRoot.toListString());
		}
		return result;
	}
private StringBuilder buildNextAndPrevUrl ( ) { StringBuilder result = new StringBuilder ( ) ; try { result . append ( CookieUtils . buildServerRootUrl ( ) . toString ( ) ) ; } catch ( DomainException e ) { LOGGER . error ( "Error building the next and previous URLs." ) ; return null ; } result . append ( RequestBuilder . getInstance ( ) . getApiStreamRead ( ) ) ; result . append ( '?' ) ; String token = getUser ( ) . getToken ( ) ; if ( token != null ) { result . append ( InputKeys . AUTH_TOKEN ) . append ( '=' ) . append ( token ) . append ( '&' ) ; } result . append ( InputKeys . CLIENT ) . append ( '=' ) . append ( getClient ( ) ) ; result . append ( '&' ) . append ( InputKeys . OBSERVER_ID ) . append ( '=' ) . append ( observerId ) ; if ( observerVersion != null ) { result . append ( '&' ) . append ( InputKeys . OBSERVER_VERSION ) . append ( '=' ) . append ( observerVersion ) ; } result . append ( '&' ) . append ( InputKeys . STREAM_ID ) . append ( '=' ) . append ( streamId ) ; result . append ( '&' ) . append ( InputKeys . STREAM_VERSION ) . append ( '=' ) . append ( streamVersion ) ; if ( startDate != null ) { result . append ( '&' ) . append ( InputKeys . START_DATE ) . append ( '=' ) . append ( ISODateTimeFormat . dateTime ( ) . print ( startDate ) ) ; } if ( endDate != null ) { result . append ( '&' ) . append ( InputKeys . END_DATE ) . append ( '=' ) . append ( ISODateTimeFormat . dateTime ( ) . print ( endDate ) ) ; } if ( ! columnsRoot . isLeaf ( ) ) { result . append ( '&' ) . append ( InputKeys . COLUMN_LIST ) . append ( '=' ) . append ( columnsRoot . toListString ( ) ) ; } return result ; }
Generates a URL for the "previous" and "next" URLs in the result's
 meta-data.
Generates a URL for the " previous " and " next " URLs in the result ' s meta - data .
// Add the protocol and FQDN. // Add the stream/read URI. // Add the parameters. // If the token was provided as a parameter, add it as a  // parameter. If it was not, we don't want to start echoing  // back passwords, so we will make it a requirement that the  // caller re-supply the password. // This is so that the next component doesn't have to // worry about checking if this exists or not. // Add the client value. // Add the observer ID. // Add the observer version if it was given. // Add the stream ID and version. // Add the start date if it was given. // Add the end date if it was given. // Add the columns list if it was given.