| 1 | /* | |
| 2 | * Copyright 1999-2006 University of Chicago | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | ||
| 18 | #include "NotificationConsumerFactoryService_skeleton.h" | |
| 19 | #include "NotificationConsumerFactoryService_internal_skeleton.h" | |
| 20 | ||
| 21 | #include "globus_notification_consumer.h" | |
| 22 | ||
| 23 | globus_result_t | |
| 24 | NotificationConsumerFactoryService_init( | |
| 25 | globus_service_descriptor_t * service_desc) | |
| 26 | 0 | { |
| 27 | GlobusFuncName(NotificationConsumerFactoryService_init); | |
| 28 | 0 | NotificationConsumerFactoryServiceDebugEnter(); |
| 29 | ||
| 30 | /* do any service specific init stuff here, such | |
| 31 | * as loading other operation providers and setting them | |
| 32 | * in the operation table of the service descriptor. This | |
| 33 | * function is called at the end of service activation. | |
| 34 | */ | |
| 35 | ||
| 36 | 0 | NotificationConsumerFactoryServiceDebugExit(); |
| 37 | 0 | return GLOBUS_SUCCESS; |
| 38 | } | |
| 39 | ||
| 40 | globus_result_t | |
| 41 | NotificationConsumerFactoryService_finalize( | |
| 42 | globus_service_descriptor_t * service_desc) | |
| 43 | 0 | { |
| 44 | GlobusFuncName(NotificationConsumerFactoryService_finalize); | |
| 45 | 0 | NotificationConsumerFactoryServiceDebugEnter(); |
| 46 | ||
| 47 | /* do any service specific finalize stuff here, | |
| 48 | * opposite of NotificationConsumerFactoryService_init | |
| 49 | */ | |
| 50 | ||
| 51 | 0 | NotificationConsumerFactoryServiceDebugExit(); |
| 52 | 0 | return GLOBUS_SUCCESS; |
| 53 | } | |
| 54 | ||
| 55 | ||
| 56 | static | |
| 57 | void | |
| 58 | globus_l_notify_callback( | |
| 59 | void * arg, | |
| 60 | wsnt_TopicExpressionType * topic, | |
| 61 | wsa_EndpointReferenceType * producer, | |
| 62 | xsd_any * message) | |
| 63 | 0 | { |
| 64 | 0 | printf("Notification delivered\n"); |
| 65 | 0 | } |
| 66 | /* globus_l_notify_callback() */ | |
| 67 | ||
| 68 | globus_result_t | |
| 69 | NotificationConsumerFactory_createNotificationConsumer_impl( | |
| 70 | globus_service_engine_t engine, | |
| 71 | globus_soap_message_handle_t message, | |
| 72 | globus_service_descriptor_t * descriptor, | |
| 73 | createNotificationConsumerType * createNotificationConsumer, | |
| 74 | wsa_EndpointReferenceType * createNotificationConsumerResponse, | |
| 75 | xsd_any * fault) | |
| 76 | 0 | { |
| 77 | /* add function local variable declarations here */ | |
| 78 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 79 | ||
| 80 | GlobusFuncName(NotificationConsumerFactory_createNotificationConsumer_impl); | |
| 81 | 0 | NotificationConsumerFactoryServiceDebugEnter(); |
| 82 | ||
| 83 | 0 | result = globus_notification_create_consumer( |
| 84 | createNotificationConsumerResponse, | |
| 85 | engine, | |
| 86 | globus_l_notify_callback, | |
| 87 | NULL); | |
| 88 | ||
| 89 | 0 | NotificationConsumerFactoryServiceDebugExit(); |
| 90 | 0 | return result; |
| 91 | } |