-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor the session-store
- Loading branch information
yuzhi.lyz
committed
Dec 21, 2020
1 parent
a2aaf1d
commit 39954fb
Showing
21 changed files
with
560 additions
and
834 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
79 changes: 79 additions & 0 deletions
79
server/common/model/src/main/java/com/alipay/sofa/registry/common/model/IPPort.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,79 @@ | ||
/* | ||
* 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 com.alipay.sofa.registry.common.model; | ||
|
||
import com.alipay.sofa.registry.util.ParaCheckUtil; | ||
|
||
import java.io.Serializable; | ||
import java.util.Objects; | ||
|
||
/** | ||
* | ||
* @author yuzhi.lyz | ||
* @version v 0.1 2020-12-21 11:14 yuzhi.lyz Exp $ | ||
*/ | ||
public final class IPPort implements Serializable { | ||
private final String ip; | ||
private final int port; | ||
|
||
private IPPort(String ip, int port) { | ||
this.ip = ip; | ||
this.port = port; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>ip</tt>. | ||
* @return property value of ip | ||
*/ | ||
public String getIp() { | ||
return ip; | ||
} | ||
|
||
/** | ||
* Getter method for property <tt>port</tt>. | ||
* @return property value of port | ||
*/ | ||
public int getPort() { | ||
return port; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) | ||
return true; | ||
if (!(o instanceof IPPort)) | ||
return false; | ||
IPPort ipPort = (IPPort) o; | ||
return port == ipPort.port && Objects.equals(ip, ipPort.ip); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(ip, port); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return ip + ":" + port; | ||
} | ||
|
||
public static IPPort of(String ip, int port) { | ||
ParaCheckUtil.checkNotBlank(ip, "ip"); | ||
ParaCheckUtil.checkIsPositive(port, "port"); | ||
return new IPPort(ip, port); | ||
} | ||
} |
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
81 changes: 0 additions & 81 deletions
81
...session/src/main/java/com/alipay/sofa/registry/server/session/cache/SubscriberResult.java
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.