Package com.inductiveautomation.snap.web
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 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.Returns a row for an entity and primary value that is guaranteed to be unique for this data source.Returns a row for an entity and primary value that is guaranteed to be unique for this data source.protected RowcreateRowImpl(Entity anEntity, Object aPrimaryValue) Creates a new row for source.protected WebSiteCreates a WebSite that can be used for storing persistent support files.protected 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.Returns a row for a given entity and primary value.Returns a row for given query.protected 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.Returns 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 com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.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
Returns a request object for a URL. -
getResponse
Returns a response instance for a request. -
handleHead
Handles a head request. -
handleGet
Handle a get request. -
handlePut
Handle a PUT request. -
handleDelete
Handle a DELETE request. -
createFile
Returns a new file at the given path, regardless of whether it exists in the data source. -
getFile
Returns the individual file with the given path. -
saveFile
Save file.- Throws:
ResponseException
-
deleteFile
Delete file.- Throws:
ResponseException
-
createFileImpl
Creates a new file. -
getFileImpl
Returns a data source file for given path (if file exists).- Throws:
Exception
-
getFilesImpl
Returns a list of files at path.- Throws:
Exception
-
getFileBytesImpl
Returns file bytes.- Throws:
Exception
-
saveFileImpl
Saves a file.- Throws:
Exception
-
deleteFileImpl
Deletes a file.- Throws:
Exception
-
refreshFile
Revert file from saved version. -
refreshFileImpl
Reverts a file.- Throws:
Exception
-
getModifiedTime
Returns the modified time for a file to underlying file system. -
setModifiedTime
Saves the modified time for a file to underlying file system.- Throws:
Exception
-
setModifiedTimeImpl
Saves the modified time for a file to underlying file system.- Throws:
Exception
-
setExists
Sets whether a file exists. -
getStandardFile
Returns a standard java.io.File, if available. -
getURL
Returns a URL for the given file path. -
createURL
Creates a URL for string. -
createSite
Creates the data site remote site (database, directory file, etc.).- Throws:
Exception
-
deleteSite
Deletes this data site, assuming it corresponds to something that can be deleted, like a database.- Throws:
Exception
-
getSchema
Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects. -
createSchema
Creates the schema. -
createEntity
Creates an entity for given name. -
createEntityImpl
Returns the entity for given name. -
getEntity
Returns the entity for given name. -
getEntityImpl
Returns the entity for given name.- Throws:
Exception
-
saveEntity
Saves the given entity.- Throws:
Exception
-
saveEntityImpl
Saves the given entity.- Throws:
Exception
-
deleteEntity
Saves the given entity.- Throws:
Exception
-
deleteEntityImpl
Saves the given entity.- Throws:
Exception
-
getDataTables
Returns the list of known data tables. -
getDataTable
Returns the DataTable for given name -
createDataTable
Returns the DataTable for given name. -
createDataTableImpl
Creates an instance of DataTable. -
createRow
Returns a row for an entity and primary value that is guaranteed to be unique for this data source. -
createRow
Returns a row for an entity and primary value that is guaranteed to be unique for this data source. -
createRowImpl
Creates a new row for source. -
getRow
Returns a row for a given entity and primary value. -
getRowImpl
Returns a row for a given entity and primary value. -
getRow
Returns a row for given query. -
getRows
Returns a set of rows for the given properties and condition. -
getRowsImpl
Returns a set of rows for the given properties and condition. -
saveRow
Inserts or updates a given row.- Throws:
Exception
-
saveRowImpl
Inserts or updates a given row.- Throws:
Exception
-
deleteRow
Deletes a given row.- Throws:
Exception
-
deleteRowImpl
Deletes a given row.- Throws:
Exception
-
bulkImport
Bulk import.- Throws:
Exception
-
getProp
Returns a file property for key. -
setProp
Sets a property for a key. -
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
Flushes any unsaved changes to backing store.- Throws:
Exception
-
flushImpl
Flushes any unsaved changes to backing store.- Throws:
Exception
-
getJSONKeys
RMJSONArchiver GetKeys method.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
toString
Standard toString implementation.
-