/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
// SLPServerHeaderV2.java: SLPv2 Header Class for Server Side
// Author: James Kempf
// Created On: Wed Sep 16 08:44:31 1998
// Last Modified By: James Kempf
// Last Modified On: Mon Jan 4 15:26:33 1999
// Update Count: 30
//
/**
* The SLPServerHeaderV2 class serves as the header class for all server side
* SLPv2 messages.
*
* @author James Kempf
*/
// Function code for message reply.
// For SrvLocHeader.newInstance().
super();
}
// Construct a header for output. Used by the client side code to
// construct an initial request and the server side code to construct
// a reply.
throws ServiceLocationException {
}
// Assign reply code based on function code type, then use superclass
// method to parse header.
throws ServiceLocationException, IOException {
// We ignore the error case here.
switch (functionCode) {
case SrvLocHeader.SrvReq:
break;
case SrvLocHeader.AttrRqst:
break;
case SrvLocHeader.SrvTypeRqst:
break;
break;
// If we get an error during creating of the DAAdvert to
// reply, we need to continue and reply with DAAdvert.
// This is only true for a unicast DAAdvert, though.
case SrvLocHeader.DAAdvert:
break;
// We ignore the header error code for SAAdvert because
// it is always multicast.
}
// We are now set up to handle any errors that may come flying out
// of here.
}
// Replace the superclass method with a method that parses the server
// side.
throws ServiceLocationException,
// DAAdvert needs to get it's error code parsed here because
// error codes are always handled in parseMsg() and it is
// the only server side message that has one.
}
// Switch and convert according to function code.
switch (functionCode) {
case SrvLocHeader.SrvReg:
break;
case SrvLocHeader.SrvDereg:
break;
case SrvLocHeader.SrvReq:
break;
case SrvLocHeader.AttrRqst:
break;
case SrvLocHeader.SrvAck:
// We function as our own message.
msg = this;
iNumReplies = 1;
break;
case SrvLocHeader.SrvTypeRqst:
break;
case SrvLocHeader.DAAdvert:
break;
case SrvLocHeader.SAAdvert:
break;
default:
throw
"function_code_error",
new Object[] {
new Integer(functionCode)});
}
// Check for size overflow.
throw
"length_overflow",
new Object[] {
}
return msg;
}
// Create an error reply using the reply code. Calculate the
// error code using the exception.
// Clone the header to make sure that everything else is the same.
// We don't want to use the same header because it may be tested
// elsewhere.
try {
} catch (CloneNotSupportedException exx) {
// We support it, so no-op.
}
// Re-initialize flags but not multicast, since we need to filter on it
// We should *not* be getting a null exception down this path!
"null_parameter",
if (ex instanceof ServiceLocationException) {
}
} else if (ex instanceof IllegalArgumentException ||
ex instanceof IOException) {
} else {
}
// Construct header description.
return hdr;
}
// Return a reply header with flags properly set.
try {
} catch (CloneNotSupportedException ex) {
// No-op, since we support it.
}
return hdr;
}
// Return display string.
return
}
//
// Parsing Utilities.
//
// Parse in the scope list.
throws ServiceLocationException, IOException {
// Unescape scope strings.
// Validate.
}
throws ServiceLocationException, IOException {
}
// Return an SLPv2 DAAdvert.
long timestamp,
throws ServiceLocationException {
// If scopes vector is null, then return all scopes for this
// DA.
}
}
}