summaryrefslogtreecommitdiffstats
path: root/sandbox/sebastien/java/sca-node/modules/domain/src/main/java/org/apache/tuscany/sca/domain/spi/SCADomainEventService.java
blob: d2da70797823090911e1ddad58b18226f367c42c (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
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
 */

package org.apache.tuscany.sca.domain.spi;

import java.io.Externalizable;

import org.apache.tuscany.sca.domain.DomainException;
import org.osoa.sca.annotations.Remotable;


/**
 * The management interface for distributed domain. This is responsible for 
 * creating appropriate configuration on all the nodes that are running 
 * domain nodes for the distributed domain. 
 * 
 * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $
 */
@Remotable
public interface SCADomainEventService {
    
    // constants
    String SERVICE_NOT_KNOWN = "SERVICE_NOT_KNOWN";
    String SERVICE_NOT_REGISTERED = "SERVICE_NOT_REGISTERED";

    /**
     * Add information about a node in the domain
     * 
     * @param nodeURI
     * @param nodeURL
     * @return
     */
    void registerNode(String nodeURI, String nodeURL, Externalizable nodeManageReference) throws DomainException;
        
    /**
     * Remove information about a node in a domain
     * 
     * @param nodeURI
     * @param nodeURL
     * @return
     */
    void unregisterNode(String nodeURI) throws DomainException;
    
    /**
     * Tell the domain that a node has been started through the local API
     * 
     * @param nodeURI the URI of the node being started
     * @throws DomainException
     */
    void registerNodeStart(String nodeURI) throws DomainException;
    
    /**
     * Tell the domain that a node has been stopped through the local API
     * 
     * @param nodeURI
     * @throws DomainException
     */
    void registerNodeStop(String nodeURI) throws DomainException;

    /**
     * In the case where a contribution is added at a node this method is used to 
     * record the relationship directly. This is different from adding a contribution
     * to a domain as the contribution has already been allocated to a node
     * 
     * @param nodeURI the string URI for the node
     * @param contributionURI the string URI for the contribution
     * @param contributionURL the location of the contribution
     * @return
     */
    void registerContribution(String nodeURI, String contributionURI, String contributionURL) throws DomainException;
    

    /** 
     * In the case where a contribution is removed from a node locally this method is
     * used to remove the contribution from the domain
     * 
     * @param nodeURI the string URI for the node
     * @param contributionURI the string URI for the contribution
     * @return
     */
    void unregisterContribution(String nodeURI, String contributionURI) throws DomainException;     

    /**
     * In the case where a composite is added to the domain level composite at a node this 
     * method is used to record the event with the domain. 
     * 
     * @param nodeURI the string URI for the node
     * @param compositeQNameString the string QName of the composite
     * @throws DomainException
     */
    void registerDomainLevelComposite(String nodeURI, String compositeQNameString) throws DomainException;
    
    /**
     * Accepts information about a service endpoint and holds onto it
     * 
     * @param domainUri the string URI for the distributed domain
     * @param nodeUri the string URI for the current node
     * @param serviceName the name of the service that is exposed and the provided endpoint
     * @param bindingName the remote binding that is providing the endpoint
     * @param url the endpoint URL
     * @return TBD - information about the registration
     */
    void registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String url) throws DomainException;
    
    /**
     * Removes information about a service endpoint
     * 
     * @param domainUri the string URI for the distributed domain
     * @param nodeUri the string URI for the current node
     * @param serviceName the name of the service that is exposed and the provided endpoint
     * @param bindingName the remote binding that is providing the endpoint
     */    
    void unregisterServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName) throws DomainException;
     
    /**
     * Locates information about a service endpoint 
     * 
     * @param domainUri the string URI for the distributed domain
     * @param serviceName the name of the service to be found
     * @param bindingName the remote binding that we want to find an endpoint for
     * @return url the endpoint URL or SERVICE_NOT_REGISTERED
     */
    String findServiceEndpoint(String domainUri, String serviceName, String bindingName) throws DomainException;
    
    /**
     * Determines node that a service is available on
     * @param domainURI the string URI for the distributed domain
     * @param serviceName the name of the service to be found
     * @param bindingName the remote binding that we want to find an endpoint for
     * @return name of node running service or SERVICE_NOT_KNOWN (it's not been contributed) or SERVICE_NOT_REGISTERED (it's been contributed but isn;t running)
     * @throws DomainException
     */
    String findServiceNode(String domainURI, String serviceName, String bindingName) throws DomainException;
     
}