idman.neg.impl
Class NegotiationHandlerImpl

java.lang.Object
  |
  +--idman.neg.impl.NegotiationHandlerImpl
All Implemented Interfaces:
NegotiationHandler
Direct Known Subclasses:
RelevantNegotiationHandler

public abstract class NegotiationHandlerImpl
extends java.lang.Object
implements NegotiationHandler

Common implementation of the NegotiationHandler.

Since:
11. 07. 2002
Version:
$Id: NegotiationHandlerImpl.java,v 1.31 2004/01/29 09:40:30 tk4 Exp $
Author:
Sven Doering, Thomas Kriegelstein

Nested Class Summary
(package private) static class NegotiationHandlerImpl.Mapper
           
 
Field Summary
static java.lang.String appel
          APPEL namespace uri
static boolean debug
          flag, debug
protected  java.util.List listeners
           
static java.lang.String p3p
          P3P namespace uri
static boolean printout
          flag, verbose
 
Constructor Summary
(package private) NegotiationHandlerImpl()
          Creates the object.
 
Method Summary
 void addListener(idman.neg.NegotiationListener listener)
           
(package private)  boolean allowSend(java.util.List l, NegotiationHandlerImpl.Mapper mapper)
           
 boolean allowSend(java.lang.String[] ids, java.lang.String[] recipient, java.lang.String[] purpose, java.lang.String retention)
           
 java.util.Map getReceivedData()
          Returns the received data.
 java.lang.String[] getReceivedPurpose(java.lang.String key, java.lang.String retention)
          Returns the received purposes for given data and corresponding retention.
 java.lang.String[] getReceivedRecipient(java.lang.String key, java.lang.String retention)
          Returns the received recipients for given data and corresponding retention.
 java.lang.String[] getReceivedRetention(java.lang.String key)
          Returns the storage durations for given data.
(package private) abstract  java.util.Collection getRequestData(java.util.Collection requiredData, java.util.Collection receivedData)
          Returns the new data to request in next p3p-document, implemented in subclasses.
 java.util.Map getSentData()
          Returns the sent data.
 java.lang.String[] getSentPurpose(java.lang.String key, java.lang.String retention)
          Returns the sent purposes for given data and corresponding retention.
 java.lang.String[] getSentRecipient(java.lang.String key, java.lang.String retention)
          Returns the sent recipients for given data and corresponding retention.
 java.lang.String[] getSentRetention(java.lang.String key)
          Returns the storage durations for given data.
(package private) abstract  java.util.Collection getTransferData(java.util.Collection requestedData, java.util.Collection sentData, java.util.Collection allowedData, java.util.Collection allData)
          Returns transfer data in List, implemented in subclasses.
 void init(idman.neg.PersonalData personaldata, org.w3c.dom.Document ruleset)
          Sets the data (PersonalData) and data-handling (ruleset).
 idman.neg.NegotiationResult negotiate(org.w3c.dom.Document request)
          Returns the NegotiationResult.
 void notifyReceived(java.lang.String[] ids, java.lang.String[] recipient, java.lang.String[] purpose, java.lang.String retention)
           
 void notifySent(java.lang.String[] ids, java.lang.String[] recipient, java.lang.String[] purpose, java.lang.String retention)
           
protected static void print(java.lang.String name, java.util.Collection data)
          Prints a prefix and the data contained in List to System.out.
protected static void print(java.lang.String name, java.util.Map data)
          Prints a prefix and the data contained in Map to System.out.
 void removeListener(idman.neg.NegotiationListener listener)
           
 void setInitialRequiredData(org.w3c.dom.Document document)
          Sets the required data on Negotiation-start.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printout

public static boolean printout
flag, verbose


debug

public static boolean debug
flag, debug


p3p

public static final java.lang.String p3p
P3P namespace uri

See Also:
Constant Field Values

appel

public static final java.lang.String appel
APPEL namespace uri

See Also:
Constant Field Values

listeners

protected final java.util.List listeners
Constructor Detail

NegotiationHandlerImpl

NegotiationHandlerImpl()
                 throws java.lang.Exception
Creates the object.

Method Detail

init

public void init(idman.neg.PersonalData personaldata,
                 org.w3c.dom.Document ruleset)
          throws java.lang.Exception
Sets the data (PersonalData) and data-handling (ruleset).

Specified by:
init in interface NegotiationHandler
Parameters:
personaldata - Data to disclose
ruleset - Rules for disclosure
java.lang.Exception

setInitialRequiredData

public void setInitialRequiredData(org.w3c.dom.Document document)
Sets the required data on Negotiation-start.

Specified by:
setInitialRequiredData in interface NegotiationHandler
Parameters:
document - 1st request

getReceivedData

public java.util.Map getReceivedData()
Returns the received data.

Specified by:
getReceivedData in interface NegotiationHandler
Returns:
Map receivedData

getSentData

public java.util.Map getSentData()
Returns the sent data.

Specified by:
getSentData in interface NegotiationHandler
Returns:
Map sentData

getReceivedPurpose

public java.lang.String[] getReceivedPurpose(java.lang.String key,
                                             java.lang.String retention)
