| | |
| | | public class OracleIncrementPostGISJobContext extends AbstractOracleToPostGISJobContext |
| | | implements CreateFeatureTypeEventListener { |
| | | |
| | | static Log logger = LogFactory.getLog(OracleConvertPostGISJobContext.class); |
| | | static Log logger = LogFactory.getLog(OracleIncrementPostGISJobContext.class); |
| | | static final LoggerFacade sLogger = new CommonsLoggingLogger(logger); |
| | | |
| | | // static PostgisNGDataStoreFactory dataStoreFactory = new PostgisNGDataStoreFactory(); |
| | |
| | | private boolean schemaChanged = false; |
| | | private boolean dropTableMode = true; |
| | | private int accumulate = 0; |
| | | |
| | | public static class ElementTransactionContext { |
| | | public int transcationType; |
| | | public short cid; |
| | | public int oid; |
| | | public short compid; |
| | | public short occid; |
| | | public int taskid; |
| | | public Element element; |
| | | public int result; |
| | | }; |
| | | |
| | | public OracleIncrementPostGISJobContext(String dataPath, DataStore pgDS, String targetSchema, String filterConfig, |
| | | boolean profileMode, boolean useTransform) { |
| | |
| | | } |
| | | } |
| | | |
| | | public void putFeatureCollection(Element element) { |
| | | /** |
| | | * STATUS 欄位 :0:新增 2:編輯 3:刪除設備 4:刪除元件 |
| | | * @param context |
| | | */ |
| | | public void putFeatureCollection(ElementTransactionContext context) { |
| | | assert elementDispatcher != null; |
| | | if (context == null) { |
| | | logger.warn("putFeatureCollection context is null"); |
| | | return; |
| | | } |
| | | if (context.transcationType == 0) { |
| | | // insert Element |
| | | putFeatureCollection(context.element); |
| | | } else if (context.transcationType == 2) { |
| | | // Update Element |
| | | } else if (context.transcationType == 3) { |
| | | // Remove Whole Feature |
| | | } else if (context.transcationType == 4) { |
| | | // Remove Feature Part |
| | | } |
| | | } |
| | | |
| | | protected void putFeatureCollection(Element element) { |
| | | assert elementDispatcher != null; |
| | | // 判斷是否符和條件 |
| | | SimpleFeature feature = elementDispatcher.execute(element, getDistId(), isTransformed()); |