rlamb/Agent-Service-ATI-IA — pull request #4 by bashi-bazouk (2014-01-28 07:14:34+00:00)
Title: Verification protocol

### Behaviors.scala

Written in a new small DSL, Behaviors.scala reflects the intended nature of the VP spec by creating witnesses
* VerifierBehavior,
* ReliantPartyBehavior, and
* ClaimantBehavior.

The DSL allows the witnesses to be written in the same shorthand used by BioSimilarity in specifying the protocol. Therefore, correctness of DSL implementation amounts to evidence that the protocol fits the specification.

There are additional DSL terms within the program. These correspond to extensions of the protocol that will allow it to interact with GLoSEval, and by such means, interact with the front-end interface.

Behaviors.scala employs all of the resources of the other contributed files.

### Claim.scala

Claim.scala is a mutable record of all incoming claim information. By capturing all of the information provided in each request, Claim provides uniform look up and obtainable channels of communication.

### FilteredConnection.scala

FilteredConnection contains the ad-hoc implementation of the DSL. First, PortableAgentCnxn type objects are captured by the implicit class, PortableAgentConnection. This adds the slice functionality `( / )` to PortableAgentCnxn, allowing DSL users to create FilteredConnections (Connection + Filter).

A `FilteredConnection` object, along with a `Message` object, together contain sufficient information to dispatch a message through KVDB. The dispatch method is an exclamation point: `!`.

usage:

```
// Declare an implicit (local) kvdb node.
implicit kvdb = myKVDB

v2c ! TapClaimant(
"claim123786",
"The Romans not only cooled their wine; They also made ice cream.",
v2c,
v2r)
```

Furthermore, a FilteredConnection object can be passed a handler `handler: T => Unit` for any `T` which is a subclass of the `Message` class. This is how we install listeners, and dispatch method is the interrogative: `?`.

usage:

```
// Declare an implicit (local) kvdb node.
implicit kvdb = myKVDB

r2c ? ({ case CompleteClaim(token, claim, r2c, r2v)
if claim isSubClaimOf myClaim=>

BasicLogService.tweet("Claim # $token Complete: $claim")

}: CompleteClaim => Unit )

```

DSL Users have the option to apply filters "ad-hoc" by slicing strings, or to use them implicitly by sending and handling subclasses of the top-level Message

### Messages.scala

There are 14 types of messages: 7 to be sent by the user, and 7 to be received. The details of the messages are documented at http://softarc.net/docs/verification/

### PackageUtil.scala

Some useful implicits and type synonyms.