Description copied from interface: NegotiationHandler
Returns the received purposes for given data and corresponding retention.

Specified by:
getReceivedPurpose in interface NegotiationHandler
Parameters:
key - name of data
retention - storage duration
Returns:
array with purposes

getReceivedRecipient

public java.lang.String[] getReceivedRecipient(java.lang.String key,
                                               java.lang.String retention)
Description copied from interface: NegotiationHandler
Returns the received recipients for given data and corresponding retention.

Specified by:
getReceivedRecipient in interface NegotiationHandler
Parameters:
key - name of data
retention - storage duration
Returns:
array with recipients

getReceivedRetention

public java.lang.String[] getReceivedRetention(java.lang.String key)
Description copied from interface: NegotiationHandler
Returns the storage durations for given data.

Specified by:
getReceivedRetention in interface NegotiationHandler
Parameters:
key - name of data
Returns:
array with storage durations

getSentPurpose

public java.lang.String[] getSentPurpose(java.lang.String key,
                                         java.lang.String retention)
Description copied from interface: NegotiationHandler
Returns the sent purposes for given data and corresponding retention.

Specified by:
getSentPurpose in interface NegotiationHandler
Parameters:
key - name of data
retention - storage duration
Returns:
array with purposes

getSentRecipient

public java.lang.String[] getSentRecipient(java.lang.String key,
                                           java.lang.String retention)
Description copied from interface: NegotiationHandler
Returns the sent recipients for given data and corresponding retention.

Specified by:
getSentRecipient in interface NegotiationHandler
Parameters:
key - name of data
retention - storage duration
Returns:
array with recipients

getSentRetention

public java.lang.String[] getSentRetention(java.lang.String key)
Description copied from interface: NegotiationHandler
Returns the storage durations for given data.

Specified by:
getSentRetention in interface NegotiationHandler
Parameters:
key - name of data
Returns:
array with storage durations

negotiate

public idman.neg.NegotiationResult negotiate(org.w3c.dom.Document request)
Returns the NegotiationResult. The Negotiation-process:
  1. if new data available
    1. fill receiveddata from within the ENTITY-element to receiveddata - call: receiveddata = getReceivedData(..)
    2. check if initial-data-request is fulfilled - call: initialDemandedDataReceived()
  2. if new statements (data-requests) available
    1. start evaluation - call: appelhandler.startEvaluation(..)
    2. test, if all requested (from within p3pdocument-statement) data are available - call: allDataAvailable(..)
    3. test, block-behavior? - call: appelhandler.hasBlockRuleFired()
    4. add new negotiation-conditions to conditions and set newconditions - call: addNewConditions(..)
    5. set accessibledata = data from within fired rules with "request"-behavior
  3. call: abstract getTransferData (implement the negotiation-strategy)
  4. add the transferdata to sendeddata - call: addAllTransferDataToSendData()
  5. call: abstract getRequestData (implement the negotiation-strategy)
  6. add the newrequesteddata to allrequesteddata - call: addAllNewRequestedDataToNewRequestData();
  7. create and return the p3pdocument - call: createP3PDocument(transferdata, requestdata)

Specified by:
negotiate in interface NegotiationHandler
Parameters:
request - Request
Returns:
NegotiationResult result

getTransferData

abstract java.util.Collection getTransferData(java.util.Collection requestedData,
                                              java.util.Collection sentData,
                                              java.util.Collection allowedData,
                                              java.util.Collection allData)
                                       throws java.lang.Exception
Returns transfer data in List, implemented in subclasses.

Parameters:
requestedData -
allData -
Returns:
Collection data
java.lang.Exception

getRequestData

abstract java.util.Collection getRequestData(java.util.Collection requiredData,
                                             java.util.Collection receivedData)
                                      throws java.lang.Exception
Returns the new data to request in next p3p-document, implemented in subclasses.

Parameters:
requiredData -
receivedData -
Returns:
Collection data
java.lang.Exception

print

protected static void print(java.lang.String name,
                            java.util.Map data)
Prints a prefix and the data contained in Map to System.out.

Parameters:
name - prefix
data - to print

print

protected static void print(java.lang.String name,
                            java.util.Collection data)
Prints a prefix and the data contained in List to System.out.

Parameters:
name - prefix
data - to print

addListener

public void addListener(idman.neg.NegotiationListener listener)
Specified by:
addListener in interface NegotiationHandler

removeListener

public void removeListener(idman.neg.NegotiationListener listener)
Specified by:
removeListener in interface NegotiationHandler

notifySent

public void notifySent(java.lang.String[] ids,
                       java.lang.String[] recipient,
                       java.lang.String[] purpose,
                       java.lang.String retention)

notifyReceived

public void notifyReceived(java.lang.String[] ids,
                           java.lang.String[] recipient,
                           java.lang.String[] purpose,
                           java.lang.String retention)

allowSend

public boolean allowSend(java.lang.String[] ids,
                         java.lang.String[] recipient,
                         java.lang.String[] purpose,
                         java.lang.String retention)

allowSend

boolean allowSend(java.util.List l,
                  NegotiationHandlerImpl.Mapper mapper)


Copyright © 2003 DRIM Team. All Rights Reserved.