public abstract class PdkFeatureHandler
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PdkFeatureHandler.Filter<X>
Filter-interface.
|
Modifier and Type | Field and Description |
---|---|
protected PdkWsCommon |
endPoint |
protected static Logger |
logger |
protected PlanMetaData |
pm |
Modifier | Constructor and Description |
---|---|
protected |
PdkFeatureHandler(PdkWsCommon endPoint,
StateTable st)
The sole constructor
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
allowsChildren()
Previously named: isRootType() Every feature type is either a "root" type
or a "child" type.
|
protected static Sql |
appendCurrentId(PlanMetaData md,
Sql sql,
java.lang.Integer id) |
protected Sql |
appendCurrentId(Sql sql,
java.lang.Integer id) |
protected Sql |
appendCurrentPState(Sql sql,
java.lang.Integer id) |
protected static Sql |
appendIsCurrent(PlanMetaData md,
Sql sql) |
protected Sql |
appendIsCurrent(Sql sql) |
protected Sql |
appendOrderByPState(Sql sql) |
protected static Sql |
appendPState(PlanMetaData md,
Sql sql,
java.lang.Integer id) |
protected Sql |
appendPState(Sql sql,
java.lang.Integer id) |
protected Sql |
appendStateId(Sql sql,
java.lang.Integer id,
PlanState state) |
protected boolean |
areaOverlapCheck(FeatureTransaction ft,
int adminCode,
java.lang.String sqlWkt,
java.lang.Double max_percent,
java.lang.Double max_area) |
protected AreaNode |
assertAccessRights(FeatureTransaction ft,
Privilege priv)
Assert user has sufficient privileges to execute transaction on a plan
type within the authority defined for a PlanFeature.
|
protected boolean |
assertConstraints(FeatureTransaction ft)
Asserts that specialized data constraints are not violated when a plan's
features are inserted or updated.
|
protected boolean |
assertDeletionState(FeatureTransaction ft)
Method to assert that a plan feature is an a proper state for deletion.
|
protected boolean |
assertGeometryIsValid(AreaNode areaNode,
FeatureTransaction ft)
Assert geometry of a new version of a plan feature in an insert/update
transaction is JTS valid, and that the geometry is sufficiently inside
the boundaries of the authority identified by the admin-code of the
FeatureTransaction.
|
protected boolean |
assertGlKomNrIsValid(FeatureTransaction fur)
Assert GLKOMNR value is not specified for VDATE value after January 1st
2007
|
boolean |
checkIsNotNull(FeatureTransaction ft) |
protected Sql |
createAdminCodesSql(AreaNodeIdentifier[] areaNodeIds) |
AreaNodeIdentifier |
createAreaNodeIdentifier(FeatureTransaction ft) |
AreaNodeIdentifier |
createAreaNodeIdentifier(int id) |
AreaNodeIdentifier |
createAreaNodeIdentifier(PlanFeature pf) |
PlanFeature |
createPlanFeature(Row row)
Create a PlanFeature instance from a Row parsed from GML or fetched from
the DB.
|
PlanFeature |
createPlanFeatureFromRow(FeatureTransaction fur,
Row row) |
protected void |
deleteFeature(PlanFeature parentFeature,
boolean persistent)
Method to perform persistent or non-persistent deletion of a plan and all
of it's different kind of child plans.
|
void |
deleteFeature(java.lang.String fid,
boolean persistent)
Top-level method to perform persistent or non-persistent deletion of an
identified plan feature and all of the plan feature's different kinds of
child features.
|
protected void |
deleteFeatureNonPersistent(PlanFeature n)
Method to perform non-persistent deletion of a plan.
|
protected void |
deleteFeaturePersistent(PlanFeature n)
Method to perform persistent deletion of a plan.
|
protected boolean |
distanceCheck(FeatureTransaction ft,
int adminCode,
java.lang.String sqlWkt,
double max_distance) |
boolean |
elementExists(FeatureTransaction ft,
java.lang.String elementName) |
protected void |
establishAdminCodes(FeatureTransaction fur,
PlanFeature adminCodesFeature) |
protected void |
establishExistingPlanFeature(FeatureTransaction fur,
java.lang.Integer pstatus,
java.lang.Integer versionsnr)
Method to establish an existing version of a plan feature in a
FeatureTransaction.
|
protected boolean |
establishPdfDocument(FeatureTransaction ft,
long now)
Establish PDF-document
|
java.util.List<PlanFeature> |
getABestem(PlanFeature pf) |
java.lang.Integer |
getAdminCodeForFeatureID(java.lang.Integer id) |
void |
getChildrenByParentIdResult(java.lang.String parentId,
int parentType,
java.lang.String[] attributes) |
protected java.lang.Integer[] |
getChildTypes()
Every feature type in PDK may be the parent of one or more child feature
types (entity wise).
|
void |
getFeatureByAdminCodesResult(AreaNodeIdentifier[] areaNodeIds,
java.lang.String[] attributes) |
void |
getFeatureByIdResult(java.lang.String sid,
java.lang.Integer pstatus,
java.lang.Integer version) |
void |
getFeatureCollection(java.lang.String filter) |
void |
getFeatureCollectionPaged(int startOffset,
int count,
java.lang.String[] selectAttributes,
AreaNodeIdentifier[] areaNodeIds,
java.lang.String filter,
java.lang.String[] orderByAttributes,
java.lang.String[] descendingAttributes) |
void |
getFeatureCount(AreaNodeIdentifier[] areaNodeIds,
java.lang.String filter) |
Envelope |
getFeatureEnvelopeById(java.lang.String sid,
java.lang.Integer pstatus) |
java.util.List<PlanFeature> |
getFeatureListByParentId(java.lang.Integer parentId,
java.lang.Integer parentType,
PdkFeatureHandler.Filter<PlanFeature> filter) |
void |
getFeatureWithinGeometryResult(Geometry g) |
java.lang.Integer |
getId(java.lang.String id)
Parse and construct an Integer ID value from a string value.
|
java.lang.Long |
getNewFeatureId()
Return a new lifetime ID for a plan object of *ANY* type
|
protected com.gmcb.plandk3.server.feature.PdkFeatureHandler.OverlapParams |
getOverlapParams(PlanFeature newFeature) |
protected java.lang.Integer |
getParentCode(Row pf)
In the database each feature row may contain a foreign-key to a parent
row.
|
protected int |
getParentIdColumnIndex(int parentType)
Given the feature type of this handler is not a "root" type feature
return the index to the foreign-key column in this handler's PlanMetaData
for specified parent feature type.
|
PlanFeature |
getPlanFeature(java.lang.Integer id,
java.lang.Integer pstatus,
boolean forUpdate) |
PlanFeature |
getPlanFeatureByStatus(java.lang.Integer id,
java.lang.Integer pstatus) |
PlanFeature |
getPlanFeatureByStatusWithTransaction(FeatureTransaction fur,
java.lang.Integer pstatus,
java.lang.Integer versionsnr) |
PlanFeature |
getPlanFeatureByVersion(java.lang.Integer id,
java.lang.Integer version) |
Row |
getRowByIdState(java.lang.Integer id,
PlanState state) |
java.util.List<PlanFeature> |
getSpecific(PlanFeature pf) |
java.util.List<PlanFeature> |
getSpecificByFilterId(int refPlanId) |
java.util.List<PlanFeature> |
getSpecificForCode(PlanFeature pf,
int plt_code) |
StateTable |
getStateTable() |
java.util.List<PlanFeature> |
getTvaergaaende(PlanFeature pf) |
protected abstract void |
insertNewSpecType(FeatureTransaction fur,
java.sql.Timestamp now) |
protected abstract void |
insertUpdateFeature(FeatureTransaction fur,
java.sql.Timestamp now)
Perform handler specific insert/update of "new" feature held by
FeatureTransaction
|
abstract boolean |
isValidChildOf(int parentCode)
Tells if this feature-type is a valid child of some parent feature type.
|
protected boolean |
lengthOverlapCheck(FeatureTransaction ft,
int adminCode,
java.lang.String sqlWkt,
java.lang.Double max_percent,
java.lang.Double max_length) |
PlanMetaData |
metaData()
Every feature handler is associated with an instance of PlanMetaData
(extension of RowMetaData) which describes the GML/SQL layout of the
feature type.
|
protected boolean |
pointDistanceCheck(FeatureTransaction ft,
int adminCode,
java.lang.String sqlWkt,
double max_distance) |
void |
saveFeature(Row newF,
java.util.List<FeatureTransaction> furs,
boolean validateDraft,
SaveFeatureOption option) |
protected static void |
setState(Row r,
PlanState state) |
protected void |
setTransactionError(FeatureTransaction ft,
MessageCode msgCode,
java.lang.Object... args)
Helper method invoked during a feature transaction processing.
|
protected boolean |
supportsSelectForUpdate()
This method indicates whether the underlying table/functional view
supports SQL selects FOR UPDATE.
|
void |
testPlanStatusChange(java.lang.String featureId,
java.lang.String newState) |
protected abstract void |
updateChildren(FeatureTransaction fur,
java.util.List<FeatureTransaction> furs,
java.sql.Timestamp now,
boolean validate,
boolean newVersion)
Perform recursive update of child plans for an "update"
FeatureTransaction
|
void |
validateFeature(FeatureTransaction ft,
boolean checkRules,
boolean newVersion) |
abstract boolean |
validateGlKomNr()
Should constraints on GlKomNr be validated.
|
abstract boolean |
willCascadeUpdate(int parentType)
Tells whether the current feature handler will do cascaded updates or
not.
|
protected static Logger logger
protected final PdkWsCommon endPoint
protected final PlanMetaData pm
protected PdkFeatureHandler(PdkWsCommon endPoint, StateTable st)
public final StateTable getStateTable()
public final PlanMetaData metaData()
public abstract boolean allowsChildren()
protected final java.lang.Integer[] getChildTypes() throws java.lang.Exception
java.lang.Exception
public abstract boolean isValidChildOf(int parentCode)
public abstract boolean willCascadeUpdate(int parentType)
public abstract boolean validateGlKomNr()
protected java.lang.Integer getParentCode(Row pf)
protected int getParentIdColumnIndex(int parentType)
protected boolean supportsSelectForUpdate()
public void testPlanStatusChange(java.lang.String featureId, java.lang.String newState) throws java.lang.Exception
java.lang.Exception
public final void saveFeature(Row newF, java.util.List<FeatureTransaction> furs, boolean validateDraft, SaveFeatureOption option) throws java.lang.Exception
java.lang.Exception
public void validateFeature(FeatureTransaction ft, boolean checkRules, boolean newVersion) throws java.lang.Exception
java.lang.Exception
protected abstract void insertNewSpecType(FeatureTransaction fur, java.sql.Timestamp now) throws java.lang.Exception
java.lang.Exception
protected abstract void insertUpdateFeature(FeatureTransaction fur, java.sql.Timestamp now) throws java.lang.Exception
java.lang.Exception
protected abstract void updateChildren(FeatureTransaction fur, java.util.List<FeatureTransaction> furs, java.sql.Timestamp now, boolean validate, boolean newVersion) throws java.lang.Exception
java.lang.Exception
public final void deleteFeature(java.lang.String fid, boolean persistent) throws java.lang.Exception
fid
- featureid of feature to be deletepersistent
- java.lang.Exception
protected final void deleteFeature(PlanFeature parentFeature, boolean persistent) throws java.lang.Exception
java.lang.Exception
protected final void deleteFeaturePersistent(PlanFeature n) throws java.lang.Exception
java.lang.Exception
protected void deleteFeatureNonPersistent(PlanFeature n) throws java.lang.Exception
java.lang.Exception
protected boolean assertDeletionState(FeatureTransaction ft)
protected final void establishExistingPlanFeature(FeatureTransaction fur, java.lang.Integer pstatus, java.lang.Integer versionsnr) throws java.lang.Exception
java.lang.Exception
protected final AreaNode assertAccessRights(FeatureTransaction ft, Privilege priv) throws java.lang.Exception
java.lang.Exception
protected void establishAdminCodes(FeatureTransaction fur, PlanFeature adminCodesFeature)
protected boolean assertConstraints(FeatureTransaction ft) throws java.lang.Exception
java.lang.Exception
protected final boolean assertGeometryIsValid(AreaNode areaNode, FeatureTransaction ft) throws java.lang.Exception
java.lang.Exception
protected final com.gmcb.plandk3.server.feature.PdkFeatureHandler.OverlapParams getOverlapParams(PlanFeature newFeature) throws java.lang.Exception
java.lang.Exception
protected final boolean areaOverlapCheck(FeatureTransaction ft, int adminCode, java.lang.String sqlWkt, java.lang.Double max_percent, java.lang.Double max_area) throws java.lang.Exception
java.lang.Exception
protected final boolean lengthOverlapCheck(FeatureTransaction ft, int adminCode, java.lang.String sqlWkt, java.lang.Double max_percent, java.lang.Double max_length) throws java.lang.Exception
java.lang.Exception
protected final boolean pointDistanceCheck(FeatureTransaction ft, int adminCode, java.lang.String sqlWkt, double max_distance) throws java.lang.Exception
java.lang.Exception
protected final boolean distanceCheck(FeatureTransaction ft, int adminCode, java.lang.String sqlWkt, double max_distance) throws java.lang.Exception
java.lang.Exception
protected final boolean assertGlKomNrIsValid(FeatureTransaction fur) throws java.lang.Exception
java.lang.Exception
protected final boolean establishPdfDocument(FeatureTransaction ft, long now) throws java.lang.Exception
java.lang.Exception
protected final void setTransactionError(FeatureTransaction ft, MessageCode msgCode, java.lang.Object... args)
public final java.lang.Long getNewFeatureId() throws java.lang.Exception
java.lang.Exception
public java.util.List<PlanFeature> getSpecificByFilterId(int refPlanId) throws java.lang.Exception
java.lang.Exception
public java.util.List<PlanFeature> getSpecificForCode(PlanFeature pf, int plt_code) throws java.lang.Exception
java.lang.Exception
public java.util.List<PlanFeature> getSpecific(PlanFeature pf) throws java.lang.Exception
java.lang.Exception
public java.util.List<PlanFeature> getABestem(PlanFeature pf) throws java.lang.Exception
java.lang.Exception
public java.util.List<PlanFeature> getTvaergaaende(PlanFeature pf) throws java.lang.Exception
java.lang.Exception
public final void getFeatureByIdResult(java.lang.String sid, java.lang.Integer pstatus, java.lang.Integer version) throws java.lang.Exception
java.lang.Exception
public final Envelope getFeatureEnvelopeById(java.lang.String sid, java.lang.Integer pstatus) throws java.lang.Exception
java.lang.Exception
public final void getFeatureByAdminCodesResult(AreaNodeIdentifier[] areaNodeIds, java.lang.String[] attributes) throws java.lang.Exception
java.lang.Exception
protected Sql createAdminCodesSql(AreaNodeIdentifier[] areaNodeIds)
public final void getFeatureWithinGeometryResult(Geometry g) throws java.lang.Exception
java.lang.Exception
public final void getFeatureCollection(java.lang.String filter) throws java.lang.Exception
java.lang.Exception
public final void getFeatureCollectionPaged(int startOffset, int count, java.lang.String[] selectAttributes, AreaNodeIdentifier[] areaNodeIds, java.lang.String filter, java.lang.String[] orderByAttributes, java.lang.String[] descendingAttributes) throws java.lang.Exception
java.lang.Exception
public final void getFeatureCount(AreaNodeIdentifier[] areaNodeIds, java.lang.String filter) throws java.lang.Exception
java.lang.Exception
public final void getChildrenByParentIdResult(java.lang.String parentId, int parentType, java.lang.String[] attributes) throws java.lang.Exception
java.lang.Exception
public final PlanFeature getPlanFeatureByStatus(java.lang.Integer id, java.lang.Integer pstatus) throws java.lang.Exception
java.lang.Exception
public final PlanFeature getPlanFeatureByVersion(java.lang.Integer id, java.lang.Integer version) throws java.lang.Exception
java.lang.Exception
public final PlanFeature getPlanFeatureByStatusWithTransaction(FeatureTransaction fur, java.lang.Integer pstatus, java.lang.Integer versionsnr) throws java.lang.Exception
java.lang.Exception
public final PlanFeature getPlanFeature(java.lang.Integer id, java.lang.Integer pstatus, boolean forUpdate) throws java.lang.Exception
java.lang.Exception
public final java.lang.Integer getAdminCodeForFeatureID(java.lang.Integer id) throws java.lang.Exception
java.lang.Exception
public final Row getRowByIdState(java.lang.Integer id, PlanState state) throws java.lang.Exception
java.lang.Exception
public final java.util.List<PlanFeature> getFeatureListByParentId(java.lang.Integer parentId, java.lang.Integer parentType, PdkFeatureHandler.Filter<PlanFeature> filter) throws java.lang.Exception
java.lang.Exception
protected static void setState(Row r, PlanState state)
protected final Sql appendCurrentId(Sql sql, java.lang.Integer id)
protected static final Sql appendCurrentId(PlanMetaData md, Sql sql, java.lang.Integer id)
protected final Sql appendOrderByPState(Sql sql)
protected final Sql appendPState(Sql sql, java.lang.Integer id)
protected static final Sql appendPState(PlanMetaData md, Sql sql, java.lang.Integer id)
protected final Sql appendCurrentPState(Sql sql, java.lang.Integer id)
protected final Sql appendStateId(Sql sql, java.lang.Integer id, PlanState state)
protected final Sql appendIsCurrent(Sql sql)
protected static final Sql appendIsCurrent(PlanMetaData md, Sql sql)
public final PlanFeature createPlanFeature(Row row)
public final PlanFeature createPlanFeatureFromRow(FeatureTransaction fur, Row row)
public final java.lang.Integer getId(java.lang.String id) throws DataNotValidException
DataNotValidException
- When an integer cannot be parsed from the input string.public AreaNodeIdentifier createAreaNodeIdentifier(int id)
public AreaNodeIdentifier createAreaNodeIdentifier(PlanFeature pf)
public AreaNodeIdentifier createAreaNodeIdentifier(FeatureTransaction ft)
public boolean elementExists(FeatureTransaction ft, java.lang.String elementName)
public boolean checkIsNotNull(FeatureTransaction ft)