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,- java.beans.PropertyChangeListener,- java.lang.Cloneable,- java.util.EventListener
 
 public abstract class WebSite extends RMObject implements java.beans.PropertyChangeListener, RMJSONArchiver.GetKeys This is an abstract class to provide data management (create, get, put, delete) and file management.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceWebSite.ServletInterface for Servlet.
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringRefresh_Prop
 - 
Constructor SummaryConstructors Constructor Description WebSite()
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddDeepChangeListener(DeepChangeListener aListener)Adds a deep (property) change listener to get notified when this WebSite sees changes (to files).voidbulkImport(java.util.Map<java.lang.String,java.util.List<java.util.Map>> theMaps)Bulk import.protected WebClassLoadercreateClassLoader()Creates the DataClassLoader.protected DataTablecreateDataTable(java.lang.String aName)Returns the DataTable for given name.protected DataTablecreateDataTableImpl()Creates an instance of DataTable.EntitycreateEntity(java.lang.String aName)Creates an entity for given name.protected EntitycreateEntityImpl(java.lang.String aName)Returns the entity for given name.WebFilecreateFile(java.lang.String aPath, boolean isDirectory)Returns a new file at the given path, regardless of whether it exists in the data source.protected WebFilecreateFileImpl(java.lang.String aPath, boolean isDirectory)Creates a new file.RowcreateRow(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.RowcreateRow(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 RowcreateRowImpl(Entity anEntity, java.lang.Object aPrimaryValue)Creates a new row for source.protected WebSitecreateSandbox()Creates a WebSite that can be used for storing persistent support files.protected WebURLcreateSandboxURL()Creates a WebSite that can be used for storing persistent support files.protected java.lang.StringcreateSandboxURLS()Creates a WebSite that can be used for storing persistent support files.protected SchemacreateSchema()Creates the schema.voidcreateSite()Creates the data site remote site (database, directory file, etc.).protected WebURLcreateURL(java.lang.String aURL)Creates 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.voiddeleteRow(Row aRow)Deletes a given row.protected abstract voiddeleteRowImpl(Row aRow)Deletes a given row.voiddeleteSite()Deletes this data site, assuming it corresponds to something that can be deleted, like a database.voidflush()Flushes any unsaved changes to backing store.protected voidflushImpl()Flushes any unsaved changes to backing store.WebClassLoadergetClassLoader()Returns the DataClassLoader.DataTablegetDataTable(java.lang.String aName)Returns the DataTable for given namejava.util.List<DataTable>getDataTables()Returns the list of known data tables.EntitygetEntity(java.lang.String aName)Returns the entity for given name.protected EntitygetEntityImpl(java.lang.String aName)Returns the entity for given name.booleangetExists()Returns whether data source exists.WebFilegetFile(java.lang.String aPath)Returns the individual file with the given path.protected byte[]getFileBytesImpl(WebFile aFile)Returns file bytes.protected WebFilegetFileImpl(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.StringgetHostName()Returns the host name.java.util.List<java.lang.String>getJSONKeys()RMJSONArchiver GetKeys method.longgetModifiedTime(WebFile aFile)Returns the modified time for a file to underlying file system.java.lang.StringgetName()Returns the name for this data source.java.lang.StringgetPassword()Returns the password.java.lang.StringgetPath()Returns the data source name-space and name in standard path form.java.lang.ObjectgetProp(java.lang.String aKey)Returns a file property for key.RequestgetRequest(WebURL aURL)Returns a request object for a URL.ResponsegetResponse(Request aRequest)Returns a response instance for a request.WebFilegetRootDirectory()Returns the root directory.RowgetRow(Entity anEntity, java.lang.Object aPrimaryValue)Returns a row for a given entity and primary value.RowgetRow(Query aQuery)Returns a row for given query.protected RowgetRowImpl(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.WebSitegetSandbox()Returns a WebSite that can be used for storing persistent support files.SchemagetSchema()Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects.WebSite.ServletgetServlet(WebURL aUrl)Returns the Servlet for URL.protected java.io.FilegetStandardFile(WebFile aFile)Returns a standard java.io.File, if available.WebURLgetURL()Returns the URL.WebURLgetURL(java.lang.String aPath)Returns a URL for the given file path.java.lang.StringgetURLString()Returns the URL root.java.lang.StringgetUserName()Returns the user name.protected ResponsehandleDelete(Request aRequest)Handle a DELETE request.protected ResponsehandleGet(Request aRequest)Handle a get request.protected ResponsehandleHead(Request aRequest)Handles a head request.protected ResponsehandlePut(Request aRequest)Handle a PUT request.booleanisRunning()Returns whether this data source is running background processes.voidpropertyChange(java.beans.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 voidsaveFile(WebFile aFile)Save file.protected voidsaveFileImpl(WebFile aFile)Saves a file.voidsaveRow(Row aRow)Inserts or updates a given row.protected abstract voidsaveRowImpl(Row aRow)Inserts or updates a given row.voidsetClassLoader(WebClassLoader aClassLoader)Sets the DataClassLoader.protected voidsetExists(WebFile aFile, boolean aValue)Sets 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(java.lang.String aPassword)Sets the password.voidsetProp(java.lang.String aKey, java.lang.Object aValue)Sets 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 voidsetURL(WebURL aURL)Sets the URL.voidsetUserName(java.lang.String aName)Sets the user name.java.lang.StringtoString()Standard toString implementation.- 
Methods inherited from class com.inductiveautomation.rm.base.RMObjectaddPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
 - 
Methods inherited from class com.inductiveautomation.rm.base.RMListenerListaddListener, clone, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
 
- 
 
- 
- 
- 
Field Detail- 
Refresh_Proppublic static final java.lang.String Refresh_Prop - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getURLpublic WebURL getURL() Returns the URL.
 - 
setURLprotected void setURL(WebURL aURL) Sets the URL.
 - 
getURLStringpublic java.lang.String getURLString() Returns the URL root.
 - 
getNamepublic java.lang.String getName() Returns the name for this data source.
 - 
getHostNamepublic java.lang.String getHostName() Returns the host name.
 - 
getPathpublic java.lang.String getPath() Returns the data source name-space and name in standard path form.
 - 
getUserNamepublic java.lang.String getUserName() Returns the user name.
 - 
setUserNamepublic void setUserName(java.lang.String aName) Sets the user name.
 - 
getPasswordpublic java.lang.String getPassword() Returns the password.
 - 
setPasswordpublic void setPassword(java.lang.String aPassword) Sets the password.
 - 
getExistspublic boolean getExists() Returns whether data source exists.
 - 
getRootDirectorypublic WebFile getRootDirectory() Returns the root directory.
 - 
getResponsepublic Response getResponse(Request aRequest) Returns a response instance for a request.
 - 
createFilepublic 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.
 - 
getFilepublic WebFile getFile(java.lang.String aPath) Returns the individual file with the given path.
 - 
saveFileprotected void saveFile(WebFile aFile) throws ResponseException Save file.- Throws:
- ResponseException
 
 - 
deleteFileprotected void deleteFile(WebFile aFile) throws ResponseException Delete file.- Throws:
- ResponseException
 
 - 
createFileImplprotected WebFile createFileImpl(java.lang.String aPath, boolean isDirectory) Creates a new file.
 - 
getFileImplprotected WebFile getFileImpl(java.lang.String aPath) throws java.lang.Exception Returns a data source file for given path (if file exists).- Throws:
- java.lang.Exception
 
 - 
getFilesImpl@Nullable protected java.util.List<WebFile> getFilesImpl(WebFile aFile) throws java.lang.Exception Returns a list of files at path.- Throws:
- java.lang.Exception
 
 - 
getFileBytesImplprotected byte[] getFileBytesImpl(WebFile aFile) throws java.lang.Exception Returns file bytes.- Throws:
- java.lang.Exception
 
 - 
saveFileImplprotected void saveFileImpl(WebFile aFile) throws java.lang.Exception Saves a file.- Throws:
- java.lang.Exception
 
 - 
deleteFileImplprotected void deleteFileImpl(WebFile aFile) throws java.lang.Exception Deletes a file.- Throws:
- java.lang.Exception
 
 - 
refreshFilepublic void refreshFile(WebFile aFile) Revert file from saved version.
 - 
refreshFileImplprotected void refreshFileImpl(WebFile aFile) throws java.lang.Exception Reverts a file.- Throws:
- java.lang.Exception
 
 - 
getModifiedTimepublic long getModifiedTime(WebFile aFile) Returns the modified time for a file to underlying file system.
 - 
setModifiedTimepublic void setModifiedTime(WebFile aFile, long aTime) throws java.lang.Exception Saves the modified time for a file to underlying file system.- Throws:
- java.lang.Exception
 
 - 
setModifiedTimeImplprotected void setModifiedTimeImpl(WebFile aFile, long aTime) throws java.lang.Exception Saves the modified time for a file to underlying file system.- Throws:
- java.lang.Exception
 
 - 
setExistsprotected void setExists(WebFile aFile, boolean aValue) Sets whether a file exists.
 - 
getStandardFileprotected java.io.File getStandardFile(WebFile aFile) Returns a standard java.io.File, if available.
 - 
getURLpublic WebURL getURL(java.lang.String aPath) Returns a URL for the given file path.
 - 
createURLprotected WebURL createURL(java.lang.String aURL) Creates a URL for string.
 - 
createSitepublic void createSite() throws java.lang.ExceptionCreates the data site remote site (database, directory file, etc.).- Throws:
- java.lang.Exception
 
 - 
deleteSitepublic void deleteSite() throws java.lang.ExceptionDeletes this data site, assuming it corresponds to something that can be deleted, like a database.- Throws:
- java.lang.Exception
 
 - 
getSchemapublic Schema getSchema() Returns the schema of represented WebSite as a hierarchy of RMEntity and RMProperty objects.
 - 
createSchemaprotected Schema createSchema() Creates the schema.
 - 
createEntitypublic Entity createEntity(java.lang.String aName) Creates an entity for given name.
 - 
createEntityImplprotected Entity createEntityImpl(java.lang.String aName) Returns the entity for given name.
 - 
getEntitypublic Entity getEntity(java.lang.String aName) Returns the entity for given name.
 - 
getEntityImplprotected Entity getEntityImpl(java.lang.String aName) throws java.lang.Exception Returns the entity for given name.- Throws:
- java.lang.Exception
 
 - 
saveEntitypublic void saveEntity(Entity anEntity) throws java.lang.Exception Saves the given entity.- Throws:
- java.lang.Exception
 
 - 
saveEntityImplprotected void saveEntityImpl(Entity anEntity) throws java.lang.Exception Saves the given entity.- Throws:
- java.lang.Exception
 
 - 
deleteEntitypublic void deleteEntity(Entity anEntity) throws java.lang.Exception Saves the given entity.- Throws:
- java.lang.Exception
 
 - 
deleteEntityImplprotected void deleteEntityImpl(Entity anEntity) throws java.lang.Exception Saves the given entity.- Throws:
- java.lang.Exception
 
 - 
getDataTablespublic java.util.List<DataTable> getDataTables() Returns the list of known data tables.
 - 
getDataTablepublic DataTable getDataTable(java.lang.String aName) Returns the DataTable for given name
 - 
createDataTableprotected DataTable createDataTable(java.lang.String aName) Returns the DataTable for given name.
 - 
createDataTableImpl@Nonnull protected DataTable createDataTableImpl() Creates an instance of DataTable.
 - 
createRow@Nonnull public Row createRow(@Nonnull Entity anEntity, @Nullable java.lang.Object aPrimaryValue) Returns a row for an entity and primary value that is guaranteed to be unique for this data source.
 - 
createRow@Nonnull public Row createRow(@Nonnull Entity anEntity, @Nullable 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.
 - 
createRowImpl@Nonnull protected Row createRowImpl(Entity anEntity, java.lang.Object aPrimaryValue) Creates a new row for source.
 - 
getRow@Nullable public Row getRow(Entity anEntity, java.lang.Object aPrimaryValue) Returns a row for a given entity and primary value.
 - 
getRowImpl@Nullable protected Row getRowImpl(Entity anEntity, java.lang.Object aPrimaryValue) Returns a row for a given entity and primary value.
 - 
getRows@Nonnull public java.util.List<Row> getRows(Query aQuery) Returns a set of rows for the given properties and condition.
 - 
getRowsImpl@Nonnull protected abstract java.util.List<Row> getRowsImpl(Entity anEntity, Query aQuery) Returns a set of rows for the given properties and condition.
 - 
saveRowpublic void saveRow(Row aRow) throws java.lang.Exception Inserts or updates a given row.- Throws:
- java.lang.Exception
 
 - 
saveRowImplprotected abstract void saveRowImpl(Row aRow) throws java.lang.Exception Inserts or updates a given row.- Throws:
- java.lang.Exception
 
 - 
deleteRowpublic void deleteRow(Row aRow) throws java.lang.Exception Deletes a given row.- Throws:
- java.lang.Exception
 
 - 
deleteRowImplprotected abstract void deleteRowImpl(Row aRow) throws java.lang.Exception Deletes a given row.- Throws:
- java.lang.Exception
 
 - 
bulkImportpublic void bulkImport(java.util.Map<java.lang.String,java.util.List<java.util.Map>> theMaps) throws java.lang.ExceptionBulk import.- Throws:
- java.lang.Exception
 
 - 
getProppublic java.lang.Object getProp(java.lang.String aKey) Returns a file property for key.
 - 
setProppublic void setProp(java.lang.String aKey, java.lang.Object aValue)Sets a property for a key.
 - 
getSandbox@Nonnull public WebSite getSandbox() Returns a WebSite that can be used for storing persistent support files.
 - 
setSandboxpublic void setSandbox(WebSite aSandbox) Sets a WebSite that can be used for storing persistent support files.
 - 
createSandbox@Nonnull protected WebSite createSandbox() Creates a WebSite that can be used for storing persistent support files.
 - 
createSandboxURL@Nonnull protected WebURL createSandboxURL() Creates a WebSite that can be used for storing persistent support files.
 - 
createSandboxURLSprotected java.lang.String createSandboxURLS() Creates a WebSite that can be used for storing persistent support files.
 - 
getServletpublic WebSite.Servlet getServlet(WebURL aUrl) Returns the Servlet for URL.
 - 
setServletpublic void setServlet(WebURL aUrl, WebSite.Servlet aServlet) Sets a Servlet for URL.
 - 
getClassLoaderpublic WebClassLoader getClassLoader() Returns the DataClassLoader.
 - 
setClassLoaderpublic void setClassLoader(WebClassLoader aClassLoader) Sets the DataClassLoader.
 - 
createClassLoaderprotected WebClassLoader createClassLoader() Creates the DataClassLoader.
 - 
isRunningpublic boolean isRunning() Returns whether this data source is running background processes.
 - 
addDeepChangeListenerpublic void addDeepChangeListener(DeepChangeListener aListener) Adds a deep (property) change listener to get notified when this WebSite sees changes (to files).
 - 
removeDeepChangeListenerpublic void removeDeepChangeListener(DeepChangeListener aListener) Removes a deep (property) change listener to get notified when this WebSite sees changes (to files).
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent anEvent) Handle property changes on row objects by forwarding to listener.- Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
 
 - 
refreshpublic void refresh() Clears all cached data in the data source, forcing everything to reload.
 - 
flushpublic void flush() throws java.lang.ExceptionFlushes any unsaved changes to backing store.- Throws:
- java.lang.Exception
 
 - 
flushImplprotected void flushImpl() throws java.lang.ExceptionFlushes any unsaved changes to backing store.- Throws:
- java.lang.Exception
 
 - 
getJSONKeyspublic java.util.List<java.lang.String> getJSONKeys() RMJSONArchiver GetKeys method.- Specified by:
- getJSONKeysin interface- RMJSONArchiver.GetKeys
 
 
- 
 
-