org.ssonet.net
Class ActionConfiguration

java.lang.Object
  |
  +--org.ssonet.net.ActionConfiguration

public final class ActionConfiguration
extends java.lang.Object

This class saves all values which are neccessary for configuring a action. This are mainly settings for the security goals. Methods are provided to access the values. Furthermore there are methods to save a configuration into a stream, respectively read from there.


Field Summary
static int STREAM_SIZE
          contains the size (in bytes) which a configuration file needs if it's saved in a stream or is read from one
 
Constructor Summary
ActionConfiguration(org.w3c.dom.Element rootElement)
          creates an ActionConfiguration from an XML Node.
ActionConfiguration(java.io.InputStream is)
          Creates an ActionConfiguration from its XML-encoded form a stream.
ActionConfiguration(java.io.InputStream is, boolean isZipped)
          Creates an ActionConfiguration from its XML-encoded form a stream.
ActionConfiguration(int confidentiality, int integrity, int accountabilitySign, int accountabilityAccept)
          creates a action configuration objectes
ActionConfiguration(org.ssonet.io.IOStream ioStream)
          Creates an ActionConfiguration from its XML-encoded form an IOStream.
ActionConfiguration(org.ssonet.io.IOStream ioStream, boolean isZipped)
          Creates an ActionConfiguration from its XML-encoded form an IOStream.
 
Method Summary
 org.w3c.dom.Document asXMLDocument(boolean negotiableIsSecret)
          Outputs the ActionConfiguration as XML Document
 byte getSecurityGoalLevel(int securityGoal)
          returns the level set for a security goal
 boolean lower(int securityGoal)
          Lowers the level for a security goal.
static void main(java.lang.String[] argv)
          Main method (for testing purposes only)
 boolean raise(int securityGoal)
          Raises the level for a security goal.
 boolean setSecurityGoalLevel(int securityGoal, byte securityLevel)
          Sets the level for a security goal
 void toStreamXML(org.ssonet.io.IOStream ioStream, boolean negotiableIsSecret)
          Encodes the data of this object in an XML document and writes it to an IOStream
 void toStreamXML(org.ssonet.io.IOStream ioStream, boolean negotiableIsSecret, boolean isZipped)
          Encodes the data of this object in an XML document and writes it to an IOStream
 void toStreamXML(java.io.OutputStream outputStream, boolean negotiableIsSecret)
          Encodes the data of this object in an XML document and writes it to an OutputStream
 void toStreamXML(java.io.OutputStream outputStream, boolean negotiableIsSecret, boolean isZipped)
          Encodes the data of this object in an XML document and writes it to an OutputStream
 java.lang.String toString()
          returns a text, from which one can extract the actual settings
 java.lang.String toString(int securityGoal)
          Returns a short description of the level set for the corresponding security goal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STREAM_SIZE

public static final int STREAM_SIZE
contains the size (in bytes) which a configuration file needs if it's saved in a stream or is read from one

See Also:
Constant Field Values
Constructor Detail

ActionConfiguration

public ActionConfiguration(int confidentiality,
                           int integrity,
                           int accountabilitySign,
                           int accountabilityAccept)
                    throws java.security.InvalidParameterException
creates a action configuration objectes

Parameters:
confidentiality - Level for confidentiality
integrity - Level for Integrity
accountabilitySign - Level for accountabilitySign
accountabilityAccept - Level for accountabilityAccept The value for the level to set ranges from 0 - 6. For a more precise description of the number meanings see @see names

ActionConfiguration

public ActionConfiguration(org.w3c.dom.Element rootElement)
                    throws java.io.IOException
creates an ActionConfiguration from an XML Node.

Parameters:
rootElement - the XML document
Throws:
java.io.IOException - if an error occures while reading the data from the XML Document

ActionConfiguration

public ActionConfiguration(java.io.InputStream is)
                    throws java.io.IOException
Creates an ActionConfiguration from its XML-encoded form a stream.

Parameters:
is - the stream the XML-encoded ActionConfiguration shall be read from.
Throws:
java.io.IOException - if an error occures while parsing the XML-encoded ActionConfiguration

ActionConfiguration

public ActionConfiguration(java.io.InputStream is,
                           boolean isZipped)
                    throws java.io.IOException
Creates an ActionConfiguration from its XML-encoded form a stream.

Parameters:
is - the stream the XML-encoded ActionConfiguration shall be read from.
isZipped - true, if the document to be read is zipped, false otherwise
Throws:
java.io.IOException - if an error occures while parsing the XML-encoded ActionConfiguration

ActionConfiguration

public ActionConfiguration(org.ssonet.io.IOStream ioStream)
                    throws java.io.IOException
Creates an ActionConfiguration from its XML-encoded form an IOStream.

Parameters:
ioStream - the IOStream the XML-encoded ActionConfiguration shall be read from.
Throws:
java.io.IOException - if an error occures while parsing the XML-encoded ActionConfiguration

ActionConfiguration

