Grooper.Services.ImportWatcher

Import Watcher is a Grooper service which periodically polls an external storage platform, importing new documents as they become available. Periodically executes an Import Provider to query or poll for documents which meet specific criteria. When matching documents are found, they are imported to Grooper. After import, the imported objects are moved, deleted, or modified so that they are not imported again on the next polling cycle.


Inherits from: Grooper.Services.TimerService

Constructors

Signature Description
New (gdb As GrooperDb)
Parameters
gdb
          Type: GrooperDb
          

Fields

Field Name Field Type Description
Database As Grooper.GrooperDb Grooper.GrooperDb
Id As System.Int32 System.Int32
LastError As System.String System.String
LastStatus As System.ServiceProcess.ServiceControllerStatus System.ServiceProcess.ServiceControllerStatus Can be one of the following values:
  • Stopped: The service is not running. This corresponds to the Win32 SERVICE_STOPPED constant, which is defined as 0x00000001.
  • StartPending: The service is starting. This corresponds to the Win32 SERVICE_START_PENDING constant, which is defined as 0x00000002.
  • StopPending: The service is stopping. This corresponds to the Win32 SERVICE_STOP_PENDING constant, which is defined as 0x00000003.
  • Running: The service is running. This corresponds to the Win32 SERVICE_RUNNING constant, which is defined as 0x00000004.
  • ContinuePending: The service continue is pending. This corresponds to the Win32 SERVICE_CONTINUE_PENDING constant, which is defined as 0x00000005.
  • PausePending: The service pause is pending. This corresponds to the Win32 SERVICE_PAUSE_PENDING constant, which is defined as 0x00000006.
  • Paused: The service is paused. This corresponds to the Win32 SERVICE_PAUSED constant, which is defined as 0x00000007.
MachineName As System.String System.String
Password_Encrypted As System.String System.String
RestrictedMode As System.Boolean System.Boolean Disables certain properties when in Grooper Admin. See IsPropertyEnabled()
Tag As System.Object System.Object

Properties

Property Name Property Type Description
AsSeviceEntry Grooper.ServiceEntry Returns the Service Instance as a ServiceEntry.
EnableScheduling System.Boolean Enable or disable Scheduling Options
EndTime System.DateTime Latest time the service is permitted to run each day
HasDBRow System.Boolean Returns true if a database row exists for this service instance.
HasReferenceProperties System.Boolean Returns true if the object has properties which reference Grooper Node objects.
HasValidId System.Boolean Returns true if this object has a valid row ID, indicating that it has been stored to the database.
IsEmpty System.Boolean Returns true if all properties with a ViewableAttribute are set to their default value.
IsLicenseServer System.Boolean Returns true if this service instance is an instance of Grooper.Services.LicenseServer.
IsProcessingModule System.Boolean Returns true if this service instance is an instance of Grooper.Services.ActivityProcessing.
IsWriteable System.Boolean Returns true if the object is writable, or false if it is not.
MaximumConsecutiveErrors System.Int32 The number of consecutive errors that can occur in the Tick event before a critical stop will be raised, stopping the timer service. Setting this property to zero will allow exceptions to repeatedly occur without raising a critical stop.
MinimumItems System.Int32 Minimum number of objects required to trigger an import.
Password System.String The password for the user account under which the service should run.
PgServiceDisplayName System.String The display name for the service.
PgServiceName System.String The name for the service.
Provider Grooper.Core.ImportProvider Defines settings for the Import Provider. When using Import Watcher, it is important to configure the Import Provider in way that prevents repeated import of the same objects. After an object is imported, something about the imported object must be changed so that it does not qualify for import on the next polling cycle. More specifically, this means that one of the following methods must be employed:
  • Delete the source objects on import. Simple solution, but not always practical and precludes use of sparse imports.
  • Move the source objects to a new folder which is outside the scope of the import process.
  • Update properties on the source objects so that they no longer match the query or filter used for import.
If one of these methods is not employed, Import Watcher will simply import the same set of files over and over again.
ProviderTypeName System.String The type of Import Provider to use.
Repository Grooper.DataSource The repository to which this service instance is bound. Service instances are bound permanently to a Grooper repository. To change to repository, delete the service instance and reinstall it using the desired repository.
RepositoryId System.Guid The Repository Id of the Service Instance pertains to.
RepositoryName System.String Returns the name of the Grooper repository this service instance is linked to.
Root Grooper.GrooperRoot Returns the root node
RunDaysOfWeek Grooper.Services.TimerService.DaysOfWeek A variable determining whether the service should run or not on each day of the week If StartTime and EndTime are left at their default values of 12:00:00 AM, then time of day will not be considered for service scheduling.A combination of the following flags:
  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
