Package org.cdlib.mrt.cloud
Class VersionMap
java.lang.Object
org.cdlib.mrt.cloud.VersionMap
This object imports the formatTypes.xml and builds a local table of supported format types.
Note, that the ObjectFormat is being deprecated and replaced by a single format id (fmtid).
This change is happening because formatName is strictly a description and has no functional
use. The scienceMetadata flag is being dropped because the ORE Resource Map is more flexible
and allows for a broader set of data type.
- Author:
- dloy
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected longprotected intprotected LinkedHashList<String, VersionMap.VersionFileComponent> protected HashMap<String, VersionMap.VersionFileComponent> protected DateStateprotected DateStateprotected DateStateprotected LoggerInfprotected intprotected Identifierprotected intprotected longprotected intprotected DateStateprotected DateStateprotected longprotected intprotected Stringprotected intprotected long -
Constructor Summary
ConstructorsConstructorDescriptionVersionMap(VersionMap inMap) VersionMap(Identifier objectID, LoggerInf logger) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTest(int versionID, int outVersionID) voidaddVersion(List<FileComponent> components) intbuildAddManifest(String fileURLS, int versionID, File addManifest) Create an add Manifest in File addManifeststatic ManInfobuildManInfo(int versionID, DateState created, List<FileComponent> components) voidvoiddeleteFromManList(int delInx) voidfillComponent(FileComponent manifestComponent) intlongintgetFileComponent(int versionID, String fileID) longgetManifestSize(ManInfo info) getManInfo(int inx) intstatic ArrayList<FileComponent> getMergeComponents(List<FileComponent> updateComponents, List<FileComponent> currentComponents, String[] deleteList) getMergeInfo(ManInfo update, String[] deleteList) getMergeInfoOriginal(ManInfo update, String[] deleteList) intintgetNode()intlongintlongintintlongintlonggetVersionComponents(int versionID) getVersionContent(int versionID) intgetVersionInfo(int versionID) intgetVersionListInx(int versionID) static VersionMapgetVersionMap(String manifestXMLUrlS) Get version map from manifext URLgetVersionStats(int versionID) booleanisMatch(VersionMap testMap) booleanisMatch(FileComponent matchComponent, FileComponent manifestComponent) booleanisMatchComponents(List<FileComponent> components, List<FileComponent> tcomponents) booleanisThisSubset(VersionMap testMap) Is testMap VersionMap a subset of this.versionMapvoidvoidsetActualCnt(int actualCnt) voidsetActualSize(long actualSize) voidsetCloudComponent(FileComponent manifestComponent, boolean doFill) voidsetCurrent(int current) voidsetLastAddVersion(DateState lastAddVersion) voidsetLastDeleteObject(DateState lastDeleteObject) voidsetLastDeleteVersion(DateState lastDeleteVersion) voidsetNode(int node) voidsetObjectID(Identifier objectID) voidsetOriginalActualCount(int originalActualCount) voidsetOriginalActualSize(long originalActualSize) voidsetOriginalFileCount(int originalFileCount) voidsetOriginalLastAddVersion(DateState originalLastAddVersion) voidsetOriginalLastDeleteVersion(DateState originalLastDeleteVersion) voidsetOriginalTotalSize(long originalTotalSize) voidsetOriginalVersionCnt(int originalVersionCnt) voidsetStorageBase(String storageBase) voidsetTotalCnt(int totalCnt) voidsetTotalSize(long totalSize) intsize()protected voidstubFromManList(ManInfo manInfo, int stubVersion) protected voidstubFromVersions(int stubVersion) voidstubVersion(int stubVersion) voidupdateVersion(List<FileComponent> components, String[] deleteList) protected voidvalidateManInfo(ManInfo info) void
-
Field Details
-
objectID
-
current
protected int current -
actualSize
protected long actualSize -
totalSize
protected long totalSize -
totalCnt
protected int totalCnt -
actualCnt
protected int actualCnt -
originalFileCount
protected int originalFileCount -
originalTotalSize
protected long originalTotalSize -
originalActualCount
protected int originalActualCount -
originalActualSize
protected long originalActualSize -
lastAddVersion
-
lastDeleteObject
-
lastDeleteVersion
-
originalLastAddVersion
-
originalLastDeleteVersion
-
originalVersionCnt
protected int originalVersionCnt -
logger
-
node
protected int node -
storageBase
-
manList
-
keyHash
-
fileHashList
-
-
Constructor Details
-
VersionMap
- Throws:
TException
-
VersionMap
- Throws:
TException
-
-
Method Details
-
getVersionMap
Get version map from manifext URL- Parameters:
manifestXMLUrlS- string form manifest URL- Returns:
- version manifest map
- Throws:
TException- process exception
-
size
public int size() -
getVersionCount
public int getVersionCount() -
getManInfo
-
getVersionInfo
-
getVersionComponents
-
getVersionContent
-
getVersionListInx
public int getVersionListInx(int versionID) -
getMaxVersion
public int getMaxVersion() -
validateVersion
- Throws:
TException
-
deleteFromManList
public void deleteFromManList(int delInx) -
rebuildHash
public void rebuildHash() -
addVersion
- Throws:
TException
-
updateVersion
- Throws:
TException
-
deleteCurrent
- Throws:
TException
-
stubVersion
- Throws:
TException
-
stubFromVersions
- Throws:
TException
-
stubFromManList
- Throws:
TException
-
buildManInfo
public static ManInfo buildManInfo(int versionID, DateState created, List<FileComponent> components) throws TException - Throws:
TException
-
add
- Throws:
TException
-
getMergeInfoOriginal
- Throws:
TException
-
getMergeInfo
- Throws:
TException
-
getMergeComponents
public static ArrayList<FileComponent> getMergeComponents(List<FileComponent> updateComponents, List<FileComponent> currentComponents, String[] deleteList) throws TException - Throws:
TException
-
addHash
-
validateManInfo
- Throws:
TException
-
getUniqueCnt
public int getUniqueCnt()- Returns:
- count of unique fileComponents
-
getUniqueSize
public long getUniqueSize() -
getManifestSize
-
setCloudComponent
- Throws:
TException
-
fillComponent
- Throws:
TException
-
isMatch
public boolean isMatch(FileComponent matchComponent, FileComponent manifestComponent) throws TException - Throws:
TException
-
getActualCnt
public int getActualCnt() -
getActualSize
public long getActualSize() -
getTotalCnt
public int getTotalCnt() -
getTotalSize
public long getTotalSize() -
getObjectID
-
getLastAddVersion
-
getLastDeleteVersion
-
getOriginalLastAddVersion
-
setActualCnt
public void setActualCnt(int actualCnt) -
setActualSize
public void setActualSize(long actualSize) -
setLastAddVersion
-
setLastDeleteVersion
-
setObjectID
-
setTotalCnt
public void setTotalCnt(int totalCnt) -
setTotalSize
public void setTotalSize(long totalSize) -
setOriginalLastAddVersion
-
getOriginalLastDeleteVersion
-
setOriginalLastDeleteVersion
-
getOriginalActualCount
public int getOriginalActualCount() -
setOriginalActualCount
public void setOriginalActualCount(int originalActualCount) -
getOriginalActualSize
public long getOriginalActualSize() -
setOriginalActualSize
public void setOriginalActualSize(long originalActualSize) -
getOriginalFileCount
public int getOriginalFileCount() -
setOriginalFileCount
public void setOriginalFileCount(int originalFileCount) -
getOriginalTotalSize
public long getOriginalTotalSize() -
setOriginalTotalSize
public void setOriginalTotalSize(long originalTotalSize) -
getNextVersion
public int getNextVersion() -
getCurrent
public int getCurrent() -
setCurrent
public void setCurrent(int current) -
getOriginalVersionCnt
public int getOriginalVersionCnt() -
setOriginalVersionCnt
public void setOriginalVersionCnt(int originalVersionCnt) -
getLastDeleteObject
-
setLastDeleteObject
-
getDeltaStats
-
dump
-
addTest
- Throws:
TException
-
getFileComponent
- Throws:
TException
-
getVersionStats
- Throws:
TException
-
buildAddManifest
Create an add Manifest in File addManifest- Parameters:
fileURLS- base URL of add Manifest in the form http://host:port/content/nodeidversionID- versionID for this created add ManifestaddManifest- File to contain add Manifest- Throws:
TException
-
isThisSubset
Is testMap VersionMap a subset of this.versionMap- Parameters:
testMap- test if this versionMap is subset of this.VersionMap- Returns:
- true=testMap is subset of this.VersionMap
- Throws:
TException
-
isMatch
- Throws:
TException
-
isMatchComponents
public boolean isMatchComponents(List<FileComponent> components, List<FileComponent> tcomponents) throws TException - Throws:
TException
-
getLogger
-
getNode
public int getNode() -
setNode
public void setNode(int node) -
getStorageBase
-
setStorageBase
-