protected long getLastSampleTime( long startTime, long endTime, long resolution ) throws RrdException, IOException
	{
		if ( rrd == null )
			openRrd();

		long minSampleTime = Long.MAX_VALUE, sampleTime = 0;

		for ( int i = 0; i < datasources.length; i++ )
		{
			if ( datasources[i].size() > 0 )
			{
				sampleTime = rrd.findStartMatchArchive( cfNames[i], startTime, resolution ).getEndTime();

				if ( sampleTime < minSampleTime )
					minSampleTime = sampleTime;
			}
		}

		return minSampleTime;
	}