public abstract class WebSite extends RMObject implements java.beans.PropertyChangeListener, RMJSONArchiver.GetKeys
Modifier and Type | Class and Description |
---|---|
static interface |
WebSite.Servlet
Interface for Servlet.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
Refresh_Prop |
Constructor and Description |
---|
WebSite() |
Modifier and Type | Method and Description |
---|---|
void |
addDeepChangeListener(DeepChangeListener aListener)
Adds a deep (property) change listener to get notified when this WebSite sees changes (to files).
|
void |
bulkImport(java.util.Map<java.lang.String,java.util.List<java.util.Map>> theMaps)
Bulk import.
|
protected WebClassLoader |
createClassLoader()
Creates the DataClassLoader.
|
protected DataTable |
createDataTable(java.lang.String aName)
Returns the DataTable for given name.
|
protected DataTable |
createDataTableImpl()
Creates an instance of DataTable.
|
Entity |
createEntity(java.lang.String aName)
Creates an entity for given name.
|
protected Entity |
createEntityImpl(java.lang.String aName)
Returns the entity for given name.
|
WebFile |
createFile(java.lang.String aPath,
boolean isDirectory)
Returns a new file at the given path, regardless of whether it exists in the data source.
|
protected WebFile |
createFileImpl(java.lang.String aPath,
boolean isDirectory)
Creates a new file.
|
Row |
createRow(Entity anEntity,
java.lang.Object aPrimaryValue)
Returns a row for an entity and primary value that is guaranteed to be unique for this data source.
|
Row |
createRow(Entity anEntity,
java.lang.Object aPrimaryValue,
java.util.Map aMap)
Returns a row for an entity and primary value that is guaranteed to be unique for this data source.
|
protected Row |
createRowImpl(Entity anEntity,
java.lang.Object aPrimaryValue)
Creates a new row for source.
|
protected WebSite |
createSandbox()
Creates a WebSite that can be used for storing persistent support files.
|
protected WebURL |
createSandboxURL()
Creates a WebSite that can be used for storing persistent support files.
|
protected java.lang.String |
createSandboxURLS()
Creates a WebSite that can be used for storing persistent support files.
|
protected Schema |
createSchema()
Creates the schema.
|
void |
createSite()
Creates the data site remote site (database, directory file, etc.).
|
protected WebURL |
createURL(java.lang.String aURL)
Creates a URL for string.
|
void |
deleteEntity(Entity anEntity)
Saves the given entity.
|
protected void |
deleteEntityImpl(Entity anEntity)
Saves the given entity.
|
protected void |
deleteFile(WebFile aFile)
Delete file.
|
protected void |
deleteFileImpl(WebFile aFile)
Deletes a file.
|
void |
deleteRow(Row aRow)
Deletes a given row.
|
protected abstract void |
deleteRowImpl(Row aRow)
Deletes a given row.
|
void |
deleteSite()
Deletes this data site, assuming it corresponds to something that can be deleted, like a database.
|
void |
flush()
Flushes any unsaved changes to backing store.
|
protected void |
flushImpl()
Flushes any unsaved changes to backing store.
|
WebClassLoader |
getClassLoader()
Returns the DataClassLoader.
|
DataTable |
getDataTable(java.lang.String aName)
Returns the DataTable for given name
|
java.util.List<DataTable> |
getDataTables()
Returns the list of known data tables.
|
Entity |
getEntity(java.lang.String aName)
Returns the entity for given name.
|
protected Entity |
getEntityImpl(java.lang.String aName)
Returns the entity for given name.
|
boolean |
getExists()
Returns whether data source exists.
|
WebFile |
getFile(java.lang.String aPath)
Returns the individual file with the given path.
|
protected byte[] |
getFileBytesImpl(WebFile aFile)
Returns file bytes.
|
protected WebFile |
getFileImpl(java.lang.String aPath)
Returns a data source file for given path (if file exists).
|
protected java.util.List<WebFile> |
getFilesImpl(WebFile aFile)
Returns a list of files at path.
|
java.lang.String |
getHostName()
Returns the host name.
|
java.util.List<java.lang.String> |
getJSONKeys()
RMJSONArchiver GetKeys method.
|
long |
getModifiedTime(WebFile aFile)
Returns the modified time for a file to underlying file system.
|
java.lang.String |
getName()
Returns the name for this data source.
|
java.lang.String |
getPassword()
Returns the password.
|
java.lang.String |
getPath()
Returns the data source name-space and name in standard path form.
|
java.lang.Object |
getProp(java.lang.String aKey)
Returns a file property for key.
|
Request |
getRequest(WebURL aURL)
Returns a request object for a URL.
|
Response |
getResponse(Request aRequest)
Returns a response instance for a request.
|
WebFile |
getRootDirectory()
Returns the root directory.
|
Row |
getRow(Entity anEntity,
java.lang.Object aPrimaryValue)
Returns a row for a given entity and primary value.
|
Row |
getRow(Query aQuery)
Returns a row for given query.
|
protected Row |
getRowImpl(Entity anEntity,
java.lang.Object aPrimaryValue)
Returns a row for a given entity and primary value.
|
java.util.List<Row> |
getRows(Query aQuery)
Returns a set of rows for the given properties and condition.
|
protected abstract java.util.List<Row> |
getRowsImpl(Entity anEntity,
Query aQuery)
Returns a set of rows for the given properties and condition.
|
WebSite |
getSandbox()
Returns a WebSite that can be used for storing persistent support files.
|
Schema |
getSchema()
Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects.
|
WebSite.Servlet |
getServlet(WebURL aURL)
Returns the Servlet for URL.
|
protected java.io.File |
getStandardFile(WebFile aFile)
Returns a standard java.io.File, if available.
|
WebURL |
getURL()
Returns the URL.
|
WebURL |
getURL(java.lang.String aPath)
Returns a URL for the given file path.
|
java.lang.String |
getURLString()
Returns the URL root.
|
java.lang.String |
getUserName()
Returns the user name.
|
protected Response |
handleDelete(Request aRequest)
Handle a DELETE request.
|
protected Response |
handleGet(Request aRequest)
Handle a get request.
|
protected Response |
handleHead(Request aRequest)
Handles a head request.
|
protected Response |
handlePut(Request aRequest)
Handle a PUT request.
|
boolean |
isRunning()
Returns whether this data source is running background processes.
|
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
Handle property changes on row objects by forwarding to listener.
|
void |
refresh()
Clears all cached data in the data source, forcing everything to reload.
|
void |
refreshFile(WebFile aFile)
Revert file from saved version.
|
protected void |
refreshFileImpl(WebFile aFile)
Reverts a file.
|
void |
removeDeepChangeListener(DeepChangeListener aListener)
Removes a deep (property) change listener to get notified when this WebSite sees changes (to files).
|
void |
saveEntity(Entity anEntity)
Saves the given entity.
|
protected void |
saveEntityImpl(Entity anEntity)
Saves the given entity.
|
protected void |
saveFile(WebFile aFile)
Save file.
|
protected void |
saveFileImpl(WebFile aFile)
Saves a file.
|
void |
saveRow(Row aRow)
Inserts or updates a given row.
|
protected abstract void |
saveRowImpl(Row aRow)
Inserts or updates a given row.
|
void |
setClassLoader(WebClassLoader aClassLoader)
Sets the DataClassLoader.
|
protected void |
setExists(WebFile aFile,
boolean aValue)
Sets whether a file exists.
|
void |
setModifiedTime(WebFile aFile,
long aTime)
Saves the modified time for a file to underlying file system.
|
protected void |
setModifiedTimeImpl(WebFile aFile,
long aTime)
Saves the modified time for a file to underlying file system.
|
void |
setPassword(java.lang.String aPassword)
Sets the password.
|
void |
setProp(java.lang.String aKey,
java.lang.Object aValue)
Sets a property for a key.
|
void |
setSandbox(WebSite aSandbox)
Sets a WebSite that can be used for storing persistent support files.
|
void |
setServlet(WebURL aURL,
WebSite.Servlet aServlet)
Sets a Servlet for URL.
|
protected void |
setURL(WebURL aURL)
Sets the URL.
|
void |
setUserName(java.lang.String aName)
Sets the user name.
|
java.lang.String |
toString()
Standard toString implementation.
|
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
public static final java.lang.String Refresh_Prop
public WebURL getURL()
protected void setURL(WebURL aURL)
public java.lang.String getURLString()
public java.lang.String getName()
public java.lang.String getHostName()
public java.lang.String getPath()
public java.lang.String getUserName()
public void setUserName(java.lang.String aName)
public java.lang.String getPassword()
public void setPassword(java.lang.String aPassword)
public boolean getExists()
public WebFile getRootDirectory()
public Response getResponse(Request aRequest)
public WebFile createFile(java.lang.String aPath, boolean isDirectory)
public WebFile getFile(java.lang.String aPath)
protected void saveFile(WebFile aFile) throws ResponseException
ResponseException
protected void deleteFile(WebFile aFile) throws ResponseException
ResponseException
protected WebFile createFileImpl(java.lang.String aPath, boolean isDirectory)
protected WebFile getFileImpl(java.lang.String aPath) throws java.lang.Exception
java.lang.Exception
protected java.util.List<WebFile> getFilesImpl(WebFile aFile) throws java.lang.Exception
java.lang.Exception
protected byte[] getFileBytesImpl(WebFile aFile) throws java.lang.Exception
java.lang.Exception
protected void saveFileImpl(WebFile aFile) throws java.lang.Exception
java.lang.Exception
protected void deleteFileImpl(WebFile aFile) throws java.lang.Exception
java.lang.Exception
public void refreshFile(WebFile aFile)
protected void refreshFileImpl(WebFile aFile) throws java.lang.Exception
java.lang.Exception
public long getModifiedTime(WebFile aFile)
public void setModifiedTime(WebFile aFile, long aTime) throws java.lang.Exception
java.lang.Exception
protected void setModifiedTimeImpl(WebFile aFile, long aTime) throws java.lang.Exception
java.lang.Exception
protected void setExists(WebFile aFile, boolean aValue)
protected java.io.File getStandardFile(WebFile aFile)
public WebURL getURL(java.lang.String aPath)
protected WebURL createURL(java.lang.String aURL)
public void createSite() throws java.lang.Exception
java.lang.Exception
public void deleteSite() throws java.lang.Exception
java.lang.Exception
public Schema getSchema()
protected Schema createSchema()
public Entity createEntity(java.lang.String aName)
protected Entity createEntityImpl(java.lang.String aName)
public Entity getEntity(java.lang.String aName)
protected Entity getEntityImpl(java.lang.String aName) throws java.lang.Exception
java.lang.Exception
public void saveEntity(Entity anEntity) throws java.lang.Exception
java.lang.Exception
protected void saveEntityImpl(Entity anEntity) throws java.lang.Exception
java.lang.Exception
public void deleteEntity(Entity anEntity) throws java.lang.Exception
java.lang.Exception
protected void deleteEntityImpl(Entity anEntity) throws java.lang.Exception
java.lang.Exception
public java.util.List<DataTable> getDataTables()
public DataTable getDataTable(java.lang.String aName)
protected DataTable createDataTable(java.lang.String aName)
protected DataTable createDataTableImpl()
public Row createRow(Entity anEntity, java.lang.Object aPrimaryValue)
public Row createRow(Entity anEntity, java.lang.Object aPrimaryValue, java.util.Map aMap)
protected Row createRowImpl(Entity anEntity, java.lang.Object aPrimaryValue)
public Row getRow(Entity anEntity, java.lang.Object aPrimaryValue)
protected Row getRowImpl(Entity anEntity, java.lang.Object aPrimaryValue)
public java.util.List<Row> getRows(Query aQuery)
protected abstract java.util.List<Row> getRowsImpl(Entity anEntity, Query aQuery)
public void saveRow(Row aRow) throws java.lang.Exception
java.lang.Exception
protected abstract void saveRowImpl(Row aRow) throws java.lang.Exception
java.lang.Exception
public void deleteRow(Row aRow) throws java.lang.Exception
java.lang.Exception
protected abstract void deleteRowImpl(Row aRow) throws java.lang.Exception
java.lang.Exception
public void bulkImport(java.util.Map<java.lang.String,java.util.List<java.util.Map>> theMaps) throws java.lang.Exception
java.lang.Exception
public java.lang.Object getProp(java.lang.String aKey)
public void setProp(java.lang.String aKey, java.lang.Object aValue)
public WebSite getSandbox()
public void setSandbox(WebSite aSandbox)
protected WebSite createSandbox()
protected WebURL createSandboxURL()
protected java.lang.String createSandboxURLS()
public WebSite.Servlet getServlet(WebURL aURL)
public void setServlet(WebURL aURL, WebSite.Servlet aServlet)
public WebClassLoader getClassLoader()
public void setClassLoader(WebClassLoader aClassLoader)
protected WebClassLoader createClassLoader()
public boolean isRunning()
public void addDeepChangeListener(DeepChangeListener aListener)
public void removeDeepChangeListener(DeepChangeListener aListener)
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
propertyChange
in interface java.beans.PropertyChangeListener
public void refresh()
public void flush() throws java.lang.Exception
java.lang.Exception
protected void flushImpl() throws java.lang.Exception
java.lang.Exception
public java.util.List<java.lang.String> getJSONKeys()
getJSONKeys
in interface RMJSONArchiver.GetKeys