1: <?php
2:
3: namespace Project_Authority;
4:
5: //----------------------------------------------------------------------
6: // Copyright (c) 2012 Raytheon BBN Technologies
7: //
8: // Permission is hereby granted, free of charge, to any person obtaining
9: // a copy of this software and/or hardware specification (the "Work") to
10: // deal in the Work without restriction, including without limitation the
11: // rights to use, copy, modify, merge, publish, distribute, sublicense,
12: // and/or sell copies of the Work, and to permit persons to whom the Work
13: // is furnished to do so, subject to the following conditions:
14: //
15: // The above copyright notice and this permission notice shall be
16: // included in all copies or substantial portions of the Work.
17: //
18: // THE WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19: // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20: // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21: // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22: // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23: // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24: // OUT OF OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS
25: // IN THE WORK.
26: //----------------------------------------------------------------------
27:
28:
29: /**
30: * GENI Clearinghouse Project Authority (PA) controller interface
31: * <br><br>
32: * The PA maintains a list of projects, their details and members and provides access
33: * to creating, looking up, updating, deleting projects.
34: * <br><br>
35: * Supports these methods:
36: <ul>
37: <li> project_id <= create_project(project_name, lead_id, lead_email, purpose) </li>
38: <li> success <= delete_project(project_id); </li>
39: <li> [project_name, lead_id, project_email, project_purpose] <= lookup_project(project_id); </li>
40: <li> success <= update_project(project_id, project_email, project_purpose); </li>
41: <li> success <= change_lead(project_id, previous_lead_id, new_lead_id); </li>
42: <li> success <= add_project_member(project_id, member_id, role) </li>
43: <li> success <= remove_project_member(project_id, member_id) </li>
44: <li> success <= change_member_role(project_id, member_id, role) </li>
45: <li> [member_id, role]* <= get_project_members(project_id, role=null) </li>
46: <li> [project_id]* <= get_projects_for_member(member_id, is_member, role=null) </li>
47: </ul>
48: **/
49: class Project_Authority {
50:
51: /**
52: * Create and register new project within clearinghouse
53: *
54: * @param dict $args_dict Dictionary containing name/value pairs:
55: <ul>
56: <li>"operation" : name of this method ("create_project")</li>
57: <li>"project_name" : name of project being created</li>
58: <li>"lead_id" : UUID of project lead</li>
59: <li>"project_purpose" : description of project purpose</li>
60: </ul>
61: * @return boolean Success/Failure
62: *
63: */
64: function create_project($args_dict)
65: {
66: }
67:
68: /**
69: * Delete given project of given ID
70: *
71: * @param dict $args_dict Dictionary containing name/value pairs:
72: <ul>
73: <li>"operation" : name of this method ("delete_project")</li>
74: <li>"project_id" : ID of project to be deleted</li>
75: </ul>
76: * @return boolean Success/Failure
77: *
78: */
79: function delete_project($args_dict)
80: {
81: }
82:
83: /**
84: * Update details of given project
85: *
86: * @param dict $args_dict Dictionary containing name/value pairs:
87: <ul>
88: <li>"operation" : name of this method ("update_project")</li>
89: <li>"project_id" : ID of project to be modified</li>
90: <li>"project_name" : new name of project</li>
91: <li>"project_purpose" : new purpose of project</li>
92: </ul>
93: * @return boolean Success/Failure
94: */
95: function update_project($args_dict)
96: {
97: }
98:
99: /**
100: * Update lead of given project
101: *
102: * @param dict $args_dict Dictionary containing name/value pairs:
103: <ul>
104: <li>"operation" : name of this method ("change_lead")</li>
105: <li>"project_id" : ID of project to be modified</li>
106: <li>"previous_lead_id" : ID of previous project lead</li>
107: <li>"lead_id" : ID of new project lead</li>
108: </ul>
109: * @return boolean Success/Failure
110: */
111: function change_lead($args_dict)
112: {
113: }
114:
115: /**
116: * Add a member of given role to given project
117: *
118: * @param dict $args_dict Dictionary containing name/value pairs:
119: <ul>
120: <li>"operation" : name of this method ("add_project_member")</li>
121: <li>"project_id" : ID of project to be modified</li>
122: <li>"member_id : ID of member to be associated with given project</li>
123: <li>"role_type" : role of member within project</li>
124: </ul>
125: * @return boolean Success/Failure
126: */
127: function add_project_member($args_dict)
128: {
129: }
130:
131: /**
132: * Remove a member from given project
133: *
134: * @param dict $args_dict Dictionary containing name/value pairs:
135: <ul>
136: <li>"operation" : name of this method ("remove_project_member")</li>
137: <li>"project_id" : ID of project to be modified</li>
138: <li>"member_id : ID of member to be disassociated with given project</li>
139: </ul>
140: * @return boolean Success/Failure
141: */
142: function remove_project_member($args_dict)
143: {
144: }
145:
146: /**
147: * Change role of given member in given project
148: *
149: * @param dict $args_dict Dictionary containing name/value pairs:
150: <ul>
151: <li>"operation" : name of this method ("change_member_role")</li>
152: <li>"project_id" : ID of project to be modified</li>
153: <li>"member_id : ID of member whose role within project is to be modified</li>
154: <li>"role_type" : role to be associated with given member</li>
155: </ul>
156: * @return boolean Success/Failure
157: */
158: function change_member_role($args_dict)
159: {
160: }
161:
162: /**
163: * Return list of all project ID's, optionally limited by lead_id
164: *
165: * @param dict $args_dict Dictionary containing name/value pairs:
166: <ul>
167: <li>"operation" : name of this method ("get_projects")</li>
168: <li>"lead_id" : ID of lead of projects to be provided [optional]</li>
169: </ul>
170: * @return array List of project IDs associated with given lead ID (if provided)
171: *
172: */
173: function get_projects($args_dict)
174: {
175: }
176:
177: /**
178: * Return list of all projects and data.
179: * Optionally, filtered by lead_id if provided
180: *
181: * @param dict $args_dict Dictionary containing name/value pairs:
182: <ul>
183: <li>"operation" : name of this method ("lookup_projects")</li>
184: <li>"lead_id" : ID of lead of projects to be provided [optional]</li>
185: </ul>
186: * @return array List of project ID, project name, lead_id, project_email, creation time and project purpose for projects of given lead ID (if provided)
187: *
188: */
189: function lookup_projects($args_dict)
190: {
191: }
192:
193:
194: /**
195: * Return information about project with given ID or name
196: * Optionally, filtered by lead_id if provided
197: *
198: * @param dict $args_dict Dictionary containing name/value pairs:
199: <ul>
200: <li>"operation" : name of this method ("lookup_project")</li>
201: <li>"lead_id" : ID of lead of project [optional]</li>
202: <li>"project_id" : ID of project to be provided </li>
203: <li>"project_name" : name of project to be provided </li>
204: <li> NOTE: At least one of preceding two tags is required </li>
205: </ul>
206: * @return dict Project ID, project name, lead_id, project_email, creation time
207: * and project purpose for projects of given lead ID (if provided)
208: *
209: */
210: function lookup_project($args_dict)
211: {
212: }
213:
214: /**
215: * Return list of member ID's and roles associated with given project.<br>
216: * If role is provided, filter to members of given role
217: *
218: * @param dict $args_dict Dictionary containing name/value pairs:
219: <ul>
220: <li>"operation" : name of this method ("get_project_members")</li>
221: <li>"project_id" : ID of project to be modified</li>
222: <li>"role_type" : role filter to be applied to query [optional]</li>
223: </ul>
224: * @return array List of (member_id, role) tuples for members of given project
225: */
226: function get_project_members($args_dict)
227: {
228:
229: }
230:
231: /**
232: * Return list of project ID's for given member_id
233: * <br>
234: * Optionally indicate sense of 'is member' or 'is not member'
235: * <br>If is_member is true, return projects for which member is a member
236: * <br>If is_member is false, return projects for which member is NOT a member
237: * <br>
238: * <br>Optionally indicate role type of member
239: * <br>If role is provided, filter on projects
240: * <br> for which member has given role (is_member = true)
241: * <br> for which member does NOT have given role (is_member = false)
242: *
243: * @param dict $args_dict Dictionary containing name/value pairs:
244: <ul>
245: <li>"operation" : name of this method ("get_projects_for_member")</li>
246: <li>"member_id" : ID of member about which projects are being queried </li>
247: <li>"is_member" : determines sense of 'member_id' query match [optional]</li>
248: <li>"role_type" : role associated with given member [optional]</li>
249: </ul>
250: * @return arrary List of ID's of given projects
251: */
252: function get_projects_for_member($args_dict)
253: {
254: }
255:
256: /**
257: * Get the version of the API of this particular service provider
258: * @param dict $args_dict Dictionary containing 'operation' argument
259: * @return number Version of API of this particular service provider
260: */
261: function get_version($args_dict)
262: {
263: }
264:
265: }
266:
267: ?>
268: