summaryrefslogtreecommitdiff
path: root/storage/ndb/src/cw/cpcc-win32/csharp/Process.cs
blob: 6feee5c5b416978b713dc53b808d59e85141b56d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* Copyright (c) 2004, 2005 MySQL AB

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; version 2 of the License.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace NDB_CPC
{
	/// <summary>
	/// Summary description for Process.
	/// </summary>
	public class Process 
	{
		public enum Status {Running, Stopped, Unknown}
		private string m_id;
		protected string m_name;
		private Status m_status;
		private Computer m_computer;
		private string m_owner;
		private string m_cwd;
		private string m_type;
		private string m_path;
		private string m_other;
		private string m_args;
		private string m_env;
		private string m_database;
		private string m_connectString;
		private bool m_defined;
		public Process( string name, 
					string owner, string database,
					Computer computer)
		{
			m_name=name;
			m_owner=owner;
			m_computer=computer;
			m_status=Status.Unknown;
			m_database=database;
			m_defined=false;
			m_path="";
			m_cwd="";
			m_args="";
			m_other="";
		}
		public Process()
		{
			
		}
		public Process(string id)
		{
			m_id=id;
		}

		public Process( string name, 
					 string database,
			Computer computer)
		{
			m_name=name;
			m_computer=computer;
			m_status=Status.Unknown;
			m_database=database;
			m_defined=false;
		}

		public Process( string name, 
			Computer computer)
		{
			m_name=name;
			m_computer=computer;
			m_status=Status.Unknown;
			m_defined=false;
		}


		public string getStatusString() 
		{
			if(m_status.Equals(Status.Running))
				return "Running";
			if(m_status.Equals(Status.Stopped))
				return "Stopped";
			return "Unknown";
		}

		public Computer getComputer() {return m_computer;}
		public string getName() {return m_name;}
		public string getDatabase() {return m_database;}
		public string getOwner() {return m_owner;}
		public string getId() {return m_id;}
		public void setId(string id) {m_id=id;}
	
		public void setCwd(string cwd) {m_cwd=cwd;}
		public void setPath(string path) {m_path=path;}
		public void setArgs(string args) {m_args=args;}
		public void setOther(string other) {m_other=other;}
		public void setEnv(string env) {m_env=env;}
		public void setName(string name) {m_name=name;}
		public void setOwner(string owner) {m_owner=owner;}
		public void setDatabase(string db) {m_database=db;}
		public void setComputer(Computer c) {m_computer=c;}
		

		public string getCwd() {return m_cwd;}
		public string getPath() {return m_path;}
		public string getArgs() {return m_args;}
		public string getOther() {return m_other;}
		public string getEnv() {return m_env;}

		public bool isDefined() {return m_defined;}
		public void setDefined(bool defined) 
		{
			m_defined=defined;
		}

		public Status getStatus() 
		{
			return m_status;
		}

		public void setConnectString(string cs)
		{
			m_connectString=cs;
		}

		public string getConnectString()
		{
			return m_connectString;
		}
		public void setStatus(Status status) 
		{
			m_status=status;
		}


		public void setProcessType(string type)
		{
			 m_type=type;
		}
		public string getProcessType()
		{
			return m_type;
		}
		
	}
}