2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 1999 by Sun Microsystems, Inc.
2N/A * All rights reserved.
2N/A *
2N/A */
2N/A
2N/A// SrvLocMsgImpl.java: SrvLocMsg implementation.
2N/A// Author: James Kempf
2N/A// Created On: Tue Sep 15 10:06:27 1998
2N/A// Last Modified By: James Kempf
2N/A// Last Modified On: Sun Oct 11 17:11:13 1998
2N/A// Update Count: 8
2N/A//
2N/A
2N/Apackage com.sun.slp;
2N/A
2N/Aimport java.util.*;
2N/A
2N/A/**
2N/A * The SrvLocMsgImpl class is the base class for all SLPv2 side SrvLocMsg
2N/A * implementations.
2N/A *
2N/A * @author James Kempf
2N/A */
2N/A
2N/Aabstract class SrvLocMsgImpl extends Object implements SrvLocMsg {
2N/A
2N/A protected SrvLocHeader hdr = null;
2N/A
2N/A // For creating outgoing messages.
2N/A
2N/A SrvLocMsgImpl() {}
2N/A
2N/A // Check and set the header.
2N/A
2N/A SrvLocMsgImpl(SrvLocHeader hdr, int functionCode)
2N/A throws ServiceLocationException {
2N/A
2N/A if (hdr.functionCode != functionCode) {
2N/A throw
2N/A new ServiceLocationException(
2N/A ServiceLocationException.NETWORK_ERROR,
2N/A "wrong_reply_type",
2N/A new Object[] {new Integer(hdr.functionCode)});
2N/A }
2N/A
2N/A this.hdr = hdr;
2N/A
2N/A }
2N/A
2N/A // Return the header.
2N/A
2N/A public SrvLocHeader getHeader() {
2N/A return hdr;
2N/A }
2N/A
2N/A // Return the error code, via the header.
2N/A
2N/A public short getErrorCode() {
2N/A return hdr.errCode;
2N/A }
2N/A
2N/A}