public ActionConfiguration(org.ssonet.io.IOStream ioStream,
                           boolean isZipped)
                    throws java.io.IOException
Creates an ActionConfiguration from its XML-encoded form an IOStream.

Parameters:
ioStream - the IOStream the XML-encoded ActionConfiguration shall be read from.
isZipped - true, if the document to be read is zipped, false otherwise
Throws:
java.io.IOException - if an error occures while parsing the XML-encoded ActionConfiguration
Method Detail

toString

public java.lang.String toString(int securityGoal)
Returns a short description of the level set for the corresponding security goal. The security goal constants are defined in @see SSONETConstants

Returns:
short description of the set level, see @see names

toString

public java.lang.String toString()
returns a text, from which one can extract the actual settings

Overrides:
toString in class java.lang.Object
Returns:
description of the actual settings

getSecurityGoalLevel

public byte getSecurityGoalLevel(int securityGoal)
returns the level set for a security goal

Parameters:
securityGoal - security goal the level should be determined for. See @see SSONEConstants
Returns:
level set, or -1, if security goal not valid

setSecurityGoalLevel

public boolean setSecurityGoalLevel(int securityGoal,
                                    byte securityLevel)
Sets the level for a security goal

Parameters:
securityGoal - security goal the level should be set for. See @see SSONEConstants
securityLevel - securityLevel to set
Returns:
true, if security goal set to securityLevel, false, if securityLevel or security goal are invalid

raise

public boolean raise(int securityGoal)
Raises the level for a security goal. 'on no condition' becomes 'if neccessary'; 'if neccessary' becomes 'don't care' etc.

Parameters:
securityGoal - security goal which security level should be raised
Returns:
true, if settings are changed successfully, false, if security goal is invalid or can't be raised anymore

lower

public boolean lower(int securityGoal)
Lowers the level for a security goal. 'if neccessary' becomes 'on no condition'; 'don't care' becomes 'if neccessary' etc.

Parameters:
securityGoal - security goal which security level should be lowered
Returns:
true, if settings are changed successfully false, if security goal is invalid or can't be lowered anymore

asXMLDocument

public org.w3c.dom.Document asXMLDocument(boolean negotiableIsSecret)
Outputs the ActionConfiguration as XML Document

Parameters:
negotiableIsSecret - true, if the Negotiable-Flag shall not be included in the XML Document, false otherwise ("on no condition, negotiable" becomes "on no condition" and "unconditional, negotiable" becomes "unconditional") * @return the ActionConfiguration encoded as XML Document

toStreamXML

public void toStreamXML(java.io.OutputStream outputStream,
                        boolean negotiableIsSecret)
                 throws java.io.IOException
Encodes the data of this object in an XML document and writes it to an OutputStream

Parameters:
outputStream - the stream, where the XML document shall be written to,
negotiableIsSecret - true, if the "negotiable" flag shall not be seen in the encoded form, false otherwise ("on no condition, negotiable" becomes "on no condition" and "unconditional, negotiable" becomes "unconditional")
Throws:
java.io.IOException - if an error occures during encoding to XML.

toStreamXML

public void toStreamXML(java.io.OutputStream outputStream,
                        boolean negotiableIsSecret,
                        boolean isZipped)
                 throws java.io.IOException
Encodes the data of this object in an XML document and writes it to an OutputStream

Parameters:
outputStream - the stream, where the XML document shall be written to,
negotiableIsSecret - true, if the "negotiable" flag shall not be seen in the encoded form, false otherwise ("on no condition, negotiable" becomes "on no condition" and "unconditional, negotiable" becomes "unconditional")
isZipped - true, if the document shall be zipped, false otherwise
Throws:
java.io.IOException - if an error occures during encoding to XML.

toStreamXML

public void toStreamXML(org.ssonet.io.IOStream ioStream,
                        boolean negotiableIsSecret)
                 throws java.io.IOException
Encodes the data of this object in an XML document and writes it to an IOStream

Parameters:
ioStream - the stream, where the XML document shall be written to,
negotiableIsSecret - true, if the "negotiable" flag shall not be seen in the encoded form, false otherwise ("on no condition, negotiable" becomes "on no condition" and "unconditional, negotiable" becomes "unconditional")
Throws:
java.io.IOException - if an error occures during encoding to XML.

toStreamXML

public void toStreamXML(org.ssonet.io.IOStream ioStream,
                        boolean negotiableIsSecret,
                        boolean isZipped)
                 throws java.io.IOException
Encodes the data of this object in an XML document and writes it to an IOStream

Parameters:
ioStream - the stream, where the XML document shall be written to,
negotiableIsSecret - true, if the "negotiable" flag shall not be seen in the encoded form, false otherwise ("on no condition, negotiable" becomes "on no condition" and "unconditional, negotiable" becomes "unconditional")
isZipped - true, if the document shall be zipped, false otherwise
Throws:
java.io.IOException - if an error occures during encoding to XML.

main

public static void main(java.lang.String[] argv)
Main method (for testing purposes only)



Copyright © 2003 DRIM Team. All Rights Reserved.