Class WebSite
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.snap.web.WebSite
- All Implemented Interfaces:
RMJSONArchiver.GetKeys, RMPropertyChanger, PropertyChangeListener, Cloneable, EventListener
public abstract class WebSite
extends RMObject
implements PropertyChangeListener, RMJSONArchiver.GetKeys
This is an abstract class to provide data management (create, get, put, delete) and file
management.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDeepChangeListener(DeepChangeListener aListener) Adds a deep (property) change listener to get notified when this WebSite sees changes (to files).voidbulkImport(Map<String, List<Map>> theMaps) Bulk import.protected WebClassLoaderCreates the DataClassLoader.protected DataTablecreateDataTable(String aName) Returns the DataTable for given name.protected @NonNull DataTableCreates an instance of DataTable.createEntity(String aName) Creates an entity for given name.protected EntitycreateEntityImpl(String aName) Returns the entity for given name.createFile(String aPath, boolean isDirectory) Returns a new file at the given path, regardless of whether it exists in the data source.protected WebFilecreateFileImpl(String aPath, boolean isDirectory) Creates a new file.@NonNull RowReturns a row for an entity and primary value that is guaranteed to be unique for this data source.@NonNull RowReturns a row for an entity and primary value that is guaranteed to be unique for this data source.protected @NonNull RowcreateRowImpl(Entity anEntity, Object aPrimaryValue) Creates a new row for source.protected @NonNull WebSiteCreates a WebSite that can be used for storing persistent support files.protected @NonNull WebURLCreates a WebSite that can be used for storing persistent support files.protected StringCreates a WebSite that can be used for storing persistent support files.protected SchemaCreates the schema.voidCreates the data site remote site (database, directory file, etc.).protected WebURLCreates a URL for string.voiddeleteEntity(Entity anEntity) Saves the given entity.protected voiddeleteEntityImpl(Entity anEntity) Saves the given entity.protected voiddeleteFile(WebFile aFile) Delete file.protected voiddeleteFileImpl(WebFile aFile) Deletes a file.voidDeletes a given row.protected abstract voiddeleteRowImpl(Row aRow) Deletes a given row.voidDeletes this data site, assuming it corresponds to something that can be deleted, like a database.voidflush()Flushes any unsaved changes to backing store.protected voidFlushes any unsaved changes to backing store.Returns the DataClassLoader.getDataTable(String aName) Returns the DataTable for given nameReturns the list of known data tables.Returns the entity for given name.protected EntitygetEntityImpl(String aName) Returns the entity for given name.booleanReturns whether data source exists.Returns the individual file with the given path.protected byte[]getFileBytesImpl(WebFile aFile) Returns file bytes.protected WebFilegetFileImpl(String aPath) Returns a data source file for given path (if file exists).getFilesImpl(WebFile aFile) Returns a list of files at path.Returns the host name.RMJSONArchiver GetKeys method.longgetModifiedTime(WebFile aFile) Returns the modified time for a file to underlying file system.getName()Returns the name for this data source.Returns the password.getPath()Returns the data source name-space and name in standard path form.Returns a file property for key.getRequest(WebURL aURL) Returns a request object for a URL.getResponse(Request aRequest) Returns a response instance for a request.Returns the root directory.@Nullable RowReturns a row for a given entity and primary value.@Nullable RowReturns a row for given query.protected @Nullable RowgetRowImpl(Entity anEntity, Object aPrimaryValue) Returns a row for a given entity and primary value.Returns a set of rows for the given properties and condition.getRowsImpl(Entity anEntity, Query aQuery) Returns a set of rows for the given properties and condition.@NonNull WebSiteReturns a WebSite that can be used for storing persistent support files.Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects.getServlet(WebURL aUrl) Returns the Servlet for URL.protected FilegetStandardFile(WebFile aFile) Returns a standard java.io.File, if available.getURL()Returns the URL.Returns a URL for the given file path.Returns the URL root.Returns the user name.protected ResponsehandleDelete(Request aRequest) Handle a DELETE request.protected ResponseHandle a get request.protected ResponsehandleHead(Request aRequest) Handles a head request.protected ResponseHandle a PUT request.booleanReturns whether this data source is running background processes.voidpropertyChange(PropertyChangeEvent anEvent) Handle property changes on row objects by forwarding to listener.voidrefresh()Clears all cached data in the data source, forcing everything to reload.voidrefreshFile(WebFile aFile) Revert file from saved version.protected voidrefreshFileImpl(WebFile aFile) Reverts a file.voidremoveDeepChangeListener(DeepChangeListener aListener) Removes a deep (property) change listener to get notified when this WebSite sees changes (to files).voidsaveEntity(Entity anEntity) Saves the given entity.protected voidsaveEntityImpl(Entity anEntity) Saves the given entity.protected voidSave file.protected voidsaveFileImpl(WebFile aFile) Saves a file.voidInserts or updates a given row.protected abstract voidsaveRowImpl(Row aRow) Inserts or updates a given row.voidsetClassLoader(WebClassLoader aClassLoader) Sets the DataClassLoader.protected voidSets whether a file exists.voidsetModifiedTime(WebFile aFile, long aTime) Saves the modified time for a file to underlying file system.protected voidsetModifiedTimeImpl(WebFile aFile, long aTime) Saves the modified time for a file to underlying file system.voidsetPassword(String aPassword) Sets the password.voidSets a property for a key.voidsetSandbox(WebSite aSandbox) Sets a WebSite that can be used for storing persistent support files.voidsetServlet(WebURL aUrl, WebSite.Servlet aServlet) Sets a Servlet for URL.protected voidSets the URL.voidsetUserName(String aName) Sets the user name.toString()Standard toString implementation.Methods inherited from class RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class RMListenerList
addListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Field Details
-
Refresh_Prop
- See Also:
-
-
Constructor Details
-
WebSite
public WebSite()
-
-
Method Details
-
getURL
Returns the URL. -
setURL
Sets the URL. -
getURLString
Returns the URL root. -
getName
Returns the name for this data source. -
getHostName
Returns the host name. -
getPath
Returns the data source name-space and name in standard path form. -
getUserName
Returns the user name. -
setUserName
Sets the user name. -
getPassword
Returns the password. -
setPassword
Sets the password. -
getExists
public boolean getExists()Returns whether data source exists. -
getRootDirectory
Returns the root directory. -
getRequest
-
getResponse
-
handleHead
-
handleGet
-
handlePut
-
handleDelete
-
createFile
-
getFile
-
saveFile
Save file.- Throws:
ResponseException
-
deleteFile
Delete file.- Throws:
ResponseException
-
createFileImpl
-
getFileImpl
-
getFilesImpl
-
getFileBytesImpl
-
saveFileImpl
-
deleteFileImpl
-
refreshFile
Revert file from saved version. -
refreshFileImpl
-
getModifiedTime
Returns the modified time for a file to underlying file system. -
setModifiedTime
-
setModifiedTimeImpl
-
setExists
Sets whether a file exists. -
getStandardFile
-
getURL
-
createURL
-
createSite
-
deleteSite
-
getSchema
Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects. -
createSchema
Creates the schema. -
createEntity
-
createEntityImpl
-
getEntity
-
getEntityImpl
-
saveEntity
-
saveEntityImpl
-
deleteEntity
-
deleteEntityImpl
-
getDataTables
-
getDataTable
-
createDataTable
-
createDataTableImpl
Creates an instance of DataTable. -
createRow
-
createRow
-
createRowImpl
-
getRow
-
getRowImpl
-
getRow
-
getRows
-
getRowsImpl
-
saveRow
-
saveRowImpl
-
deleteRow
-
deleteRowImpl
-
bulkImport
-
getProp
-
setProp
-
getSandbox
Returns a WebSite that can be used for storing persistent support files. -
setSandbox
Sets a WebSite that can be used for storing persistent support files. -
createSandbox
Creates a WebSite that can be used for storing persistent support files. -
createSandboxURL
Creates a WebSite that can be used for storing persistent support files. -
createSandboxURLS
Creates a WebSite that can be used for storing persistent support files. -
getServlet
Returns the Servlet for URL. -
setServlet
Sets a Servlet for URL. -
getClassLoader
Returns the DataClassLoader. -
setClassLoader
Sets the DataClassLoader. -
createClassLoader
Creates the DataClassLoader. -
isRunning
public boolean isRunning()Returns whether this data source is running background processes. -
addDeepChangeListener
Adds a deep (property) change listener to get notified when this WebSite sees changes (to files). -
removeDeepChangeListener
Removes a deep (property) change listener to get notified when this WebSite sees changes (to files). -
propertyChange
Handle property changes on row objects by forwarding to listener.- Specified by:
propertyChangein interfacePropertyChangeListener
-
refresh
public void refresh()Clears all cached data in the data source, forcing everything to reload. -
flush
-
flushImpl
-
getJSONKeys
RMJSONArchiver GetKeys method.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
toString
-