/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Notification Target data.
*/
private int port;
/**
* Target parameter is a <CODE>java.lang.String</CODE>
* target synctax is <host>:<port>:community. Eg: "localhost:163:private".
* <p>The <code><em>host</em></code> is a host name, an IPv4 numeric
* host address, or an IPv6 numeric address enclosed in square
* brackets.</p>
* @throws IllegalArgumentException In case the target is malformed
*/
throws IllegalArgumentException, UnknownHostException {
}
throws UnknownHostException {
}
}
throws IllegalArgumentException, UnknownHostException {
if(index == -1)
throw new IllegalArgumentException("Host starts with [ but " +
"does not end with ]");
index2));
if (!isNumericIPv6Address(addrStr)) {
throw new IllegalArgumentException("Address inside [...] must " +
"be numeric IPv6 address");
}
throw new IllegalArgumentException("More than one [[...]]");
} else {
if(index == -1) throw new
IllegalArgumentException("Missing port separator \":\"");
index2));
}
//THE CHECK SHOULD BE STRONGER!!!
}
/* True if this string, assumed to be a valid argument to
* InetAddress.getByName, is a numeric IPv6 address.
*/
// address contains colon iff it's a numeric IPv6 address
}
return community;
}
return address;
}
public int getPort() {
return port;
}
" community : " + community;
}
}