Grooper.ServiceInstance

A Service Instance is a Grooper Service that has been installed on a Server or Workstation. Service instances must be installed from Grooper Configuration, using the Service Manager control on the Services Tab. After initial installation, service instances may be started, stopped, or configured using the Service Instance Viewer control in Grooper Design Studio. The Service Instance Viewer can be accessed from the property panel of any Machine object in Grooper Design Studio. To manage all services for an entire Grooper repository, use the Service Instance Viewer found on the Machines Folder (immediately below the Infrastructure Folder).


Inherits from: Grooper.ViewableDatabaseObject

Constructors

Signature Description
New (Database As GrooperDb) Initializes a new instance of the ServiceInstance class.
Parameters
Database
          Type: GrooperDb
          The associated Grooper database.

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.
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.
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.
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
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.
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.
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.
DeleteServiceInstance(Database As GrooperDb, MachineName As String, ServiceName As String)
Parameters
Database
          Type: GrooperDb
          
 
MachineName
          Type: String
          
 
ServiceName
          Type: String
          
ExecuteServiceControl(InstallLog As String&, CommandText As String) As Boolean Runs the service controller for the service instance.
Parameters
InstallLog
          Type: String&
          
 
CommandText
          Type: String
          
FromDR(Database As GrooperDb, dr As IDataReader) As ServiceInstance
Parameters
Database
          Type: GrooperDb
          
 
dr
          Type: IDataReader
          
GetHighestInstanceNo(Database As GrooperDb, MachineName As String, ServiceInstancingId As String) As Int32
Parameters
Database
          Type: GrooperDb
          
 
MachineName
          Type: String
          
 
ServiceInstancingId
          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.
LoadServiceInstance(Database As GrooperDb, MachineName As String, ServiceName As String) As ServiceInstance
Parameters
Database
          Type: GrooperDb
          
 
MachineName
          Type: String
          
 
ServiceName
          Type: String
          
NewInstance(Database As GrooperDb, TypeName As String) As ServiceInstance
Parameters
Database
          Type: GrooperDb
          
 
TypeName
          Type: String
          
OnStart() As Boolean
OnStop() As Boolean
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
          
StartService() As Boolean Start the service instance.
StopService() As Boolean Stop the service instance.
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.

Events

Event Name Description
CriticalStop(sender As Object, e As CriticalStopEventArgs) Fired each time a critical error occurs that causes the service instance to stop.

CriticalStopEventArgs
Message
 Type: String
 An error message indicating the reason for the Critical Stop.
 
ex
 Type: Exception