[java-shib-shared] branch main updated: Add a deprecated stub for IPRange class.

Scott Cantor cantor.2 at osu.edu
Fri Mar 24 18:04:51 UTC 2023


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch main
in repository java-shib-shared.

View the commit online:
http://git.shibboleth.net/view/?p=java-shib-shared.git;a=commit;h=1d7d3f61e99e1f4b1679d4cc66237afe6c81a0b5

The following commit(s) were added to refs/heads/main by this push:
     new 1d7d3f61 Add a deprecated stub for IPRange class.
1d7d3f61 is described below

commit 1d7d3f61e99e1f4b1679d4cc66237afe6c81a0b5
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Mar 24 14:04:27 2023 -0400

    Add a deprecated stub for IPRange class.
---
 .../utilities/java/support/net/IPRange.java        | 82 ++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/shib-networking/src/main/java/net/shibboleth/utilities/java/support/net/IPRange.java b/shib-networking/src/main/java/net/shibboleth/utilities/java/support/net/IPRange.java
new file mode 100644
index 00000000..a59c8094
--- /dev/null
+++ b/shib-networking/src/main/java/net/shibboleth/utilities/java/support/net/IPRange.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the University Corporation for Advanced Internet Development,
+ * Inc. (UCAID) under one or more contributor license agreements.  See the
+ * NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The UCAID licenses this file to You under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package net.shibboleth.utilities.java.support.net;
+
+import java.net.InetAddress;
+
+import javax.annotation.Nonnull;
+
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+import net.shibboleth.shared.primitive.DeprecationSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
+
+/**
+ * Represents a range of IP addresses.
+ * 
+ * @deprecated
+ */
+ at Deprecated(since="9.0.0", forRemoval=true)
+public class IPRange extends net.shibboleth.shared.net.IPRange {
+
+    /**
+     * Constructor.
+     * 
+     * @param address address to base the range on; may be the network address or the
+     *                address of a host within the network
+     * @param maskSize the number of bits in the netmask
+     * 
+     * @throws IllegalArgumentException if the address or mask are invalid
+     */
+    public IPRange(@Nonnull final InetAddress address, final int maskSize) throws IllegalArgumentException {
+        super(address, maskSize);
+        DeprecationSupport.warn(ObjectType.CLASS, getClass().getName(), null,
+                net.shibboleth.shared.net.IPRange.class.getName());
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param address address to base the range on; may be the network address or the
+     *                address of a host within the network
+     * @param maskSize the number of bits in the netmask
+     * 
+     * @throws IllegalArgumentException if the address or mask are invalid
+     */
+    public IPRange(@Nonnull final byte[] address, final int maskSize) throws IllegalArgumentException {
+        super(address, maskSize);
+        DeprecationSupport.warn(ObjectType.CLASS, getClass().getName(), null,
+                net.shibboleth.shared.net.IPRange.class.getName());
+    }
+    
+    /**
+     * Parses a CIDR block definition in to an IP range.
+     * 
+     * @param cidrBlock the CIDR block definition
+     * 
+     * @return the resultant IP range
+     * 
+     * @throws IllegalArgumentException if expression cannot be parsed
+     */
+    @Nonnull public static net.shibboleth.shared.net.IPRange parseCIDRBlock(@Nonnull @NotEmpty final String cidrBlock)
+            throws IllegalArgumentException {
+        DeprecationSupport.warn(ObjectType.CLASS, IPRange.class.getName(), null,
+                net.shibboleth.shared.net.IPRange.class.getName());
+        return net.shibboleth.shared.net.IPRange.parseCIDRBlock(cidrBlock);
+    }
+    
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list