1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * ident "%Z%%M% %I% %E% SMI" 24 * 25 * Copyright (c) 1999 by Sun Microsystems, Inc. 26 * All rights reserved. 27 * 28 */ 29 30 // SCCS Status: %W% %G% 31 // SrvLocMsgImpl.java: SrvLocMsg implementation. 32 // Author: James Kempf 33 // Created On: Tue Sep 15 10:06:27 1998 34 // Last Modified By: James Kempf 35 // Last Modified On: Sun Oct 11 17:11:13 1998 36 // Update Count: 8 37 // 38 39 package com.sun.slp; 40 41 import java.util.*; 42 43 /** 44 * The SrvLocMsgImpl class is the base class for all SLPv2 side SrvLocMsg 45 * implementations. 46 * 47 * @version %R%.%L% %D% 48 * @author James Kempf 49 */ 50 51 abstract class SrvLocMsgImpl extends Object implements SrvLocMsg { 52 53 protected SrvLocHeader hdr = null; 54 55 // For creating outgoing messages. 56 57 SrvLocMsgImpl() {} 58 59 // Check and set the header. 60 61 SrvLocMsgImpl(SrvLocHeader hdr, int functionCode) 62 throws ServiceLocationException { 63 64 if (hdr.functionCode != functionCode) { 65 throw 66 new ServiceLocationException( 67 ServiceLocationException.NETWORK_ERROR, 68 "wrong_reply_type", 69 new Object[] {new Integer(hdr.functionCode)}); 70 } 71 72 this.hdr = hdr; 73 74 } 75 76 // Return the header. 77 78 public SrvLocHeader getHeader() { 79 return hdr; 80 } 81 82 // Return the error code, via the header. 83 84 public short getErrorCode() { 85 return hdr.errCode; 86 } 87 88 } 89