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 SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
- 
Field Details- 
Refresh_Prop- See Also:
 
 
- 
- 
Constructor Details- 
WebSitepublic WebSite()
 
- 
- 
Method Details- 
getURLReturns the URL.
- 
setURLSets the URL.
- 
getURLStringReturns the URL root.
- 
getNameReturns the name for this data source.
- 
getHostNameReturns the host name.
- 
getPathReturns the data source name-space and name in standard path form.
- 
getUserNameReturns the user name.
- 
setUserNameSets the user name.
- 
getPasswordReturns the password.
- 
setPasswordSets the password.
- 
getExistspublic boolean getExists()Returns whether data source exists.
- 
getRootDirectoryReturns the root directory.
- 
getRequestReturns a request object for a URL.
- 
getResponseReturns a response instance for a request.
- 
handleHeadHandles a head request.
- 
handleGetHandle a get request.
- 
handlePutHandle a PUT request.
- 
handleDeleteHandle a DELETE request.
- 
createFileReturns a new file at the given path, regardless of whether it exists in the data source.
- 
getFileReturns the individual file with the given path.
- 
saveFileSave file.- Throws:
- ResponseException
 
- 
deleteFileDelete file.- Throws:
- ResponseException
 
- 
createFileImplCreates a new file.
- 
getFileImplReturns a data source file for given path (if file exists).- Throws:
- Exception
 
- 
getFilesImplReturns a list of files at path.- Throws:
- Exception
 
- 
getFileBytesImplReturns file bytes.- Throws:
- Exception
 
- 
saveFileImplSaves a file.- Throws:
- Exception
 
- 
deleteFileImplDeletes a file.- Throws:
- Exception
 
- 
refreshFileRevert file from saved version.
- 
refreshFileImplReverts a file.- Throws:
- Exception
 
- 
getModifiedTimeReturns the modified time for a file to underlying file system.
- 
setModifiedTimeSaves the modified time for a file to underlying file system.- Throws:
- Exception
 
- 
setModifiedTimeImplSaves the modified time for a file to underlying file system.- Throws:
- Exception
 
- 
setExistsSets whether a file exists.
- 
getStandardFileReturns a standard java.io.File, if available.
- 
getURLReturns a URL for the given file path.
- 
createURLCreates a URL for string.
- 
createSiteCreates the data site remote site (database, directory file, etc.).- Throws:
- Exception
 
- 
deleteSiteDeletes this data site, assuming it corresponds to something that can be deleted, like a database.- Throws:
- Exception
 
- 
getSchemaReturns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects.
- 
createSchemaCreates the schema.
- 
createEntityCreates an entity for given name.
- 
createEntityImplReturns the entity for given name.
- 
getEntityReturns the entity for given name.
- 
getEntityImplReturns the entity for given name.- Throws:
- Exception
 
- 
saveEntitySaves the given entity.- Throws:
- Exception
 
- 
saveEntityImplSaves the given entity.- Throws:
- Exception
 
- 
deleteEntitySaves the given entity.- Throws:
- Exception
 
- 
deleteEntityImplSaves the given entity.- Throws:
- Exception
 
- 
getDataTablesReturns the list of known data tables.
- 
getDataTableReturns the DataTable for given name
- 
createDataTableReturns the DataTable for given name.
- 
createDataTableImplCreates an instance of DataTable.
- 
createRowReturns a row for an entity and primary value that is guaranteed to be unique for this data source.
- 
createRowReturns a row for an entity and primary value that is guaranteed to be unique for this data source.
- 
createRowImplCreates a new row for source.
- 
getRowReturns a row for a given entity and primary value.
- 
getRowImplReturns a row for a given entity and primary value.
- 
getRowReturns a row for given query.
- 
getRowsReturns a set of rows for the given properties and condition.
- 
getRowsImplReturns a set of rows for the given properties and condition.
- 
saveRowInserts or updates a given row.- Throws:
- Exception
 
- 
saveRowImplInserts or updates a given row.- Throws:
- Exception
 
- 
deleteRowDeletes a given row.- Throws:
- Exception
 
- 
deleteRowImplDeletes a given row.- Throws:
- Exception
 
- 
bulkImportBulk import.- Throws:
- Exception
 
- 
getPropReturns a file property for key.
- 
setPropSets a property for a key.
- 
getSandboxReturns a WebSite that can be used for storing persistent support files.
- 
setSandboxSets a WebSite that can be used for storing persistent support files.
- 
createSandboxCreates a WebSite that can be used for storing persistent support files.
- 
createSandboxURLCreates a WebSite that can be used for storing persistent support files.
- 
createSandboxURLSCreates a WebSite that can be used for storing persistent support files.
- 
getServletReturns the Servlet for URL.
- 
setServletSets a Servlet for URL.
- 
getClassLoaderReturns the DataClassLoader.
- 
setClassLoaderSets the DataClassLoader.
- 
createClassLoaderCreates the DataClassLoader.
- 
isRunningpublic boolean isRunning()Returns whether this data source is running background processes.
- 
addDeepChangeListenerAdds a deep (property) change listener to get notified when this WebSite sees changes (to files).
- 
removeDeepChangeListenerRemoves a deep (property) change listener to get notified when this WebSite sees changes (to files).
- 
propertyChangeHandle property changes on row objects by forwarding to listener.- Specified by:
- propertyChangein interface- PropertyChangeListener
 
- 
refreshpublic void refresh()Clears all cached data in the data source, forcing everything to reload.
- 
flushFlushes any unsaved changes to backing store.- Throws:
- Exception
 
- 
flushImplFlushes any unsaved changes to backing store.- Throws:
- Exception
 
- 
getJSONKeysRMJSONArchiver GetKeys method.- Specified by:
- getJSONKeysin interface- RMJSONArchiver.GetKeys
 
- 
toStringStandard toString implementation.
 
-