-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: forgive_dengkai <forgive_dengkai@163.com>
- Loading branch information
1 parent
cfdc757
commit 303dd29
Showing
18 changed files
with
207 additions
and
105 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
56 changes: 56 additions & 0 deletions
56
java/osx/osx-broker/src/main/java/org/fedai/osx/broker/grpc/PcpInnerService.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,56 @@ | ||
package org.fedai.osx.broker.grpc; | ||
|
||
import com.google.inject.Inject; | ||
import com.google.inject.Singleton; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.fedai.osx.broker.provider.TechProviderRegister; | ||
import org.fedai.osx.broker.util.ContextUtil; | ||
import org.fedai.osx.core.constant.UriConstants; | ||
import org.fedai.osx.core.context.OsxContext; | ||
import org.fedai.osx.core.provider.TechProvider; | ||
import org.ppc.ptp.PrivateTransferProtocolGrpc; | ||
import org.ppc.ptp.PrivateTransferTransportGrpc; | ||
@Singleton | ||
@Slf4j | ||
public class PcpInnerService extends PrivateTransferTransportGrpc.PrivateTransferTransportImplBase { | ||
|
||
@Inject | ||
TechProviderRegister techProviderRegister; | ||
|
||
public void peek(org.ppc.ptp.Osx.PeekInbound request, | ||
io.grpc.stub.StreamObserver<org.ppc.ptp.Osx.TransportOutbound> responseObserver) { | ||
OsxContext osxContext = new OsxContext(); | ||
osxContext.setUri(UriConstants.PEEK); | ||
ContextUtil.assableContextFromInbound(osxContext); | ||
TechProvider techProvider= techProviderRegister.getTechProvider(osxContext); | ||
techProvider.processGrpcPeek(osxContext,request, responseObserver); | ||
} | ||
|
||
public void pop(org.ppc.ptp.Osx.PopInbound request, | ||
io.grpc.stub.StreamObserver<org.ppc.ptp.Osx.TransportOutbound> responseObserver) { | ||
OsxContext osxContext = new OsxContext(); | ||
osxContext.setUri(UriConstants.POP); | ||
ContextUtil.assableContextFromInbound(osxContext); | ||
TechProvider techProvider=techProviderRegister.getTechProvider(osxContext); | ||
techProvider.processGrpcPop(osxContext,request, responseObserver); | ||
} | ||
|
||
public void push(org.ppc.ptp.Osx.PushInbound request, | ||
io.grpc.stub.StreamObserver<org.ppc.ptp.Osx.TransportOutbound> responseObserver) { | ||
OsxContext osxContext = new OsxContext(); | ||
osxContext.setUri(UriConstants.PUSH); | ||
ContextUtil.assableContextFromInbound(osxContext); | ||
TechProvider techProvider= techProviderRegister.getTechProvider(osxContext); | ||
techProvider.processGrpcPush(osxContext,request, responseObserver); | ||
} | ||
|
||
public void release(org.ppc.ptp.Osx.ReleaseInbound request, | ||
io.grpc.stub.StreamObserver<org.ppc.ptp.Osx.TransportOutbound> responseObserver) { | ||
OsxContext osxContext = new OsxContext(); | ||
osxContext.setUri(UriConstants.RELEASE); | ||
ContextUtil.assableContextFromInbound(osxContext); | ||
TechProvider techProvider= techProviderRegister.getTechProvider(osxContext); | ||
techProvider.processGrpcRelease(osxContext,request, responseObserver); | ||
} | ||
|
||
} |
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
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.