Adding nemo engine.
[nemo.git] / nemo-impl / src / main / java / org / opendaylight / nemo / user / advancedquery / AdvancedQuery.java
1 /*\r
2  * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html\r
7  */\r
8 package org.opendaylight.nemo.user.advancedquery;\r
9 \r
10 import org.opendaylight.nemo.user.tenantmanager.AAA;\r
11 import org.opendaylight.nemo.user.tenantmanager.TenantManage;\r
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;\r
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.AdvancedNemoQueryInput;\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.Users;\r
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.advanced.nemo.query.input.QueryCondition;\r
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Objects;\r
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Operations;\r
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;\r
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Connection;\r
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Flow;\r
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.objects.Node;\r
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.operations.Operation;\r
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.User;\r
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.users.UserKey;\r
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.flow.instance.MatchItem;\r
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.flow.instance.Property;\r
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.property.instance.property.values.IntValue;\r
28 import com.google.common.base.Optional;\r
29 import com.google.common.util.concurrent.FutureCallback;\r
30 import com.google.common.util.concurrent.Futures;\r
31 import com.google.common.util.concurrent.ListenableFuture;\r
32 import org.opendaylight.controller.md.sal.binding.api.DataBroker;\r
33 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;\r
34 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;\r
35 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;\r
36 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;\r
37 \r
38 import org.slf4j.Logger;\r
39 import org.slf4j.LoggerFactory;\r
40 \r
41 import java.util.List;\r
42 \r
43 /**\r
44  * Created by z00293636 on 2015/8/29.\r
45  */\r
46 public class AdvancedQuery\r
47 {\r
48     private DataBroker dataBroker;\r
49     private TenantManage tenantManage;\r
50     private QueryDefinitionCheck queryDefinitionCheck;\r
51     private Objects objects;\r
52     private Operations operations;\r
53     private List<Results> resultsList;\r
54     private static final Logger LOG = LoggerFactory.getLogger(QueryDefinitionCheck.class);\r
55 \r
56     public AdvancedQuery(DataBroker dataBroker, TenantManage tenantManage)\r
57     {\r
58         this.dataBroker = dataBroker;\r
59         this.tenantManage = tenantManage;\r
60         queryDefinitionCheck = new QueryDefinitionCheck(dataBroker);\r
61         objects = null;\r
62         operations = null;\r
63         resultsList = null;\r
64     }\r
65 \r
66     public String advancedQuery(AAA aaa, AdvancedNemoQueryInput input)\r
67     {\r
68         String errorInfo = null;\r
69         List<QueryCondition> queryConditionList = null;\r
70 \r
71         errorInfo = aaa.CheckUser(input.getUserId(),input.getUserName(),input.getUserPassword(),input.getUserRole());\r
72 \r
73         if (errorInfo != null)\r
74         {\r
75             return errorInfo;\r
76         }\r
77         else\r
78         {\r
79             if (input.getQueryCondition() != null)\r
80             {\r
81                 queryConditionList = input.getQueryCondition();\r
82                 for (QueryCondition queryCondition : queryConditionList)\r
83                 {\r
84                     errorInfo = queryDefinitionCheck.CheckQueryDefinition(queryCondition);\r
85                     if (errorInfo != null)\r
86                     {\r
87                         break;\r
88                     }\r
89                 }\r
90             }\r
91         }\r
92         return errorInfo;\r
93     }\r
94 \r
95     public String getAdvancedQueryReuslt(AdvancedNemoQueryInput advancedNemoQueryInput)\r
96     {\r
97         UserId userId = advancedNemoQueryInput.getUserId();\r
98         List<QueryCondition> queryConditionList = advancedNemoQueryInput.getQueryCondition();\r
99         String queryResult = null;\r
100 \r
101         for (QueryCondition queryCondition : queryConditionList)\r
102         {\r
103             if (queryCondition.getQueryIntentType() != null)\r
104             {\r
105                 if (queryCondition.getQueryIntentType().getIntValue() == 0)\r
106                 {\r
107                     queryResult += nodeInstanceQuery(userId, queryCondition);\r
108                 }\r
109                 if (queryCondition.getQueryIntentType().getIntValue() == 1)\r
110                 {\r
111                     queryResult += connectionInstanceQuery(userId,queryCondition);\r
112                 }\r
113                 if (queryCondition.getQueryIntentType().getIntValue() == 2)\r
114                 {\r
115                     queryResult += flowInstanceQuery(userId,queryCondition);\r
116                 }\r
117                 if (queryCondition.getQueryIntentType().getIntValue() == 3)\r
118                 {\r
119                     queryResult += operationsInstanceQuery(userId,queryCondition);\r
120                 }\r
121             }\r
122         }\r
123 \r
124         return queryResult;\r
125     }\r
126 \r
127     private String nodeInstanceQuery(UserId userId, QueryCondition queryCondition)\r
128     {\r
129         String queryResult = null;\r
130 \r
131         fetchObjectsInstance(userId);\r
132 \r
133         if (objects != null)\r
134         {\r
135             if (objects.getNode() != null)\r
136             {\r
137                 List<Node> nodeList = objects.getNode();\r
138 \r
139                 for (Node node : nodeList)\r
140                 {\r
141                     if (node.getProperty() != null)\r
142                     {\r
143                         for(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.node.instance.Property property : node.getProperty())\r
144                         {\r
145                             if (property.getPropertyName().equals(queryCondition.getQueryConditionName()))\r
146                             {\r
147                                 int operator = queryCondition.getQueryConditionMatchPattern().getIntValue();\r
148                                 List<IntValue> values =property.getPropertyValues().getIntValue();\r
149                                 if (operator == 0 && (property.getPropertyValues().getIntValue() != null))\r
150                                 {\r
151                                     for(IntValue value:values)\r
152                                     {\r
153                                         if (value.getValue()<queryCondition.getQueryConditionTargetValue().getIntValue())\r
154                                         {\r
155                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
156                                         }\r
157                                     }\r
158                                 }\r
159                                 if (operator == 1 && (property.getPropertyValues().getIntValue() != null))\r
160                                 {\r
161                                     for(IntValue value:values)\r
162                                     {\r
163                                         if (value.getValue()<=queryCondition.getQueryConditionTargetValue().getIntValue())\r
164                                         {\r
165                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
166                                         }\r
167                                     }\r
168                                 }\r
169                                 if (operator == 2 && (property.getPropertyValues().getIntValue() != null))\r
170                                 {\r
171                                     for(IntValue value:values)\r
172                                     {\r
173                                         if (value.getValue()==queryCondition.getQueryConditionTargetValue().getIntValue())\r
174                                         {\r
175                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
176                                         }\r
177                                     }\r
178                                 }\r
179                                 if (operator == 3 && (property.getPropertyValues().getIntValue() != null))\r
180                                 {\r
181                                     for(IntValue value:values)\r
182                                     {\r
183                                         if (value.getValue()!=queryCondition.getQueryConditionTargetValue().getIntValue())\r
184                                         {\r
185                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
186                                         }\r
187                                     }\r
188                                 }\r
189                                 if (operator == 4 && (property.getPropertyValues().getIntValue() != null))\r
190                                 {\r
191                                     for(IntValue value:values)\r
192                                     {\r
193                                         if (value.getValue()>queryCondition.getQueryConditionTargetValue().getIntValue())\r
194                                         {\r
195                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
196                                         }\r
197                                     }\r
198                                 }\r
199                                 if (operator == 5 && (property.getPropertyValues().getIntValue() != null))\r
200                                 {\r
201                                     for(IntValue value:values)\r
202                                     {\r
203                                         if (value.getValue()>=queryCondition.getQueryConditionTargetValue().getIntValue())\r
204                                         {\r
205                                             queryResult += node.getNodeId().toString()+node.getNodeName().toString()+node.getNodeType().toString()+node.getSubNode().toString()+node.getProperty().toString();\r
206                                         }\r
207                                     }\r
208                                 }\r
209                                 if (operator == 6 && (property.getPropertyValues().getIntValue() != null))\r
210                                 {\r
211                                     //between todo\r
212                                 }\r
213                             }\r
214                         }\r
215                     }\r
216 \r
217             }\r
218         }\r
219 \r
220         }\r
221 \r
222         return queryResult;\r
223     }\r
224 \r
225     private String connectionInstanceQuery(UserId userId, QueryCondition queryCondition)\r
226     {\r
227         String queryResult = null;\r
228 \r
229         fetchObjectsInstance(userId);\r
230         if (objects != null)\r
231         {\r
232             if (objects.getConnection() != null)\r
233             {\r
234                 List<Connection> connectionList = objects.getConnection();\r
235 \r
236                 for (Connection connection : connectionList)\r
237                 {\r
238                     if (connection.getProperty() != null)\r
239                     {\r
240                         for (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.object.rev151010.connection.instance.Property property : connection.getProperty())\r
241                         {\r
242                             if (property.getPropertyName().equals(queryCondition.getQueryConditionName()))\r
243                             {\r
244                                 int operator = queryCondition.getQueryConditionMatchPattern().getIntValue();\r
245                                 List<IntValue> values =property.getPropertyValues().getIntValue();\r
246                                 if (operator == 0 && (property.getPropertyValues().getIntValue() != null))\r
247                                 {\r
248                                     for(IntValue value:values)\r
249                                     {\r
250                                         if (value.getValue()<queryCondition.getQueryConditionTargetValue().getIntValue())\r
251                                         {\r
252                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
253                                         }\r
254                                     }\r
255                                 }\r
256                                 if (operator == 1 && (property.getPropertyValues().getIntValue() != null))\r
257                                 {\r
258                                     for(IntValue value:values)\r
259                                     {\r
260                                         if (value.getValue()<=queryCondition.getQueryConditionTargetValue().getIntValue())\r
261                                         {\r
262                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
263                                         }\r
264                                     }\r
265                                 }\r
266                                 if (operator == 2 && (property.getPropertyValues().getIntValue() != null))\r
267                                 {\r
268                                     for(IntValue value:values)\r
269                                     {\r
270                                         if (value.getValue()==queryCondition.getQueryConditionTargetValue().getIntValue())\r
271                                         {\r
272                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
273                                         }\r
274                                     }\r
275                                 }\r
276                                 if (operator == 3 && (property.getPropertyValues().getIntValue() != null))\r
277                                 {\r
278                                     for(IntValue value:values)\r
279                                     {\r
280                                         if (value.getValue()!=queryCondition.getQueryConditionTargetValue().getIntValue())\r
281                                         {\r
282                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
283                                         }\r
284                                     }\r
285                                 }\r
286                                 if (operator == 4 && (property.getPropertyValues().getIntValue() != null))\r
287                                 {\r
288                                     for(IntValue value:values)\r
289                                     {\r
290                                         if (value.getValue()>queryCondition.getQueryConditionTargetValue().getIntValue())\r
291                                         {\r
292                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
293                                         }\r
294                                     }\r
295                                 }\r
296                                 if (operator == 5 && (property.getPropertyValues().getIntValue() != null))\r
297                                 {\r
298                                     for(IntValue value:values)\r
299                                     {\r
300                                         if (value.getValue()>=queryCondition.getQueryConditionTargetValue().getIntValue())\r
301                                         {\r
302                                             queryResult += connection.getConnectionId().toString()+ connection.getConnectionName().toString()+connection.getConnectionType().toString()+connection.getEndNode().toString()+connection.getProperty().toString();\r
303                                         }\r
304                                     }\r
305                                 }\r
306                                 if (operator == 6 && (property.getPropertyValues().getIntValue() != null))\r
307                                 {\r
308                                     //between todo\r
309                                 }\r
310                             }\r
311                         }\r
312                     }\r
313 \r
314                 }\r
315             }\r
316         }\r
317 \r
318         return queryResult;\r
319     }\r
320 \r
321     private String flowInstanceQuery(UserId userId, QueryCondition queryCondition)\r
322     {\r
323         String queryResult = null;\r
324 \r
325         fetchObjectsInstance(userId);\r
326         if (objects != null)\r
327         {\r
328             if (objects.getFlow() != null)\r
329             {\r
330                 List<Flow> flowList = objects.getFlow();\r
331 \r
332                 for (Flow flow: flowList)\r
333                 {\r
334                     if (flow.getProperty() != null)\r
335                     {\r
336                         for (Property property : flow.getProperty())\r
337                         {\r
338                             if (property.getPropertyName().equals(queryCondition.getQueryConditionName()))\r
339                             {\r
340                                 int operator = queryCondition.getQueryConditionMatchPattern().getIntValue();\r
341                                 List<IntValue> values = property.getPropertyValues().getIntValue();\r
342                                 if (operator == 0 && (property.getPropertyValues().getIntValue() != null))\r
343                                 {\r
344                                     for(IntValue value:values)\r
345                                     {\r
346                                         if (value.getValue()<queryCondition.getQueryConditionTargetValue().getIntValue())\r
347                                         {\r
348                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
349                                         }\r
350                                     }\r
351                                 }\r
352                                 if (operator == 1 && (property.getPropertyValues().getIntValue() != null))\r
353                                 {\r
354                                     for(IntValue value:values)\r
355                                     {\r
356                                         if (value.getValue()<=queryCondition.getQueryConditionTargetValue().getIntValue())\r
357                                         {\r
358                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
359                                         }\r
360                                     }\r
361                                 }\r
362                                 if (operator == 2 && (property.getPropertyValues().getIntValue() != null))\r
363                                 {\r
364                                     for(IntValue value:values)\r
365                                     {\r
366                                         if (value.getValue()==queryCondition.getQueryConditionTargetValue().getIntValue())\r
367                                         {\r
368                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
369                                         }\r
370                                     }\r
371                                 }\r
372                                 if (operator == 3 && (property.getPropertyValues().getIntValue() != null))\r
373                                 {\r
374                                     for(IntValue value:values)\r
375                                     {\r
376                                         if (value.getValue()!=queryCondition.getQueryConditionTargetValue().getIntValue())\r
377                                         {\r
378                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
379                                         }\r
380                                     }\r
381                                 }\r
382                                 if (operator == 4 && (property.getPropertyValues().getIntValue() != null))\r
383                                 {\r
384                                     for(IntValue value:values)\r
385                                     {\r
386                                         if (value.getValue()>queryCondition.getQueryConditionTargetValue().getIntValue())\r
387                                         {\r
388                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
389                                         }\r
390                                     }\r
391                                 }\r
392                                 if (operator == 5 && (property.getPropertyValues().getIntValue() != null))\r
393                                 {\r
394                                     for(IntValue value:values)\r
395                                     {\r
396                                         if (value.getValue()>=queryCondition.getQueryConditionTargetValue().getIntValue())\r
397                                         {\r
398                                             queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
399                                         }\r
400                                     }\r
401                                 }\r
402                                 if (operator == 6 && (property.getPropertyValues().getIntValue() != null))\r
403                                 {\r
404                                     //between todo\r
405                                 }\r
406                             }\r
407                         }\r
408                     }\r
409                     if (flow.getMatchItem() != null)\r
410                     {\r
411                         for(MatchItem matchItem: flow.getMatchItem())\r
412                         {\r
413                             if (matchItem.getMatchItemName().equals(queryCondition.getQueryConditionName()))\r
414                             {\r
415                                 int operator = queryCondition.getQueryConditionMatchPattern().getIntValue();\r
416                                 if (operator == 0 && matchItem.getMatchItemValue().getIntValue()<queryCondition.getQueryConditionTargetValue().getIntValue())\r
417                                 {\r
418                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
419                                 }\r
420                                 if (operator == 1 && matchItem.getMatchItemValue().getIntValue()<=queryCondition.getQueryConditionTargetValue().getIntValue())\r
421                                 {\r
422                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
423                                 }\r
424                                 if (operator == 2 && matchItem.getMatchItemValue().getIntValue()==queryCondition.getQueryConditionTargetValue().getIntValue())\r
425                                 {\r
426                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
427                                 }\r
428                                 if (operator == 3 && matchItem.getMatchItemValue().getIntValue()!=queryCondition.getQueryConditionTargetValue().getIntValue())\r
429                                 {\r
430                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
431                                 }\r
432                                 if (operator == 4 && matchItem.getMatchItemValue().getIntValue()>queryCondition.getQueryConditionTargetValue().getIntValue())\r
433                                 {\r
434                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
435                                 }\r
436                                 if (operator == 5 && matchItem.getMatchItemValue().getIntValue()>=queryCondition.getQueryConditionTargetValue().getIntValue())\r
437                                 {\r
438                                     queryResult += flow.getFlowId().toString() + flow.getFlowName().toString() + flow.getMatchItem().toString() + flow.getProperty().toString();\r
439                                 }\r
440                                 if (operator == 6 )\r
441                                 {\r
442                                     //todo\r
443                                 }\r
444                             }\r
445                         }\r
446                     }\r
447                 }\r
448             }\r
449         }\r
450 \r
451         return queryResult;\r
452     }\r
453 \r
454     private String operationsInstanceQuery(UserId userId, QueryCondition queryCondition)\r
455     {\r
456         String queryResult = null;\r
457         fetchOperationsInstance(userId);\r
458         List<Operation> operationList = operations.getOperation();\r
459 \r
460         //todo\r
461 \r
462       return queryResult;\r
463     }\r
464 \r
465 \r
466     private void fetchObjectsInstance(UserId userId)\r
467     {\r
468         UserKey userKey = new UserKey(userId);\r
469         InstanceIdentifier<Objects> objectsId = InstanceIdentifier.builder(Users.class).child(User.class, userKey).child(Objects.class).build();\r
470         ListenableFuture<Optional<Objects>> objectsFuture = dataBroker.newReadOnlyTransaction().read(LogicalDatastoreType.CONFIGURATION, objectsId);\r
471         Futures.addCallback(objectsFuture, new FutureCallback<Optional<Objects>>() {\r
472             @Override\r
473             public void onSuccess(Optional<Objects> result)\r
474             {\r
475                 setObjects(result.get());\r
476                 return;\r
477             }\r
478 \r
479             @Override\r
480             public void onFailure(Throwable t)\r
481             {\r
482                 LOG.error("Can not read objects instances.", t);\r
483 \r
484                 return;\r
485             }\r
486         });\r
487     }\r
488 \r
489     private void fetchOperationsInstance(UserId userId)\r
490     {\r
491         UserKey userKey = new UserKey(userId);\r
492         InstanceIdentifier<Operations> operationsId = InstanceIdentifier.builder(Users.class).child(User.class, userKey).child(Operations.class).build();\r
493         ListenableFuture<Optional<Operations>> operationsFuture = dataBroker.newReadOnlyTransaction().read(LogicalDatastoreType.CONFIGURATION, operationsId);\r
494         Futures.addCallback(operationsFuture, new FutureCallback<Optional<Operations>>() {\r
495             @Override\r
496             public void onSuccess(Optional<Operations> result)\r
497             {\r
498                 setOperations(result.get());\r
499                 return;\r
500             }\r
501 \r
502             @Override\r
503             public void onFailure(Throwable t)\r
504             {\r
505                 LOG.error("Can not read operations instances.", t);\r
506 \r
507                 return;\r
508             }\r
509         });\r
510     }\r
511 \r
512     private void setObjects(Objects objects)\r
513     {\r
514         this.objects = objects;\r
515     }\r
516     private void setOperations(Operations operations)\r
517     {\r
518         this.operations = operations;\r
519     }\r
520 \r
521 }\r