-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
60 changed files
with
2,825 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
api/src/main/java/com/alibaba/nacos/api/naming/listener/AbstractFuzzyWatchEventListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 1999-2023 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed 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 com.alibaba.nacos.api.naming.listener; | ||
|
||
import java.util.concurrent.Executor; | ||
|
||
/** | ||
* Abstract fuzzy watch event listener, to support handle event by user custom executor. | ||
* | ||
* @author tanyongquan | ||
*/ | ||
public abstract class AbstractFuzzyWatchEventListener implements FuzzyWatchListener { | ||
|
||
String uuid; | ||
|
||
public Executor getExecutor() { | ||
return null; | ||
} | ||
|
||
public final void setUuid(String uuid) { | ||
this.uuid = uuid; | ||
} | ||
|
||
public final String getUuid() { | ||
return uuid; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
api/src/main/java/com/alibaba/nacos/api/naming/listener/FuzzyWatchListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 1999-2023 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed 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 com.alibaba.nacos.api.naming.listener; | ||
|
||
/** | ||
* Fuzzy Watch Listener. | ||
* | ||
* @author tanyongquan | ||
*/ | ||
public interface FuzzyWatchListener { | ||
|
||
/** | ||
* callback event. | ||
* | ||
* @param event event | ||
*/ | ||
void onEvent(FuzzyWatchNotifyEvent event); | ||
} |
55 changes: 55 additions & 0 deletions
55
api/src/main/java/com/alibaba/nacos/api/naming/listener/FuzzyWatchNotifyEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* Copyright 1999-2023 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed 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 com.alibaba.nacos.api.naming.listener; | ||
|
||
import com.alibaba.nacos.api.naming.pojo.Service; | ||
|
||
/** | ||
* Fuzzy Watch Notify Event. | ||
* | ||
* @author tanyongquan | ||
*/ | ||
public class FuzzyWatchNotifyEvent implements Event { | ||
|
||
private Service service; | ||
|
||
private String changeType; | ||
|
||
public FuzzyWatchNotifyEvent() { | ||
} | ||
|
||
public FuzzyWatchNotifyEvent(Service service, String changeType) { | ||
this.service = service; | ||
this.changeType = changeType; | ||
} | ||
|
||
public Service getService() { | ||
return service; | ||
} | ||
|
||
public void setService(Service service) { | ||
this.service = service; | ||
} | ||
|
||
public String getChangeType() { | ||
return changeType; | ||
} | ||
|
||
public void setChangeType(String changeType) { | ||
this.changeType = changeType; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
...ain/java/com/alibaba/nacos/api/naming/remote/request/AbstractFuzzyWatchNotifyRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 1999-2023 Alibaba Group Holding Ltd. | ||
* | ||
* Licensed 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 com.alibaba.nacos.api.naming.remote.request; | ||
|
||
import com.alibaba.nacos.api.remote.request.ServerRequest; | ||
|
||
import static com.alibaba.nacos.api.common.Constants.Naming.NAMING_MODULE; | ||
|
||
/** | ||
* Abstract fuzzy watch notify request, including basic fuzzy watch notify information. | ||
* | ||
* @author tanyongquan | ||
*/ | ||
public abstract class AbstractFuzzyWatchNotifyRequest extends ServerRequest { | ||
private String namespace; | ||
|
||
private String serviceChangedType; | ||
|
||
public AbstractFuzzyWatchNotifyRequest(){ | ||
} | ||
|
||
public AbstractFuzzyWatchNotifyRequest(String namespace, String serviceChangedType) { | ||
this.namespace = namespace; | ||
this.serviceChangedType = serviceChangedType; | ||
} | ||
|
||
public String getNamespace() { | ||
return namespace; | ||
} | ||
|
||
public void setNamespace(String namespace) { | ||
this.namespace = namespace; | ||
} | ||
|
||
public String getServiceChangedType() { | ||
return serviceChangedType; | ||
} | ||
|
||
public void setServiceChangedType(String serviceChangedType) { | ||
this.serviceChangedType = serviceChangedType; | ||
} | ||
|
||
@Override | ||
public String getModule() { | ||
return NAMING_MODULE; | ||
} | ||
} |
Oops, something went wrong.