1 22 23 package org.xquark.xml.xdbc; 24 25 28 public abstract class DefaultReadOnlyXMLConnection implements XMLConnection { 29 30 31 32 33 public DefaultReadOnlyXMLConnection() { 34 } 35 36 44 public void commit() throws XMLDBCException, XMLDBCNotSupportedException { 45 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 46 } 47 48 57 public XMLCollection createCollection(String name, String description, Configurable config) throws XMLDBCException, XMLDBCNotSupportedException { 58 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 59 } 60 61 67 public Configurable createCollectionConfig() throws XMLDBCException, XMLDBCNotSupportedException { 68 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 69 } 70 71 77 public int deleteAllCollections() throws XMLDBCException, XMLDBCNotSupportedException { 78 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 79 } 80 81 87 public void deleteCollection(String name) throws XMLDBCException, XMLDBCNotSupportedException { 88 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 89 } 90 91 97 public boolean getAutoCommit() throws XMLDBCException, XMLDBCNotSupportedException { 98 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 99 } 100 101 107 public short getTransactionIsolation() throws XMLDBCException, XMLDBCNotSupportedException { 108 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 109 } 110 111 118 public XMLCollection getCollection(String name) throws XMLDBCException, XMLDBCNotSupportedException { 119 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 120 } 121 122 127 public boolean isReadOnly() throws XMLDBCException { 128 return true; 129 } 130 131 138 public void renameCollection(String oldname, String newname) throws XMLDBCException, XMLDBCNotSupportedException { 139 throw new XMLDBCNotSupportedException("Read-only connection does not support collection management"); 140 } 141 142 148 public void rollback() throws XMLDBCException, XMLDBCNotSupportedException { 149 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 150 } 151 152 159 public void setAutoCommit(boolean autoCommitMode) throws XMLDBCException, XMLDBCNotSupportedException { 160 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 161 } 162 163 170 public void setReadOnly(boolean readOnlyMode) throws XMLDBCException, XMLDBCNotSupportedException { 171 if (!readOnlyMode) 172 throw new XMLDBCNotSupportedException("Read-only mode cannot be changed for this connection"); 173 } 174 175 184 public void setTransactionIsolation(short level) throws XMLDBCException, XMLDBCNotSupportedException { 185 throw new XMLDBCNotSupportedException("Read-only connection does not support transactions"); 186 } 187 188 } 189 | Popular Tags |