-
- All Implemented Interfaces:
-
org.openziti.identity.Identity
public interface ZitiContext implements Identity
Object representing an instantiated Ziti identity. It main purpose is to instantiate
connections to Ziti services
binding for hosting Ziti services in the app
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumZitiContext.ServiceUpdatepublic final classZitiContext.ServiceEventpublic classZitiContext.Status
-
Method Summary
Modifier and Type Method Description abstract UnitsetEnabled(Boolean v)abstract ZitiContext.StatusgetStatus()abstract Flow<ZitiContext.Status>statusUpdates()abstract Flow<ZitiContext.ServiceEvent>serviceUpdates()abstract IdentitygetId()abstract ServicegetService(InetSocketAddress addr)abstract ServicegetService(String name)abstract Collection<ServiceTerminator>getServiceTerminators(Service service)abstract ZitiConnectiondial(String serviceName)connect to Ziti service. abstract Socketconnect(String host, Integer port)connect to Ziti service identified by intercept host and port. abstract AsynchronousSocketChannelopen()creates unconnected AsynchronousSocketChannel. abstract AsynchronousServerSocketChannelopenServer()creates unbound AsynchronousServerSocketChannel. abstract Unitdestroy()-
-
Method Detail
-
setEnabled
abstract Unit setEnabled(Boolean v)
-
getStatus
abstract ZitiContext.Status getStatus()
-
statusUpdates
abstract Flow<ZitiContext.Status> statusUpdates()
-
serviceUpdates
abstract Flow<ZitiContext.ServiceEvent> serviceUpdates()
-
getService
abstract Service getService(InetSocketAddress addr)
-
getService
abstract Service getService(String name)
-
getServiceTerminators
abstract Collection<ServiceTerminator> getServiceTerminators(Service service)
-
dial
abstract ZitiConnection dial(String serviceName)
connect to Ziti service.
-
connect
abstract Socket connect(String host, Integer port)
connect to Ziti service identified by intercept host and port.
- Parameters:
host- intercept hostnameport- intercept port
-
open
abstract AsynchronousSocketChannel open()
creates unconnected AsynchronousSocketChannel.
before it can be used it has to be connected, via any standard AsynchronousSocketChannel.connect method with ZitiAddress.Dial address.
val con = zitiCtx.open() con.connect(ZitiAddress.Service(serviceName)).get()
-
openServer
abstract AsynchronousServerSocketChannel openServer()
creates unbound AsynchronousServerSocketChannel.
before it can be used to accept ziti client connections it has to be bound to Ziti service via any standard AsynchronousServerSocketChannel.bind method with ZitiAddress.Bind address all standard AsynchronousServerSocketChannel.accept methods are supported.
Example:
val server = zitiCtx.openServer() server.bind(ZitiAddress.Service(serviceName)) // start accepting val clt = service.accept().get()
-
-
-
-