Class SnapSite

  • All Implemented Interfaces:
    RMJSONArchiver.GetKeys, RMPropertyChanger, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

    public class SnapSite
    extends WebSite
    A class to manage resources for a Snap site (a data source subclass).
    • Constructor Detail

      • SnapSite

        public SnapSite()
    • Method Detail

      • getSite

        public WebSite getSite()
        Returns the encapsulated WebSite.
      • setSite

        protected void setSite​(WebSite aSite)
        Sets the encapsulated WebSite.
      • createFileImpl

        protected WebFile createFileImpl​(java.lang.String aPath,
                                         boolean isDirectory)
        Nobody should be asking for files from this site.
        Overrides:
        createFileImpl in class WebSite
      • getFileImpl

        protected WebFile getFileImpl​(java.lang.String aPath)
        Description copied from class: WebSite
        Returns a data source file for given path (if file exists).
        Overrides:
        getFileImpl in class WebSite
      • saveFileImpl

        protected void saveFileImpl​(WebFile aFile)
                             throws java.lang.Exception
        Description copied from class: WebSite
        Saves a file.
        Overrides:
        saveFileImpl in class WebSite
        Throws:
        java.lang.Exception
      • deleteFileImpl

        protected void deleteFileImpl​(WebFile aFile)
                               throws java.lang.Exception
        Description copied from class: WebSite
        Deletes a file.
        Overrides:
        deleteFileImpl in class WebSite
        Throws:
        java.lang.Exception
      • refreshFileImpl

        protected void refreshFileImpl​(WebFile aFile)
                                throws java.lang.Exception
        Description copied from class: WebSite
        Reverts a file.
        Overrides:
        refreshFileImpl in class WebSite
        Throws:
        java.lang.Exception
      • getDataTable

        public SnapTable getDataTable​(java.lang.String aName)
        Override to return as SnapTable.
        Overrides:
        getDataTable in class WebSite
      • getTableView

        public SnapTableView getTableView​(java.lang.String aName)
        Returns a table view for given name.
      • getEntityImpl

        protected Entity getEntityImpl​(java.lang.String aName)
                                throws java.lang.Exception
        Returns the entity for given name.
        Overrides:
        getEntityImpl in class WebSite
        Throws:
        java.lang.Exception
      • saveEntityImpl

        protected void saveEntityImpl​(Entity anEntity)
                               throws java.lang.Exception
        Override to save entity to encapsulated source.
        Overrides:
        saveEntityImpl in class WebSite
        Throws:
        java.lang.Exception
      • deleteEntityImpl

        protected void deleteEntityImpl​(@Nullable
                                        Entity anEntity)
                                 throws java.lang.Exception
        Override to delete entity from encapsulated source.
        Overrides:
        deleteEntityImpl in class WebSite
        Throws:
        java.lang.Exception
      • createRowImpl

        @Nonnull
        protected Row createRowImpl​(Entity anEntity,
                                    java.lang.Object aPrimaryValue)
        Creates a new row for source.
        Overrides:
        createRowImpl in class WebSite
      • getRowImpl

        @Nullable
        protected Row getRowImpl​(@Nonnull
                                 Entity anEntity,
                                 java.lang.Object aPrimaryValue)
        Returns a row for a given entity and primary value.
        Overrides:
        getRowImpl in class WebSite
      • getRowsImpl

        @Nonnull
        protected java.util.List<Row> getRowsImpl​(Entity anEntity,
                                                  Query aQuery)
        Returns a set of rows for the given properties and condition.
        Specified by:
        getRowsImpl in class WebSite
      • saveRowImpl

        protected void saveRowImpl​(Row aRow)
                            throws java.lang.Exception
        Inserts or updates a given row.
        Specified by:
        saveRowImpl in class WebSite
        Throws:
        java.lang.Exception
      • deleteRowImpl

        protected void deleteRowImpl​(Row aRow)
                              throws java.lang.Exception
        Deletes a given row.
        Specified by:
        deleteRowImpl in class WebSite
        Throws:
        java.lang.Exception
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent anEvent)
        Override to track changed rows.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Overrides:
        propertyChange in class WebSite
      • addAutosaveRow

        protected void addAutosaveRow​(Row aRow)
        Adds a Row to AutosaveRows set.
      • refresh

        public void refresh()
        Override to forward to real data source.
        Overrides:
        refresh in class WebSite
      • flushImpl

        protected void flushImpl()
                          throws java.lang.Exception
        Override to save SettingsFile and AutosaveRows.
        Overrides:
        flushImpl in class WebSite
        Throws:
        java.lang.Exception
      • get

        public static SnapSite get​(WebSite aSite)
        Returns the SnapSite for a given site.