* internal reference to single copy of Document Roots array
*/
private VAMSAS[] _VamsasRoots=null;
+ /**
+ * set if the client has corrupted the Vamsas Document structure somehow.
+ * if this is set the document will never be written back to the session unless the corruption is fixed.
+ */
+ private boolean invalidModification=false;
protected void updateDocumentRoots() {
if (doc==null) {
}
// just do internal validation for moment.
try {
- if (SimpleClientConfig.validateUpdatedRoots())
+ if (getSimpleClientConfig().validateUpdatedRoots())
+ {
newVersion.validate();
+ }
return true;
}
catch (Exception e)
{
log.error("Validation Exception for new vamsas root :"+newVersion.getVorbaId(),e);
+ modflag.invalidModification=true;
}
return false;
} else {
modflag.isModified=true;
}
try {
- if (SimpleClientConfig.validateMergedRoots())
+ if (getSimpleClientConfig().validateMergedRoots())
{
newVersion.validate();
}
}
}*/
}
+ private SimpleClientConfig getSimpleClientConfig() {
+ return sclient.getSimpleClientConfig();
+}
/**
* merge old and new root vectors
* @param newr This array may be written to
*/
private VAMSAS[] _combineRoots(VAMSAS[] newr, final VAMSAS[] original, ClientDocument modflag) {
Vector rts = new Vector();
- boolean modified=false;
for (int i=0,j=original.length; i<j; i++) {
int k = _contains(original[i], newr);
if (k>-1) {
throw new java.io.IOException("Document is closed.");
}
if (iohandler==null) {
- log.warn("updateSessionDocument called document iohandler handler.");
+ log.warn("updateSessionDocument called on null document iohandler handler.");
throw new java.io.IOException("Document is closed.");
}
doc = null;
}
// disengage from client
- if (sclient!=null)
+ if (sclient!=null && sclient.cdocument==this)
sclient.cdocument = null;
sclient=null;
// TODO: WALK through the document objects calling the update mechanism for each one, or just pass this vector back to client ?return updatedObjects;
return null;
}
+ /**
+ * if this is set the document will never be written back to the session unless the corruption is fixed.
+ * @return the invalidModification
+ */
+ public boolean isInvalidModification() {
+ return invalidModification;
+ }
+ /**
+ * set if the client has corrupted the Vamsas Document structure somehow.
+ * if this is set the document will never be written back to the session unless the corruption is fixed.
+ * @param invalidModification the invalidModification to set
+ */
+ public void setInvalidModification(boolean invalidModification) {
+ this.invalidModification = invalidModification;
+ }
}