|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAMETAS.data.AMETASSCContainer
AMETAS.data.AMETASSPUContainer
Bundle of classes, privileges, types, and signatures defining a Place User. The SPU container (also short SPU) contains all classes which are required to get a PU running at a place. All classes are signed with one signature of the author. It is possible to integrate further SPUs in this SPU. These sub-SPUs may be agents which are to be invoked at a remote place using the spawnAgent command.
Sub-SPUs must be completely prepared before they are integrated. That means that all privileges are set as required, all types are set, and all signatures are provided. The integration process may be iterated.
The runtime privileges are the maximum set of privileges during runtime of this Place User. The actual privileges are computed from the user's current privileges intersected with the runtime privileges set. The start privileges are the minimum set of privileges a user must have to start this Place User.
For services, the privileges at runtime are exactly the runtime privileges, regardless of the person causing the service to start. The start privileges are used to define whether messages from a user's PU are accepted or not.
The contents are stored by a zip stream using compression.
Note the terminology: A PU main class is a subclass of AMETASPlaceUser or AMETASServiceObject. The main PU class is the PU main class which is instantiated after loading this SPU; it is the main Place User.
| Constructor Summary | |
AMETASSPUContainer()
Initialization of a SPU container. |
|
| Method Summary | |
boolean |
addType(java.lang.String sComponentName,
AMETASType type)
Adds another type description. |
void |
addVersion(java.lang.String sVersionName,
AMETASType[] aType)
Adds another version of this Place User. |
void |
addVersion(java.lang.String sVersionName,
java.lang.String[] asStartPrivilege,
java.lang.String[] asRuntimePrivilege,
AMETASType[] aType)
Adds another version to this SPU. |
void |
checkValid()
Checks the integrity of the SPU. |
AMETASSPUContainer |
extractSPU(java.lang.String sComponentName)
Extracts a previously integrated SPU container. |
java.lang.String |
getName()
Returns the name of the SPU, that is the name of the main PU class. |
java.lang.String[] |
getRuntimePrivileges(java.lang.String sComponentName)
Delivers the set of privileges which may be assigned to any instance of the Place User. |
byte[] |
getSignableData(int nComponent,
boolean bUseHashes)
Returns a sequence of bytes to be signed. |
AMETASSignature[] |
getSignatures(java.lang.String sComponentName)
Delivers the list of signatures for the component. |
java.lang.String[] |
getStartPrivileges(java.lang.String sComponentName)
Delivers the set of privileges which a user must have to start this Place User. |
AMETASType[] |
getTypes(java.lang.String sComponentName)
Returns the set of types of the requested component. |
void |
integrate(AMETASSPUContainer spuSub)
Imports the given SPU container into this container. |
boolean |
isVersion(int nIndex)
Determines whether the given component name refers to a version or to another integrated SPU. |
boolean |
isVersion(java.lang.String sComponent)
Determines whether the given component name refers to a version or to another integrated SPU. |
void |
readExternal(java.io.ObjectInput in)
Initializing the SPU from a data stream. |
boolean |
removeTypes(java.lang.String sComponentName)
Removes all type descriptions of the Place User. |
void |
setReferencedClasses(short[] anReference)
Defines the list of classes which are referenced by a Place User. |
void |
setRuntimePrivileges(int nIndex,
java.lang.String[] asPrivileges)
Allows to set the list of maximum runtime privileges. |
boolean |
setRuntimePrivileges(java.lang.String sName,
java.lang.String[] asPrivilege)
Allows to set the list of maximum runtime privileges. |
void |
setStartPrivileges(int nIndex,
java.lang.String[] asPrivileges)
Allows to set the list of required start privileges. |
boolean |
setStartPrivileges(java.lang.String sName,
java.lang.String[] asPrivilege)
Allows to set the list of required start privileges. |
boolean |
setTypes(java.lang.String sComponentName,
AMETASType[] aType)
Sets the defined types of this Place User (component or version). |
java.lang.String |
toString()
Outputs the contents of the SPU container to a string. |
java.lang.String |
toString(boolean bDetailed)
Outputs the contents of the SPU to a string. |
void |
wipeClassDefs()
Removes the class definitions after they were copied to the cache. |
void |
writeExternal(java.io.ObjectOutput out)
Serialization method. |
| Methods inherited from class AMETAS.data.AMETASSCContainer |
addClass, addFile, addSignature, containsClass, createHash, getAllClassNames, getAllComponents, getBytesFromStream, getClass, getClassAt, getDigestAlgorithm, getHashValue, getHashValueAt, getIndexOfClass, getIndexOfComponent, getNextEntryData, getSignableData, getSignatures, removeSignature, removeSignatures, serializeObject, setCompressionLevel, setDigestAlgorithm, size, writeToZip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public AMETASSPUContainer()
| Method Detail |
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class AMETASSCContainerin - Data stream from where the data is read.
java.io.IOException - if the stream encounters an error.
java.lang.ClassNotFoundException - if the container uses unknown classes.
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class AMETASSCContainerout - Output stream.
java.io.IOException - if errors occured in the underlying stream.
public void integrate(AMETASSPUContainer spuSub)
throws InvalidContainerException
spuSub - SPU container to be integrated.
InvalidContainerException - if the second container cannot be integrated. This happens
when this method is attempted to be used in the AMETAS runtime environment (AMETAS-re).
public void addVersion(java.lang.String sVersionName,
AMETASType[] aType)
throws InvalidContainerException
sVersionName - Version name. Corresponds to the parametrization name.aType - Set of types which characterize this version.
InvalidContainerException - if the version cannot be added. This happens
when this method is attempted to be used in the AMETAS runtime environment (AMETAS-re).
public void addVersion(java.lang.String sVersionName,
java.lang.String[] asStartPrivilege,
java.lang.String[] asRuntimePrivilege,
AMETASType[] aType)
throws InvalidContainerException
sVersionName - Version name. Corresponds to the parametrization name.asStartPrivilege - Start privileges.asRuntimePrivilege - Runtime privileges.aType - Set of types characterizing this version.
InvalidContainerException - if the version cannot be added. This happens
when this method is attempted to be used in the AMETAS runtime environment (AMETAS-re).public boolean isVersion(java.lang.String sComponent)
sComponent - Component name or null if the main PU (version) is referred to.
public boolean isVersion(int nIndex)
nIndex - Component or version index.
public AMETASSPUContainer extractSPU(java.lang.String sComponentName)
sComponentName - Class name of the subagent.
public java.lang.String getName()
public void wipeClassDefs()
public void setReferencedClasses(short[] anReference)
anReference - Indexes of referenced classes, the main class being at position 0.
public void checkValid()
throws InvalidContainerException
checkValid in class AMETASSCContainerInvalidContainerException - if the container fails to validate.
public byte[] getSignableData(int nComponent,
boolean bUseHashes)
nComponent - Component index.bUseHashes - if true, only the digests of the classes are used; the classes themselves are ignored.
public AMETASSignature[] getSignatures(java.lang.String sComponentName)
sComponentName - Class name of the enclosed (or main) Place User. Null refers to the main PU class.
public java.lang.String[] getStartPrivileges(java.lang.String sComponentName)
sComponentName - Class name of the enclosed (or main) Place User. Null refers to the main PU class.
public java.lang.String[] getRuntimePrivileges(java.lang.String sComponentName)
sComponentName - Class name of the enclosed (or main) Place User. Null refers to the main PU class.
public boolean setStartPrivileges(java.lang.String sName,
java.lang.String[] asPrivilege)
sName - Class name of the enclosed (or main) Place User. Null referes to the main PU version.asPrivilege - Array of privileges.
public void setStartPrivileges(int nIndex,
java.lang.String[] asPrivileges)
throws java.lang.IndexOutOfBoundsException
nIndex - Component index.asPrivileges - String array containing the privileges.
java.lang.IndexOutOfBoundsException - if the index is not smaller than the number of components.
public boolean setRuntimePrivileges(java.lang.String sName,
java.lang.String[] asPrivilege)
sName - Class name of the enclosed (or main) Place User. Null refers to the main version.asPrivilege - Array of privileges.
public void setRuntimePrivileges(int nIndex,
java.lang.String[] asPrivileges)
throws java.lang.IndexOutOfBoundsException
nIndex - Component index.asPrivileges - String array containing the privileges.
java.lang.IndexOutOfBoundsException - if the index is not smaller than the number of components.public AMETASType[] getTypes(java.lang.String sComponentName)
sComponentName - Place User name, including its parametrization if applicable. Using null
yields the main PU version types.
public boolean setTypes(java.lang.String sComponentName,
AMETASType[] aType)
sComponentName - PU main class name with parametrization (if applicable). Null refers to the
main Place User.aType - Type descriptions.
public boolean addType(java.lang.String sComponentName,
AMETASType type)
sComponentName - Component or version name, or null if the main Place User
is requested.type - Type description.
public boolean removeTypes(java.lang.String sComponentName)
sComponentName - PU main class, including the parametrization if applicable. Null refers to the
main version.
public java.lang.String toString()
toString in class AMETASSCContainerpublic java.lang.String toString(boolean bDetailed)
toString in class AMETASSCContainerbDetailed - if true, details are included, else the simple toString method is used.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||