| | |
| | | return logger; |
| | | } |
| | | |
| | | protected OracleConvertJobContext prepareJobContext(String filterPath) |
| | | { |
| | | return new OracleConvertJobContext(filterPath); |
| | | } |
| | | |
| | | public void execute(JobExecutionContext context) throws JobExecutionException |
| | | { |
| | | // Every job has its own job detail |
| | |
| | | logger.info(jobName + " fired at " + new Date()); |
| | | extractJobConfiguration(jobDetail); |
| | | |
| | | OracleConvertJobContext jobContext = prepareJobContext(); |
| | | OracleConvertJobContext jobContext = prepareJobContext(_filterPath); |
| | | jobContext.setConnectionInfo(_oracleHost, _oraclePort, _oracleInstance); |
| | | jobContext.setLogin(_username, _password); |
| | | jobContext.setShapeData(_dataPath); |
| | |
| | | , null); |
| | | |
| | | logger.info("begin convert job:[" + map.size() + "]:testmode=" + _testMode); |
| | | jobContext.startTransaction(); |
| | | for (OrderedMapIterator it = map.orderedMapIterator(); it.hasNext();) |
| | | { |
| | | it.next(); |
| | |
| | | System.gc(); |
| | | } |
| | | |
| | | private OrderedMap getBlobStorageList(OracleConnection connection, String schemaSrc, String tableSrc, |
| | | OrderedMap orderedMap) throws SQLException |
| | | protected OrderedMap getBlobStorageList(OracleConnection connection, String schemaSrc, String tableSrc, |
| | | OrderedMap orderedMap) throws SQLException |
| | | { |
| | | if (orderedMap == null) |
| | | orderedMap = new LinkedMap(99); |
| | |
| | | values[i] = rs.getObject(i + 1); |
| | | } |
| | | |
| | | Integer key = new Integer(((BigDecimal) values[0]).intValue()); |
| | | Integer key = ((BigDecimal) values[0]).intValue(); |
| | | String name = (String) values[1]; |
| | | |
| | | Pair pair = (Pair) orderedMap.get(key); |
| | |
| | | return orderedMap; |
| | | } |
| | | |
| | | private OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, |
| | | OrderedMap orderedMap) throws SQLException |
| | | protected OrderedMap getRawFormatStorageList(OracleConnection connection, String schemaSrc, String tableSrc, |
| | | OrderedMap orderedMap) throws SQLException |
| | | { |
| | | if (orderedMap == null) |
| | | orderedMap = new LinkedMap(99); |
| | |
| | | values[i] = rs.getObject(i + 1); |
| | | } |
| | | |
| | | Integer key = new Integer(((BigDecimal) values[0]).intValue()); |
| | | Integer key = ((BigDecimal) values[0]).intValue(); |
| | | String name = (String) values[1]; |
| | | |
| | | Pair pair = (Pair) orderedMap.get(key); |
| | |
| | | return orderedMap; |
| | | } |
| | | |
| | | private void queryIgsetElement(OracleConvertJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | protected void queryIgsetElement(OracleConvertJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | String fetchSrcStmtFmt = "SELECT IGDSELM FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | |
| | | { |
| | | Element element = fetchBinaryElement(raw); |
| | | jobContext.putFeatureCollection(element); |
| | | |
| | | } catch (Dgn7fileException e) |
| | | { |
| | | logger.warn("Dgn7Exception", e); |
| | |
| | | } |
| | | } |
| | | |
| | | private void queryRawElement(OracleConvertJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | protected void queryRawElement(OracleConvertJobContext jobContext, |
| | | String srcschema, String srctable) throws SQLException |
| | | { |
| | | OracleConnection connection = jobContext.getOracleConnection(); |
| | | String fetchDestStmtFmt = "SELECT ELEMENT FROM \"%s\".\"%s\" ORDER BY ROWID"; |
| | |
| | | try |
| | | { |
| | | Element element = fetchBinaryElement(rawDest); |
| | | // Feature feature = convertElementToFeature(element); |
| | | jobContext.putFeatureCollection(element); |
| | | } catch (Dgn7fileException e) |
| | | { |
| | | logger.warn("Dgn7Exception:" + e.getMessage(), e); |
| | |
| | | // track the record location |
| | | int elementLength = (buffer.getShort() * 2) + 4; |
| | | ElementType recordType = ElementType.forID(type); |
| | | IElementHandler handler = null; |
| | | IElementHandler handler; |
| | | |
| | | handler = recordType.getElementHandler(); |
| | | |
| | |
| | | |
| | | return dgnElement; |
| | | } |
| | | |
| | | private boolean equalRawData(byte[] rawSrc, byte[] rawDest) |
| | | { |
| | | if (rawSrc.length != rawDest.length) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | for (int i = 0; i < rawSrc.length; i++) |
| | | { |
| | | if (rawSrc[i] != rawDest[i]) |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |