mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Merged 5.1.N (5.1.2) to 5.2.N (5.2.1)
125605 rmunteanu: Merged 5.1.1 (5.1.1) to 5.1.N (5.1.2)
125498 slanglois: MNT-16155 Update source headers - remove svn:eol-style property on Java and JSP source files
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@125783 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
+92
-92
@@ -1,92 +1,92 @@
|
||||
package org.alfresco.solr;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class AclReport
|
||||
{
|
||||
|
||||
private Long aclId;
|
||||
|
||||
private boolean existsInDb;
|
||||
|
||||
private Long indexAclDoc;
|
||||
|
||||
private Long indexAclTx;
|
||||
private Long indexedAclDocCount;
|
||||
|
||||
/**
|
||||
* @return the aclId
|
||||
*/
|
||||
public Long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param aclId the aclId to set
|
||||
*/
|
||||
public void setAclId(Long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the existsInDb
|
||||
*/
|
||||
public boolean isExistsInDb()
|
||||
{
|
||||
return existsInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param existsInDb the existsInDb to set
|
||||
*/
|
||||
public void setExistsInDb(boolean existsInDb)
|
||||
{
|
||||
this.existsInDb = existsInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAclDoc
|
||||
*/
|
||||
public Long getIndexAclDoc()
|
||||
{
|
||||
return indexAclDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAclDoc the indexAclDoc to set
|
||||
*/
|
||||
public void setIndexAclDoc(Long indexAclDoc)
|
||||
{
|
||||
this.indexAclDoc = indexAclDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAclTx
|
||||
*/
|
||||
public Long getIndexAclTx()
|
||||
{
|
||||
return indexAclTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAclTx the indexAclTx to set
|
||||
*/
|
||||
public void setIndexAclTx(Long indexAclTx)
|
||||
{
|
||||
this.indexAclTx = indexAclTx;
|
||||
}
|
||||
|
||||
public Long getIndexedAclDocCount()
|
||||
{
|
||||
return indexedAclDocCount;
|
||||
}
|
||||
|
||||
public void setIndexedAclDocCount(Long indexedAclDocCount)
|
||||
{
|
||||
this.indexedAclDocCount = indexedAclDocCount;
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class AclReport
|
||||
{
|
||||
|
||||
private Long aclId;
|
||||
|
||||
private boolean existsInDb;
|
||||
|
||||
private Long indexAclDoc;
|
||||
|
||||
private Long indexAclTx;
|
||||
private Long indexedAclDocCount;
|
||||
|
||||
/**
|
||||
* @return the aclId
|
||||
*/
|
||||
public Long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param aclId the aclId to set
|
||||
*/
|
||||
public void setAclId(Long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the existsInDb
|
||||
*/
|
||||
public boolean isExistsInDb()
|
||||
{
|
||||
return existsInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param existsInDb the existsInDb to set
|
||||
*/
|
||||
public void setExistsInDb(boolean existsInDb)
|
||||
{
|
||||
this.existsInDb = existsInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAclDoc
|
||||
*/
|
||||
public Long getIndexAclDoc()
|
||||
{
|
||||
return indexAclDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAclDoc the indexAclDoc to set
|
||||
*/
|
||||
public void setIndexAclDoc(Long indexAclDoc)
|
||||
{
|
||||
this.indexAclDoc = indexAclDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAclTx
|
||||
*/
|
||||
public Long getIndexAclTx()
|
||||
{
|
||||
return indexAclTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAclTx the indexAclTx to set
|
||||
*/
|
||||
public void setIndexAclTx(Long indexAclTx)
|
||||
{
|
||||
this.indexAclTx = indexAclTx;
|
||||
}
|
||||
|
||||
public Long getIndexedAclDocCount()
|
||||
{
|
||||
return indexedAclDocCount;
|
||||
}
|
||||
|
||||
public void setIndexedAclDocCount(Long indexedAclDocCount)
|
||||
{
|
||||
this.indexedAclDocCount = indexedAclDocCount;
|
||||
}
|
||||
}
|
||||
|
||||
+60
-60
@@ -1,61 +1,61 @@
|
||||
|
||||
package org.alfresco.solr;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
|
||||
public class BoundedDeque<T> implements Iterable<T>
|
||||
{
|
||||
private LinkedBlockingDeque<T> deque;
|
||||
|
||||
private int max = 10;
|
||||
|
||||
public BoundedDeque(int max)
|
||||
{
|
||||
this.max = max;
|
||||
setDeque(new LinkedBlockingDeque<T>());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public int size()
|
||||
{
|
||||
return getDeque().size();
|
||||
}
|
||||
|
||||
public void add(T add)
|
||||
{
|
||||
while (getDeque().size() > (max - 1))
|
||||
{
|
||||
getDeque().removeLast();
|
||||
}
|
||||
getDeque().addFirst(add);
|
||||
}
|
||||
|
||||
public T getLast()
|
||||
{
|
||||
return getDeque().getFirst();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator()
|
||||
{
|
||||
return getDeque().iterator();
|
||||
}
|
||||
|
||||
public LinkedBlockingDeque<T> getDeque()
|
||||
{
|
||||
return deque;
|
||||
}
|
||||
|
||||
public void setDeque(LinkedBlockingDeque<T> deque)
|
||||
{
|
||||
this.deque = deque;
|
||||
}
|
||||
|
||||
|
||||
package org.alfresco.solr;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
|
||||
public class BoundedDeque<T> implements Iterable<T>
|
||||
{
|
||||
private LinkedBlockingDeque<T> deque;
|
||||
|
||||
private int max = 10;
|
||||
|
||||
public BoundedDeque(int max)
|
||||
{
|
||||
this.max = max;
|
||||
setDeque(new LinkedBlockingDeque<T>());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public int size()
|
||||
{
|
||||
return getDeque().size();
|
||||
}
|
||||
|
||||
public void add(T add)
|
||||
{
|
||||
while (getDeque().size() > (max - 1))
|
||||
{
|
||||
getDeque().removeLast();
|
||||
}
|
||||
getDeque().addFirst(add);
|
||||
}
|
||||
|
||||
public T getLast()
|
||||
{
|
||||
return getDeque().getFirst();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Iterable#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<T> iterator()
|
||||
{
|
||||
return getDeque().iterator();
|
||||
}
|
||||
|
||||
public LinkedBlockingDeque<T> getDeque()
|
||||
{
|
||||
return deque;
|
||||
}
|
||||
|
||||
public void setDeque(LinkedBlockingDeque<T> deque)
|
||||
{
|
||||
this.deque = deque;
|
||||
}
|
||||
|
||||
}
|
||||
+11
-11
@@ -1,11 +1,11 @@
|
||||
package org.alfresco.solr;
|
||||
|
||||
public class IndexTrackingShutdownException extends RuntimeException
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1294455847013444397L;
|
||||
|
||||
}
|
||||
package org.alfresco.solr;
|
||||
|
||||
public class IndexTrackingShutdownException extends RuntimeException
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1294455847013444397L;
|
||||
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,11 +1,11 @@
|
||||
package org.alfresco.solr;
|
||||
|
||||
import org.alfresco.solr.adapters.IOpenBitSet;
|
||||
import org.alfresco.solr.adapters.ISimpleOrderedMap;
|
||||
|
||||
public interface InformationServerCollectionProvider
|
||||
{
|
||||
IOpenBitSet getOpenBitSetInstance();
|
||||
|
||||
<T> ISimpleOrderedMap<T> getSimpleOrderedMapInstance();
|
||||
}
|
||||
package org.alfresco.solr;
|
||||
|
||||
import org.alfresco.solr.adapters.IOpenBitSet;
|
||||
import org.alfresco.solr.adapters.ISimpleOrderedMap;
|
||||
|
||||
public interface InformationServerCollectionProvider
|
||||
{
|
||||
IOpenBitSet getOpenBitSetInstance();
|
||||
|
||||
<T> ISimpleOrderedMap<T> getSimpleOrderedMapInstance();
|
||||
}
|
||||
|
||||
+152
-152
@@ -1,152 +1,152 @@
|
||||
package org.alfresco.solr;
|
||||
|
||||
import org.alfresco.solr.client.Node.SolrApiNodeStatus;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*/
|
||||
public class NodeReport
|
||||
{
|
||||
private Long dbid;
|
||||
|
||||
private Long dbTx;
|
||||
|
||||
private SolrApiNodeStatus dbNodeStatus;
|
||||
|
||||
private Long indexLeafDoc;
|
||||
|
||||
private Long indexAuxDoc;
|
||||
|
||||
private Long indexLeafTx;
|
||||
|
||||
private Long indexAuxTx;
|
||||
private Long indexedNodeDocCount;
|
||||
|
||||
|
||||
/**
|
||||
* @return the dbid
|
||||
*/
|
||||
public Long getDbid()
|
||||
{
|
||||
return dbid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbid
|
||||
* the dbid to set
|
||||
*/
|
||||
public void setDbid(Long dbid)
|
||||
{
|
||||
this.dbid = dbid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbTx
|
||||
*/
|
||||
public Long getDbTx()
|
||||
{
|
||||
return dbTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbTx
|
||||
* the dbTx to set
|
||||
*/
|
||||
public void setDbTx(Long dbTx)
|
||||
{
|
||||
this.dbTx = dbTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbNodeStatus
|
||||
*/
|
||||
public SolrApiNodeStatus getDbNodeStatus()
|
||||
{
|
||||
return dbNodeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbNodeStatus
|
||||
* the dbNodeStatus to set
|
||||
*/
|
||||
public void setDbNodeStatus(SolrApiNodeStatus dbNodeStatus)
|
||||
{
|
||||
this.dbNodeStatus = dbNodeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexLeafDoc
|
||||
*/
|
||||
public Long getIndexLeafDoc()
|
||||
{
|
||||
return indexLeafDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexLeafDoc
|
||||
* the indexLeafDoc to set
|
||||
*/
|
||||
public void setIndexLeafDoc(Long indexLeafDoc)
|
||||
{
|
||||
this.indexLeafDoc = indexLeafDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAuxDoc
|
||||
*/
|
||||
public Long getIndexAuxDoc()
|
||||
{
|
||||
return indexAuxDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAuxDoc
|
||||
* the indexAuxDoc to set
|
||||
*/
|
||||
public void setIndexAuxDoc(Long indexAuxDoc)
|
||||
{
|
||||
this.indexAuxDoc = indexAuxDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexLeafTx
|
||||
*/
|
||||
public Long getIndexLeafTx()
|
||||
{
|
||||
return indexLeafTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexLeafTx the indexLeafTx to set
|
||||
*/
|
||||
public void setIndexLeafTx(Long indexLeafTx)
|
||||
{
|
||||
this.indexLeafTx = indexLeafTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAuxTx
|
||||
*/
|
||||
public Long getIndexAuxTx()
|
||||
{
|
||||
return indexAuxTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAuxTx the indexAuxTx to set
|
||||
*/
|
||||
public void setIndexAuxTx(Long indexAuxTx)
|
||||
{
|
||||
this.indexAuxTx = indexAuxTx;
|
||||
}
|
||||
|
||||
public Long getIndexedNodeDocCount()
|
||||
{
|
||||
return indexedNodeDocCount;
|
||||
}
|
||||
|
||||
public void setIndexedNodeDocCount(Long indexedNodeDocCount)
|
||||
{
|
||||
this.indexedNodeDocCount = indexedNodeDocCount;
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr;
|
||||
|
||||
import org.alfresco.solr.client.Node.SolrApiNodeStatus;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*/
|
||||
public class NodeReport
|
||||
{
|
||||
private Long dbid;
|
||||
|
||||
private Long dbTx;
|
||||
|
||||
private SolrApiNodeStatus dbNodeStatus;
|
||||
|
||||
private Long indexLeafDoc;
|
||||
|
||||
private Long indexAuxDoc;
|
||||
|
||||
private Long indexLeafTx;
|
||||
|
||||
private Long indexAuxTx;
|
||||
private Long indexedNodeDocCount;
|
||||
|
||||
|
||||
/**
|
||||
* @return the dbid
|
||||
*/
|
||||
public Long getDbid()
|
||||
{
|
||||
return dbid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbid
|
||||
* the dbid to set
|
||||
*/
|
||||
public void setDbid(Long dbid)
|
||||
{
|
||||
this.dbid = dbid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbTx
|
||||
*/
|
||||
public Long getDbTx()
|
||||
{
|
||||
return dbTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbTx
|
||||
* the dbTx to set
|
||||
*/
|
||||
public void setDbTx(Long dbTx)
|
||||
{
|
||||
this.dbTx = dbTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbNodeStatus
|
||||
*/
|
||||
public SolrApiNodeStatus getDbNodeStatus()
|
||||
{
|
||||
return dbNodeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbNodeStatus
|
||||
* the dbNodeStatus to set
|
||||
*/
|
||||
public void setDbNodeStatus(SolrApiNodeStatus dbNodeStatus)
|
||||
{
|
||||
this.dbNodeStatus = dbNodeStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexLeafDoc
|
||||
*/
|
||||
public Long getIndexLeafDoc()
|
||||
{
|
||||
return indexLeafDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexLeafDoc
|
||||
* the indexLeafDoc to set
|
||||
*/
|
||||
public void setIndexLeafDoc(Long indexLeafDoc)
|
||||
{
|
||||
this.indexLeafDoc = indexLeafDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAuxDoc
|
||||
*/
|
||||
public Long getIndexAuxDoc()
|
||||
{
|
||||
return indexAuxDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAuxDoc
|
||||
* the indexAuxDoc to set
|
||||
*/
|
||||
public void setIndexAuxDoc(Long indexAuxDoc)
|
||||
{
|
||||
this.indexAuxDoc = indexAuxDoc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexLeafTx
|
||||
*/
|
||||
public Long getIndexLeafTx()
|
||||
{
|
||||
return indexLeafTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexLeafTx the indexLeafTx to set
|
||||
*/
|
||||
public void setIndexLeafTx(Long indexLeafTx)
|
||||
{
|
||||
this.indexLeafTx = indexLeafTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the indexAuxTx
|
||||
*/
|
||||
public Long getIndexAuxTx()
|
||||
{
|
||||
return indexAuxTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param indexAuxTx the indexAuxTx to set
|
||||
*/
|
||||
public void setIndexAuxTx(Long indexAuxTx)
|
||||
{
|
||||
this.indexAuxTx = indexAuxTx;
|
||||
}
|
||||
|
||||
public Long getIndexedNodeDocCount()
|
||||
{
|
||||
return indexedNodeDocCount;
|
||||
}
|
||||
|
||||
public void setIndexedNodeDocCount(Long indexedNodeDocCount)
|
||||
{
|
||||
this.indexedNodeDocCount = indexedNodeDocCount;
|
||||
}
|
||||
}
|
||||
|
||||
+276
-276
@@ -1,276 +1,276 @@
|
||||
|
||||
package org.alfresco.solr;
|
||||
|
||||
/**
|
||||
* This class was moved from org.alfresco.solr.tracker.CoreTracker
|
||||
* The data in this class is relevant for a particular Solr index.
|
||||
*/
|
||||
public class TrackerState
|
||||
{
|
||||
private volatile long lastChangeSetIdOnServer;
|
||||
|
||||
private volatile long lastChangeSetCommitTimeOnServer;
|
||||
|
||||
private volatile long lastIndexedChangeSetId;
|
||||
|
||||
private volatile long lastIndexedTxCommitTime = 0;
|
||||
|
||||
private volatile long lastIndexedTxId = 0;
|
||||
|
||||
private volatile long lastIndexedChangeSetCommitTime = 0;
|
||||
|
||||
private volatile long lastTxCommitTimeOnServer = 0;
|
||||
|
||||
private volatile long lastTxIdOnServer = 0;
|
||||
|
||||
private volatile long lastIndexedTxIdBeforeHoles = -1;
|
||||
|
||||
private volatile long lastIndexedChangeSetIdBeforeHoles = -1;
|
||||
|
||||
private volatile boolean running = false;
|
||||
|
||||
private volatile boolean checkedFirstTransactionTime = false;
|
||||
private volatile boolean checkedFirstAclTransactionTime = false;
|
||||
private volatile boolean checkedLastAclTransactionTime = false;
|
||||
private volatile boolean checkedLastTransactionTime = false;
|
||||
|
||||
private volatile boolean check = false;
|
||||
|
||||
private long timeToStopIndexing;
|
||||
|
||||
private long lastGoodChangeSetCommitTimeInIndex;
|
||||
|
||||
private long lastGoodTxCommitTimeInIndex;
|
||||
|
||||
private long timeBeforeWhichThereCanBeNoHoles;
|
||||
|
||||
public long getLastChangeSetIdOnServer()
|
||||
{
|
||||
return lastChangeSetIdOnServer;
|
||||
}
|
||||
|
||||
public void setLastChangeSetIdOnServer(long lastChangeSetIdOnServer)
|
||||
{
|
||||
this.lastChangeSetIdOnServer = lastChangeSetIdOnServer;
|
||||
}
|
||||
|
||||
public long getLastChangeSetCommitTimeOnServer()
|
||||
{
|
||||
return lastChangeSetCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public void setLastChangeSetCommitTimeOnServer(long lastChangeSetCommitTimeOnServer)
|
||||
{
|
||||
this.lastChangeSetCommitTimeOnServer = lastChangeSetCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetId()
|
||||
{
|
||||
return lastIndexedChangeSetId;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetId(long lastIndexedChangeSetId)
|
||||
{
|
||||
this.lastIndexedChangeSetId = lastIndexedChangeSetId;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxCommitTime()
|
||||
{
|
||||
return lastIndexedTxCommitTime;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxCommitTime(long lastIndexedTxCommitTime)
|
||||
{
|
||||
this.lastIndexedTxCommitTime = lastIndexedTxCommitTime;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxId()
|
||||
{
|
||||
return lastIndexedTxId;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxId(long lastIndexedTxId)
|
||||
{
|
||||
this.lastIndexedTxId = lastIndexedTxId;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetCommitTime()
|
||||
{
|
||||
return lastIndexedChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetCommitTime(long lastIndexedChangeSetCommitTime)
|
||||
{
|
||||
this.lastIndexedChangeSetCommitTime = lastIndexedChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public long getLastTxCommitTimeOnServer()
|
||||
{
|
||||
return lastTxCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public void setLastTxCommitTimeOnServer(long lastTxCommitTimeOnServer)
|
||||
{
|
||||
this.lastTxCommitTimeOnServer = lastTxCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public long getLastTxIdOnServer()
|
||||
{
|
||||
return lastTxIdOnServer;
|
||||
}
|
||||
|
||||
public void setLastTxIdOnServer(long lastTxIdOnServer)
|
||||
{
|
||||
this.lastTxIdOnServer = lastTxIdOnServer;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedTxIdBeforeHoles;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxIdBeforeHoles(long lastIndexedTxIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedTxIdBeforeHoles = lastIndexedTxIdBeforeHoles;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedChangeSetIdBeforeHoles;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetIdBeforeHoles(long lastIndexedChangeSetIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedChangeSetIdBeforeHoles = lastIndexedChangeSetIdBeforeHoles;
|
||||
}
|
||||
|
||||
public boolean isRunning()
|
||||
{
|
||||
return running;
|
||||
}
|
||||
|
||||
public void setRunning(boolean running)
|
||||
{
|
||||
this.running = running;
|
||||
}
|
||||
|
||||
public boolean isCheckedFirstTransactionTime()
|
||||
{
|
||||
return checkedFirstTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedFirstTransactionTime(boolean checkedFirstTransactionTime)
|
||||
{
|
||||
this.checkedFirstTransactionTime = checkedFirstTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheck()
|
||||
{
|
||||
return check;
|
||||
}
|
||||
|
||||
public void setCheck(boolean check)
|
||||
{
|
||||
this.check = check;
|
||||
}
|
||||
|
||||
public long getTimeToStopIndexing()
|
||||
{
|
||||
return timeToStopIndexing;
|
||||
}
|
||||
|
||||
public void setTimeToStopIndexing(long timeToStopIndexing)
|
||||
{
|
||||
this.timeToStopIndexing = timeToStopIndexing;
|
||||
}
|
||||
|
||||
public long getLastGoodChangeSetCommitTimeInIndex()
|
||||
{
|
||||
return lastGoodChangeSetCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public void setLastGoodChangeSetCommitTimeInIndex(long lastGoodChangeSetCommitTimeInIndex)
|
||||
{
|
||||
this.lastGoodChangeSetCommitTimeInIndex = lastGoodChangeSetCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public long getLastGoodTxCommitTimeInIndex()
|
||||
{
|
||||
return lastGoodTxCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public void setLastGoodTxCommitTimeInIndex(long lastGoodTxCommitTimeInIndex)
|
||||
{
|
||||
this.lastGoodTxCommitTimeInIndex = lastGoodTxCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public long getTimeBeforeWhichThereCanBeNoHoles()
|
||||
{
|
||||
return timeBeforeWhichThereCanBeNoHoles;
|
||||
}
|
||||
|
||||
public void setTimeBeforeWhichThereCanBeNoHoles(long timeBeforeWhichThereCanBeNoHoles)
|
||||
{
|
||||
this.timeBeforeWhichThereCanBeNoHoles = timeBeforeWhichThereCanBeNoHoles;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "TrackerState [lastChangeSetIdOnServer=" + lastChangeSetIdOnServer
|
||||
+ ", lastChangeSetCommitTimeOnServer=" + lastChangeSetCommitTimeOnServer
|
||||
+ ", lastIndexedChangeSetId=" + lastIndexedChangeSetId
|
||||
+ ", lastIndexedTxCommitTime=" + lastIndexedTxCommitTime
|
||||
+ ", lastIndexedTxId=" + lastIndexedTxId
|
||||
+ ", lastIndexedChangeSetCommitTime=" + lastIndexedChangeSetCommitTime
|
||||
+ ", lastTxCommitTimeOnServer=" + lastTxCommitTimeOnServer
|
||||
+ ", lastTxIdOnServer=" + lastTxIdOnServer
|
||||
+ ", lastIndexedTxIdBeforeHoles=" + lastIndexedTxIdBeforeHoles
|
||||
+ ", lastIndexedChangeSetIdBeforeHoles=" + lastIndexedChangeSetIdBeforeHoles
|
||||
+ ", running=" + running
|
||||
+ ", checkedFirstTransactionTime=" + checkedFirstTransactionTime
|
||||
+ ", checkedFirstAclTransactionTime=" + this.checkedFirstAclTransactionTime
|
||||
+ ", checkedLastTransactionTime=" + this.checkedLastTransactionTime
|
||||
+ ", checkedLastAclTransactionTime=" + this.checkedLastAclTransactionTime
|
||||
+ ", check=" + check
|
||||
+ ", timeToStopIndexing=" + timeToStopIndexing
|
||||
+ ", lastGoodChangeSetCommitTimeInIndex=" + lastGoodChangeSetCommitTimeInIndex
|
||||
+ ", lastGoodTxCommitTimeInIndex=" + lastGoodTxCommitTimeInIndex
|
||||
+ ", timeBeforeWhichThereCanBeNoHoles=" + timeBeforeWhichThereCanBeNoHoles + "]";
|
||||
}
|
||||
|
||||
public boolean isCheckedFirstAclTransactionTime()
|
||||
{
|
||||
return checkedFirstAclTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedFirstAclTransactionTime(boolean checkedFirstAclTransactionTime)
|
||||
{
|
||||
this.checkedFirstAclTransactionTime = checkedFirstAclTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheckedLastTransactionTime()
|
||||
{
|
||||
return checkedLastTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedLastTransactionTime(boolean checkedLastTransactionTime)
|
||||
{
|
||||
this.checkedLastTransactionTime = checkedLastTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheckedLastAclTransactionTime()
|
||||
{
|
||||
return checkedLastAclTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedLastAclTransactionTime(boolean checkedLastAclTransactionTime)
|
||||
{
|
||||
this.checkedLastAclTransactionTime = checkedLastAclTransactionTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package org.alfresco.solr;
|
||||
|
||||
/**
|
||||
* This class was moved from org.alfresco.solr.tracker.CoreTracker
|
||||
* The data in this class is relevant for a particular Solr index.
|
||||
*/
|
||||
public class TrackerState
|
||||
{
|
||||
private volatile long lastChangeSetIdOnServer;
|
||||
|
||||
private volatile long lastChangeSetCommitTimeOnServer;
|
||||
|
||||
private volatile long lastIndexedChangeSetId;
|
||||
|
||||
private volatile long lastIndexedTxCommitTime = 0;
|
||||
|
||||
private volatile long lastIndexedTxId = 0;
|
||||
|
||||
private volatile long lastIndexedChangeSetCommitTime = 0;
|
||||
|
||||
private volatile long lastTxCommitTimeOnServer = 0;
|
||||
|
||||
private volatile long lastTxIdOnServer = 0;
|
||||
|
||||
private volatile long lastIndexedTxIdBeforeHoles = -1;
|
||||
|
||||
private volatile long lastIndexedChangeSetIdBeforeHoles = -1;
|
||||
|
||||
private volatile boolean running = false;
|
||||
|
||||
private volatile boolean checkedFirstTransactionTime = false;
|
||||
private volatile boolean checkedFirstAclTransactionTime = false;
|
||||
private volatile boolean checkedLastAclTransactionTime = false;
|
||||
private volatile boolean checkedLastTransactionTime = false;
|
||||
|
||||
private volatile boolean check = false;
|
||||
|
||||
private long timeToStopIndexing;
|
||||
|
||||
private long lastGoodChangeSetCommitTimeInIndex;
|
||||
|
||||
private long lastGoodTxCommitTimeInIndex;
|
||||
|
||||
private long timeBeforeWhichThereCanBeNoHoles;
|
||||
|
||||
public long getLastChangeSetIdOnServer()
|
||||
{
|
||||
return lastChangeSetIdOnServer;
|
||||
}
|
||||
|
||||
public void setLastChangeSetIdOnServer(long lastChangeSetIdOnServer)
|
||||
{
|
||||
this.lastChangeSetIdOnServer = lastChangeSetIdOnServer;
|
||||
}
|
||||
|
||||
public long getLastChangeSetCommitTimeOnServer()
|
||||
{
|
||||
return lastChangeSetCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public void setLastChangeSetCommitTimeOnServer(long lastChangeSetCommitTimeOnServer)
|
||||
{
|
||||
this.lastChangeSetCommitTimeOnServer = lastChangeSetCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetId()
|
||||
{
|
||||
return lastIndexedChangeSetId;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetId(long lastIndexedChangeSetId)
|
||||
{
|
||||
this.lastIndexedChangeSetId = lastIndexedChangeSetId;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxCommitTime()
|
||||
{
|
||||
return lastIndexedTxCommitTime;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxCommitTime(long lastIndexedTxCommitTime)
|
||||
{
|
||||
this.lastIndexedTxCommitTime = lastIndexedTxCommitTime;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxId()
|
||||
{
|
||||
return lastIndexedTxId;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxId(long lastIndexedTxId)
|
||||
{
|
||||
this.lastIndexedTxId = lastIndexedTxId;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetCommitTime()
|
||||
{
|
||||
return lastIndexedChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetCommitTime(long lastIndexedChangeSetCommitTime)
|
||||
{
|
||||
this.lastIndexedChangeSetCommitTime = lastIndexedChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public long getLastTxCommitTimeOnServer()
|
||||
{
|
||||
return lastTxCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public void setLastTxCommitTimeOnServer(long lastTxCommitTimeOnServer)
|
||||
{
|
||||
this.lastTxCommitTimeOnServer = lastTxCommitTimeOnServer;
|
||||
}
|
||||
|
||||
public long getLastTxIdOnServer()
|
||||
{
|
||||
return lastTxIdOnServer;
|
||||
}
|
||||
|
||||
public void setLastTxIdOnServer(long lastTxIdOnServer)
|
||||
{
|
||||
this.lastTxIdOnServer = lastTxIdOnServer;
|
||||
}
|
||||
|
||||
public long getLastIndexedTxIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedTxIdBeforeHoles;
|
||||
}
|
||||
|
||||
public void setLastIndexedTxIdBeforeHoles(long lastIndexedTxIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedTxIdBeforeHoles = lastIndexedTxIdBeforeHoles;
|
||||
}
|
||||
|
||||
public long getLastIndexedChangeSetIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedChangeSetIdBeforeHoles;
|
||||
}
|
||||
|
||||
public void setLastIndexedChangeSetIdBeforeHoles(long lastIndexedChangeSetIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedChangeSetIdBeforeHoles = lastIndexedChangeSetIdBeforeHoles;
|
||||
}
|
||||
|
||||
public boolean isRunning()
|
||||
{
|
||||
return running;
|
||||
}
|
||||
|
||||
public void setRunning(boolean running)
|
||||
{
|
||||
this.running = running;
|
||||
}
|
||||
|
||||
public boolean isCheckedFirstTransactionTime()
|
||||
{
|
||||
return checkedFirstTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedFirstTransactionTime(boolean checkedFirstTransactionTime)
|
||||
{
|
||||
this.checkedFirstTransactionTime = checkedFirstTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheck()
|
||||
{
|
||||
return check;
|
||||
}
|
||||
|
||||
public void setCheck(boolean check)
|
||||
{
|
||||
this.check = check;
|
||||
}
|
||||
|
||||
public long getTimeToStopIndexing()
|
||||
{
|
||||
return timeToStopIndexing;
|
||||
}
|
||||
|
||||
public void setTimeToStopIndexing(long timeToStopIndexing)
|
||||
{
|
||||
this.timeToStopIndexing = timeToStopIndexing;
|
||||
}
|
||||
|
||||
public long getLastGoodChangeSetCommitTimeInIndex()
|
||||
{
|
||||
return lastGoodChangeSetCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public void setLastGoodChangeSetCommitTimeInIndex(long lastGoodChangeSetCommitTimeInIndex)
|
||||
{
|
||||
this.lastGoodChangeSetCommitTimeInIndex = lastGoodChangeSetCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public long getLastGoodTxCommitTimeInIndex()
|
||||
{
|
||||
return lastGoodTxCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public void setLastGoodTxCommitTimeInIndex(long lastGoodTxCommitTimeInIndex)
|
||||
{
|
||||
this.lastGoodTxCommitTimeInIndex = lastGoodTxCommitTimeInIndex;
|
||||
}
|
||||
|
||||
public long getTimeBeforeWhichThereCanBeNoHoles()
|
||||
{
|
||||
return timeBeforeWhichThereCanBeNoHoles;
|
||||
}
|
||||
|
||||
public void setTimeBeforeWhichThereCanBeNoHoles(long timeBeforeWhichThereCanBeNoHoles)
|
||||
{
|
||||
this.timeBeforeWhichThereCanBeNoHoles = timeBeforeWhichThereCanBeNoHoles;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "TrackerState [lastChangeSetIdOnServer=" + lastChangeSetIdOnServer
|
||||
+ ", lastChangeSetCommitTimeOnServer=" + lastChangeSetCommitTimeOnServer
|
||||
+ ", lastIndexedChangeSetId=" + lastIndexedChangeSetId
|
||||
+ ", lastIndexedTxCommitTime=" + lastIndexedTxCommitTime
|
||||
+ ", lastIndexedTxId=" + lastIndexedTxId
|
||||
+ ", lastIndexedChangeSetCommitTime=" + lastIndexedChangeSetCommitTime
|
||||
+ ", lastTxCommitTimeOnServer=" + lastTxCommitTimeOnServer
|
||||
+ ", lastTxIdOnServer=" + lastTxIdOnServer
|
||||
+ ", lastIndexedTxIdBeforeHoles=" + lastIndexedTxIdBeforeHoles
|
||||
+ ", lastIndexedChangeSetIdBeforeHoles=" + lastIndexedChangeSetIdBeforeHoles
|
||||
+ ", running=" + running
|
||||
+ ", checkedFirstTransactionTime=" + checkedFirstTransactionTime
|
||||
+ ", checkedFirstAclTransactionTime=" + this.checkedFirstAclTransactionTime
|
||||
+ ", checkedLastTransactionTime=" + this.checkedLastTransactionTime
|
||||
+ ", checkedLastAclTransactionTime=" + this.checkedLastAclTransactionTime
|
||||
+ ", check=" + check
|
||||
+ ", timeToStopIndexing=" + timeToStopIndexing
|
||||
+ ", lastGoodChangeSetCommitTimeInIndex=" + lastGoodChangeSetCommitTimeInIndex
|
||||
+ ", lastGoodTxCommitTimeInIndex=" + lastGoodTxCommitTimeInIndex
|
||||
+ ", timeBeforeWhichThereCanBeNoHoles=" + timeBeforeWhichThereCanBeNoHoles + "]";
|
||||
}
|
||||
|
||||
public boolean isCheckedFirstAclTransactionTime()
|
||||
{
|
||||
return checkedFirstAclTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedFirstAclTransactionTime(boolean checkedFirstAclTransactionTime)
|
||||
{
|
||||
this.checkedFirstAclTransactionTime = checkedFirstAclTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheckedLastTransactionTime()
|
||||
{
|
||||
return checkedLastTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedLastTransactionTime(boolean checkedLastTransactionTime)
|
||||
{
|
||||
this.checkedLastTransactionTime = checkedLastTransactionTime;
|
||||
}
|
||||
|
||||
public boolean isCheckedLastAclTransactionTime()
|
||||
{
|
||||
return checkedLastAclTransactionTime;
|
||||
}
|
||||
|
||||
public void setCheckedLastAclTransactionTime(boolean checkedLastAclTransactionTime)
|
||||
{
|
||||
this.checkedLastAclTransactionTime = checkedLastAclTransactionTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+21
-21
@@ -1,22 +1,22 @@
|
||||
|
||||
package org.alfresco.solr.adapters;
|
||||
|
||||
/**
|
||||
* The reason we have this interface is so that lucene-free dependent classes can be dependent on IOpenBitSet instead of the
|
||||
* lucene-version-specific OpenBitSet.
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public interface IOpenBitSet
|
||||
{
|
||||
|
||||
void set(long txid);
|
||||
|
||||
void or(IOpenBitSet duplicatedTxInIndex);
|
||||
|
||||
long nextSetBit(long l);
|
||||
|
||||
long cardinality();
|
||||
|
||||
boolean get(long i);
|
||||
|
||||
|
||||
package org.alfresco.solr.adapters;
|
||||
|
||||
/**
|
||||
* The reason we have this interface is so that lucene-free dependent classes can be dependent on IOpenBitSet instead of the
|
||||
* lucene-version-specific OpenBitSet.
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public interface IOpenBitSet
|
||||
{
|
||||
|
||||
void set(long txid);
|
||||
|
||||
void or(IOpenBitSet duplicatedTxInIndex);
|
||||
|
||||
long nextSetBit(long l);
|
||||
|
||||
long cardinality();
|
||||
|
||||
boolean get(long i);
|
||||
|
||||
}
|
||||
+14
-14
@@ -1,14 +1,14 @@
|
||||
package org.alfresco.solr.adapters;
|
||||
|
||||
|
||||
/**
|
||||
* The reason we have this interface is so that lucene-free dependent classes can be dependent on ISimpleOrderedMap instead of the
|
||||
* lucene-version-specific SimpleOrderedMap.
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public interface ISimpleOrderedMap<T>
|
||||
{
|
||||
|
||||
void add(String name, T val);
|
||||
|
||||
}
|
||||
package org.alfresco.solr.adapters;
|
||||
|
||||
|
||||
/**
|
||||
* The reason we have this interface is so that lucene-free dependent classes can be dependent on ISimpleOrderedMap instead of the
|
||||
* lucene-version-specific SimpleOrderedMap.
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public interface ISimpleOrderedMap<T>
|
||||
{
|
||||
|
||||
void add(String name, T val);
|
||||
|
||||
}
|
||||
|
||||
+39
-39
@@ -1,39 +1,39 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class AclChangeSets
|
||||
{
|
||||
private List<AclChangeSet> aclChangeSets;
|
||||
|
||||
private Long maxChangeSetCommitTime;
|
||||
|
||||
private Long maxChangeSetId;
|
||||
|
||||
AclChangeSets(List<AclChangeSet> aclChangeSets, Long maxChangeSetCommitTime, Long maxChangeSetId)
|
||||
{
|
||||
this.aclChangeSets = aclChangeSets;
|
||||
this.maxChangeSetCommitTime = maxChangeSetCommitTime;
|
||||
this.maxChangeSetId = maxChangeSetId;
|
||||
}
|
||||
|
||||
public List<AclChangeSet> getAclChangeSets()
|
||||
{
|
||||
return aclChangeSets;
|
||||
}
|
||||
|
||||
public Long getMaxChangeSetCommitTime()
|
||||
{
|
||||
return maxChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public Long getMaxChangeSetId()
|
||||
{
|
||||
return maxChangeSetId;
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class AclChangeSets
|
||||
{
|
||||
private List<AclChangeSet> aclChangeSets;
|
||||
|
||||
private Long maxChangeSetCommitTime;
|
||||
|
||||
private Long maxChangeSetId;
|
||||
|
||||
AclChangeSets(List<AclChangeSet> aclChangeSets, Long maxChangeSetCommitTime, Long maxChangeSetId)
|
||||
{
|
||||
this.aclChangeSets = aclChangeSets;
|
||||
this.maxChangeSetCommitTime = maxChangeSetCommitTime;
|
||||
this.maxChangeSetId = maxChangeSetId;
|
||||
}
|
||||
|
||||
public List<AclChangeSet> getAclChangeSets()
|
||||
{
|
||||
return aclChangeSets;
|
||||
}
|
||||
|
||||
public Long getMaxChangeSetCommitTime()
|
||||
{
|
||||
return maxChangeSetCommitTime;
|
||||
}
|
||||
|
||||
public Long getMaxChangeSetId()
|
||||
{
|
||||
return maxChangeSetId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+55
-55
@@ -1,55 +1,55 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
|
||||
/**
|
||||
* Represents an alfresco model and checksum.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class AlfrescoModel
|
||||
{
|
||||
private M2Model model;
|
||||
private Long checksum;
|
||||
|
||||
public AlfrescoModel(M2Model model, Long checksum)
|
||||
{
|
||||
this.model = model;
|
||||
this.checksum = checksum;
|
||||
}
|
||||
|
||||
public M2Model getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public Long getChecksum()
|
||||
{
|
||||
return checksum;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if (this == other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!(other instanceof AlfrescoModel))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AlfrescoModel model = (AlfrescoModel)other;
|
||||
return (this.model.getName().equals(model.getModel().getName()) &&
|
||||
checksum.equals(model.getChecksum()));
|
||||
}
|
||||
|
||||
public int hashcode()
|
||||
{
|
||||
int result = 17;
|
||||
result = 31 * result + model.hashCode();
|
||||
result = 31 * result + Long.valueOf(checksum).hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import org.alfresco.repo.dictionary.M2Model;
|
||||
|
||||
/**
|
||||
* Represents an alfresco model and checksum.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class AlfrescoModel
|
||||
{
|
||||
private M2Model model;
|
||||
private Long checksum;
|
||||
|
||||
public AlfrescoModel(M2Model model, Long checksum)
|
||||
{
|
||||
this.model = model;
|
||||
this.checksum = checksum;
|
||||
}
|
||||
|
||||
public M2Model getModel()
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
public Long getChecksum()
|
||||
{
|
||||
return checksum;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if (this == other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!(other instanceof AlfrescoModel))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AlfrescoModel model = (AlfrescoModel)other;
|
||||
return (this.model.getName().equals(model.getModel().getName()) &&
|
||||
checksum.equals(model.getChecksum()));
|
||||
}
|
||||
|
||||
public int hashcode()
|
||||
{
|
||||
int result = 17;
|
||||
result = 31 * result + model.hashCode();
|
||||
result = 31 * result + Long.valueOf(checksum).hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+78
-78
@@ -1,78 +1,78 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Represents a diff between the set of current repository Alfresco models and the set maintained in SOLR.
|
||||
* The diff can represent a new, changed or removed Alfresco model. For a new model the newChecksum is
|
||||
* populated; for a changed model both checksums are populated; for a removed model neither checksum is populated.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class AlfrescoModelDiff
|
||||
{
|
||||
public static enum TYPE
|
||||
{
|
||||
NEW, CHANGED, REMOVED;
|
||||
};
|
||||
|
||||
private QName modelName;
|
||||
private TYPE type;
|
||||
private Long oldChecksum;
|
||||
private Long newChecksum;
|
||||
|
||||
public AlfrescoModelDiff(QName modelName, TYPE type, Long oldChecksum, Long newChecksum)
|
||||
{
|
||||
super();
|
||||
this.modelName = modelName;
|
||||
this.type = type;
|
||||
this.oldChecksum = oldChecksum;
|
||||
this.newChecksum = newChecksum;
|
||||
}
|
||||
|
||||
public QName getModelName()
|
||||
{
|
||||
return modelName;
|
||||
}
|
||||
|
||||
public TYPE getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public Long getOldChecksum()
|
||||
{
|
||||
return oldChecksum;
|
||||
}
|
||||
|
||||
public Long getNewChecksum()
|
||||
{
|
||||
return newChecksum;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if(this == other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!(other instanceof AlfrescoModelDiff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
AlfrescoModelDiff diff = (AlfrescoModelDiff)other;
|
||||
return(diff.getModelName().equals(getModelName()) &&
|
||||
diff.getType().equals(getType()) &&
|
||||
diff.getOldChecksum().equals(getOldChecksum()) &&
|
||||
diff.getNewChecksum().equals(getNewChecksum()));
|
||||
}
|
||||
|
||||
public int hashcode()
|
||||
{
|
||||
int result = 17;
|
||||
result = 31 * result + getModelName().hashCode();
|
||||
result = 31 * result + getType().hashCode();
|
||||
result = 31 * result + (int)(getOldChecksum().longValue() ^ (getOldChecksum().longValue() >>> 32));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Represents a diff between the set of current repository Alfresco models and the set maintained in SOLR.
|
||||
* The diff can represent a new, changed or removed Alfresco model. For a new model the newChecksum is
|
||||
* populated; for a changed model both checksums are populated; for a removed model neither checksum is populated.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class AlfrescoModelDiff
|
||||
{
|
||||
public static enum TYPE
|
||||
{
|
||||
NEW, CHANGED, REMOVED;
|
||||
};
|
||||
|
||||
private QName modelName;
|
||||
private TYPE type;
|
||||
private Long oldChecksum;
|
||||
private Long newChecksum;
|
||||
|
||||
public AlfrescoModelDiff(QName modelName, TYPE type, Long oldChecksum, Long newChecksum)
|
||||
{
|
||||
super();
|
||||
this.modelName = modelName;
|
||||
this.type = type;
|
||||
this.oldChecksum = oldChecksum;
|
||||
this.newChecksum = newChecksum;
|
||||
}
|
||||
|
||||
public QName getModelName()
|
||||
{
|
||||
return modelName;
|
||||
}
|
||||
|
||||
public TYPE getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public Long getOldChecksum()
|
||||
{
|
||||
return oldChecksum;
|
||||
}
|
||||
|
||||
public Long getNewChecksum()
|
||||
{
|
||||
return newChecksum;
|
||||
}
|
||||
|
||||
public boolean equals(Object other)
|
||||
{
|
||||
if(this == other)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if(!(other instanceof AlfrescoModelDiff))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
AlfrescoModelDiff diff = (AlfrescoModelDiff)other;
|
||||
return(diff.getModelName().equals(getModelName()) &&
|
||||
diff.getType().equals(getType()) &&
|
||||
diff.getOldChecksum().equals(getOldChecksum()) &&
|
||||
diff.getNewChecksum().equals(getNewChecksum()));
|
||||
}
|
||||
|
||||
public int hashcode()
|
||||
{
|
||||
int result = 17;
|
||||
result = 31 * result + getModelName().hashCode();
|
||||
result = 31 * result + getType().hashCode();
|
||||
result = 31 * result + (int)(getOldChecksum().longValue() ^ (getOldChecksum().longValue() >>> 32));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
+59
-59
@@ -1,59 +1,59 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents a content property value, including locale, length, content id, encoding, mime type
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class ContentPropertyValue extends PropertyValue
|
||||
{
|
||||
private Locale locale;
|
||||
private long length;
|
||||
private String encoding;
|
||||
private String mimetype;
|
||||
private Long id;
|
||||
|
||||
public ContentPropertyValue(Locale locale, long length, String encoding, String mimetype, Long id)
|
||||
{
|
||||
super();
|
||||
this.locale = locale;
|
||||
this.length = length;
|
||||
this.encoding = encoding;
|
||||
this.mimetype = mimetype;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEncoding()
|
||||
{
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public String getMimetype()
|
||||
{
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public Locale getLocale()
|
||||
{
|
||||
return locale;
|
||||
}
|
||||
|
||||
public long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ContentPropertyValue [locale=" + locale + ", length=" + length + ", encoding="
|
||||
+ encoding + ", mimetype=" + mimetype + ", id="+id+"]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents a content property value, including locale, length, content id, encoding, mime type
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class ContentPropertyValue extends PropertyValue
|
||||
{
|
||||
private Locale locale;
|
||||
private long length;
|
||||
private String encoding;
|
||||
private String mimetype;
|
||||
private Long id;
|
||||
|
||||
public ContentPropertyValue(Locale locale, long length, String encoding, String mimetype, Long id)
|
||||
{
|
||||
super();
|
||||
this.locale = locale;
|
||||
this.length = length;
|
||||
this.encoding = encoding;
|
||||
this.mimetype = mimetype;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEncoding()
|
||||
{
|
||||
return encoding;
|
||||
}
|
||||
|
||||
public String getMimetype()
|
||||
{
|
||||
return mimetype;
|
||||
}
|
||||
|
||||
public Locale getLocale()
|
||||
{
|
||||
return locale;
|
||||
}
|
||||
|
||||
public long getLength()
|
||||
{
|
||||
return length;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ContentPropertyValue [locale=" + locale + ", length=" + length + ", encoding="
|
||||
+ encoding + ", mimetype=" + mimetype + ", id="+id+"]";
|
||||
}
|
||||
}
|
||||
|
||||
+122
-122
@@ -1,122 +1,122 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Query parameters for fetching nodes.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class GetNodesParameters
|
||||
{
|
||||
private List<Long> transactionIds;
|
||||
private Long fromNodeId;
|
||||
private Long toNodeId;
|
||||
|
||||
private String storeProtocol;
|
||||
private String storeIdentifier;
|
||||
|
||||
private Set<QName> includeNodeTypes;
|
||||
private Set<QName> excludeNodeTypes;
|
||||
|
||||
private Set<QName> includeAspects;
|
||||
private Set<QName> excludeAspects;
|
||||
|
||||
public boolean getStoreFilter()
|
||||
{
|
||||
return (storeProtocol != null || storeIdentifier != null);
|
||||
}
|
||||
|
||||
public void setStoreProtocol(String storeProtocol)
|
||||
{
|
||||
this.storeProtocol = storeProtocol;
|
||||
}
|
||||
|
||||
public String getStoreProtocol()
|
||||
{
|
||||
return storeProtocol;
|
||||
}
|
||||
|
||||
public void setStoreIdentifier(String storeIdentifier)
|
||||
{
|
||||
this.storeIdentifier = storeIdentifier;
|
||||
}
|
||||
|
||||
public String getStoreIdentifier()
|
||||
{
|
||||
return storeIdentifier;
|
||||
}
|
||||
|
||||
public void setTransactionIds(List<Long> txnIds)
|
||||
{
|
||||
this.transactionIds = txnIds;
|
||||
}
|
||||
|
||||
public List<Long> getTransactionIds()
|
||||
{
|
||||
return transactionIds;
|
||||
}
|
||||
|
||||
public Long getFromNodeId()
|
||||
{
|
||||
return fromNodeId;
|
||||
}
|
||||
|
||||
public void setFromNodeId(Long fromNodeId)
|
||||
{
|
||||
this.fromNodeId = fromNodeId;
|
||||
}
|
||||
|
||||
public Long getToNodeId()
|
||||
{
|
||||
return toNodeId;
|
||||
}
|
||||
|
||||
public void setToNodeId(Long toNodeId)
|
||||
{
|
||||
this.toNodeId = toNodeId;
|
||||
}
|
||||
|
||||
public Set<QName> getIncludeNodeTypes()
|
||||
{
|
||||
return includeNodeTypes;
|
||||
}
|
||||
|
||||
public Set<QName> getExcludeNodeTypes()
|
||||
{
|
||||
return excludeNodeTypes;
|
||||
}
|
||||
|
||||
public Set<QName> getIncludeAspects()
|
||||
{
|
||||
return includeAspects;
|
||||
}
|
||||
|
||||
public Set<QName> getExcludeAspects()
|
||||
{
|
||||
return excludeAspects;
|
||||
}
|
||||
|
||||
public void setIncludeNodeTypes(Set<QName> includeNodeTypes)
|
||||
{
|
||||
this.includeNodeTypes = includeNodeTypes;
|
||||
}
|
||||
|
||||
public void setExcludeNodeTypes(Set<QName> excludeNodeTypes)
|
||||
{
|
||||
this.excludeNodeTypes = excludeNodeTypes;
|
||||
}
|
||||
|
||||
public void setIncludeAspects(Set<QName> includeAspects)
|
||||
{
|
||||
this.includeAspects = includeAspects;
|
||||
}
|
||||
|
||||
public void setExcludeAspects(Set<QName> excludeAspects)
|
||||
{
|
||||
this.excludeAspects = excludeAspects;
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.namespace.QName;
|
||||
|
||||
/**
|
||||
* Query parameters for fetching nodes.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class GetNodesParameters
|
||||
{
|
||||
private List<Long> transactionIds;
|
||||
private Long fromNodeId;
|
||||
private Long toNodeId;
|
||||
|
||||
private String storeProtocol;
|
||||
private String storeIdentifier;
|
||||
|
||||
private Set<QName> includeNodeTypes;
|
||||
private Set<QName> excludeNodeTypes;
|
||||
|
||||
private Set<QName> includeAspects;
|
||||
private Set<QName> excludeAspects;
|
||||
|
||||
public boolean getStoreFilter()
|
||||
{
|
||||
return (storeProtocol != null || storeIdentifier != null);
|
||||
}
|
||||
|
||||
public void setStoreProtocol(String storeProtocol)
|
||||
{
|
||||
this.storeProtocol = storeProtocol;
|
||||
}
|
||||
|
||||
public String getStoreProtocol()
|
||||
{
|
||||
return storeProtocol;
|
||||
}
|
||||
|
||||
public void setStoreIdentifier(String storeIdentifier)
|
||||
{
|
||||
this.storeIdentifier = storeIdentifier;
|
||||
}
|
||||
|
||||
public String getStoreIdentifier()
|
||||
{
|
||||
return storeIdentifier;
|
||||
}
|
||||
|
||||
public void setTransactionIds(List<Long> txnIds)
|
||||
{
|
||||
this.transactionIds = txnIds;
|
||||
}
|
||||
|
||||
public List<Long> getTransactionIds()
|
||||
{
|
||||
return transactionIds;
|
||||
}
|
||||
|
||||
public Long getFromNodeId()
|
||||
{
|
||||
return fromNodeId;
|
||||
}
|
||||
|
||||
public void setFromNodeId(Long fromNodeId)
|
||||
{
|
||||
this.fromNodeId = fromNodeId;
|
||||
}
|
||||
|
||||
public Long getToNodeId()
|
||||
{
|
||||
return toNodeId;
|
||||
}
|
||||
|
||||
public void setToNodeId(Long toNodeId)
|
||||
{
|
||||
this.toNodeId = toNodeId;
|
||||
}
|
||||
|
||||
public Set<QName> getIncludeNodeTypes()
|
||||
{
|
||||
return includeNodeTypes;
|
||||
}
|
||||
|
||||
public Set<QName> getExcludeNodeTypes()
|
||||
{
|
||||
return excludeNodeTypes;
|
||||
}
|
||||
|
||||
public Set<QName> getIncludeAspects()
|
||||
{
|
||||
return includeAspects;
|
||||
}
|
||||
|
||||
public Set<QName> getExcludeAspects()
|
||||
{
|
||||
return excludeAspects;
|
||||
}
|
||||
|
||||
public void setIncludeNodeTypes(Set<QName> includeNodeTypes)
|
||||
{
|
||||
this.includeNodeTypes = includeNodeTypes;
|
||||
}
|
||||
|
||||
public void setExcludeNodeTypes(Set<QName> excludeNodeTypes)
|
||||
{
|
||||
this.excludeNodeTypes = excludeNodeTypes;
|
||||
}
|
||||
|
||||
public void setIncludeAspects(Set<QName> includeAspects)
|
||||
{
|
||||
this.includeAspects = includeAspects;
|
||||
}
|
||||
|
||||
public void setExcludeAspects(Set<QName> excludeAspects)
|
||||
{
|
||||
this.excludeAspects = excludeAspects;
|
||||
}
|
||||
}
|
||||
|
||||
+54
-54
@@ -1,54 +1,54 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Represents a multi-lingual property value, comprising a map from locale to string value
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MLTextPropertyValue extends PropertyValue
|
||||
{
|
||||
private Map<Locale, String> values;
|
||||
|
||||
public MLTextPropertyValue()
|
||||
{
|
||||
super();
|
||||
values = new HashMap<Locale, String>(10);
|
||||
}
|
||||
|
||||
public MLTextPropertyValue(Map<Locale, String> values)
|
||||
{
|
||||
super();
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public void addValue(Locale locale, String value)
|
||||
{
|
||||
values.put(locale, value);
|
||||
}
|
||||
|
||||
public Map<Locale, String> getValues()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
public Set<Locale> getLocales()
|
||||
{
|
||||
return values.keySet();
|
||||
}
|
||||
|
||||
public String getValue(Locale locale)
|
||||
{
|
||||
return values.get(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MLTextPropertyValue [values=" + values + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Represents a multi-lingual property value, comprising a map from locale to string value
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MLTextPropertyValue extends PropertyValue
|
||||
{
|
||||
private Map<Locale, String> values;
|
||||
|
||||
public MLTextPropertyValue()
|
||||
{
|
||||
super();
|
||||
values = new HashMap<Locale, String>(10);
|
||||
}
|
||||
|
||||
public MLTextPropertyValue(Map<Locale, String> values)
|
||||
{
|
||||
super();
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public void addValue(Locale locale, String value)
|
||||
{
|
||||
values.put(locale, value);
|
||||
}
|
||||
|
||||
public Map<Locale, String> getValues()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
public Set<Locale> getLocales()
|
||||
{
|
||||
return values.keySet();
|
||||
}
|
||||
|
||||
public String getValue(Locale locale)
|
||||
{
|
||||
return values.get(locale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MLTextPropertyValue [values=" + values + "]";
|
||||
}
|
||||
}
|
||||
|
||||
+42
-42
@@ -1,42 +1,42 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a multi property value, comprising a list of other property values
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MultiPropertyValue extends PropertyValue
|
||||
{
|
||||
private List<PropertyValue> values;
|
||||
|
||||
public MultiPropertyValue()
|
||||
{
|
||||
super();
|
||||
this.values = new ArrayList<PropertyValue>(10);
|
||||
}
|
||||
|
||||
public MultiPropertyValue(List<PropertyValue> values)
|
||||
{
|
||||
super();
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public void addValue(PropertyValue value)
|
||||
{
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
public List<PropertyValue> getValues()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MultiPropertyValue [values=" + values + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents a multi property value, comprising a list of other property values
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class MultiPropertyValue extends PropertyValue
|
||||
{
|
||||
private List<PropertyValue> values;
|
||||
|
||||
public MultiPropertyValue()
|
||||
{
|
||||
super();
|
||||
this.values = new ArrayList<PropertyValue>(10);
|
||||
}
|
||||
|
||||
public MultiPropertyValue(List<PropertyValue> values)
|
||||
{
|
||||
super();
|
||||
this.values = values;
|
||||
}
|
||||
|
||||
public void addValue(PropertyValue value)
|
||||
{
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
public List<PropertyValue> getValues()
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "MultiPropertyValue [values=" + values + "]";
|
||||
}
|
||||
}
|
||||
|
||||
+86
-86
@@ -1,86 +1,86 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
public class Node
|
||||
{
|
||||
public static enum SolrApiNodeStatus
|
||||
{
|
||||
UPDATED, DELETED, UNKNOWN, NON_SHARD_DELETED, NON_SHARD_UPDATED;
|
||||
};
|
||||
|
||||
private long id;
|
||||
private String nodeRef;
|
||||
private long txnId;
|
||||
private SolrApiNodeStatus status;
|
||||
private String tenant;
|
||||
private long aclId;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public String getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
public void setNodeRef(String nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
public long getTxnId()
|
||||
{
|
||||
return txnId;
|
||||
}
|
||||
public void setTxnId(long txnId)
|
||||
{
|
||||
this.txnId = txnId;
|
||||
}
|
||||
public SolrApiNodeStatus getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setStatus(SolrApiNodeStatus status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
/**
|
||||
* @return the tenant
|
||||
*/
|
||||
public String getTenant()
|
||||
{
|
||||
return tenant;
|
||||
}
|
||||
/**
|
||||
* @param tenant the tenant to set
|
||||
*/
|
||||
public void setTenant(String tenant)
|
||||
{
|
||||
this.tenant = tenant;
|
||||
}
|
||||
/**
|
||||
* @return the aclId
|
||||
*/
|
||||
public long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
/**
|
||||
* @param aclId the aclId to set
|
||||
*/
|
||||
public void setAclId(long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Node [id=" + id + ", nodeRef=" + nodeRef + ", txnId=" + txnId + ", status=" + status + ", tenant=" + tenant + ", aclId=" + aclId + "]";
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
public class Node
|
||||
{
|
||||
public static enum SolrApiNodeStatus
|
||||
{
|
||||
UPDATED, DELETED, UNKNOWN, NON_SHARD_DELETED, NON_SHARD_UPDATED;
|
||||
};
|
||||
|
||||
private long id;
|
||||
private String nodeRef;
|
||||
private long txnId;
|
||||
private SolrApiNodeStatus status;
|
||||
private String tenant;
|
||||
private long aclId;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public String getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
public void setNodeRef(String nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
public long getTxnId()
|
||||
{
|
||||
return txnId;
|
||||
}
|
||||
public void setTxnId(long txnId)
|
||||
{
|
||||
this.txnId = txnId;
|
||||
}
|
||||
public SolrApiNodeStatus getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setStatus(SolrApiNodeStatus status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
/**
|
||||
* @return the tenant
|
||||
*/
|
||||
public String getTenant()
|
||||
{
|
||||
return tenant;
|
||||
}
|
||||
/**
|
||||
* @param tenant the tenant to set
|
||||
*/
|
||||
public void setTenant(String tenant)
|
||||
{
|
||||
this.tenant = tenant;
|
||||
}
|
||||
/**
|
||||
* @return the aclId
|
||||
*/
|
||||
public long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
/**
|
||||
* @param aclId the aclId to set
|
||||
*/
|
||||
public void setAclId(long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Node [id=" + id + ", nodeRef=" + nodeRef + ", txnId=" + txnId + ", status=" + status + ", tenant=" + tenant + ", aclId=" + aclId + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+181
-181
@@ -1,181 +1,181 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* SOLR-side representation of node metadata information.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class NodeMetaData
|
||||
{
|
||||
private long id;
|
||||
private NodeRef nodeRef;
|
||||
private QName type;
|
||||
private long aclId;
|
||||
private Map<QName, PropertyValue> properties;
|
||||
private Set<QName> aspects;
|
||||
private List<Pair<String, QName>> paths;
|
||||
private List<List<String>> namePaths;
|
||||
private long parentAssocsCrc;
|
||||
private List<ChildAssociationRef> parentAssocs;
|
||||
private List<ChildAssociationRef> childAssocs;
|
||||
private List<Long> childIds;
|
||||
private String owner;
|
||||
private long txnId;
|
||||
private Set<NodeRef> ancestors;
|
||||
private String tenantDomain;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
public void setNodeRef(NodeRef nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
public QName getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setType(QName type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
public long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
public void setAclId(long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* A property value is either null or a subclass of PropertyValue
|
||||
*/
|
||||
public Map<QName, PropertyValue> getProperties()
|
||||
{
|
||||
return properties;
|
||||
}
|
||||
public void setProperties(Map<QName, PropertyValue> properties)
|
||||
{
|
||||
this.properties = properties;
|
||||
}
|
||||
public Set<QName> getAspects()
|
||||
{
|
||||
return aspects;
|
||||
}
|
||||
public void setAspects(Set<QName> aspects)
|
||||
{
|
||||
this.aspects = aspects;
|
||||
}
|
||||
public List<Pair<String, QName>> getPaths()
|
||||
{
|
||||
return paths;
|
||||
}
|
||||
public void setPaths(List<Pair<String, QName>> paths)
|
||||
{
|
||||
this.paths = paths;
|
||||
}
|
||||
|
||||
public List<List<String>> getNamePaths()
|
||||
{
|
||||
return namePaths;
|
||||
}
|
||||
|
||||
public void setNamePaths(List<List<String>> namePaths)
|
||||
{
|
||||
this.namePaths = namePaths;
|
||||
}
|
||||
public void setParentAssocsCrc(long parentAssocsCrc)
|
||||
{
|
||||
this.parentAssocsCrc = parentAssocsCrc;
|
||||
}
|
||||
public long getParentAssocsCrc()
|
||||
{
|
||||
return parentAssocsCrc;
|
||||
}
|
||||
public void setParentAssocs(List<ChildAssociationRef> parentAssocs)
|
||||
{
|
||||
this.parentAssocs = parentAssocs;
|
||||
}
|
||||
public List<ChildAssociationRef> getParentAssocs()
|
||||
{
|
||||
return parentAssocs;
|
||||
}
|
||||
public void setChildAssocs(List<ChildAssociationRef> childAssocs)
|
||||
{
|
||||
this.childAssocs = childAssocs;
|
||||
}
|
||||
public List<ChildAssociationRef> getChildAssocs()
|
||||
{
|
||||
return childAssocs;
|
||||
}
|
||||
public List<Long> getChildIds()
|
||||
{
|
||||
return childIds;
|
||||
}
|
||||
public void setChildIds(List<Long> childIds)
|
||||
{
|
||||
this.childIds = childIds;
|
||||
}
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
public void setOwner(String owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public long getTxnId()
|
||||
{
|
||||
return txnId;
|
||||
}
|
||||
public void setTxnId(long txnId)
|
||||
{
|
||||
this.txnId = txnId;
|
||||
}
|
||||
public Set<NodeRef> getAncestors()
|
||||
{
|
||||
return ancestors;
|
||||
}
|
||||
public void setAncestors(Set<NodeRef> ancestors)
|
||||
{
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
public String getTenantDomain()
|
||||
{
|
||||
return tenantDomain;
|
||||
}
|
||||
public void setTenantDomain(String tenantDomain)
|
||||
{
|
||||
this.tenantDomain = tenantDomain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "NodeMetaData [id="
|
||||
+ id + ", nodeRef=" + nodeRef + ", type=" + type + ", aclId=" + aclId + ", properties=" + properties + ", aspects=" + aspects + ", paths=" + paths
|
||||
+ ", parentAssocsCrc=" + parentAssocsCrc + ", parentAssocs=" + parentAssocs + ", childAssocs=" + childAssocs + ", childIds=" + childIds + ", owner=" + owner
|
||||
+ ", txnId=" + txnId + ", ancestors=" + ancestors + ", tenantDomain=" + tenantDomain + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.service.cmr.repository.ChildAssociationRef;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
|
||||
/**
|
||||
* SOLR-side representation of node metadata information.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class NodeMetaData
|
||||
{
|
||||
private long id;
|
||||
private NodeRef nodeRef;
|
||||
private QName type;
|
||||
private long aclId;
|
||||
private Map<QName, PropertyValue> properties;
|
||||
private Set<QName> aspects;
|
||||
private List<Pair<String, QName>> paths;
|
||||
private List<List<String>> namePaths;
|
||||
private long parentAssocsCrc;
|
||||
private List<ChildAssociationRef> parentAssocs;
|
||||
private List<ChildAssociationRef> childAssocs;
|
||||
private List<Long> childIds;
|
||||
private String owner;
|
||||
private long txnId;
|
||||
private Set<NodeRef> ancestors;
|
||||
private String tenantDomain;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public NodeRef getNodeRef()
|
||||
{
|
||||
return nodeRef;
|
||||
}
|
||||
public void setNodeRef(NodeRef nodeRef)
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
public QName getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setType(QName type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
public long getAclId()
|
||||
{
|
||||
return aclId;
|
||||
}
|
||||
public void setAclId(long aclId)
|
||||
{
|
||||
this.aclId = aclId;
|
||||
}
|
||||
|
||||
/**
|
||||
* A property value is either null or a subclass of PropertyValue
|
||||
*/
|
||||
public Map<QName, PropertyValue> getProperties()
|
||||
{
|
||||
return properties;
|
||||
}
|
||||
public void setProperties(Map<QName, PropertyValue> properties)
|
||||
{
|
||||
this.properties = properties;
|
||||
}
|
||||
public Set<QName> getAspects()
|
||||
{
|
||||
return aspects;
|
||||
}
|
||||
public void setAspects(Set<QName> aspects)
|
||||
{
|
||||
this.aspects = aspects;
|
||||
}
|
||||
public List<Pair<String, QName>> getPaths()
|
||||
{
|
||||
return paths;
|
||||
}
|
||||
public void setPaths(List<Pair<String, QName>> paths)
|
||||
{
|
||||
this.paths = paths;
|
||||
}
|
||||
|
||||
public List<List<String>> getNamePaths()
|
||||
{
|
||||
return namePaths;
|
||||
}
|
||||
|
||||
public void setNamePaths(List<List<String>> namePaths)
|
||||
{
|
||||
this.namePaths = namePaths;
|
||||
}
|
||||
public void setParentAssocsCrc(long parentAssocsCrc)
|
||||
{
|
||||
this.parentAssocsCrc = parentAssocsCrc;
|
||||
}
|
||||
public long getParentAssocsCrc()
|
||||
{
|
||||
return parentAssocsCrc;
|
||||
}
|
||||
public void setParentAssocs(List<ChildAssociationRef> parentAssocs)
|
||||
{
|
||||
this.parentAssocs = parentAssocs;
|
||||
}
|
||||
public List<ChildAssociationRef> getParentAssocs()
|
||||
{
|
||||
return parentAssocs;
|
||||
}
|
||||
public void setChildAssocs(List<ChildAssociationRef> childAssocs)
|
||||
{
|
||||
this.childAssocs = childAssocs;
|
||||
}
|
||||
public List<ChildAssociationRef> getChildAssocs()
|
||||
{
|
||||
return childAssocs;
|
||||
}
|
||||
public List<Long> getChildIds()
|
||||
{
|
||||
return childIds;
|
||||
}
|
||||
public void setChildIds(List<Long> childIds)
|
||||
{
|
||||
this.childIds = childIds;
|
||||
}
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
public void setOwner(String owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public long getTxnId()
|
||||
{
|
||||
return txnId;
|
||||
}
|
||||
public void setTxnId(long txnId)
|
||||
{
|
||||
this.txnId = txnId;
|
||||
}
|
||||
public Set<NodeRef> getAncestors()
|
||||
{
|
||||
return ancestors;
|
||||
}
|
||||
public void setAncestors(Set<NodeRef> ancestors)
|
||||
{
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
public String getTenantDomain()
|
||||
{
|
||||
return tenantDomain;
|
||||
}
|
||||
public void setTenantDomain(String tenantDomain)
|
||||
{
|
||||
this.tenantDomain = tenantDomain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "NodeMetaData [id="
|
||||
+ id + ", nodeRef=" + nodeRef + ", type=" + type + ", aclId=" + aclId + ", properties=" + properties + ", aspects=" + aspects + ", paths=" + paths
|
||||
+ ", parentAssocsCrc=" + parentAssocsCrc + ", parentAssocs=" + parentAssocs + ", childAssocs=" + childAssocs + ", childIds=" + childIds + ", owner=" + owner
|
||||
+ ", txnId=" + txnId + ", ancestors=" + ancestors + ", tenantDomain=" + tenantDomain + "]";
|
||||
}
|
||||
}
|
||||
|
||||
+215
-215
@@ -1,215 +1,215 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Stores node meta data query parameters for use in SOLR remote api calls
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class NodeMetaDataParameters
|
||||
{
|
||||
private List<Long> transactionIds;
|
||||
private Long fromTxnId;
|
||||
private Long toTxnId;
|
||||
|
||||
// default is 'all' results
|
||||
private int maxResults = 0;
|
||||
|
||||
private Long fromNodeId;
|
||||
private Long toNodeId;
|
||||
private List<Long> nodeIds;
|
||||
|
||||
private boolean includeAclId = true;
|
||||
private boolean includeAspects = true;
|
||||
private boolean includeNodeRef = true;
|
||||
private boolean includeOwner = true;
|
||||
private boolean includeProperties = true;
|
||||
private boolean includePaths = true;
|
||||
private boolean includeType = true;
|
||||
private boolean includeChildAssociations = true;
|
||||
private boolean includeParentAssociations = true;
|
||||
private boolean includeChildIds = true;
|
||||
private boolean includeTxnId = true;
|
||||
|
||||
public boolean isIncludeAclId()
|
||||
{
|
||||
return includeAclId;
|
||||
}
|
||||
|
||||
public void setIncludeAclId(boolean includeAclId)
|
||||
{
|
||||
this.includeAclId = includeAclId;
|
||||
}
|
||||
|
||||
public boolean isIncludeAspects()
|
||||
{
|
||||
return includeAspects;
|
||||
}
|
||||
|
||||
public void setIncludeAspects(boolean includeAspects)
|
||||
{
|
||||
this.includeAspects = includeAspects;
|
||||
}
|
||||
|
||||
public boolean isIncludeNodeRef()
|
||||
{
|
||||
return includeNodeRef;
|
||||
}
|
||||
|
||||
public void setIncludeNodeRef(boolean includeNodeRef)
|
||||
{
|
||||
this.includeNodeRef = includeNodeRef;
|
||||
}
|
||||
|
||||
public boolean isIncludeOwner()
|
||||
{
|
||||
return includeOwner;
|
||||
}
|
||||
|
||||
public void setIncludeOwner(boolean includeOwner)
|
||||
{
|
||||
this.includeOwner = includeOwner;
|
||||
}
|
||||
|
||||
public boolean isIncludeProperties()
|
||||
{
|
||||
return includeProperties;
|
||||
}
|
||||
|
||||
public void setIncludeProperties(boolean includeProperties)
|
||||
{
|
||||
this.includeProperties = includeProperties;
|
||||
}
|
||||
|
||||
public boolean isIncludePaths()
|
||||
{
|
||||
return includePaths;
|
||||
}
|
||||
|
||||
public void setIncludePaths(boolean includePaths)
|
||||
{
|
||||
this.includePaths = includePaths;
|
||||
}
|
||||
|
||||
public boolean isIncludeType()
|
||||
{
|
||||
return includeType;
|
||||
}
|
||||
|
||||
public void setIncludeType(boolean includeType)
|
||||
{
|
||||
this.includeType = includeType;
|
||||
}
|
||||
|
||||
public boolean isIncludeChildAssociations()
|
||||
{
|
||||
return includeChildAssociations;
|
||||
}
|
||||
|
||||
public void setIncludeChildAssociations(boolean includeChildAssociations)
|
||||
{
|
||||
this.includeChildAssociations = includeChildAssociations;
|
||||
}
|
||||
|
||||
public boolean isIncludeParentAssociations()
|
||||
{
|
||||
return includeParentAssociations;
|
||||
}
|
||||
|
||||
public void setIncludeParentAssociations(boolean includeParentAssociations)
|
||||
{
|
||||
this.includeParentAssociations = includeParentAssociations;
|
||||
}
|
||||
|
||||
public int getMaxResults()
|
||||
{
|
||||
return maxResults;
|
||||
}
|
||||
|
||||
public void setMaxResults(int maxResults)
|
||||
{
|
||||
this.maxResults = maxResults;
|
||||
}
|
||||
|
||||
public List<Long> getNodeIds()
|
||||
{
|
||||
return nodeIds;
|
||||
}
|
||||
|
||||
public void setNodeIds(List<Long> nodeIds)
|
||||
{
|
||||
this.nodeIds = nodeIds;
|
||||
}
|
||||
|
||||
public void setTransactionIds(List<Long> txnIds)
|
||||
{
|
||||
this.transactionIds = txnIds;
|
||||
}
|
||||
|
||||
public List<Long> getTransactionIds()
|
||||
{
|
||||
return transactionIds;
|
||||
}
|
||||
|
||||
public Long getFromTxnId()
|
||||
{
|
||||
return fromTxnId;
|
||||
}
|
||||
|
||||
public void setFromTxnId(Long fromTxnId)
|
||||
{
|
||||
this.fromTxnId = fromTxnId;
|
||||
}
|
||||
|
||||
public Long getToTxnId()
|
||||
{
|
||||
return toTxnId;
|
||||
}
|
||||
|
||||
public void setToTxnId(Long toTxnId)
|
||||
{
|
||||
this.toTxnId = toTxnId;
|
||||
}
|
||||
|
||||
public Long getFromNodeId()
|
||||
{
|
||||
return fromNodeId;
|
||||
}
|
||||
|
||||
public void setFromNodeId(Long fromNodeId)
|
||||
{
|
||||
this.fromNodeId = fromNodeId;
|
||||
}
|
||||
|
||||
public Long getToNodeId()
|
||||
{
|
||||
return toNodeId;
|
||||
}
|
||||
|
||||
public void setToNodeId(Long toNodeId)
|
||||
{
|
||||
this.toNodeId = toNodeId;
|
||||
}
|
||||
|
||||
public boolean isIncludeChildIds()
|
||||
{
|
||||
return includeChildIds;
|
||||
}
|
||||
|
||||
public void setIncludeChildIds(boolean includeChildIds)
|
||||
{
|
||||
this.includeChildIds = includeChildIds;
|
||||
}
|
||||
|
||||
public boolean isIncludeTxnId()
|
||||
{
|
||||
return includeTxnId;
|
||||
}
|
||||
|
||||
public void setIncludeTxnId(boolean includeTxnId)
|
||||
{
|
||||
this.includeTxnId = includeTxnId;
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Stores node meta data query parameters for use in SOLR remote api calls
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class NodeMetaDataParameters
|
||||
{
|
||||
private List<Long> transactionIds;
|
||||
private Long fromTxnId;
|
||||
private Long toTxnId;
|
||||
|
||||
// default is 'all' results
|
||||
private int maxResults = 0;
|
||||
|
||||
private Long fromNodeId;
|
||||
private Long toNodeId;
|
||||
private List<Long> nodeIds;
|
||||
|
||||
private boolean includeAclId = true;
|
||||
private boolean includeAspects = true;
|
||||
private boolean includeNodeRef = true;
|
||||
private boolean includeOwner = true;
|
||||
private boolean includeProperties = true;
|
||||
private boolean includePaths = true;
|
||||
private boolean includeType = true;
|
||||
private boolean includeChildAssociations = true;
|
||||
private boolean includeParentAssociations = true;
|
||||
private boolean includeChildIds = true;
|
||||
private boolean includeTxnId = true;
|
||||
|
||||
public boolean isIncludeAclId()
|
||||
{
|
||||
return includeAclId;
|
||||
}
|
||||
|
||||
public void setIncludeAclId(boolean includeAclId)
|
||||
{
|
||||
this.includeAclId = includeAclId;
|
||||
}
|
||||
|
||||
public boolean isIncludeAspects()
|
||||
{
|
||||
return includeAspects;
|
||||
}
|
||||
|
||||
public void setIncludeAspects(boolean includeAspects)
|
||||
{
|
||||
this.includeAspects = includeAspects;
|
||||
}
|
||||
|
||||
public boolean isIncludeNodeRef()
|
||||
{
|
||||
return includeNodeRef;
|
||||
}
|
||||
|
||||
public void setIncludeNodeRef(boolean includeNodeRef)
|
||||
{
|
||||
this.includeNodeRef = includeNodeRef;
|
||||
}
|
||||
|
||||
public boolean isIncludeOwner()
|
||||
{
|
||||
return includeOwner;
|
||||
}
|
||||
|
||||
public void setIncludeOwner(boolean includeOwner)
|
||||
{
|
||||
this.includeOwner = includeOwner;
|
||||
}
|
||||
|
||||
public boolean isIncludeProperties()
|
||||
{
|
||||
return includeProperties;
|
||||
}
|
||||
|
||||
public void setIncludeProperties(boolean includeProperties)
|
||||
{
|
||||
this.includeProperties = includeProperties;
|
||||
}
|
||||
|
||||
public boolean isIncludePaths()
|
||||
{
|
||||
return includePaths;
|
||||
}
|
||||
|
||||
public void setIncludePaths(boolean includePaths)
|
||||
{
|
||||
this.includePaths = includePaths;
|
||||
}
|
||||
|
||||
public boolean isIncludeType()
|
||||
{
|
||||
return includeType;
|
||||
}
|
||||
|
||||
public void setIncludeType(boolean includeType)
|
||||
{
|
||||
this.includeType = includeType;
|
||||
}
|
||||
|
||||
public boolean isIncludeChildAssociations()
|
||||
{
|
||||
return includeChildAssociations;
|
||||
}
|
||||
|
||||
public void setIncludeChildAssociations(boolean includeChildAssociations)
|
||||
{
|
||||
this.includeChildAssociations = includeChildAssociations;
|
||||
}
|
||||
|
||||
public boolean isIncludeParentAssociations()
|
||||
{
|
||||
return includeParentAssociations;
|
||||
}
|
||||
|
||||
public void setIncludeParentAssociations(boolean includeParentAssociations)
|
||||
{
|
||||
this.includeParentAssociations = includeParentAssociations;
|
||||
}
|
||||
|
||||
public int getMaxResults()
|
||||
{
|
||||
return maxResults;
|
||||
}
|
||||
|
||||
public void setMaxResults(int maxResults)
|
||||
{
|
||||
this.maxResults = maxResults;
|
||||
}
|
||||
|
||||
public List<Long> getNodeIds()
|
||||
{
|
||||
return nodeIds;
|
||||
}
|
||||
|
||||
public void setNodeIds(List<Long> nodeIds)
|
||||
{
|
||||
this.nodeIds = nodeIds;
|
||||
}
|
||||
|
||||
public void setTransactionIds(List<Long> txnIds)
|
||||
{
|
||||
this.transactionIds = txnIds;
|
||||
}
|
||||
|
||||
public List<Long> getTransactionIds()
|
||||
{
|
||||
return transactionIds;
|
||||
}
|
||||
|
||||
public Long getFromTxnId()
|
||||
{
|
||||
return fromTxnId;
|
||||
}
|
||||
|
||||
public void setFromTxnId(Long fromTxnId)
|
||||
{
|
||||
this.fromTxnId = fromTxnId;
|
||||
}
|
||||
|
||||
public Long getToTxnId()
|
||||
{
|
||||
return toTxnId;
|
||||
}
|
||||
|
||||
public void setToTxnId(Long toTxnId)
|
||||
{
|
||||
this.toTxnId = toTxnId;
|
||||
}
|
||||
|
||||
public Long getFromNodeId()
|
||||
{
|
||||
return fromNodeId;
|
||||
}
|
||||
|
||||
public void setFromNodeId(Long fromNodeId)
|
||||
{
|
||||
this.fromNodeId = fromNodeId;
|
||||
}
|
||||
|
||||
public Long getToNodeId()
|
||||
{
|
||||
return toNodeId;
|
||||
}
|
||||
|
||||
public void setToNodeId(Long toNodeId)
|
||||
{
|
||||
this.toNodeId = toNodeId;
|
||||
}
|
||||
|
||||
public boolean isIncludeChildIds()
|
||||
{
|
||||
return includeChildIds;
|
||||
}
|
||||
|
||||
public void setIncludeChildIds(boolean includeChildIds)
|
||||
{
|
||||
this.includeChildIds = includeChildIds;
|
||||
}
|
||||
|
||||
public boolean isIncludeTxnId()
|
||||
{
|
||||
return includeTxnId;
|
||||
}
|
||||
|
||||
public void setIncludeTxnId(boolean includeTxnId)
|
||||
{
|
||||
this.includeTxnId = includeTxnId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,11 +1,11 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* Base class for property values returned to SOLR for indexing.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public abstract class PropertyValue
|
||||
{
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* Base class for property values returned to SOLR for indexing.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public abstract class PropertyValue
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
+1516
-1516
File diff suppressed because it is too large
Load Diff
+163
-163
@@ -1,163 +1,163 @@
|
||||
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.encryption.KeyResourceLoader;
|
||||
import org.alfresco.encryption.KeyStoreParameters;
|
||||
import org.alfresco.encryption.ssl.SSLEncryptionParameters;
|
||||
import org.alfresco.httpclient.AlfrescoHttpClient;
|
||||
import org.alfresco.httpclient.HttpClientFactory;
|
||||
import org.alfresco.httpclient.HttpClientFactory.SecureCommsType;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
|
||||
/**
|
||||
* This factory encapsulates the creation of a SOLRAPIClient and the management of that resource.
|
||||
*
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public class SOLRAPIClientFactory
|
||||
{
|
||||
/*
|
||||
* Pool of cached client resources keyed on alfresco instances
|
||||
*/
|
||||
private static Map<String, SOLRAPIClient> clientsPerAlfresco = new HashMap<>();
|
||||
|
||||
// encryption related parameters
|
||||
private String secureCommsType; // "none", "https"
|
||||
private String keyStoreType;
|
||||
private String keyStoreProvider;
|
||||
private String passwordFileLocation;
|
||||
private String keyStoreLocation;
|
||||
|
||||
// ssl
|
||||
private String sslKeyStoreType;
|
||||
private String sslKeyStoreProvider;
|
||||
private String sslKeyStoreLocation;
|
||||
private String sslKeyStorePasswordFileLocation;
|
||||
private String sslTrustStoreType;
|
||||
private String sslTrustStoreProvider;
|
||||
private String sslTrustStoreLocation;
|
||||
private String sslTrustStorePasswordFileLocation;
|
||||
private String alfrescoHost;
|
||||
private int alfrescoPort;
|
||||
private int alfrescoPortSSL;
|
||||
private String baseUrl;
|
||||
|
||||
// http client
|
||||
private int maxTotalConnections = 40;
|
||||
private int maxHostConnections = 40;
|
||||
private int socketTimeout = 120000;
|
||||
|
||||
/**
|
||||
* Gets the client resource from the pool.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @return SOLRAPIClient
|
||||
*/
|
||||
private SOLRAPIClient getCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL)
|
||||
{
|
||||
String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
return clientsPerAlfresco.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a key to identify a unique alfresco instance to which the client will connect.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @return the key to get a client
|
||||
*/
|
||||
private String constructKey(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL)
|
||||
{
|
||||
return alfrescoHost + alfrescoPort + alfrescoPortSSL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client in the resource pool.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @param client SOLRAPIClient
|
||||
*/
|
||||
private void setCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL, SOLRAPIClient client)
|
||||
{
|
||||
String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
clientsPerAlfresco.put(key, client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the SOLRAPIClient or gets it from a pool
|
||||
*
|
||||
* @param props solrcore.properties in the <coreName>/conf directory
|
||||
* @param keyResourceLoader reads encryption key resources
|
||||
* @param dictionaryService represents the Repository Data Dictionary
|
||||
* @param namespaceDAO allows retrieving and creating Namespace definitions
|
||||
* @return an instance of SOLRAPIClient
|
||||
*/
|
||||
public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader,
|
||||
DictionaryService dictionaryService, NamespaceDAO namespaceDAO)
|
||||
{
|
||||
alfrescoHost = props.getProperty("alfresco.host", "localhost");
|
||||
alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080"));
|
||||
alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443"));
|
||||
|
||||
SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
if (client == null)
|
||||
{
|
||||
baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco");
|
||||
keyStoreType = props.getProperty("alfresco.encryption.keystore.type", "JCEKS");
|
||||
keyStoreProvider = props.getProperty("alfresco.encryption.keystore.provider");
|
||||
passwordFileLocation = props.getProperty("alfresco.encryption.keystore.passwordFileLocation");
|
||||
keyStoreLocation = props.getProperty("alfresco.encryption.keystore.location");
|
||||
sslKeyStoreType = props.getProperty("alfresco.encryption.ssl.keystore.type", "JCEKS");
|
||||
sslKeyStoreProvider = props.getProperty("alfresco.encryption.ssl.keystore.provider", "");
|
||||
sslKeyStoreLocation = props.getProperty("alfresco.encryption.ssl.keystore.location",
|
||||
"ssl.repo.client.keystore");
|
||||
sslKeyStorePasswordFileLocation = props.getProperty(
|
||||
"alfresco.encryption.ssl.keystore.passwordFileLocation", "ssl-keystore-passwords.properties");
|
||||
sslTrustStoreType = props.getProperty("alfresco.encryption.ssl.truststore.type", "JCEKS");
|
||||
sslTrustStoreProvider = props.getProperty("alfresco.encryption.ssl.truststore.provider", "");
|
||||
sslTrustStoreLocation = props.getProperty("alfresco.encryption.ssl.truststore.location",
|
||||
"ssl.repo.client.truststore");
|
||||
sslTrustStorePasswordFileLocation = props.getProperty(
|
||||
"alfresco.encryption.ssl.truststore.passwordFileLocation",
|
||||
"ssl-truststore-passwords.properties");
|
||||
secureCommsType = props.getProperty("alfresco.secureComms", "none");
|
||||
maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40"));
|
||||
maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40"));
|
||||
socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000"));
|
||||
|
||||
client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO);
|
||||
setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client);
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
protected AlfrescoHttpClient getRepoClient(KeyResourceLoader keyResourceLoader)
|
||||
{
|
||||
// TODO i18n
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters("SSL Key Store", sslKeyStoreType,
|
||||
sslKeyStoreProvider, sslKeyStorePasswordFileLocation, sslKeyStoreLocation);
|
||||
KeyStoreParameters trustStoreParameters = new KeyStoreParameters("SSL Trust Store", sslTrustStoreType,
|
||||
sslTrustStoreProvider, sslTrustStorePasswordFileLocation, sslTrustStoreLocation);
|
||||
SSLEncryptionParameters sslEncryptionParameters = new SSLEncryptionParameters(keyStoreParameters,
|
||||
trustStoreParameters);
|
||||
|
||||
HttpClientFactory httpClientFactory = new HttpClientFactory(SecureCommsType.getType(secureCommsType),
|
||||
sslEncryptionParameters, keyResourceLoader, null, null, alfrescoHost, alfrescoPort,
|
||||
alfrescoPortSSL, maxTotalConnections, maxHostConnections, socketTimeout);
|
||||
// TODO need to make port configurable depending on secure comms, or just make redirects work
|
||||
AlfrescoHttpClient repoClient = httpClientFactory.getRepoClient(alfrescoHost, alfrescoPortSSL);
|
||||
repoClient.setBaseUrl(baseUrl);
|
||||
return repoClient;
|
||||
}
|
||||
}
|
||||
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.encryption.KeyResourceLoader;
|
||||
import org.alfresco.encryption.KeyStoreParameters;
|
||||
import org.alfresco.encryption.ssl.SSLEncryptionParameters;
|
||||
import org.alfresco.httpclient.AlfrescoHttpClient;
|
||||
import org.alfresco.httpclient.HttpClientFactory;
|
||||
import org.alfresco.httpclient.HttpClientFactory.SecureCommsType;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
|
||||
/**
|
||||
* This factory encapsulates the creation of a SOLRAPIClient and the management of that resource.
|
||||
*
|
||||
* @author Ahmed Owian
|
||||
*/
|
||||
public class SOLRAPIClientFactory
|
||||
{
|
||||
/*
|
||||
* Pool of cached client resources keyed on alfresco instances
|
||||
*/
|
||||
private static Map<String, SOLRAPIClient> clientsPerAlfresco = new HashMap<>();
|
||||
|
||||
// encryption related parameters
|
||||
private String secureCommsType; // "none", "https"
|
||||
private String keyStoreType;
|
||||
private String keyStoreProvider;
|
||||
private String passwordFileLocation;
|
||||
private String keyStoreLocation;
|
||||
|
||||
// ssl
|
||||
private String sslKeyStoreType;
|
||||
private String sslKeyStoreProvider;
|
||||
private String sslKeyStoreLocation;
|
||||
private String sslKeyStorePasswordFileLocation;
|
||||
private String sslTrustStoreType;
|
||||
private String sslTrustStoreProvider;
|
||||
private String sslTrustStoreLocation;
|
||||
private String sslTrustStorePasswordFileLocation;
|
||||
private String alfrescoHost;
|
||||
private int alfrescoPort;
|
||||
private int alfrescoPortSSL;
|
||||
private String baseUrl;
|
||||
|
||||
// http client
|
||||
private int maxTotalConnections = 40;
|
||||
private int maxHostConnections = 40;
|
||||
private int socketTimeout = 120000;
|
||||
|
||||
/**
|
||||
* Gets the client resource from the pool.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @return SOLRAPIClient
|
||||
*/
|
||||
private SOLRAPIClient getCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL)
|
||||
{
|
||||
String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
return clientsPerAlfresco.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a key to identify a unique alfresco instance to which the client will connect.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @return the key to get a client
|
||||
*/
|
||||
private String constructKey(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL)
|
||||
{
|
||||
return alfrescoHost + alfrescoPort + alfrescoPortSSL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the client in the resource pool.
|
||||
*
|
||||
* @param alfrescoHost String
|
||||
* @param alfrescoPort int
|
||||
* @param alfrescoPortSSL int
|
||||
* @param client SOLRAPIClient
|
||||
*/
|
||||
private void setCachedClient(String alfrescoHost, int alfrescoPort, int alfrescoPortSSL, SOLRAPIClient client)
|
||||
{
|
||||
String key = constructKey(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
clientsPerAlfresco.put(key, client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the SOLRAPIClient or gets it from a pool
|
||||
*
|
||||
* @param props solrcore.properties in the <coreName>/conf directory
|
||||
* @param keyResourceLoader reads encryption key resources
|
||||
* @param dictionaryService represents the Repository Data Dictionary
|
||||
* @param namespaceDAO allows retrieving and creating Namespace definitions
|
||||
* @return an instance of SOLRAPIClient
|
||||
*/
|
||||
public SOLRAPIClient getSOLRAPIClient(Properties props, KeyResourceLoader keyResourceLoader,
|
||||
DictionaryService dictionaryService, NamespaceDAO namespaceDAO)
|
||||
{
|
||||
alfrescoHost = props.getProperty("alfresco.host", "localhost");
|
||||
alfrescoPort = Integer.parseInt(props.getProperty("alfresco.port", "8080"));
|
||||
alfrescoPortSSL = Integer.parseInt(props.getProperty("alfresco.port.ssl", "8443"));
|
||||
|
||||
SOLRAPIClient client = getCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL);
|
||||
if (client == null)
|
||||
{
|
||||
baseUrl = props.getProperty("alfresco.baseUrl", "/alfresco");
|
||||
keyStoreType = props.getProperty("alfresco.encryption.keystore.type", "JCEKS");
|
||||
keyStoreProvider = props.getProperty("alfresco.encryption.keystore.provider");
|
||||
passwordFileLocation = props.getProperty("alfresco.encryption.keystore.passwordFileLocation");
|
||||
keyStoreLocation = props.getProperty("alfresco.encryption.keystore.location");
|
||||
sslKeyStoreType = props.getProperty("alfresco.encryption.ssl.keystore.type", "JCEKS");
|
||||
sslKeyStoreProvider = props.getProperty("alfresco.encryption.ssl.keystore.provider", "");
|
||||
sslKeyStoreLocation = props.getProperty("alfresco.encryption.ssl.keystore.location",
|
||||
"ssl.repo.client.keystore");
|
||||
sslKeyStorePasswordFileLocation = props.getProperty(
|
||||
"alfresco.encryption.ssl.keystore.passwordFileLocation", "ssl-keystore-passwords.properties");
|
||||
sslTrustStoreType = props.getProperty("alfresco.encryption.ssl.truststore.type", "JCEKS");
|
||||
sslTrustStoreProvider = props.getProperty("alfresco.encryption.ssl.truststore.provider", "");
|
||||
sslTrustStoreLocation = props.getProperty("alfresco.encryption.ssl.truststore.location",
|
||||
"ssl.repo.client.truststore");
|
||||
sslTrustStorePasswordFileLocation = props.getProperty(
|
||||
"alfresco.encryption.ssl.truststore.passwordFileLocation",
|
||||
"ssl-truststore-passwords.properties");
|
||||
secureCommsType = props.getProperty("alfresco.secureComms", "none");
|
||||
maxTotalConnections = Integer.parseInt(props.getProperty("alfresco.maxTotalConnections", "40"));
|
||||
maxHostConnections = Integer.parseInt(props.getProperty("alfresco.maxHostConnections", "40"));
|
||||
socketTimeout = Integer.parseInt(props.getProperty("alfresco.socketTimeout", "60000"));
|
||||
|
||||
client = new SOLRAPIClient(getRepoClient(keyResourceLoader), dictionaryService, namespaceDAO);
|
||||
setCachedClient(alfrescoHost, alfrescoPort, alfrescoPortSSL, client);
|
||||
}
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
protected AlfrescoHttpClient getRepoClient(KeyResourceLoader keyResourceLoader)
|
||||
{
|
||||
// TODO i18n
|
||||
KeyStoreParameters keyStoreParameters = new KeyStoreParameters("SSL Key Store", sslKeyStoreType,
|
||||
sslKeyStoreProvider, sslKeyStorePasswordFileLocation, sslKeyStoreLocation);
|
||||
KeyStoreParameters trustStoreParameters = new KeyStoreParameters("SSL Trust Store", sslTrustStoreType,
|
||||
sslTrustStoreProvider, sslTrustStorePasswordFileLocation, sslTrustStoreLocation);
|
||||
SSLEncryptionParameters sslEncryptionParameters = new SSLEncryptionParameters(keyStoreParameters,
|
||||
trustStoreParameters);
|
||||
|
||||
HttpClientFactory httpClientFactory = new HttpClientFactory(SecureCommsType.getType(secureCommsType),
|
||||
sslEncryptionParameters, keyResourceLoader, null, null, alfrescoHost, alfrescoPort,
|
||||
alfrescoPortSSL, maxTotalConnections, maxHostConnections, socketTimeout);
|
||||
// TODO need to make port configurable depending on secure comms, or just make redirects work
|
||||
AlfrescoHttpClient repoClient = httpClientFactory.getRepoClient(alfrescoHost, alfrescoPortSSL);
|
||||
repoClient.setBaseUrl(baseUrl);
|
||||
return repoClient;
|
||||
}
|
||||
}
|
||||
|
||||
+190
-190
@@ -1,190 +1,190 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Status code constants for SOLR.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class Status
|
||||
{
|
||||
/* Status code constants */
|
||||
public static final int STATUS_CONTINUE = HttpServletResponse.SC_CONTINUE;
|
||||
public static final int STATUS_SWITCHING_PROTOCOLS = HttpServletResponse.SC_SWITCHING_PROTOCOLS;
|
||||
public static final int STATUS_OK = HttpServletResponse.SC_OK;
|
||||
public static final int STATUS_CREATED = HttpServletResponse.SC_CREATED;
|
||||
public static final int STATUS_ACCEPTED = HttpServletResponse.SC_ACCEPTED;
|
||||
public static final int STATUS_NON_AUTHORITATIVE_INFORMATION = HttpServletResponse.SC_NON_AUTHORITATIVE_INFORMATION;
|
||||
public static final int STATUS_NO_CONTENT = HttpServletResponse.SC_NO_CONTENT;
|
||||
public static final int STATUS_RESET_CONTENT = HttpServletResponse.SC_RESET_CONTENT;
|
||||
public static final int STATUS_PARTIAL_CONTENT = HttpServletResponse.SC_PARTIAL_CONTENT;
|
||||
public static final int STATUS_MULTIPLE_CHOICES = HttpServletResponse.SC_MULTIPLE_CHOICES;
|
||||
public static final int STATUS_MOVED_PERMANENTLY = HttpServletResponse.SC_MOVED_PERMANENTLY;
|
||||
public static final int STATUS_MOVED_TEMPORARILY = HttpServletResponse.SC_MOVED_TEMPORARILY;
|
||||
public static final int STATUS_FOUND = HttpServletResponse.SC_FOUND;
|
||||
public static final int STATUS_SEE_OTHER = HttpServletResponse.SC_SEE_OTHER;
|
||||
public static final int STATUS_NOT_MODIFIED = HttpServletResponse.SC_NOT_MODIFIED;
|
||||
public static final int STATUS_USE_PROXY = HttpServletResponse.SC_USE_PROXY;
|
||||
public static final int STATUS_TEMPORARY_REDIRECT = HttpServletResponse.SC_TEMPORARY_REDIRECT;
|
||||
public static final int STATUS_BAD_REQUEST = HttpServletResponse.SC_BAD_REQUEST;
|
||||
public static final int STATUS_UNAUTHORIZED = HttpServletResponse.SC_UNAUTHORIZED;
|
||||
public static final int STATUS_PAYMENT_REQUIRED = HttpServletResponse.SC_PAYMENT_REQUIRED;
|
||||
public static final int STATUS_FORBIDDEN = HttpServletResponse.SC_FORBIDDEN;
|
||||
public static final int STATUS_NOT_FOUND = HttpServletResponse.SC_NOT_FOUND;
|
||||
public static final int STATUS_METHOD_NOT_ALLOWED = HttpServletResponse.SC_METHOD_NOT_ALLOWED;
|
||||
public static final int STATUS_NOT_ACCEPTABLE = HttpServletResponse.SC_NOT_ACCEPTABLE;
|
||||
public static final int STATUS_PROXY_AUTHENTICATION_REQUIRED = HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED;
|
||||
public static final int STATUS_REQUEST_TIMEOUT = HttpServletResponse.SC_REQUEST_TIMEOUT;
|
||||
public static final int STATUS_CONFLICT = HttpServletResponse.SC_CONFLICT;
|
||||
public static final int STATUS_GONE = HttpServletResponse.SC_GONE;
|
||||
public static final int STATUS_LENGTH_REQUIRED = HttpServletResponse.SC_LENGTH_REQUIRED;
|
||||
public static final int STATUS_PRECONDITION_FAILED = HttpServletResponse.SC_PRECONDITION_FAILED;
|
||||
public static final int STATUS_REQUEST_ENTITY_TOO_LARGE = HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE;
|
||||
public static final int STATUS_REQUEST_URI_TOO_LONG = HttpServletResponse.SC_REQUEST_URI_TOO_LONG;
|
||||
public static final int STATUS_UNSUPPORTED_MEDIA_TYPE = HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE;
|
||||
public static final int STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE;
|
||||
public static final int STATUS_EXPECTATION_FAILED = HttpServletResponse.SC_EXPECTATION_FAILED;
|
||||
public static final int STATUS_INTERNAL_SERVER_ERROR = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
|
||||
public static final int STATUS_NOT_IMPLEMENTED = HttpServletResponse.SC_NOT_IMPLEMENTED;
|
||||
public static final int STATUS_BAD_GATEWAY = HttpServletResponse.SC_BAD_GATEWAY;
|
||||
public static final int STATUS_SERVICE_UNAVAILABLE = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
|
||||
public static final int STATUS_GATEWAY_TIMEOUT = HttpServletResponse.SC_GATEWAY_TIMEOUT;
|
||||
public static final int STATUS_HTTP_VERSION_NOT_SUPPORTED = HttpServletResponse.SC_HTTP_VERSION_NOT_SUPPORTED;
|
||||
|
||||
|
||||
private Throwable exception = null;
|
||||
private String location = "";
|
||||
private int code = HttpServletResponse.SC_OK;
|
||||
private String message = "";
|
||||
private boolean redirect = false;
|
||||
|
||||
/**
|
||||
* Helper method to set the code and message.
|
||||
* <p>
|
||||
* Redirect is set to true.
|
||||
*
|
||||
* @param code code
|
||||
* @param message message
|
||||
*/
|
||||
public void setCode(int code, String message)
|
||||
{
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.redirect = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exception Throwable
|
||||
*/
|
||||
public void setException(Throwable exception)
|
||||
{
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return exception
|
||||
*/
|
||||
public Throwable getException()
|
||||
{
|
||||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message String
|
||||
*/
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return message
|
||||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param redirect redirect to status code response
|
||||
*/
|
||||
public void setRedirect(boolean redirect)
|
||||
{
|
||||
this.redirect = redirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return redirect to status code response
|
||||
*/
|
||||
public boolean getRedirect()
|
||||
{
|
||||
return redirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HTTPServletResponse
|
||||
*
|
||||
* @param code status code
|
||||
*/
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return status code
|
||||
*/
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the short name of the status code
|
||||
*
|
||||
* @return status code name
|
||||
*/
|
||||
public String getCodeName()
|
||||
{
|
||||
String codeName = I18NUtil.getMessage("webscript.code." + code + ".name");
|
||||
return codeName == null ? "" : codeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HTTPServletResponse
|
||||
*
|
||||
* @param location location response-header
|
||||
*/
|
||||
public void setLocation(String location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return location
|
||||
*/
|
||||
public String getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description of the status code
|
||||
*
|
||||
* @return status code description
|
||||
*/
|
||||
public String getCodeDescription()
|
||||
{
|
||||
String codeDescription = I18NUtil.getMessage("webscript.code." + code + ".description");
|
||||
return codeDescription == null ? "" : codeDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return Integer.toString(code);
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.extensions.surf.util.I18NUtil;
|
||||
|
||||
/**
|
||||
* Status code constants for SOLR.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class Status
|
||||
{
|
||||
/* Status code constants */
|
||||
public static final int STATUS_CONTINUE = HttpServletResponse.SC_CONTINUE;
|
||||
public static final int STATUS_SWITCHING_PROTOCOLS = HttpServletResponse.SC_SWITCHING_PROTOCOLS;
|
||||
public static final int STATUS_OK = HttpServletResponse.SC_OK;
|
||||
public static final int STATUS_CREATED = HttpServletResponse.SC_CREATED;
|
||||
public static final int STATUS_ACCEPTED = HttpServletResponse.SC_ACCEPTED;
|
||||
public static final int STATUS_NON_AUTHORITATIVE_INFORMATION = HttpServletResponse.SC_NON_AUTHORITATIVE_INFORMATION;
|
||||
public static final int STATUS_NO_CONTENT = HttpServletResponse.SC_NO_CONTENT;
|
||||
public static final int STATUS_RESET_CONTENT = HttpServletResponse.SC_RESET_CONTENT;
|
||||
public static final int STATUS_PARTIAL_CONTENT = HttpServletResponse.SC_PARTIAL_CONTENT;
|
||||
public static final int STATUS_MULTIPLE_CHOICES = HttpServletResponse.SC_MULTIPLE_CHOICES;
|
||||
public static final int STATUS_MOVED_PERMANENTLY = HttpServletResponse.SC_MOVED_PERMANENTLY;
|
||||
public static final int STATUS_MOVED_TEMPORARILY = HttpServletResponse.SC_MOVED_TEMPORARILY;
|
||||
public static final int STATUS_FOUND = HttpServletResponse.SC_FOUND;
|
||||
public static final int STATUS_SEE_OTHER = HttpServletResponse.SC_SEE_OTHER;
|
||||
public static final int STATUS_NOT_MODIFIED = HttpServletResponse.SC_NOT_MODIFIED;
|
||||
public static final int STATUS_USE_PROXY = HttpServletResponse.SC_USE_PROXY;
|
||||
public static final int STATUS_TEMPORARY_REDIRECT = HttpServletResponse.SC_TEMPORARY_REDIRECT;
|
||||
public static final int STATUS_BAD_REQUEST = HttpServletResponse.SC_BAD_REQUEST;
|
||||
public static final int STATUS_UNAUTHORIZED = HttpServletResponse.SC_UNAUTHORIZED;
|
||||
public static final int STATUS_PAYMENT_REQUIRED = HttpServletResponse.SC_PAYMENT_REQUIRED;
|
||||
public static final int STATUS_FORBIDDEN = HttpServletResponse.SC_FORBIDDEN;
|
||||
public static final int STATUS_NOT_FOUND = HttpServletResponse.SC_NOT_FOUND;
|
||||
public static final int STATUS_METHOD_NOT_ALLOWED = HttpServletResponse.SC_METHOD_NOT_ALLOWED;
|
||||
public static final int STATUS_NOT_ACCEPTABLE = HttpServletResponse.SC_NOT_ACCEPTABLE;
|
||||
public static final int STATUS_PROXY_AUTHENTICATION_REQUIRED = HttpServletResponse.SC_PROXY_AUTHENTICATION_REQUIRED;
|
||||
public static final int STATUS_REQUEST_TIMEOUT = HttpServletResponse.SC_REQUEST_TIMEOUT;
|
||||
public static final int STATUS_CONFLICT = HttpServletResponse.SC_CONFLICT;
|
||||
public static final int STATUS_GONE = HttpServletResponse.SC_GONE;
|
||||
public static final int STATUS_LENGTH_REQUIRED = HttpServletResponse.SC_LENGTH_REQUIRED;
|
||||
public static final int STATUS_PRECONDITION_FAILED = HttpServletResponse.SC_PRECONDITION_FAILED;
|
||||
public static final int STATUS_REQUEST_ENTITY_TOO_LARGE = HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE;
|
||||
public static final int STATUS_REQUEST_URI_TOO_LONG = HttpServletResponse.SC_REQUEST_URI_TOO_LONG;
|
||||
public static final int STATUS_UNSUPPORTED_MEDIA_TYPE = HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE;
|
||||
public static final int STATUS_REQUESTED_RANGE_NOT_SATISFIABLE = HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE;
|
||||
public static final int STATUS_EXPECTATION_FAILED = HttpServletResponse.SC_EXPECTATION_FAILED;
|
||||
public static final int STATUS_INTERNAL_SERVER_ERROR = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
|
||||
public static final int STATUS_NOT_IMPLEMENTED = HttpServletResponse.SC_NOT_IMPLEMENTED;
|
||||
public static final int STATUS_BAD_GATEWAY = HttpServletResponse.SC_BAD_GATEWAY;
|
||||
public static final int STATUS_SERVICE_UNAVAILABLE = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
|
||||
public static final int STATUS_GATEWAY_TIMEOUT = HttpServletResponse.SC_GATEWAY_TIMEOUT;
|
||||
public static final int STATUS_HTTP_VERSION_NOT_SUPPORTED = HttpServletResponse.SC_HTTP_VERSION_NOT_SUPPORTED;
|
||||
|
||||
|
||||
private Throwable exception = null;
|
||||
private String location = "";
|
||||
private int code = HttpServletResponse.SC_OK;
|
||||
private String message = "";
|
||||
private boolean redirect = false;
|
||||
|
||||
/**
|
||||
* Helper method to set the code and message.
|
||||
* <p>
|
||||
* Redirect is set to true.
|
||||
*
|
||||
* @param code code
|
||||
* @param message message
|
||||
*/
|
||||
public void setCode(int code, String message)
|
||||
{
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
this.redirect = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param exception Throwable
|
||||
*/
|
||||
public void setException(Throwable exception)
|
||||
{
|
||||
this.exception = exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return exception
|
||||
*/
|
||||
public Throwable getException()
|
||||
{
|
||||
return exception;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message String
|
||||
*/
|
||||
public void setMessage(String message)
|
||||
{
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return message
|
||||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param redirect redirect to status code response
|
||||
*/
|
||||
public void setRedirect(boolean redirect)
|
||||
{
|
||||
this.redirect = redirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return redirect to status code response
|
||||
*/
|
||||
public boolean getRedirect()
|
||||
{
|
||||
return redirect;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HTTPServletResponse
|
||||
*
|
||||
* @param code status code
|
||||
*/
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return status code
|
||||
*/
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the short name of the status code
|
||||
*
|
||||
* @return status code name
|
||||
*/
|
||||
public String getCodeName()
|
||||
{
|
||||
String codeName = I18NUtil.getMessage("webscript.code." + code + ".name");
|
||||
return codeName == null ? "" : codeName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see javax.servlet.http.HTTPServletResponse
|
||||
*
|
||||
* @param location location response-header
|
||||
*/
|
||||
public void setLocation(String location)
|
||||
{
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return location
|
||||
*/
|
||||
public String getLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description of the status code
|
||||
*
|
||||
* @return status code description
|
||||
*/
|
||||
public String getCodeDescription()
|
||||
{
|
||||
String codeDescription = I18NUtil.getMessage("webscript.code." + code + ".description");
|
||||
return codeDescription == null ? "" : codeDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return Integer.toString(code);
|
||||
}
|
||||
}
|
||||
|
||||
+28
-28
@@ -1,28 +1,28 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* Represents a property value as a string
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class StringPropertyValue extends PropertyValue
|
||||
{
|
||||
private String value;
|
||||
|
||||
public StringPropertyValue(String value)
|
||||
{
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "StringPropertyValue [value=" + value + "]";
|
||||
}
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* Represents a property value as a string
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class StringPropertyValue extends PropertyValue
|
||||
{
|
||||
private String value;
|
||||
|
||||
public StringPropertyValue(String value)
|
||||
{
|
||||
super();
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "StringPropertyValue [value=" + value + "]";
|
||||
}
|
||||
}
|
||||
|
||||
+86
-86
@@ -1,86 +1,86 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* SOLR-side representation of transaction information.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class Transaction
|
||||
{
|
||||
private long id;
|
||||
private long commitTimeMs;
|
||||
private long updates;
|
||||
private long deletes;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public long getCommitTimeMs()
|
||||
{
|
||||
return commitTimeMs;
|
||||
}
|
||||
public void setCommitTimeMs(long commitTimeMs)
|
||||
{
|
||||
this.commitTimeMs = commitTimeMs;
|
||||
}
|
||||
public long getUpdates()
|
||||
{
|
||||
return updates;
|
||||
}
|
||||
public void setUpdates(long updates)
|
||||
{
|
||||
this.updates = updates;
|
||||
}
|
||||
public long getDeletes()
|
||||
{
|
||||
return deletes;
|
||||
}
|
||||
public void setDeletes(long deletes)
|
||||
{
|
||||
this.deletes = deletes;
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Transaction [id=" + id + ", commitTimeMs=" + commitTimeMs + ", updates=" + updates + ", deletes="
|
||||
+ deletes + "]";
|
||||
}
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (commitTimeMs ^ (commitTimeMs >>> 32));
|
||||
result = prime * result + (int) (deletes ^ (deletes >>> 32));
|
||||
result = prime * result + (int) (id ^ (id >>> 32));
|
||||
result = prime * result + (int) (updates ^ (updates >>> 32));
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Transaction other = (Transaction) obj;
|
||||
if (commitTimeMs != other.commitTimeMs)
|
||||
return false;
|
||||
if (deletes != other.deletes)
|
||||
return false;
|
||||
if (id != other.id)
|
||||
return false;
|
||||
if (updates != other.updates)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
/**
|
||||
* SOLR-side representation of transaction information.
|
||||
*
|
||||
* @since 4.0
|
||||
*/
|
||||
public class Transaction
|
||||
{
|
||||
private long id;
|
||||
private long commitTimeMs;
|
||||
private long updates;
|
||||
private long deletes;
|
||||
|
||||
public long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setId(long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
public long getCommitTimeMs()
|
||||
{
|
||||
return commitTimeMs;
|
||||
}
|
||||
public void setCommitTimeMs(long commitTimeMs)
|
||||
{
|
||||
this.commitTimeMs = commitTimeMs;
|
||||
}
|
||||
public long getUpdates()
|
||||
{
|
||||
return updates;
|
||||
}
|
||||
public void setUpdates(long updates)
|
||||
{
|
||||
this.updates = updates;
|
||||
}
|
||||
public long getDeletes()
|
||||
{
|
||||
return deletes;
|
||||
}
|
||||
public void setDeletes(long deletes)
|
||||
{
|
||||
this.deletes = deletes;
|
||||
}
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "Transaction [id=" + id + ", commitTimeMs=" + commitTimeMs + ", updates=" + updates + ", deletes="
|
||||
+ deletes + "]";
|
||||
}
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + (int) (commitTimeMs ^ (commitTimeMs >>> 32));
|
||||
result = prime * result + (int) (deletes ^ (deletes >>> 32));
|
||||
result = prime * result + (int) (id ^ (id >>> 32));
|
||||
result = prime * result + (int) (updates ^ (updates >>> 32));
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Transaction other = (Transaction) obj;
|
||||
if (commitTimeMs != other.commitTimeMs)
|
||||
return false;
|
||||
if (deletes != other.deletes)
|
||||
return false;
|
||||
if (id != other.id)
|
||||
return false;
|
||||
if (updates != other.updates)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+39
-39
@@ -1,39 +1,39 @@
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class Transactions
|
||||
{
|
||||
private List<Transaction> transactions;
|
||||
|
||||
private Long maxTxnCommitTime;
|
||||
|
||||
private Long maxTxnId;
|
||||
|
||||
Transactions(List<Transaction> transactions, Long maxTxnCommitTime, Long maxTxnId)
|
||||
{
|
||||
this.transactions = transactions;
|
||||
this.maxTxnCommitTime = maxTxnCommitTime;
|
||||
this.maxTxnId = maxTxnId;
|
||||
}
|
||||
|
||||
public List<Transaction> getTransactions()
|
||||
{
|
||||
return transactions;
|
||||
}
|
||||
|
||||
public Long getMaxTxnCommitTime()
|
||||
{
|
||||
return maxTxnCommitTime;
|
||||
}
|
||||
|
||||
public Long getMaxTxnId()
|
||||
{
|
||||
return maxTxnId;
|
||||
}
|
||||
|
||||
}
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Andy
|
||||
*
|
||||
*/
|
||||
public class Transactions
|
||||
{
|
||||
private List<Transaction> transactions;
|
||||
|
||||
private Long maxTxnCommitTime;
|
||||
|
||||
private Long maxTxnId;
|
||||
|
||||
Transactions(List<Transaction> transactions, Long maxTxnCommitTime, Long maxTxnId)
|
||||
{
|
||||
this.transactions = transactions;
|
||||
this.maxTxnCommitTime = maxTxnCommitTime;
|
||||
this.maxTxnId = maxTxnId;
|
||||
}
|
||||
|
||||
public List<Transaction> getTransactions()
|
||||
{
|
||||
return transactions;
|
||||
}
|
||||
|
||||
public Long getMaxTxnCommitTime()
|
||||
{
|
||||
return maxTxnCommitTime;
|
||||
}
|
||||
|
||||
public Long getMaxTxnId()
|
||||
{
|
||||
return maxTxnId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+408
-408
@@ -1,409 +1,409 @@
|
||||
package org.alfresco.solr.tracker;
|
||||
|
||||
import org.alfresco.solr.InformationServerCollectionProvider;
|
||||
import org.alfresco.solr.adapters.IOpenBitSet;
|
||||
|
||||
|
||||
public class IndexHealthReport
|
||||
{
|
||||
long dbTransactionCount;
|
||||
|
||||
IOpenBitSet missingTxFromIndex;
|
||||
|
||||
IOpenBitSet duplicatedTxInIndex;
|
||||
|
||||
IOpenBitSet txInIndexButNotInDb;
|
||||
|
||||
IOpenBitSet duplicatedLeafInIndex;
|
||||
|
||||
IOpenBitSet duplicatedAuxInIndex;
|
||||
|
||||
long transactionDocsInIndex;
|
||||
|
||||
long uniqueTransactionDocsInIndex;
|
||||
|
||||
long uniqueAclTransactionDocsInIndex;
|
||||
|
||||
long aclTransactionDocsInIndex;
|
||||
|
||||
long leafDocCountInIndex;
|
||||
|
||||
long auxDocCountInIndex;
|
||||
|
||||
long lastIndexedCommitTime;
|
||||
|
||||
long lastIndexedIdBeforeHoles;
|
||||
|
||||
long dbAclTransactionCount;
|
||||
|
||||
IOpenBitSet missingAclTxFromIndex;
|
||||
|
||||
IOpenBitSet duplicatedAclTxInIndex;
|
||||
|
||||
IOpenBitSet aclTxInIndexButNotInDb;
|
||||
|
||||
IOpenBitSet duplicatedErrorInIndex;
|
||||
|
||||
IOpenBitSet duplicatedUnindexedInIndex;
|
||||
|
||||
long errorDocCountInIndex;
|
||||
|
||||
long unindexedDocCountInIndex;
|
||||
|
||||
public IndexHealthReport(InformationServerCollectionProvider srv)
|
||||
{
|
||||
this.missingTxFromIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedTxInIndex = srv.getOpenBitSetInstance();
|
||||
this.txInIndexButNotInDb = srv.getOpenBitSetInstance();
|
||||
this.duplicatedLeafInIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedAuxInIndex = srv.getOpenBitSetInstance();
|
||||
|
||||
this.missingAclTxFromIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedAclTxInIndex = srv.getOpenBitSetInstance();
|
||||
this.aclTxInIndexButNotInDb = srv.getOpenBitSetInstance();
|
||||
this.duplicatedErrorInIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedUnindexedInIndex = srv.getOpenBitSetInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the transactionDocsInIndex
|
||||
*/
|
||||
public long getTransactionDocsInIndex()
|
||||
{
|
||||
return transactionDocsInIndex;
|
||||
}
|
||||
|
||||
public long getAclTransactionDocsInIndex()
|
||||
{
|
||||
return aclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param leafDocCountInIndex long
|
||||
*/
|
||||
public void setLeafDocCountInIndex(long leafDocCountInIndex)
|
||||
{
|
||||
this.leafDocCountInIndex = leafDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the leafDocCountInIndex
|
||||
*/
|
||||
public long getLeafDocCountInIndex()
|
||||
{
|
||||
return leafDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param auxDocCountInIndex long
|
||||
*/
|
||||
public void setAuxDocCountInIndex(long auxDocCountInIndex)
|
||||
{
|
||||
this.auxDocCountInIndex = auxDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the leafDocCountInIndex
|
||||
*/
|
||||
public long getAuxDocCountInIndex()
|
||||
{
|
||||
return auxDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param txid long
|
||||
*/
|
||||
public void setDuplicatedLeafInIndex(long txid)
|
||||
{
|
||||
duplicatedLeafInIndex.set(txid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedLeafInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedLeafInIndex()
|
||||
{
|
||||
return duplicatedLeafInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param txid long
|
||||
*/
|
||||
public void setDuplicatedAuxInIndex(long txid)
|
||||
{
|
||||
duplicatedAuxInIndex.set(txid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedLeafInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedAuxInIndex()
|
||||
{
|
||||
return duplicatedAuxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param transactionDocsInIndex
|
||||
* the transactionDocsInIndex to set
|
||||
*/
|
||||
public void setTransactionDocsInIndex(long transactionDocsInIndex)
|
||||
{
|
||||
this.transactionDocsInIndex = transactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param aclTransactionDocsInIndex
|
||||
* the transactionDocsInIndex to set
|
||||
*/
|
||||
public void setAclTransactionDocsInIndex(long aclTransactionDocsInIndex)
|
||||
{
|
||||
this.aclTransactionDocsInIndex = aclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the missingFromIndex
|
||||
*/
|
||||
public IOpenBitSet getMissingTxFromIndex()
|
||||
{
|
||||
return missingTxFromIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the missingFromIndex
|
||||
*/
|
||||
public IOpenBitSet getMissingAclTxFromIndex()
|
||||
{
|
||||
return missingAclTxFromIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedTxInIndex()
|
||||
{
|
||||
return duplicatedTxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedAclTxInIndex()
|
||||
{
|
||||
return duplicatedAclTxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the inIndexButNotInDb
|
||||
*/
|
||||
public IOpenBitSet getTxInIndexButNotInDb()
|
||||
{
|
||||
return txInIndexButNotInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the inIndexButNotInDb
|
||||
*/
|
||||
public IOpenBitSet getAclTxInIndexButNotInDb()
|
||||
{
|
||||
return aclTxInIndexButNotInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbTransactionCount
|
||||
*/
|
||||
public long getDbTransactionCount()
|
||||
{
|
||||
return dbTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbTransactionCount
|
||||
* the dbTransactionCount to set
|
||||
*/
|
||||
public void setDbTransactionCount(long dbTransactionCount)
|
||||
{
|
||||
this.dbTransactionCount = dbTransactionCount;
|
||||
}
|
||||
|
||||
public void setMissingTxFromIndex(long txid)
|
||||
{
|
||||
missingTxFromIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setMissingAclTxFromIndex(long txid)
|
||||
{
|
||||
missingAclTxFromIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setDuplicatedTxInIndex(long txid)
|
||||
{
|
||||
duplicatedTxInIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setDuplicatedAclTxInIndex(long txid)
|
||||
{
|
||||
duplicatedAclTxInIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setTxInIndexButNotInDb(long txid)
|
||||
{
|
||||
txInIndexButNotInDb.set(txid);
|
||||
}
|
||||
|
||||
public void setAclTxInIndexButNotInDb(long txid)
|
||||
{
|
||||
aclTxInIndexButNotInDb.set(txid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastIndexedCommitTime
|
||||
* the lastIndexCommitTime to set
|
||||
*/
|
||||
public void setLastIndexedCommitTime(long lastIndexedCommitTime)
|
||||
{
|
||||
this.lastIndexedCommitTime = lastIndexedCommitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastIndexedIdBeforeHoles
|
||||
*/
|
||||
public long getLastIndexedIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedIdBeforeHoles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastIndexedIdBeforeHoles
|
||||
* the lastIndexedIdBeforeHoles to set
|
||||
*/
|
||||
public void setLastIndexedIdBeforeHoles(long lastIndexedIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedIdBeforeHoles = lastIndexedIdBeforeHoles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbAclTransactionCount long
|
||||
*/
|
||||
public void setDbAclTransactionCount(long dbAclTransactionCount)
|
||||
{
|
||||
this.dbAclTransactionCount = dbAclTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbAclTransactionCount
|
||||
*/
|
||||
public long getDbAclTransactionCount()
|
||||
{
|
||||
return dbAclTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uniqueTransactionDocsInIndex
|
||||
*/
|
||||
public long getUniqueTransactionDocsInIndex()
|
||||
{
|
||||
return uniqueTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uniqueTransactionDocsInIndex the uniqueTransactionDocsInIndex to set
|
||||
*/
|
||||
public void setUniqueTransactionDocsInIndex(long uniqueTransactionDocsInIndex)
|
||||
{
|
||||
this.uniqueTransactionDocsInIndex = uniqueTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uniqueAclTransactionDocsInIndex
|
||||
*/
|
||||
public long getUniqueAclTransactionDocsInIndex()
|
||||
{
|
||||
return uniqueAclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uniqueAclTransactionDocsInIndex the uniqueAclTransactionDocsInIndex to set
|
||||
*/
|
||||
public void setUniqueAclTransactionDocsInIndex(long uniqueAclTransactionDocsInIndex)
|
||||
{
|
||||
this.uniqueAclTransactionDocsInIndex = uniqueAclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastIndexedCommitTime
|
||||
*/
|
||||
public long getLastIndexedCommitTime()
|
||||
{
|
||||
return lastIndexedCommitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unindexedDocCountInIndex long
|
||||
*/
|
||||
public void setUnindexedDocCountInIndex(long unindexedDocCountInIndex)
|
||||
{
|
||||
this.unindexedDocCountInIndex = unindexedDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbId long
|
||||
*/
|
||||
public void setDuplicatedUnindexedInIndex(long dbId)
|
||||
{
|
||||
duplicatedUnindexedInIndex.set(dbId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param errorDocCountInIndex long
|
||||
*/
|
||||
public void setErrorDocCountInIndex(long errorDocCountInIndex)
|
||||
{
|
||||
this.errorDocCountInIndex = errorDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbId long
|
||||
*/
|
||||
public void setDuplicatedErrorInIndex(long dbId)
|
||||
{
|
||||
duplicatedErrorInIndex.set(dbId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedErrorInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedErrorInIndex()
|
||||
{
|
||||
return duplicatedErrorInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedUnindexedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedUnindexedInIndex()
|
||||
{
|
||||
return duplicatedUnindexedInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the errorDocCountInIndex
|
||||
*/
|
||||
public long getErrorDocCountInIndex()
|
||||
{
|
||||
return errorDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unindexedDocCountInIndex
|
||||
*/
|
||||
public long getUnindexedDocCountInIndex()
|
||||
{
|
||||
return unindexedDocCountInIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
package org.alfresco.solr.tracker;
|
||||
|
||||
import org.alfresco.solr.InformationServerCollectionProvider;
|
||||
import org.alfresco.solr.adapters.IOpenBitSet;
|
||||
|
||||
|
||||
public class IndexHealthReport
|
||||
{
|
||||
long dbTransactionCount;
|
||||
|
||||
IOpenBitSet missingTxFromIndex;
|
||||
|
||||
IOpenBitSet duplicatedTxInIndex;
|
||||
|
||||
IOpenBitSet txInIndexButNotInDb;
|
||||
|
||||
IOpenBitSet duplicatedLeafInIndex;
|
||||
|
||||
IOpenBitSet duplicatedAuxInIndex;
|
||||
|
||||
long transactionDocsInIndex;
|
||||
|
||||
long uniqueTransactionDocsInIndex;
|
||||
|
||||
long uniqueAclTransactionDocsInIndex;
|
||||
|
||||
long aclTransactionDocsInIndex;
|
||||
|
||||
long leafDocCountInIndex;
|
||||
|
||||
long auxDocCountInIndex;
|
||||
|
||||
long lastIndexedCommitTime;
|
||||
|
||||
long lastIndexedIdBeforeHoles;
|
||||
|
||||
long dbAclTransactionCount;
|
||||
|
||||
IOpenBitSet missingAclTxFromIndex;
|
||||
|
||||
IOpenBitSet duplicatedAclTxInIndex;
|
||||
|
||||
IOpenBitSet aclTxInIndexButNotInDb;
|
||||
|
||||
IOpenBitSet duplicatedErrorInIndex;
|
||||
|
||||
IOpenBitSet duplicatedUnindexedInIndex;
|
||||
|
||||
long errorDocCountInIndex;
|
||||
|
||||
long unindexedDocCountInIndex;
|
||||
|
||||
public IndexHealthReport(InformationServerCollectionProvider srv)
|
||||
{
|
||||
this.missingTxFromIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedTxInIndex = srv.getOpenBitSetInstance();
|
||||
this.txInIndexButNotInDb = srv.getOpenBitSetInstance();
|
||||
this.duplicatedLeafInIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedAuxInIndex = srv.getOpenBitSetInstance();
|
||||
|
||||
this.missingAclTxFromIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedAclTxInIndex = srv.getOpenBitSetInstance();
|
||||
this.aclTxInIndexButNotInDb = srv.getOpenBitSetInstance();
|
||||
this.duplicatedErrorInIndex = srv.getOpenBitSetInstance();
|
||||
this.duplicatedUnindexedInIndex = srv.getOpenBitSetInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the transactionDocsInIndex
|
||||
*/
|
||||
public long getTransactionDocsInIndex()
|
||||
{
|
||||
return transactionDocsInIndex;
|
||||
}
|
||||
|
||||
public long getAclTransactionDocsInIndex()
|
||||
{
|
||||
return aclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param leafDocCountInIndex long
|
||||
*/
|
||||
public void setLeafDocCountInIndex(long leafDocCountInIndex)
|
||||
{
|
||||
this.leafDocCountInIndex = leafDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the leafDocCountInIndex
|
||||
*/
|
||||
public long getLeafDocCountInIndex()
|
||||
{
|
||||
return leafDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param auxDocCountInIndex long
|
||||
*/
|
||||
public void setAuxDocCountInIndex(long auxDocCountInIndex)
|
||||
{
|
||||
this.auxDocCountInIndex = auxDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the leafDocCountInIndex
|
||||
*/
|
||||
public long getAuxDocCountInIndex()
|
||||
{
|
||||
return auxDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param txid long
|
||||
*/
|
||||
public void setDuplicatedLeafInIndex(long txid)
|
||||
{
|
||||
duplicatedLeafInIndex.set(txid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedLeafInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedLeafInIndex()
|
||||
{
|
||||
return duplicatedLeafInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param txid long
|
||||
*/
|
||||
public void setDuplicatedAuxInIndex(long txid)
|
||||
{
|
||||
duplicatedAuxInIndex.set(txid);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedLeafInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedAuxInIndex()
|
||||
{
|
||||
return duplicatedAuxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param transactionDocsInIndex
|
||||
* the transactionDocsInIndex to set
|
||||
*/
|
||||
public void setTransactionDocsInIndex(long transactionDocsInIndex)
|
||||
{
|
||||
this.transactionDocsInIndex = transactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param aclTransactionDocsInIndex
|
||||
* the transactionDocsInIndex to set
|
||||
*/
|
||||
public void setAclTransactionDocsInIndex(long aclTransactionDocsInIndex)
|
||||
{
|
||||
this.aclTransactionDocsInIndex = aclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the missingFromIndex
|
||||
*/
|
||||
public IOpenBitSet getMissingTxFromIndex()
|
||||
{
|
||||
return missingTxFromIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the missingFromIndex
|
||||
*/
|
||||
public IOpenBitSet getMissingAclTxFromIndex()
|
||||
{
|
||||
return missingAclTxFromIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedTxInIndex()
|
||||
{
|
||||
return duplicatedTxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedAclTxInIndex()
|
||||
{
|
||||
return duplicatedAclTxInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the inIndexButNotInDb
|
||||
*/
|
||||
public IOpenBitSet getTxInIndexButNotInDb()
|
||||
{
|
||||
return txInIndexButNotInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the inIndexButNotInDb
|
||||
*/
|
||||
public IOpenBitSet getAclTxInIndexButNotInDb()
|
||||
{
|
||||
return aclTxInIndexButNotInDb;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbTransactionCount
|
||||
*/
|
||||
public long getDbTransactionCount()
|
||||
{
|
||||
return dbTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbTransactionCount
|
||||
* the dbTransactionCount to set
|
||||
*/
|
||||
public void setDbTransactionCount(long dbTransactionCount)
|
||||
{
|
||||
this.dbTransactionCount = dbTransactionCount;
|
||||
}
|
||||
|
||||
public void setMissingTxFromIndex(long txid)
|
||||
{
|
||||
missingTxFromIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setMissingAclTxFromIndex(long txid)
|
||||
{
|
||||
missingAclTxFromIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setDuplicatedTxInIndex(long txid)
|
||||
{
|
||||
duplicatedTxInIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setDuplicatedAclTxInIndex(long txid)
|
||||
{
|
||||
duplicatedAclTxInIndex.set(txid);
|
||||
}
|
||||
|
||||
public void setTxInIndexButNotInDb(long txid)
|
||||
{
|
||||
txInIndexButNotInDb.set(txid);
|
||||
}
|
||||
|
||||
public void setAclTxInIndexButNotInDb(long txid)
|
||||
{
|
||||
aclTxInIndexButNotInDb.set(txid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastIndexedCommitTime
|
||||
* the lastIndexCommitTime to set
|
||||
*/
|
||||
public void setLastIndexedCommitTime(long lastIndexedCommitTime)
|
||||
{
|
||||
this.lastIndexedCommitTime = lastIndexedCommitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastIndexedIdBeforeHoles
|
||||
*/
|
||||
public long getLastIndexedIdBeforeHoles()
|
||||
{
|
||||
return lastIndexedIdBeforeHoles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lastIndexedIdBeforeHoles
|
||||
* the lastIndexedIdBeforeHoles to set
|
||||
*/
|
||||
public void setLastIndexedIdBeforeHoles(long lastIndexedIdBeforeHoles)
|
||||
{
|
||||
this.lastIndexedIdBeforeHoles = lastIndexedIdBeforeHoles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbAclTransactionCount long
|
||||
*/
|
||||
public void setDbAclTransactionCount(long dbAclTransactionCount)
|
||||
{
|
||||
this.dbAclTransactionCount = dbAclTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dbAclTransactionCount
|
||||
*/
|
||||
public long getDbAclTransactionCount()
|
||||
{
|
||||
return dbAclTransactionCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uniqueTransactionDocsInIndex
|
||||
*/
|
||||
public long getUniqueTransactionDocsInIndex()
|
||||
{
|
||||
return uniqueTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uniqueTransactionDocsInIndex the uniqueTransactionDocsInIndex to set
|
||||
*/
|
||||
public void setUniqueTransactionDocsInIndex(long uniqueTransactionDocsInIndex)
|
||||
{
|
||||
this.uniqueTransactionDocsInIndex = uniqueTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the uniqueAclTransactionDocsInIndex
|
||||
*/
|
||||
public long getUniqueAclTransactionDocsInIndex()
|
||||
{
|
||||
return uniqueAclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uniqueAclTransactionDocsInIndex the uniqueAclTransactionDocsInIndex to set
|
||||
*/
|
||||
public void setUniqueAclTransactionDocsInIndex(long uniqueAclTransactionDocsInIndex)
|
||||
{
|
||||
this.uniqueAclTransactionDocsInIndex = uniqueAclTransactionDocsInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the lastIndexedCommitTime
|
||||
*/
|
||||
public long getLastIndexedCommitTime()
|
||||
{
|
||||
return lastIndexedCommitTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param unindexedDocCountInIndex long
|
||||
*/
|
||||
public void setUnindexedDocCountInIndex(long unindexedDocCountInIndex)
|
||||
{
|
||||
this.unindexedDocCountInIndex = unindexedDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbId long
|
||||
*/
|
||||
public void setDuplicatedUnindexedInIndex(long dbId)
|
||||
{
|
||||
duplicatedUnindexedInIndex.set(dbId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param errorDocCountInIndex long
|
||||
*/
|
||||
public void setErrorDocCountInIndex(long errorDocCountInIndex)
|
||||
{
|
||||
this.errorDocCountInIndex = errorDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param dbId long
|
||||
*/
|
||||
public void setDuplicatedErrorInIndex(long dbId)
|
||||
{
|
||||
duplicatedErrorInIndex.set(dbId);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedErrorInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedErrorInIndex()
|
||||
{
|
||||
return duplicatedErrorInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the duplicatedUnindexedInIndex
|
||||
*/
|
||||
public IOpenBitSet getDuplicatedUnindexedInIndex()
|
||||
{
|
||||
return duplicatedUnindexedInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the errorDocCountInIndex
|
||||
*/
|
||||
public long getErrorDocCountInIndex()
|
||||
{
|
||||
return errorDocCountInIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the unindexedDocCountInIndex
|
||||
*/
|
||||
public long getUnindexedDocCountInIndex()
|
||||
{
|
||||
return unindexedDocCountInIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+961
-961
File diff suppressed because it is too large
Load Diff
+80
-80
@@ -1,80 +1,80 @@
|
||||
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.encryption.KeyResourceLoader;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.solr.client.SOLRAPIClient;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class SOLRAPIClientFactoryTest
|
||||
{
|
||||
@Mock
|
||||
private Properties props;
|
||||
@Mock
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
@Mock
|
||||
private DictionaryService dictionaryService;
|
||||
@Mock
|
||||
private NamespaceDAO namespaceDAO;
|
||||
private SOLRAPIClientFactory factory;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
{
|
||||
when(props.getProperty(eq("alfresco.host"), anyString())).thenReturn("localhost");
|
||||
when(props.getProperty(eq("alfresco.port"), anyString())).thenReturn("8080");
|
||||
when(props.getProperty(eq("alfresco.port.ssl"), anyString())).thenReturn("8443");
|
||||
when(props.getProperty(eq("alfresco.maxTotalConnections"), anyString())).thenReturn("40");
|
||||
when(props.getProperty(eq("alfresco.maxHostConnections"), anyString())).thenReturn("40");
|
||||
when(props.getProperty(eq("alfresco.socketTimeout"), anyString())).thenReturn("0");
|
||||
when(props.getProperty(eq("alfresco.secureComms"), anyString())).thenReturn("none");
|
||||
when(props.getProperty(eq("alfresco.encryption.ssl.keystore.location"), anyString()))
|
||||
.thenReturn("ssl.repo.client.keystore");
|
||||
when(props.getProperty(eq("alfresco.encryption.ssl.truststore.location"), anyString()))
|
||||
.thenReturn("ssl.repo.client.truststore");
|
||||
|
||||
this.factory = new SOLRAPIClientFactory();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getsSameSOLRAPIClientForSameAlfresco()
|
||||
{
|
||||
SOLRAPIClient solrapiClient = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient);
|
||||
|
||||
SOLRAPIClient solrapiClient2 = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient2);
|
||||
|
||||
assertSame(solrapiClient, solrapiClient2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getsDifferentSOLRAPIClientForDifferentAlfresco()
|
||||
{
|
||||
SOLRAPIClient solrapiClient = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient);
|
||||
|
||||
when(props.getProperty("alfresco.port.ssl", "8443")).thenReturn("8444");
|
||||
SOLRAPIClient solrapiClient2 = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient2);
|
||||
|
||||
assertNotSame(solrapiClient, solrapiClient2);
|
||||
}
|
||||
}
|
||||
|
||||
package org.alfresco.solr.client;
|
||||
|
||||
import static org.mockito.Mockito.*;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertSame;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.alfresco.encryption.KeyResourceLoader;
|
||||
import org.alfresco.repo.dictionary.NamespaceDAO;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.solr.client.SOLRAPIClient;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class SOLRAPIClientFactoryTest
|
||||
{
|
||||
@Mock
|
||||
private Properties props;
|
||||
@Mock
|
||||
private KeyResourceLoader keyResourceLoader;
|
||||
@Mock
|
||||
private DictionaryService dictionaryService;
|
||||
@Mock
|
||||
private NamespaceDAO namespaceDAO;
|
||||
private SOLRAPIClientFactory factory;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
{
|
||||
when(props.getProperty(eq("alfresco.host"), anyString())).thenReturn("localhost");
|
||||
when(props.getProperty(eq("alfresco.port"), anyString())).thenReturn("8080");
|
||||
when(props.getProperty(eq("alfresco.port.ssl"), anyString())).thenReturn("8443");
|
||||
when(props.getProperty(eq("alfresco.maxTotalConnections"), anyString())).thenReturn("40");
|
||||
when(props.getProperty(eq("alfresco.maxHostConnections"), anyString())).thenReturn("40");
|
||||
when(props.getProperty(eq("alfresco.socketTimeout"), anyString())).thenReturn("0");
|
||||
when(props.getProperty(eq("alfresco.secureComms"), anyString())).thenReturn("none");
|
||||
when(props.getProperty(eq("alfresco.encryption.ssl.keystore.location"), anyString()))
|
||||
.thenReturn("ssl.repo.client.keystore");
|
||||
when(props.getProperty(eq("alfresco.encryption.ssl.truststore.location"), anyString()))
|
||||
.thenReturn("ssl.repo.client.truststore");
|
||||
|
||||
this.factory = new SOLRAPIClientFactory();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getsSameSOLRAPIClientForSameAlfresco()
|
||||
{
|
||||
SOLRAPIClient solrapiClient = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient);
|
||||
|
||||
SOLRAPIClient solrapiClient2 = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient2);
|
||||
|
||||
assertSame(solrapiClient, solrapiClient2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getsDifferentSOLRAPIClientForDifferentAlfresco()
|
||||
{
|
||||
SOLRAPIClient solrapiClient = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient);
|
||||
|
||||
when(props.getProperty("alfresco.port.ssl", "8443")).thenReturn("8444");
|
||||
SOLRAPIClient solrapiClient2 = factory.getSOLRAPIClient(props, keyResourceLoader, dictionaryService,
|
||||
namespaceDAO);
|
||||
assertNotNull(solrapiClient2);
|
||||
|
||||
assertNotSame(solrapiClient, solrapiClient2);
|
||||
}
|
||||
}
|
||||
|
||||
+660
-660
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user