mChaRM.mChaRMCollection
Class validationChannel

java.lang.Object
  |
  +--uka.karmi.rmi.server.RemoteObject
        |
        +--uka.karmi.rmi.server.UnicastRemoteObject
              |
              +--mChaRM.multichannel.channelCore
                    |
                    +--mChaRM.mChaRMCollection.validationChannel
All Implemented Interfaces:
channelInterface, java.lang.Cloneable, uka.karmi.rmi.Remote, validationChannelInterface

public class validationChannel
extends channelCore
implements validationChannelInterface

The validationChannel realizes a multi-channel of kind validation.

The channel meta-behavior is based on the knolwledge of the receivers. The validation channel needs also to know the sender: it is specified in the sender code by indicating the kind validation_X_, where X is the sender name. See the sender1A for more details.

The channel meta-behavior consists in trapping the method calls and checking if the temporal constraints are respected.

It uses instances of validationSenderStub class as senderStubs, and instances of validationReceiverStub as receiverStubs.

Since:
Version 1.2
Version:
1.0
Author:
Walter Cazzola (cazzola@disi.unige.it) and Lorella Ristaino (1994s015@educ.disi.unige.it)

Fields inherited from class uka.karmi.rmi.server.RemoteObject
serverRef
 
Constructor Summary
validationChannel(java.lang.String[] RsName, java.lang.String client)
          Creates a multi-channels of kind validation.
validationChannel(java.lang.String kind, java.lang.String[] RsName, java.lang.String SSClassName, java.lang.String RSClassName, java.lang.String client)
          Creates a multi-channels of kind validation.
 
Method Summary
 java.lang.Object coreMetaBehavior(mChaRMMethodCall msg)
          This method embodies the reflective behaviour realized by the multi-channel.
 boolean eval(bintree tree, int t, java.util.Vector table, int par)
          Evaluate the tree representation of the constraint to decide whether the method called by the client can be executed or not.
 bintree retrieveconstraint(mChaRMMethodCall msg, java.util.Vector table)
          Looks in the constraint file for the constraint associated to the request and retrieve it.
 partialhistory retrievehistory()
          Supply to another channel the history of the current channel.
 void updatehistory(elhistory el)
          Adds the just satisfied request el, timestamped with the current time, to the history.
 
Methods inherited from class mChaRM.multichannel.channelCore
howManyReceivers, howManySenders, kind, receiverName, receiverStub, receiverStubByPosition, receiverStubClassName, retrieveReceiverFieldValue, retrieveSenderFieldValue, senderName, senderStub, senderStubByPosition, senderStubClassName, senderStubHasBeenCreated, setKind, setReceiverName, setReceiverStub, setReceiverStubClassName, setRsName, setSenderName, setSenderStub, setSenderStubClassName, supplyASenderStub
 
Methods inherited from class uka.karmi.rmi.server.UnicastRemoteObject
buildStub, clone, exportObject, exportObject, unexportObject
 
Methods inherited from class uka.karmi.rmi.server.RemoteObject
equals, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface mChaRM.multichannel.channelInterface
senderStubHasBeenCreated, supplyASenderStub
 

Constructor Detail

validationChannel

public validationChannel(java.lang.String[] RsName,
                         java.lang.String client)
                  throws uka.karmi.rmi.RemoteException,
                         ReceiverStubNotFoundException
Creates a multi-channels of kind validation.
It calls the validationChannel constructor with kind validation, SSClassName and SRClassName the validation version of the sender and receiver stubs.
Parameters:
RsName - an Array of Strings representing the name of the receivers, which it is connected to.
client - is the sender's name.
Throws:
ReceiverStubNotFoundException - thrown when one of the specified receiver wasn't started before the core.
Since:
Version 1.0

validationChannel

public validationChannel(java.lang.String kind,
                         java.lang.String[] RsName,
                         java.lang.String SSClassName,
                         java.lang.String RSClassName,
                         java.lang.String client)
                  throws uka.karmi.rmi.RemoteException,
                         ReceiverStubNotFoundException
Creates a multi-channels of kind validation.
It calls the channelCore constructor with kind validation and as classes for sender and receiver stubs their verbose version.
Parameters:
kind - is the channel kind: validation.
RsName - an Array of Strings representing the name of the receivers, which it is connected to.
SSClassName - is the validation version of the sender stub class.
SRClassName - is the validation version of the receiver stub class.
client - is the sender's name.
Throws:
ReceiverStubNotFoundException - thrown when one of the specified receiver wasn't started before the core.
Since:
Version 1.0
Method Detail

retrievehistory

public partialhistory retrievehistory()
                               throws uka.karmi.rmi.RemoteException
Supply to another channel the history of the current channel.
Specified by:
retrievehistory in interface validationChannelInterface
Since:
Version 1.2

updatehistory

public void updatehistory(elhistory el)
Adds the just satisfied request el, timestamped with the current time, to the history.
Since:
Version 1.0

retrieveconstraint

public bintree retrieveconstraint(mChaRMMethodCall msg,
                                  java.util.Vector table)
Looks in the constraint file for the constraint associated to the request and retrieve it.
Parameters:
msg - contains the informations of the request: sender, receiver, method, and parameter.
table - represents the evaluation environment (a vector of vardom) of the existential and universal quantifier.
Returns:
the tree representation of the constraint.
Since:
Version 1.0

eval

public boolean eval(bintree tree,
                    int t,
                    java.util.Vector table,
                    int par)
Evaluate the tree representation of the constraint to decide whether the method called by the client can be executed or not. Returns TRUE if the constraint is satisfied, FALSE otherwise.
Parameters:
tree - is the tree representing the constraint to be evaluated.
t - is the time at which the constraint has to be evaluated.
table - represents the evaluation environment (a vector of vardom) of the existential and universal quantifier.
par - is the parameter of the method called from the client whose execution depends on the constraint evaluation result.
Since:
Version 1.0

coreMetaBehavior

public java.lang.Object coreMetaBehavior(mChaRMMethodCall msg)
                                  throws MethodDoesNotExistException,
                                         uka.karmi.rmi.RemoteException
This method embodies the reflective behaviour realized by the multi-channel.
Its behavior consists in trapping the method calls (also termed as service requests) of a sender and checking the security constraints related to such requests; if the contraints are satisfied the request is forwarded to the intended receiver (the server) to be carried out. Otherwise the request will not be satisfied.
Specified by:
coreMetaBehavior in interface channelInterface
Overrides:
coreMetaBehavior in class channelCore
Parameters:
RsName - the name of the receivers who the message have to be delivered to.
methodName - the name of the method whose execution is requested.
args - the actual arguments of the call.
Returns:
the result of the method call.
Throws:
MethodDoesNotExistException - thrown when the method reified doesn't exist in the referent class.
Since:
Version 1.0