Interface ZitiContext
-
- 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 BooleanisEnabled()abstract UnitsetEnabled(Boolean v)abstract ZitiContext.StatusgetStatus()abstract StateFlow<ZitiContext.Status>statusUpdates()abstract Flow<ZitiContext.ServiceEvent>serviceUpdates()abstract Flow<IdentityDetail>getIdentity()abstract IdentityDetailgetId()abstract ServiceDetailgetService(InetSocketAddress addr)abstract ServiceDetailgetService(String name)abstract ServiceDetailgetService(String name, Long timeout)abstract ServiceDetailgetService(InetSocketAddress addr, Long timeout)abstract Collection<TerminatorClientDetail>getServiceTerminators(ServiceDetail service)abstract ZitiConnectiondial(String serviceName)connect to Ziti service. abstract ZitiConnectiondial(ZitiAddress.Dial dialAddr)abstract ZitiConnectiondialSuspend(ZitiAddress.Dial dialAddr)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()abstract BooleanisMFAEnrolled()abstract UnitauthenticateMFA(String code)abstract DetailMfaenrollMFA()abstract CompletionStage<DetailMfa>enrollMFAAsync()abstract UnitverifyMFA(String code)abstract CompletionStage<Unit>verifyMFAAsync(String code)abstract UnitremoveMFA(String code)abstract CompletionStage<Unit>removeMFAAsync(String code)abstract Array<String>getMFARecoveryCodes(String code, Boolean newCodes)abstract CompletionStage<Array<String>>getMFARecoveryCodesAsync(String code, Boolean newCodes)abstract Unitdump(Writer writer)-
-
Method Detail
-
setEnabled
abstract Unit setEnabled(Boolean v)
-
getStatus
abstract ZitiContext.Status getStatus()
-
statusUpdates
abstract StateFlow<ZitiContext.Status> statusUpdates()
-
serviceUpdates
abstract Flow<ZitiContext.ServiceEvent> serviceUpdates()
-
getIdentity
abstract Flow<IdentityDetail> getIdentity()
-
getId
abstract IdentityDetail getId()
-
getService
abstract ServiceDetail getService(InetSocketAddress addr)
-
getService
abstract ServiceDetail getService(String name)
-
getService
abstract ServiceDetail getService(String name, Long timeout)
-
getService
abstract ServiceDetail getService(InetSocketAddress addr, Long timeout)
-
getServiceTerminators
abstract Collection<TerminatorClientDetail> getServiceTerminators(ServiceDetail service)
-
dial
abstract ZitiConnection dial(String serviceName)
connect to Ziti service.
-
dial
abstract ZitiConnection dial(ZitiAddress.Dial dialAddr)
-
dialSuspend
abstract ZitiConnection dialSuspend(ZitiAddress.Dial dialAddr)
-
connect
abstract Socket connect(String host, Integer port)
connect to Ziti service identified by intercept host and port.
- Parameters:
host- intercept hostnameport- intercept port- Returns:
connection adapted to standard Socket
-
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()- Returns:
unconnected connection adapted to AsynchronousSocketChannel
-
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()- Returns:
unbound AsynchronousServerSocketChannel
-
isMFAEnrolled
abstract Boolean isMFAEnrolled()
-
authenticateMFA
abstract Unit authenticateMFA(String code)
-
enrollMFA
abstract DetailMfa enrollMFA()
-
enrollMFAAsync
abstract CompletionStage<DetailMfa> enrollMFAAsync()
-
verifyMFAAsync
abstract CompletionStage<Unit> verifyMFAAsync(String code)
-
removeMFAAsync
abstract CompletionStage<Unit> removeMFAAsync(String code)
-
getMFARecoveryCodes
abstract Array<String> getMFARecoveryCodes(String code, Boolean newCodes)
-
getMFARecoveryCodesAsync
abstract CompletionStage<Array<String>> getMFARecoveryCodesAsync(String code, Boolean newCodes)
-
-
-
-