use of alma.archive.range.IdentifierRangeEntityT in project ACS by ACS-Community.
the class IdentifierJMock method getNewRange.
/**
* This is the only method that's currently implemented
* @see alma.xmlstore.IdentifierJ#getNewRange()
*/
public IdentifierRange getNewRange() throws NotAvailable {
//Create the entity information
IdentifierRangeEntityT entityt = new IdentifierRangeEntityT();
//The id of the range is the 0 document id in that range.
entityt.setEntityId(createUid());
IdentifierRange range = new IdentifierRange();
range.setIdentifierRangeEntity(entityt);
//set the time stamp
// todo: pass in time externally?
String ts = IsoDateFormat.formatCurrentDate();
range.setCreatedTimeStamp(ts);
range.setIsLocked(false);
String archiveIdString = Long.toHexString(archiveid);
archiveIdString = "X" + StringUtils.leftPad(archiveIdString, archiveIdLength, '0');
range.setArchiveID(archiveIdString);
RangeT ranget = new RangeT();
ranget.setRangeID(Long.toHexString(rangeid));
ranget.setBaseDocumentID("1");
range.setRange(ranget);
rangeid++;
return range;
}
Aggregations