NMSServerImpl.mesa
Please do not edit this file.
It was generated using CedarRPCGen.
DIRECTORY
SunRPC,
SunRPCAuth,
Rope,
MS,
NS,
MSGetPut,
NSGetPut,
NMSGetPut,
NMS;
NMSServerImpl: CEDAR PROGRAM
IMPORTS Rope, SunRPC, MSGetPut, NSGetPut, NMSGetPut
EXPORTS NMS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Handle: TYPE = SunRPC.Handle;
Conversation: TYPE = SunRPCAuth.Conversation;
defaultReplyTTL: CARDINAL ← 10;
MakeNMS2Server: PUBLIC PROC[
data: REF,
servernoop: NMS.servernoopProc,
querycentralnms: NMS.querycentralnmsProc,
updatecentralnms: NMS.updatecentralnmsProc,
querylocalnms: NMS.querylocalnmsProc,
querymaintain: NMS.querymaintainProc,
setdebuglevel: NMS.setdebuglevelProc,
checkconfigfiles: NMS.checkconfigfilesProc,
nsinsert: NMS.nsinsertProc,
nsdelete: NMS.nsdeleteProc,
nsreplace: NMS.nsreplaceProc,
nsfind: NMS.nsfindProc,
msmaintain: NMS.msmaintainProc,
msunmaintain: NMS.msunmaintainProc
] RETURNS [SunRPC.Server] ~ {
pseudoClient: NMS.NMS2 ~
NEW[NMS.NMS2Object ← [
rpcHandle ~ NIL, rpcConversation ~ NIL, data ~ data,
servernoop ~ servernoop,
querycentralnms ~ querycentralnms,
updatecentralnms ~ updatecentralnms,
querylocalnms ~ querylocalnms,
querymaintain ~ querymaintain,
setdebuglevel ~ setdebuglevel,
checkconfigfiles ~ checkconfigfiles,
nsinsert ~ nsinsert,
nsdelete ~ nsdelete,
nsreplace ~ nsreplace,
nsfind ~ nsfind,
msmaintain ~ msmaintain,
msunmaintain ~ msunmaintain
]];
unbound: SunRPC.Server ~ NEW[SunRPC.ServerObject ← [
pgm ~ NMS.NMSPrognum,
version ~ NMS.version2,
clientData ~ pseudoClient,
serverProc ~ NMS2Handler
]];
RETURN [unbound];
};
NMS2Handler: SunRPC.ServerProc -- [h: Handle, c: Conversation, proc: CARD, clientData: REFANY
-- RETURNS [doReply: BOOLEAN, replyTimeToLive: CARDINAL] -- = {
o: NMS.NMS2NARROW[clientData];
doReply ← TRUE;
replyTimeToLive ← defaultReplyTTL;
SELECT proc FROM
0 => servernoop2[h, c, o];
7 => querycentralnms2[h, c, o];
8 => updatecentralnms2[h, c, o];
9 => querylocalnms2[h, c, o];
10 => querymaintain2[h, c, o];
11 => setdebuglevel2[h, c, o];
12 => checkconfigfiles2[h, c, o];
1 => nsinsert2[h, c, o];
2 => nsdelete2[h, c, o];
3 => nsreplace2[h, c, o];
4 => nsfind2[h, c, o];
5 => msmaintain2[h, c, o];
6 => msunmaintain2[h, c, o];
ENDCASE => ERROR SunRPC.Error[$wrongProc];
};
servernoop2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
o.servernoop[o];
SunRPC.StartReply[h];
};
querycentralnms2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
host: ROPE;
state: NMS.ClaimState;
out: NMS.QueryCentralNMSreturn;
host ← SunRPC.GetRope[h];
state ← NMSGetPut.GetClaimState[h];
out ← o.querycentralnms[o,
host,
state];
SunRPC.StartReply[h];
NMSGetPut.PutQueryCentralNMSreturn[h, out];
};
updatecentralnms2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
host: NS.String;
how: NMS.UpdateType;
objs: NMS.SeqType0;
out: NMS.ReturnCodes;
host ← NSGetPut.GetString[h];
how ← NMSGetPut.GetUpdateType[h];
{
len: INT ← SunRPC.GetInt32[h];
objs ← NEW[NMS.SeqType0Object[len]];
FOR i: INT IN [0..len) DO
objs[i] ← NMSGetPut.GetUpdateObject[h];
ENDLOOP;
};
out ← o.updatecentralnms[o,
host,
how,
objs];
SunRPC.StartReply[h];
NMSGetPut.PutReturnCodes[h, out];
};
querylocalnms2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
centralHost: ROPE;
out: NMS.QueryLocalNMSreturn;
centralHost ← SunRPC.GetRope[h];
out ← o.querylocalnms[o,
centralHost];
SunRPC.StartReply[h];
NMSGetPut.PutQueryLocalNMSreturn[h, out];
};
querymaintain2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
idStr: ROPE;
out: NMS.QueryMaintainreturn;
idStr ← SunRPC.GetRope[h];
out ← o.querymaintain[o,
idStr];
SunRPC.StartReply[h];
NMSGetPut.PutQueryMaintainreturn[h, out];
};
setdebuglevel2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
in: INT32;
out: NMS.ReturnCodes;
in ← SunRPC.GetInt32[h];
out ← o.setdebuglevel[o, in];
SunRPC.StartReply[h];
NMSGetPut.PutReturnCodes[h, out];
};
checkconfigfiles2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
out: NMS.ReturnCodes;
out ← o.checkconfigfiles[o];
SunRPC.StartReply[h];
NMSGetPut.PutReturnCodes[h, out];
};
nsinsert2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
registrationKind: NS.String;
object: NS.Object;
pid: INT32;
domain: NS.Domain;
out: NS.Insertreturn;
registrationKind ← NSGetPut.GetString[h];
object ← NSGetPut.GetObject[h];
pid ← SunRPC.GetInt32[h];
domain ← NSGetPut.GetDomain[h];
out ← o.nsinsert[o,
registrationKind,
object,
pid,
domain];
SunRPC.StartReply[h];
NSGetPut.PutInsertreturn[h, out];
};
nsdelete2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
uid: NS.String;
domain: NS.Domain;
out: NS.ReturnCodes;
uid ← NSGetPut.GetString[h];
domain ← NSGetPut.GetDomain[h];
out ← o.nsdelete[o,
uid,
domain];
SunRPC.StartReply[h];
NSGetPut.PutReturnCodes[h, out];
};
nsreplace2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
registrationKind: NS.String;
object: NS.Object;
uid: NS.String;
domain: NS.Domain;
out: NS.ReturnCodes;
registrationKind ← NSGetPut.GetString[h];
object ← NSGetPut.GetObject[h];
uid ← NSGetPut.GetString[h];
domain ← NSGetPut.GetDomain[h];
out ← o.nsreplace[o,
registrationKind,
object,
uid,
domain];
SunRPC.StartReply[h];
NSGetPut.PutReturnCodes[h, out];
};
nsfind2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
patterns: NS.Object;
projection: NS.ProjectionList;
domain: NS.Domain;
out: NS.Findreturn;
patterns ← NSGetPut.GetObject[h];
projection ← NSGetPut.GetProjectionList[h];
domain ← NSGetPut.GetDomain[h];
out ← o.nsfind[o,
patterns,
projection,
domain];
SunRPC.StartReply[h];
NSGetPut.PutFindreturn[h, out];
};
msmaintain2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
idStr: ROPE;
progName: ROPE;
progArgs: MS.SeqType0;
uid: INT32;
pid: INT32;
out: MS.Maintainreturn;
idStr ← SunRPC.GetRope[h];
progName ← SunRPC.GetRope[h];
{
len: INT ← SunRPC.GetInt32[h];
progArgs ← NEW[MS.SeqType0Object[len]];
FOR i: INT IN [0..len) DO
progArgs[i] ← MSGetPut.GetString[h];
ENDLOOP;
};
uid ← SunRPC.GetInt32[h];
pid ← SunRPC.GetInt32[h];
out ← o.msmaintain[o,
idStr,
progName,
progArgs,
uid,
pid];
SunRPC.StartReply[h];
MSGetPut.PutMaintainreturn[h, out];
};
msunmaintain2: PROC[h: Handle, c: Conversation, o: NMS.NMS2] = {
idStr: ROPE;
out: MS.ReturnCodes;
idStr ← SunRPC.GetRope[h];
out ← o.msunmaintain[o,
idStr];
SunRPC.StartReply[h];
MSGetPut.PutReturnCodes[h, out];
};
END.