|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.iids.aos.kernel.KernelImpl
public class KernelImpl
RPC-neutral implementation of the AOS kernel API. This implementation is called by RPC dispatchers to do their work. Methods are documented in AOSapi. Thread-safe.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.iids.aos.kernel.AOSapi |
|---|
AOSapi.AcceptResult, AOSapi.ConnectResult, AOSapi.CreateRoleResult, AOSapi.PrepareWaitACResult, AOSapi.SecSuites, AOSapi.WaitACResult |
| Field Summary | |
|---|---|
protected byte[] |
certificate
The X509 public key certicate corresponding to privateKey in PEM format. |
protected KernelConfig |
config
Kernel config |
protected java.security.PrivateKey |
privateKey
The private key of the AOS kernel. |
protected java.lang.String |
scid
The SCID of the AOS kernel. |
| Fields inherited from interface org.iids.aos.kernel.AOSapi |
|---|
ACTP_TLS_PROTOCOL_VERSION, MUX_TLS_PROTOCOL_VERSION, SCID_AUTH_ALGO, SCID_AUTH_KEYSIZE, SCID_CERT_SIGN_ALGO, SCID_DIGEST_ALGO, SCID_DIGEST_ALGO_BITLENGTH, SEGMENT_CERT_SUBTYPE, SEGMENT_DIGEST_ALGO, SEGMENT_DIGEST_ALGO_BITLENGTH, SEGMENT_SIGN_SUBTYPE, SEGMENT_TOC_SUBTYPE, SIGN_TOC_ALGO, SIGN_TOC_CERTTYPE, XDR_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
KernelImpl(KernelConfig config)
Creates an AOS kernel object listening on the given TCP/IP contact points and maintaining file system state in the given directory. |
|
| Method Summary | |
|---|---|
AOSapi.AcceptResult |
accept(Cookie cookie,
int listenPort,
boolean blocking)
Returns the next permitted connection waiting at a listen endpoint. |
void |
closeConnection(Cookie cookie,
int connectionID)
Closes a connection. |
void |
closeListenEndpoint(Cookie cookie,
int listenPort)
Destroys a listen endpoint and closes any pending connections that have arrived at the listen endpoint. |
AOSapi.ConnectResult |
connect(Cookie cookie,
Endpoint listenEndpoint,
java.lang.String[] secSuites)
Establishes a connection by connecting to a remote listen endpoint. |
int |
createAgentContainer(Cookie cookie)
Creates an empty agent container. |
void |
createInitRole(Cookie cookie,
boolean enable)
|
Endpoint |
createListenEndpoint(Cookie cookie,
int listenPort,
java.lang.String[] secSuites)
Creates a listen endpoint. |
AOSapi.CreateRoleResult |
createRole(Cookie cookie,
RoleBitmap bitmap)
Creates a new role. |
int |
createSegment(Cookie cookie,
int acid,
int segmentType,
byte[] subtype,
byte[] description)
Creates a new empty segment and TOC entry in the given agent container, using the given parameters. |
void |
deleteAgentContainer(Cookie cookie,
int acid)
Deletes an agent container. |
void |
deleteRole(Cookie cookie,
Cookie childCookie)
Deletes an existing role and all kernel resources owned by that role (Agent containers, connection ports, listen ports, other roles etc.) |
void |
deleteSegment(Cookie cookie,
int acid,
int segID)
Removes the given segment from the given agent container. |
void |
finalizeAgentContainer(Cookie cookie,
int acid)
Finalizes an agent container: (a) computes checksums of the container's segments and signs the container using the AOS kernel's private key, and (b) writes the TOC, signature and AOS kernel's key certificate to the agent container's finalization segments. |
java.lang.String |
getLocalScid()
|
int |
getParam(Cookie cookie,
java.lang.String parameterName)
Returns the value of an AOS parameter, a positive integer |
TIDRecord |
isKnownTID(TransactionID tid)
Used by AgentContainerTransfer to see if we know this TID at all. |
void |
makePersistent(Cookie cookie,
int acid,
int segID)
Marks the given segment of the given agent container as persistent. |
byte[] |
peek(Cookie cookie,
int connectionID,
int max,
boolean blocking)
As receive() but leaves the data that was read in the connection. |
AOSapi.PrepareWaitACResult |
prepareWaitAgentContainer(Cookie cookie,
java.lang.String[] secSuites)
Prepares an incoming agent container shipment. |
byte[] |
readSegment(Cookie cookie,
int acid,
int segID,
int offset,
int length)
Reads a number of bytes from the given segment in the given agent container. |
TOCEntry[] |
readTOC(Cookie cookie,
int acid,
int offset,
int n)
Reads n TOC entries of an agent container, starting at the entry for segment ID 'offset'. |
byte[] |
receive(Cookie cookie,
int connectionID,
int max,
boolean blocking)
Reads available data from a connection up to a specified maximum. |
void |
recover()
|
void |
reenableRole(Cookie cookie)
Used to reset the role so that it can be used again. |
SelectSets |
select(Cookie cookie,
SelectSets sets,
boolean blocking)
Cf. |
int |
send(Cookie cookie,
int connectionID,
byte[] buffer)
Writes data to a connection. |
void |
shipAgentContainer(Cookie cookie,
int acid,
Endpoint dest,
java.lang.String[] secSuites,
TransactionID tid)
Ships a finalized agent container to a remote AOS kernel. |
void |
shutdown()
|
AOSapi.WaitACResult |
waitAgentContainer(Cookie cookie,
TransactionID[] tids,
int blockTime)
Waits for completion of an incoming agent container shipment with any of the given transaction ID. |
int |
writeSegment(Cookie cookie,
int acid,
int segID,
int offset,
byte[] frombuf)
Writes a number of bytes to the given segment in the given agent container. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected KernelConfig config
protected final java.security.PrivateKey privateKey
protected final byte[] certificate
protected final java.lang.String scid
| Constructor Detail |
|---|
public KernelImpl(KernelConfig config)
throws java.io.IOException,
java.security.KeyStoreException,
java.security.cert.CertificateException,
java.security.KeyManagementException,
java.security.NoSuchAlgorithmException,
java.security.UnrecoverableKeyException,
java.security.cert.CertificateEncodingException,
KernelException
java.io.IOException
java.security.KeyStoreException
java.security.cert.CertificateException
java.security.KeyManagementException
java.security.NoSuchAlgorithmException
java.security.UnrecoverableKeyException
java.security.cert.CertificateEncodingException
KernelException| Method Detail |
|---|
public java.lang.String getLocalScid()
public void shutdown()
public void recover()
throws KernelException
KernelException
public AOSapi.CreateRoleResult createRole(Cookie cookie,
RoleBitmap bitmap)
throws KernelException
AOSapi
createRole in interface AOSapicookie - caller cookiebitmap - the role bitmap for the new role
UnknownRoleException - if the caller is unknown
KernelExceptionAOSapi.createRole(org.iids.aos.kernel.Cookie, org.iids.aos.kernel.RoleBitmap)
public void deleteRole(Cookie cookie,
Cookie childCookie)
throws KernelException
AOSapi
deleteRole in interface AOSapicookie - caller cookie, must correspond to the parent role that
created this rolechildCookie - cookie of the role to be deleted
KernelExceptionAOSapi.deleteRole(org.iids.aos.kernel.Cookie, org.iids.aos.kernel.Cookie)
public int createAgentContainer(Cookie cookie)
throws KernelException
AOSapi
createAgentContainer in interface AOSapicookie - caller cookie
KernelExceptionAOSapi.createAgentContainer(org.iids.aos.kernel.Cookie)
public void deleteAgentContainer(Cookie cookie,
int acid)
throws KernelException
AOSapi
deleteAgentContainer in interface AOSapicookie - caller cookieacid - agent container to delete
KernelExceptionAOSapi.deleteAgentContainer(org.iids.aos.kernel.Cookie, int)
public int createSegment(Cookie cookie,
int acid,
int segmentType,
byte[] subtype,
byte[] description)
throws KernelException
AOSapi
createSegment in interface AOSapicookie - caller cookieacid - agent container to create a segment insegmentType - see XDR documentation of TOC_ENTRYsubtype - see XDR documentation of TOC_ENTRYdescription - see XDR documentation of TOC_ENTRY
KernelExceptionAOSapi.createSegment(org.iids.aos.kernel.Cookie, int, int, byte[], byte[])
public void deleteSegment(Cookie cookie,
int acid,
int segID)
throws KernelException
AOSapi
deleteSegment in interface AOSapicookie - caller cookieacid - agent container to delete segment fromsegID - segment to delete
KernelExceptionAOSapi.deleteSegment(org.iids.aos.kernel.Cookie, int, int)
public TOCEntry[] readTOC(Cookie cookie,
int acid,
int offset,
int n)
throws KernelException
AOSapi
readTOC in interface AOSapicookie - caller cookieacid - agent container to read TOC fromoffset - segment ID of first entry requestedn - the number of entries requested
KernelExceptionAOSapi.readTOC(org.iids.aos.kernel.Cookie, int, int, int)
public byte[] readSegment(Cookie cookie,
int acid,
int segID,
int offset,
int length)
throws KernelException
AOSapi
readSegment in interface AOSapicookie - caller cookieacid - agent container to read fromsegID - segment to read fromoffset - offset in segment to start reading atlength - number of bytes requested
KernelExceptionAOSapi.readSegment(org.iids.aos.kernel.Cookie, int, int, int, int)
public int writeSegment(Cookie cookie,
int acid,
int segID,
int offset,
byte[] frombuf)
throws KernelException
AOSapi
writeSegment in interface AOSapicookie - caller cookieacid - agent container to write tosegID - segment to write tooffset - offset in segment to start writing atfrombuf - buffer containing the bytes to write
KernelExceptionAOSapi.writeSegment(org.iids.aos.kernel.Cookie, int, int, int, byte[])
public void makePersistent(Cookie cookie,
int acid,
int segID)
throws KernelException
AOSapi
makePersistent in interface AOSapicookie - caller cookieacid - agent container whose segment to make persistentsegID - segment to make persistent
KernelExceptionAOSapi.makePersistent(org.iids.aos.kernel.Cookie, int, int)
public void finalizeAgentContainer(Cookie cookie,
int acid)
throws KernelException
AOSapi
finalizeAgentContainer in interface AOSapicookie - caller cookieacid - agent container to finalize
KernelExceptionAOSapi.finalizeAgentContainer(org.iids.aos.kernel.Cookie, int)
public void shipAgentContainer(Cookie cookie,
int acid,
Endpoint dest,
java.lang.String[] secSuites,
TransactionID tid)
throws KernelException
AOSapi
shipAgentContainer in interface AOSapicookie - caller cookieacid - agent container to shipdest - the listen endpoint that the remote
kernel uses for incoming agent container
shipments (note: dest.port currently unused)secSuites - a series of cipher suites acceptable to the caller,
null or empty is equivalent to ALL_SEC_SUITES, as ACTP
requires authentication.tid - the transaction ID for this shipment,
created by the remote AOS kernel
KernelExceptionAOSapi.shipAgentContainer(org.iids.aos.kernel.Cookie, int, org.iids.aos.kernel.Endpoint, java.lang.String[], org.iids.aos.kernel.TransactionID)
public AOSapi.PrepareWaitACResult prepareWaitAgentContainer(Cookie cookie,
java.lang.String[] secSuites)
throws KernelException
AOSapi
prepareWaitAgentContainer in interface AOSapicookie - caller cookiesecSuites - a series of cipher suites acceptable to the caller,
null or empty is equivalent to ALL_SEC_SUITES, as ACTP
requires authentication.
KernelExceptionAOSapi.prepareWaitAgentContainer(org.iids.aos.kernel.Cookie, java.lang.String[])public TIDRecord isKnownTID(TransactionID tid)
public AOSapi.WaitACResult waitAgentContainer(Cookie cookie,
TransactionID[] tids,
int blockTime)
AOSapi
waitAgentContainer in interface AOSapicookie - caller cookietids - TransactionIDs for the AC shipment. All exceptions
occuring will include the tid of the transaction that met
the error.blockTime - time in seconds in which the kernel will wait for an ACT
to be initiated. blockTime 0 means ``poll''.
AOSapi.waitAgentContainer(org.iids.aos.kernel.Cookie, org.iids.aos.kernel.TransactionID[], int)
public Endpoint createListenEndpoint(Cookie cookie,
int listenPort,
java.lang.String[] secSuites)
throws KernelException
AOSapi
createListenEndpoint in interface AOSapicookie - caller cookielistenPort - the listen port number to use, or 0 to let the AOS
kernel pick onesecSuites - a series of cipher suites acceptable to the caller, or
null or empty to leave unspecified. Kernel will then
selected appropriate suites.
KernelExceptionAOSapi.createListenEndpoint(org.iids.aos.kernel.Cookie, int, java.lang.String[])
public void closeListenEndpoint(Cookie cookie,
int listenPort)
throws KernelException
AOSapi
closeListenEndpoint in interface AOSapicookie - caller cookielistenPort - the listen port number
KernelExceptionAOSapi.closeListenEndpoint(org.iids.aos.kernel.Cookie, int)
public AOSapi.AcceptResult accept(Cookie cookie,
int listenPort,
boolean blocking)
throws KernelException
AOSapi
accept in interface AOSapicookie - caller cookielistenPort - the listen port numberblocking - whether to allow this method to block
KernelExceptionAOSapi.accept(org.iids.aos.kernel.Cookie, int, boolean)
public AOSapi.ConnectResult connect(Cookie cookie,
Endpoint listenEndpoint,
java.lang.String[] secSuites)
throws KernelException
AOSapi
connect in interface AOSapicookie - caller cookielistenEndpoint - the address of the remote listen endpointsecSuites - a series of cipher suites acceptable to the
caller, or null or empty to leave unspecified
KernelExceptionAOSapi.connect(org.iids.aos.kernel.Cookie, org.iids.aos.kernel.Endpoint, java.lang.String[])
public void closeConnection(Cookie cookie,
int connectionID)
throws KernelException
AOSapi
closeConnection in interface AOSapicookie - caller cookieconnectionID - the connection to close
KernelExceptionAOSapi.closeConnection(org.iids.aos.kernel.Cookie, int)
public int send(Cookie cookie,
int connectionID,
byte[] buffer)
throws KernelException
AOSapi
send in interface AOSapicookie - caller cookieconnectionID - the connection to write tobuffer - the buffer that holds the data
KernelExceptionAOSapi.send(org.iids.aos.kernel.Cookie, int, byte[])
public byte[] receive(Cookie cookie,
int connectionID,
int max,
boolean blocking)
throws KernelException
AOSapi
receive in interface AOSapicookie - caller cookieconnectionID - the connection to readmax - maximum number of bytes to readblocking - whether to allow this method to block
KernelExceptionAOSapi.receive(org.iids.aos.kernel.Cookie, int, int, boolean)
public byte[] peek(Cookie cookie,
int connectionID,
int max,
boolean blocking)
throws KernelException
AOSapi
peek in interface AOSapiKernelExceptionAOSapi.peek(org.iids.aos.kernel.Cookie, int, int, boolean)
public SelectSets select(Cookie cookie,
SelectSets sets,
boolean blocking)
throws KernelException
AOSapi
select in interface AOSapicookie - caller cookiesets - set of three sets: readSet, writeSet, exceptSet
readSet : set of local descriptors to check for data/connection
availability
writeSet set of local descriptors to check for writability
exceptSet set of local descriptors to check for exceptionsblocking - whether to block or not
KernelException
public int getParam(Cookie cookie,
java.lang.String parameterName)
throws KernelException
AOSapi
getParam in interface AOSapicookie - caller cookieparameterName - the name of the AOS parameter
KernelException
public void reenableRole(Cookie cookie)
throws KernelException
AOSapi
reenableRole in interface AOSapicookie - caller cookie
KernelException
public void createInitRole(Cookie cookie,
boolean enable)
throws KernelException
KernelException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||