class DocumentServiceImpl extends RemoteServiceServlet implements DocumentService {

	@Override
	public long countDocuments(long[] folderIds, int status) throws ServerException {
		Session session = ServiceUtil.validateSession(getThreadLocalRequest());

		long count = 0;
		try {
			for (int i = 0; i < folderIds.length; i++) {
				count += countDocuments(session.getUser(), folderIds[i], status);
			}
		} catch (Throwable t) {
			return (Long) ServiceUtil.throwServerException(session, log, t);
		}
		return count;
	}

}