<commit_before>package com.google.enterprise.connector.dctm.dctmmockwrap;

import com.google.enterprise.connector.dctm.dfcwrap.IId;
import com.google.enterprise.connector.dctm.dfcwrap.ISession;
import com.google.enterprise.connector.dctm.dfcwrap.ISysObject;
import com.google.enterprise.connector.mock.MockRepositoryDocumentStore;
import com.google.enterprise.connector.mock.jcr.MockJcrRepository;
import com.google.enterprise.connector.mock.jcr.MockJcrSession;
import com.google.enterprise.connector.spi.RepositoryException;

public class MockDmSession implements ISession {
	
	private MockJcrRepository mockRep;
	private MockJcrSession mockJcrSession;
//	private String sessionID;
	private String sessionFileNameSuffix;
	
	public MockDmSession(MockJcrRepository mjR , MockJcrSession mjS, String dbFileName){
		this.mockRep = mjR;
		this.mockJcrSession = mjS;
//		this.sessionID=sessID;
		this.sessionFileNameSuffix = dbFileName;
	}
	
	public MockRepositoryDocumentStore getStore(){
		return mockRep.getRepo().getStore();
	}


//	public String getSessionId() {
//		return sessionID;
//	}

	public String getLoginTicketForUser(String username) {
		//this assumes that Mock authenticated the session by
		//checking username==paswword (which was the case at least till
		//2007/01/19 but it is so aukward that I thought it could
		//be changed anytime...)
		return mockJcrSession.getUserID();//The only security here is inherent to the fact that if authentication failed, Session==null the returning getUserId instead of directly retuning username would throw a nullPointerException
	}

	public String getDocbaseName() {
		return this.sessionFileNameSuffix;
	}

	public MockJcrSession getMockJcrSession() {
		return mockJcrSession;
	}

	public void setMockJcrSession(MockJcrSession mockJcrSession) {
		this.mockJcrSession = mockJcrSession;
	}

	public ISysObject getObject(IId objectId) throws RepositoryException {
		MockDmRepositoryDocument dctmMockRepositoryDocument = new MockDmRepositoryDocument();
		return dctmMockRepositoryDocument;
	}


	

	
	<commit_msg>Re-integrating a change that Jeremy made while I was doing that big check-in.  Jeremy, please check that this file is now ok.<commit_after>package com.google.enterprise.connector.dctm.dctmmockwrap;

import com.google.enterprise.connector.dctm.dfcwrap.IId;
import com.google.enterprise.connector.dctm.dfcwrap.ISession;
import com.google.enterprise.connector.dctm.dfcwrap.ISysObject;
import com.google.enterprise.connector.mock.MockRepositoryDocumentStore;
import com.google.enterprise.connector.mock.jcr.MockJcrRepository;
import com.google.enterprise.connector.mock.jcr.MockJcrSession;
import com.google.enterprise.connector.spi.RepositoryException;

public class MockDmSession implements ISession {
	
	private MockJcrRepository mockRep;
	private MockJcrSession mockJcrSession;
//	private String sessionID;
	private String sessionFileNameSuffix;
	
	public MockDmSession(MockJcrRepository mjR , MockJcrSession mjS, String dbFileName){
		this.mockRep = mjR;
		this.mockJcrSession = mjS;
//		this.sessionID=sessID;
		this.sessionFileNameSuffix = dbFileName;
	}
	
	public MockRepositoryDocumentStore getStore(){
		return mockRep.getRepo().getStore();
	}


//	public String getSessionId() {
//		return sessionID;
//	}

	public String getLoginTicketForUser(String username) {
		//this assumes that Mock authenticated the session by
		//checking username==paswword 
		return mockJcrSession.getUserID();//The only security here is inherent to the fact that if authentication failed, Session==null the returning getUserId instead of directly retuning username would throw a nullPointerException
	}

	public String getDocbaseName() {
		return this.sessionFileNameSuffix;
	}

	public MockJcrSession getMockJcrSession() {
		return mockJcrSession;
	}

	public void setMockJcrSession(MockJcrSession mockJcrSession) {
		this.mockJcrSession = mockJcrSession;
	}

	public ISysObject getObject(IId objectId) throws RepositoryException {
		MockDmRepositoryDocument dctmMockRepositoryDocument = new MockDmRepositoryDocument();
		return dctmMockRepositoryDocument;
	}

{'fraction_non_alphanumeric': 0.07737226277372262, 'fraction_numerical': 0.0019464720194647203, 'mean_word_length': 5.525396825396825, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5634661', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1224, 'n_words': 294}