|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bees.core.Coroutine | +--bees.core.ResponderCoroutine | +--bees.core.AuthorizationCoroutine
A Coroutine for interacting with the Auth App. This coroutine can be used by a downloaded protocol to dynamically request capabilities from the Auth App. It can also be used to inform the Auth App that the protocol wishes to be "managed." A protocol becomes "managed" when its ProtocolSession or ExtendedProtocolSession is connected to a ProtocolPresentation in the Auth App. Thus, in the case of the extended version, the protocol will be notified of newly discovered or lost neighbors.
Field Summary | |
static int |
STATE_CONNECTED
Indicates the coroutine is connected to a peer. |
static int |
STATE_REQUESTING
Indicates the requesting Coroutine is waiting for a response. |
Fields inherited from class bees.core.Coroutine |
DEFAULT_TIMEOUT, INVALID_ID, STATE_ANY, STATE_COMPLETE, STATE_ERROR, STATE_ERROR_CAGED, STATE_ERROR_INTERNAL, STATE_ERROR_TIMEOUT, STATE_ERROR_USER, STATE_NEWBORN, STATE_USER |
Constructor Summary | |
AuthorizationCoroutine()
Construct an empty AuthorizationCoroutine. |
|
AuthorizationCoroutine(AuthorizationCoroutine ac)
Construct an AuthorizationCoroutine with the given argument. |
|
AuthorizationCoroutine(StateResponder sr,
AuthorizationCoroutine ac)
Construct an AuthorizationCoroutine with the given arguments. |
Method Summary | |
protected CapabilityEnvelope[] |
authorize(CapabilityEnvelope requester,
java.lang.String src,
java.lang.String dst,
byte[] auth)
Call back used to handle an authorize event. |
protected void |
beginExtendedManagement(CapabilityEnvelope ce,
TypeID sessionID)
Call back used to handle a beginExtendedManagement event. |
void |
beginExtendedManagement(EventChannel ec,
TypeID sessionID)
Tell the authorization application that a protocol wishes to be "managed" using an ExtendedProtocolPresentation. |
protected void |
beginManagement(CapabilityEnvelope ce,
TypeID sessionID)
Call back used to handle a beginManagement event. |
void |
beginManagement(EventChannel ec,
TypeID sessionID)
Tell the authorization application that a protocol wishes to be "managed" using a basic ProtocolPresentation. |
CapabilityEnvelope[] |
getEnvelopes()
|
EventChannel |
getEventChannel()
An EventChannel connected to the peer domain. |
long |
getPeerID()
|
void |
handle(BeesEvent ae)
Callback used to handle BeesEvents directed to this Coroutine. |
void |
requestCapability(java.lang.String src,
java.lang.String dst,
byte[] auth)
Request a capability from the Authenticator. |
java.lang.String |
toString()
|
Methods inherited from class bees.core.ResponderCoroutine |
getResponder, setState |
Methods inherited from class bees.core.Coroutine |
cleanup, drop, finalize, getCoroutine, getID, getState, getThrowable, setThrowable, waitForCompletion, waitForCompletion, waitForState, waitForState |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STATE_REQUESTING
public static final int STATE_CONNECTED
Constructor Detail |
public AuthorizationCoroutine(StateResponder sr, AuthorizationCoroutine ac)
sr
- A StateResponder that will handle state transitions in this
Coroutine.ac
- A connected AuthorizationCoroutine or null if a new connection
is to be made.public AuthorizationCoroutine(AuthorizationCoroutine ac)
ac
- A connected AuthorizationCoroutine or null if a new connection
is to be made.public AuthorizationCoroutine()
Method Detail |
public CapabilityEnvelope[] getEnvelopes()
public long getPeerID()
public EventChannel getEventChannel()
public void requestCapability(java.lang.String src, java.lang.String dst, byte[] auth)
ec
- An EventChannel connected to the Authenticator.src
- The name of the capability, relative to the Authenticator's
internal ObjectTree.dst
- The name to be placed in the CapabilityEnvelopes.auth
- Authorization data/signatures.public void beginManagement(EventChannel ec, TypeID sessionID)
ec
- The authorizer's event channel.sessionID
- The protocol session identifier that wishes to be
managed.public void beginExtendedManagement(EventChannel ec, TypeID sessionID)
ec
- The authorizer's event channel.sessionID
- The protocol session identifier that wishes to be
managed.protected void beginManagement(CapabilityEnvelope ce, TypeID sessionID)
ce
- An envelope containing the event channel of the requester.sessionID
- The protocol session identifier that wishes to be
managed.protected void beginExtendedManagement(CapabilityEnvelope ce, TypeID sessionID)
ce
- An envelope containing the event channel of the requester.sessionID
- The protocol session identifier that wishes to be
managed.protected CapabilityEnvelope[] authorize(CapabilityEnvelope requester, java.lang.String src, java.lang.String dst, byte[] auth)
requester
- The envelope containing the event channel.src
- The name of the capability, relative to the Authenticator's
internal ObjectTree.dst
- The name to be placed in the CapabilityEnvelopes.auth
- Authorization data/signatures.public void handle(BeesEvent ae)
Coroutine
handle
in class Coroutine
Coroutine.handle(BeesEvent)
public java.lang.String toString()
toString
in class ResponderCoroutine
Object.toString()
|
Bees v0.5.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |