View Javadoc
1   // NAME
2   //      $RCSfile: AsnOctetsPrintableFace.java,v $
3   // DESCRIPTION
4   //      [given below in javadoc format]
5   // DELTA
6   //      $Revision: 3.5 $
7   // CREATED
8   //      $Date: 2006/03/23 14:54:10 $
9   // COPYRIGHT
10  //      Westhawk Ltd
11  // TO DO
12  //
13  
14  /*
15   * Copyright (C) 2005 - 2006 by Westhawk Ltd
16   * <a href="www.westhawk.co.uk">www.westhawk.co.uk</a>
17   *
18   * Permission to use, copy, modify, and distribute this software
19   * for any purpose and without fee is hereby granted, provided
20   * that the above copyright notices appear in all copies and that
21   * both the copyright notice and this permission notice appear in
22   * supporting documentation.
23   * This software is provided "as is" without express or implied
24   * warranty.
25   * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a>
26   */
27  
28  package uk.co.westhawk.snmp.stack;
29  
30  /*-
31   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
32   * SNMP Java Client
33   * ჻჻჻჻჻჻
34   * Copyright 2023 MetricsHub, Westhawk
35   * ჻჻჻჻჻჻
36   * This program is free software: you can redistribute it and/or modify
37   * it under the terms of the GNU Lesser General Public License as
38   * published by the Free Software Foundation, either version 3 of the
39   * License, or (at your option) any later version.
40   *
41   * This program is distributed in the hope that it will be useful,
42   * but WITHOUT ANY WARRANTY; without even the implied warranty of
43   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
44   * GNU General Lesser Public License for more details.
45   *
46   * You should have received a copy of the GNU General Lesser Public
47   * License along with this program.  If not, see
48   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
49   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
50   */
51  
52  /**
53   * This interface contains the isPrintable() method that is used to decided
54   * whether or not an AsnOctets with type ASN_OCTET_STR is printable or not.
55   * This interface has no effect on the way AsnOctets with type IPADDRESS 
56   * or OPAQUE are printed.
57   *
58   * <p>
59   * When the type is ASN_OCTET_STR, the method tries to guess whether
60   * or not the string is printable; without the knowledge of the MIB
61   * it cannot distinguish between OctetString and any textual
62   * conventions, like DisplayString, InternationalDisplayString or DateAndTime.
63   * </p>
64   *
65   * @since 4_14
66   * @author <a href="mailto:snmp@westhawk.co.uk">Birgit Arkesteijn</a>
67   * @version $Revision: 3.5 $ $Date: 2006/03/23 14:54:10 $
68   */
69  public interface AsnOctetsPrintableFace {
70      static final String version_id = "@(#)$Id: AsnOctetsPrintableFace.java,v 3.5 2006/03/23 14:54:10 birgit Exp $ Copyright Westhawk Ltd";
71  
72      /**
73       * Returns whether or not the AsnOctets' byte array represent a printable
74       * string or not.
75       *
76       * @see AsnOctets#toCalendar()
77       * @see AsnOctets#toDisplayString()
78       * @see AsnOctets#toHex()
79       * @see AsnOctets#toString()
80       */
81      public boolean isPrintable(byte[] value);
82  
83      /**
84       * This method provides the implemantation of the
85       * InternationalDisplayString text-convention. See
86       * <a href="http://www.ietf.org/rfc/rfc2790.txt">HOST-RESOURCES-MIB</a>.
87       *
88       * <p>
89       * "This data type is used to model textual information
90       * in some character set. A network management station
91       * should use a local algorithm to determine which
92       * character set is in use and how it should be
93       * displayed. Note that this character set may be
94       * encoded with more than one octet per symbol, but will
95       * most often be NVT ASCII. When a size clause is
96       * specified for an object of this type, the size refers
97       * to the length in octets, not the number of symbols."
98       * </p>
99       */
100     public String toInternationalDisplayString(byte[] value);
101 
102 }