ClearinghouseP2V2AuxImpl:
CEDAR
PROGRAM
IMPORTS Convert, Rope
EXPORTS ClearinghouseP2V2Aux ~ {
OPEN ClearinghouseP2V2, ClearinghouseP2V2Aux;
ROPE: TYPE ~ Rope.ROPE;
ExposeAuthenticator:
PUBLIC
PROC [r: Authenticator, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, "credentials: "];
x ← Rope.Concat[x, FooP1V1.ExposeCARD[r.credentials, (level+1)]];
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "verifier: "];
x ← Rope.Concat[x, FooP1V1.ExposeCARD[r.verifier, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeStreamOfOrganization:
PUBLIC
PROC [c: StreamOfOrganization, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfOrganization(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfOrganization => {
x ← Rope.Concat[x, ExposeOrganizationList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfOrganization => {
x ← Rope.Concat[x, ExposeOrganizationSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposeItem:
PUBLIC
PROC [s: Item, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "Item: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, Convert.RopeFromCard[s[i]]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeDomainNameList:
PUBLIC
PROC [r: DomainNameList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeDomainNameSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeDomainList:
PUBLIC
PROC [r: DomainList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeDomainSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeStreamOfObject:
PUBLIC
PROC [c: StreamOfObject, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfObject(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfObject => {
x ← Rope.Concat[x, ExposeObjectList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfObject => {
x ← Rope.Concat[x, ExposeObjectSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposeNetworkAddressList:
PUBLIC
PROC [s: NetworkAddressList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "NetworkAddressList: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, ExposeNetworkAddress[s[i], (level+1)]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeThreePartNameList:
PUBLIC
PROC [r: ThreePartNameList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeThreePartNameSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeCallProblem:
PUBLIC
PROC [e: CallProblem, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
accessRightsInsufficient => x ← "accessRightsInsufficient";
tooBusy => x ← "tooBusy";
serverDown => x ← "serverDown";
useCourier => x ← "useCourier";
other => x ← "other";
ENDCASE => x ← "unknown CallProblem";
};
ExposeObjectSequence:
PUBLIC
PROC [s: ObjectSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "ObjectSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, Convert.RopeFromRope[s[i]]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeStreamOfObjectName:
PUBLIC
PROC [c: StreamOfObjectName, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfObjectName(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfObjectName => {
x ← Rope.Concat[x, ExposeObjectNameList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfObjectName => {
x ← Rope.Concat[x, ExposeObjectNameSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposeUpdateProblem:
PUBLIC
PROC [e: UpdateProblem, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
noChange => x ← "noChange";
outOfDate => x ← "outOfDate";
objectOverflow => x ← "objectOverflow";
databaseOverflow => x ← "databaseOverflow";
ENDCASE => x ← "unknown UpdateProblem";
};
ExposeWhichArgument:
PUBLIC
PROC [e: WhichArgument, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
first => x ← "first";
second => x ← "second";
ENDCASE => x ← "unknown WhichArgument";
};
ExposeStreamKind:
PUBLIC
PROC [e: StreamKind, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
nextSegment => x ← "nextSegment";
lastSegment => x ← "lastSegment";
ENDCASE => x ← "unknown StreamKind";
};
ExposeHostNumber:
PUBLIC
PROC [a: HostNumber, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "HostNumber: [";
FOR i:
CARDINAL
IN [0..2)
DO
x ← Rope.Concat[x, Convert.RopeFromCard[a[i]]];
x ← Rope.Concat[x, ", "];
ENDLOOP;
x ← Rope.Concat[x, Convert.RopeFromCard[a[2]]];
x ← Rope.Concat[x, "]"];
};
ExposeStreamOfDomain:
PUBLIC
PROC [c: StreamOfDomain, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfDomain(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfDomain => {
x ← Rope.Concat[x, ExposeDomainList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfDomain => {
x ← Rope.Concat[x, ExposeDomainSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposeObjectNameSequence:
PUBLIC
PROC [s: ObjectNameSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "ObjectNameSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, FooP1V1.ExposeCARD[s[i], (level+1)]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeDomainNameSequence:
PUBLIC
PROC [s: DomainNameSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "DomainNameSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, FooP1V1.ExposeCARD[s[i], (level+1)]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeOrganizationList:
PUBLIC
PROC [r: OrganizationList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeOrganizationSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeDomainSequence:
PUBLIC
PROC [s: DomainSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "DomainSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, Convert.RopeFromRope[s[i]]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeStreamOfDomainName:
PUBLIC
PROC [c: StreamOfDomainName, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfDomainName(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfDomainName => {
x ← Rope.Concat[x, ExposeDomainNameList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfDomainName => {
x ← Rope.Concat[x, ExposeDomainNameSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposePropertyProblem:
PUBLIC
PROC [e: PropertyProblem, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
missing => x ← "missing";
wrongType => x ← "wrongType";
ENDCASE => x ← "unknown PropertyProblem";
};
ExposeStreamOfThreePartName:
PUBLIC
PROC [c: StreamOfThreePartName, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "StreamOfThreePartName(";
x ← Rope.Concat[x, ExposeStreamKind[c.type, (level+1)]];
x ← Rope.Concat[x, "): "];
WITH c
SELECT
FROM
v: nextSegment StreamOfThreePartName => {
x ← Rope.Concat[x, ExposeThreePartNameList[v.nextSegment, (level+1)]];
};
v: lastSegment StreamOfThreePartName => {
x ← Rope.Concat[x, ExposeThreePartNameSequence[v.lastSegment, (level+1)]];
};
ENDCASE => { x ← Rope.Concat[x, "Unknown"]; };
};
ExposeOrganizationSequence:
PUBLIC
PROC [s: OrganizationSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "OrganizationSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, Convert.RopeFromRope[s[i]]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeObjectList:
PUBLIC
PROC [r: ObjectList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeObjectSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeProperties:
PUBLIC
PROC [s: Properties, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "Properties: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, Convert.RopeFromCard[s[i]]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
ExposeObjectNameList:
PUBLIC
PROC [r: ObjectNameList, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "segment: "];
x ← Rope.Concat[x, ExposeObjectNameSequence[r.segment, (level+1)]];
x ← Rope.Concat[x, "]"];
};
ExposeNetworkNumber:
PUBLIC
PROC [a: NetworkNumber, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "NetworkNumber: [";
FOR i:
CARDINAL
IN [0..1)
DO
x ← Rope.Concat[x, Convert.RopeFromCard[a[i]]];
x ← Rope.Concat[x, ", "];
ENDLOOP;
x ← Rope.Concat[x, Convert.RopeFromCard[a[1]]];
x ← Rope.Concat[x, "]"];
};
ExposeArgumentProblem:
PUBLIC
PROC [e: ArgumentProblem, level:
NAT]
RETURNS [x:
ROPE] ~ {
SELECT e
FROM
illegalProperty => x ← "illegalProperty";
illegalOrganizationName => x ← "illegalOrganizationName";
illegalDomainName => x ← "illegalDomainName";
illegalObjectName => x ← "illegalObjectName";
noSuchOrganization => x ← "noSuchOrganization";
noSuchDomain => x ← "noSuchDomain";
noSuchObject => x ← "noSuchObject";
ENDCASE => x ← "unknown ArgumentProblem";
};
ExposeNetworkAddress:
PUBLIC
PROC [r: NetworkAddress, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "[";
x ← Rope.Concat[x, "network: "];
x ← Rope.Concat[x, ExposeNetworkNumber[r.network, (level+1)]];
x ← Rope.Concat[x, "host: "];
x ← Rope.Concat[x, ExposeHostNumber[r.host, (level+1)]];
x ← Rope.Concat[x, ", "];
x ← Rope.Concat[x, "socket: "];
x ← Rope.Concat[x, Convert.RopeFromCard[r.socket]];
x ← Rope.Concat[x, "]"];
};
ExposeThreePartNameSequence:
PUBLIC
PROC [s: ThreePartNameSequence, level:
NAT]
RETURNS [x:
ROPE] ~ {
x ← "ThreePartNameSequence: [";
FOR i:
CARDINAL
IN [0..s.length)
DO
x ← Rope.Concat[x, "\n"];
FOR i: CARDINAL IN [0..2*level) DO x ← Rope.Concat[x, " "]; ENDLOOP;
x ← Rope.Concat[x, "("];
x ← Rope.Concat[x, Convert.RopeFromCard[i]];
x ← Rope.Concat[x, ") "];
x ← Rope.Concat[x, FooP1V1.ExposeCARD[s[i], (level+1)]];
ENDLOOP;
x ← Rope.Concat[x, "]"];
};
}...