ServiceDescription System.String The description of the Windows service.
ServiceDisplayName System.String The display name of the Windows service.
ServiceInstancingId System.String A unique identifier for this service type.
ServiceName System.String The name of the Windows service.
StartTime System.DateTime Earliest time the service is permitted to run each day If StartTime and EndTime are left at their default values of 12:00:00 AM, then time of day will not be considered for service scheduling.
ThreadPriority System.Threading.ThreadPriority The priority level with which threads will be created. If the service is running on a workstation, a priority lower than normal will help prevent the service from impacting the user interface responsiveness.Can be one of the following values:
  • Lowest: The thread can be scheduled after threads with any other priority.
  • BelowNormal: The thread can be scheduled after threads with Normal priority and before those with Lowest priority.
  • Normal: The thread can be scheduled after threads with AboveNormal priority and before those with BelowNormal priority. Threads have Normal priority by default.
  • AboveNormal: The thread can be scheduled after threads with Highest priority and before those with Normal priority.
  • Highest: The thread can be scheduled before threads with any other priority.
TimerInterval System.Int32 Represents the time, in seconds, before the Tick event is raised relative to the completion of the last occurrence of the Tick event. For example, if the Timer Interval is set to five minutes (300 seconds), the Tick event will fire 5 minutes after each execution completes:
  • 1. The service/timer is started (12:00:00).
  • 2. The "Tick" event fires (12:00:00).
  • 3. The "Tick" event takes two minutes to complete (12:02:00).
  • 4. The second "Tick" event fires (12:07:00).
TypeName System.String Returns the full type name of this service instance.
UserName System.String The user account under which the service should run. The account specified must:
  • Have the Logon as Service permission on the machine on which the service is to run.
  • Have access to the Grooper database, if Windows security is being used for SQL connections.
  • Have access to the Grooper file store location.

Methods

Method Name Description
AddNew() As Boolean Add this object to the database as a new row.
ClearId() Clears the database row ID from this object, thereby disassociating it from the database row.
Delete() As Boolean Deletes the database row associated with this object.
ExecuteServiceControl(InstallLog As String&, CommandText As String) As Boolean Runs the service controller for the service instance.
Parameters
InstallLog
          Type: String&
          
 
CommandText
          Type: String
          
GetProperties() As PropertyDescriptorCollection
GetReferences() As List(Of GrooperNode) Returns a list of GrooperNode objects referenced in the properties of this object.
GetServiceController() As ServiceController Gets the service controller for the service instance.
GetServiceStatus() As ServiceControllerStatus Queries the status of the service instance.
Install(InstallLog As String&) As Boolean Installs the service instance.
Parameters
InstallLog
          Type: String&
          
IsPropertyEnabled(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently enabled.
Parameters
PropertyName
          Type: String
          The name of the property to determine the enabled state for.
IsPropertyVisible(PropertyName As String) As Nullable(Of Boolean) Defines whether a property is currently visible.
Parameters
PropertyName
          Type: String
          The name of the property to determine the visible state for.
IsType(Type As Type) As Boolean Returns true if the object is of the type specified, or if it derives from the type specfied.
Parameters
Type
          Type: Type
          The type to check.
OnStart() As Boolean Handles starting of the TimerServiceInstance.
OnStop() As Boolean Handles stopping of the TimerServiceInstance.
RaiseCriticalStopEvent(Message As String)
Parameters
Message
          Type: String
          
RaiseCriticalStopEvent(ex As Exception)
Parameters
ex
          Type: Exception
          
Serialize() As String Serializes the object.
SetDatabase(Database As GrooperDb) Sets the database connection of the object.
Parameters
Database
          Type: GrooperDb
          
SetPassword(Password As String)
Parameters
Password
          Type: String
          
ShouldRunToday() As Boolean
StartService() As Boolean Start the service instance.
StopService() As Boolean Stop the service instance.
Tick() Called each time the timer counts down to zero. Classes inheriting from TimerServiceInstance override this method to handle.
ToString() As String Returns a string value representation of the connected object.
Uninstall(InstallLog As String&) As Boolean Uninstalls the service instance.
Parameters
InstallLog
          Type: String&
          
Update() As Boolean Updates the web service instance in the Grooper database.
UpdateLogin() As Boolean
ValidateProperties() As ValidationErrorList Validates the Service Instance.