diff options
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/resource')
30 files changed, 0 insertions, 2008 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocation.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocation.java deleted file mode 100644 index 01b69b2a..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocation.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Abstraction of allocated resource. - */ -@Beta -public interface ResourceAllocation { - /** - * Returns the resource type. - * - * @return the resource type - */ - ResourceType type(); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocationException.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocationException.java deleted file mode 100644 index c3d1fcc7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceAllocationException.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Exception thrown for resource allocation errors. - */ -@Beta -public class ResourceAllocationException extends ResourceException { - public ResourceAllocationException() { - super(); - } - - public ResourceAllocationException(String message) { - super(message); - } - - public ResourceAllocationException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceException.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceException.java deleted file mode 100644 index 31e82d5d..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceException.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Represents a resource related error. - */ -@Beta -public class ResourceException extends RuntimeException { - - /** - * Constructs an exception with no message and no underlying cause. - */ - public ResourceException() { - } - - /** - * Constructs an exception with the specified message. - * - * @param message the message describing the specific nature of the error - */ - public ResourceException(String message) { - super(message); - } - - /** - * Constructs an exception with the specified message and the underlying cause. - * - * @param message the message describing the specific nature of the error - * @param cause the underlying cause of this error - */ - public ResourceException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceId.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceId.java deleted file mode 100644 index 722ec4d7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceId.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Resource identifier. - */ -@Beta -public interface ResourceId { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceRequest.java deleted file mode 100644 index fb53f120..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceRequest.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Abstraction of resource request. - */ -@Beta -public interface ResourceRequest { - /** - * Returns the resource type. - * - * @return the resource type - */ - ResourceType type(); - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceType.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceType.java deleted file mode 100644 index 75832134..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/ResourceType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource; - -import com.google.common.annotations.Beta; - -/** - * Represents types for link resources. - */ -@Beta -public enum ResourceType { - /** - * Lambda resource type. - */ - LAMBDA, - - /** - * Bandwidth resource type. - */ - BANDWIDTH, - - /** - * MPLS label resource type. - */ - MPLS_LABEL, -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java deleted file mode 100644 index f17bfb8e..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/IntentSetMultimap.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.device; - -import com.google.common.annotations.Beta; -import org.onosproject.net.intent.IntentId; - -import java.util.Set; - -@Beta -public interface IntentSetMultimap { - - /** - * Allocates the mapping between the given intents. - * - * @param keyIntentId key intent ID - * @param valIntentId value intent ID - * @return true if mapping was successful, false otherwise - */ - boolean allocateMapping(IntentId keyIntentId, IntentId valIntentId); - - /** - * Returns the set of intents mapped to a lower intent. - * - * @param intentId intent ID - * @return set of intent IDs - */ - Set<IntentId> getMapping(IntentId intentId); - - /** - * Releases the mapping of the given intent. - * - * @param intentId intent ID - */ - void releaseMapping(IntentId intentId); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/package-info.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/package-info.java deleted file mode 100644 index 3ced37dc..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/device/package-info.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed 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. - */ - -/** - * Services for reserving devices as network resources. - */ -package org.onosproject.net.resource.device; diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResource.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResource.java deleted file mode 100644 index d3bd2d7b..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResource.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import org.onlab.util.Bandwidth; -import org.onlab.util.DataRateUnit; -import java.util.Objects; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Representation of bandwidth resource in bps. - * - * @deprecated in Emu Release - */ -@Deprecated -public final class BandwidthResource implements LinkResource { - - private final Bandwidth bandwidth; - - /** - * Creates a new instance with given bandwidth. - * - * @param bandwidth bandwidth value to be assigned - */ - public BandwidthResource(Bandwidth bandwidth) { - this.bandwidth = checkNotNull(bandwidth); - } - - // Constructor for serialization - private BandwidthResource() { - this.bandwidth = null; - } - - /** - * Creates a new bandwidth resource. - * - * @param v amount of bandwidth to request - * @param unit {@link DataRateUnit} of {@code v} - * @return {@link BandwidthResource} instance with given bandwidth - */ - public static BandwidthResource of(double v, DataRateUnit unit) { - return new BandwidthResource(Bandwidth.of(v, unit)); - } - - /** - * Returns bandwidth as a double value. - * - * @return bandwidth as a double value - */ - public double toDouble() { - return bandwidth.bps(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof BandwidthResource) { - BandwidthResource that = (BandwidthResource) obj; - return Objects.equals(this.bandwidth, that.bandwidth); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hashCode(this.bandwidth); - } - - @Override - public String toString() { - return String.valueOf(this.bandwidth); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceAllocation.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceAllocation.java deleted file mode 100644 index 5f36d5f8..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceAllocation.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceAllocation; -import org.onosproject.net.resource.ResourceType; - -import java.util.Objects; - -/** - * Representation of allocated bandwidth resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class BandwidthResourceAllocation implements ResourceAllocation { - private final BandwidthResource bandwidth; - - /** - * Creates a new {@link BandwidthResourceRequest} with {@link BandwidthResource} - * object. - * - * @param bandwidth {@link BandwidthResource} object to be requested - */ - public BandwidthResourceAllocation(BandwidthResource bandwidth) { - this.bandwidth = bandwidth; - } - - /** - * Returns the bandwidth resource. - * - * @return the bandwidth resource - */ - public BandwidthResource bandwidth() { - return bandwidth; - } - - @Override - public ResourceType type() { - return ResourceType.BANDWIDTH; - } - - @Override - public int hashCode() { - return bandwidth.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final BandwidthResourceAllocation other = (BandwidthResourceAllocation) obj; - return Objects.equals(this.bandwidth, other.bandwidth()); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("bandwidth", bandwidth) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceRequest.java deleted file mode 100644 index ff26e81e..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/BandwidthResourceRequest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Objects; - -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceRequest; -import org.onosproject.net.resource.ResourceType; - -/** - * Representation of a request for bandwidth resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class BandwidthResourceRequest implements ResourceRequest { - private final BandwidthResource bandwidth; - - /** - * Creates a new {@link BandwidthResourceRequest} with {@link BandwidthResource} - * object. - * - * @param bandwidth {@link BandwidthResource} object to be requested - */ - public BandwidthResourceRequest(BandwidthResource bandwidth) { - this.bandwidth = bandwidth; - } - - /** - * Returns the bandwidth resource. - * - * @return the bandwidth resource - */ - public BandwidthResource bandwidth() { - return bandwidth; - } - - @Override - public ResourceType type() { - return ResourceType.BANDWIDTH; - } - - @Override - public int hashCode() { - return bandwidth.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final BandwidthResourceRequest other = (BandwidthResourceRequest) obj; - return Objects.equals(this.bandwidth, other.bandwidth()); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("bandwidth", bandwidth) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceAllocations.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceAllocations.java deleted file mode 100644 index 2fa4fa6b..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceAllocations.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import static com.google.common.base.Preconditions.checkNotNull; - -import com.google.common.base.MoreObjects; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; - -import org.onosproject.net.Link; -import org.onosproject.net.intent.IntentId; -import org.onosproject.net.resource.ResourceAllocation; -import org.onosproject.net.resource.ResourceRequest; -import org.onosproject.net.resource.ResourceType; - -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Objects; -import java.util.Map.Entry; -import java.util.Set; - -/** - * Implementation of {@link LinkResourceAllocations}. - * - * @deprecated in Emu Release - */ -@Deprecated -public class DefaultLinkResourceAllocations implements LinkResourceAllocations { - private final LinkResourceRequest request; - // TODO: probably should be using LinkKey instead - private final Map<Link, Set<ResourceAllocation>> allocations; - - /** - * Creates a new link resource allocations. - * - * @param request requested resources - * @param allocations allocated resources - */ - public DefaultLinkResourceAllocations(LinkResourceRequest request, - Map<Link, Set<ResourceAllocation>> allocations) { - this.request = checkNotNull(request); - ImmutableMap.Builder<Link, Set<ResourceAllocation>> builder - = ImmutableMap.builder(); - for (Entry<Link, Set<ResourceAllocation>> e : allocations.entrySet()) { - builder.put(e.getKey(), ImmutableSet.copyOf(e.getValue())); - } - this.allocations = builder.build(); - } - - public IntentId intentId() { - return request.intentId(); - } - - public Collection<Link> links() { - return request.links(); - } - - public Set<ResourceRequest> resources() { - return request.resources(); - } - - @Override - public ResourceType type() { - return null; - } - - @Override - public Set<ResourceAllocation> getResourceAllocation(Link link) { - Set<ResourceAllocation> result = allocations.get(link); - if (result == null) { - result = Collections.emptySet(); - } - return result; - } - - @Override - public int hashCode() { - return Objects.hash(request, allocations); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final DefaultLinkResourceAllocations other = (DefaultLinkResourceAllocations) obj; - return Objects.equals(this.request, other.request) - && Objects.equals(this.allocations, other.allocations); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("allocations", allocations) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceRequest.java deleted file mode 100644 index 583570f5..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/DefaultLinkResourceRequest.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.Objects; -import java.util.stream.Collectors; - -import com.google.common.annotations.Beta; -import com.google.common.collect.ImmutableMap; -import org.onlab.util.Bandwidth; -import org.onosproject.net.Link; -import org.onosproject.net.intent.Constraint; -import org.onosproject.net.intent.IntentId; - -import org.onosproject.net.intent.constraint.BandwidthConstraint; -import org.onosproject.net.intent.constraint.LambdaConstraint; -import org.onosproject.net.resource.ResourceRequest; -import org.onosproject.net.resource.ResourceType; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Implementation of {@link LinkResourceRequest}. - * - * @deprecated in Emu Release - */ -@Deprecated -public final class DefaultLinkResourceRequest implements LinkResourceRequest { - - private final IntentId intentId; - protected final Map<Link, Set<ResourceRequest>> requests; - - /** - * Creates a new link resource request with the specified Intent ID, - * and resource requests over links. - * - * @param intentId intent ID associated with this request - * @param requests resource requests over links - */ - private DefaultLinkResourceRequest(IntentId intentId, Map<Link, Set<ResourceRequest>> requests) { - this.intentId = checkNotNull(intentId); - this.requests = checkNotNull(ImmutableMap.copyOf(requests)); - } - - @Override - public ResourceType type() { - return null; - } - - @Override - public IntentId intentId() { - return intentId; - } - - @Override - public Collection<Link> links() { - return requests.keySet(); - } - - @Override - public Set<ResourceRequest> resources() { - return requests.values().stream() - .flatMap(Collection::stream) - .collect(Collectors.toSet()); - } - - @Override - public Set<ResourceRequest> resources(Link link) { - return requests.get(link); - } - - /** - * Returns builder of link resource request. - * - * @param intentId intent ID related to this request - * @param links a set of links for the request - * @return builder of link resource request - */ - public static LinkResourceRequest.Builder builder( - IntentId intentId, Collection<Link> links) { - return new Builder(intentId, links); - } - - /** - * Builder of link resource request. - */ - public static final class Builder implements LinkResourceRequest.Builder { - private IntentId intentId; - private Map<Link, Set<ResourceRequest>> requests; - - /** - * Creates a new link resource request. - * - * @param intentId intent ID related to this request - * @param links a set of links for the request - */ - private Builder(IntentId intentId, Collection<Link> links) { - this.intentId = intentId; - this.requests = new HashMap<>(); - for (Link link : links) { - requests.put(link, new HashSet<>()); - } - } - - /** - * Adds lambda request. - * - * @return self - * @deprecated in Emu Release - */ - @Deprecated - @Override - public Builder addLambdaRequest() { - for (Link link : requests.keySet()) { - requests.get(link).add(new LambdaResourceRequest()); - } - return this; - } - - @Beta - @Override - public LinkResourceRequest.Builder addLambdaRequest(LambdaResource lambda) { - for (Link link : requests.keySet()) { - requests.get(link).add(new LambdaResourceRequest(lambda)); - } - return this; - } - - /** - * Adds Mpls request. - * - * @return self - * @deprecated in Emu Release - */ - @Deprecated - @Override - public Builder addMplsRequest() { - for (Link link : requests.keySet()) { - requests.get(link).add(new MplsLabelResourceRequest()); - } - return this; - } - - @Beta - @Override - public Builder addMplsRequest(MplsLabel label) { - for (Link link : requests.keySet()) { - requests.get(link).add(new MplsLabelResourceRequest(label)); - } - return this; - } - - @Beta - @Override - public LinkResourceRequest.Builder addMplsRequest(Map<Link, MplsLabel> labels) { - for (Link link : labels.keySet()) { - if (!requests.containsKey(link)) { - requests.put(link, new HashSet<>()); - } - requests.get(link).add(new MplsLabelResourceRequest(labels.get(link))); - } - - return this; - } - - /** - * Adds bandwidth request with bandwidth value. - * - * @param bandwidth bandwidth value in bits per second to be requested - * @return self - */ - @Override - public Builder addBandwidthRequest(double bandwidth) { - for (Link link : requests.keySet()) { - requests.get(link).add(new BandwidthResourceRequest(new BandwidthResource(Bandwidth.bps(bandwidth)))); - } - return this; - } - - @Override - public LinkResourceRequest.Builder addConstraint(Constraint constraint) { - if (constraint instanceof LambdaConstraint) { - return addLambdaRequest(); - } else if (constraint instanceof BandwidthConstraint) { - BandwidthConstraint bw = (BandwidthConstraint) constraint; - return addBandwidthRequest(bw.bandwidth().bps()); - } - return this; - } - - /** - * Returns link resource request. - * - * @return link resource request - */ - @Override - public LinkResourceRequest build() { - return new DefaultLinkResourceRequest(intentId, requests); - } - } - - @Override - public int hashCode() { - return Objects.hash(intentId, links()); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final DefaultLinkResourceRequest other = (DefaultLinkResourceRequest) obj; - return Objects.equals(this.intentId, other.intentId) - && Objects.equals(this.links(), other.links()); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResource.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResource.java deleted file mode 100644 index 06582497..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResource.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import org.onosproject.net.IndexedLambda; - -import java.util.Objects; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Representation of lambda resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public final class LambdaResource implements LinkResource { - - private final IndexedLambda lambda; - - /** - * Creates a new instance with given lambda. - * - * @param lambda lambda to be assigned - */ - private LambdaResource(IndexedLambda lambda) { - this.lambda = checkNotNull(lambda); - } - - // Constructor for serialization - private LambdaResource() { - this.lambda = null; - } - - /** - * Creates a new instance with the given index of lambda. - * - * @param lambda index value of lambda to be assigned - * @return {@link LambdaResource} instance with the given lambda - */ - public static LambdaResource valueOf(int lambda) { - return valueOf(new IndexedLambda(lambda)); - } - - /** - * Creates a new instance with the given lambda. - * - * @param lambda lambda to be assigned - * @return {@link LambdaResource} instance with the given lambda - */ - public static LambdaResource valueOf(IndexedLambda lambda) { - return new LambdaResource(lambda); - } - - /** - * Returns lambda as an int value. - * - * @return lambda as an int value - */ - public int toInt() { - return (int) lambda.index(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof LambdaResource) { - LambdaResource that = (LambdaResource) obj; - return Objects.equals(this.lambda, that.lambda); - } - return false; - } - - @Override - public int hashCode() { - return lambda.hashCode(); - } - - @Override - public String toString() { - return String.valueOf(this.lambda); - } - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceAllocation.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceAllocation.java deleted file mode 100644 index 930a6b27..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceAllocation.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceAllocation; -import org.onosproject.net.resource.ResourceType; - -import java.util.Objects; - -/** - * Representation of allocated lambda resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class LambdaResourceAllocation implements ResourceAllocation { - private final LambdaResource lambda; - - @Override - public ResourceType type() { - return ResourceType.LAMBDA; - } - - /** - * Creates a new {@link LambdaResourceAllocation} with {@link LambdaResource} - * object. - * - * @param lambda allocated lambda - */ - public LambdaResourceAllocation(LambdaResource lambda) { - this.lambda = lambda; - } - - /** - * Returns the lambda resource. - * - * @return the lambda resource - */ - public LambdaResource lambda() { - return lambda; - } - - @Override - public int hashCode() { - return Objects.hashCode(lambda); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final LambdaResourceAllocation other = (LambdaResourceAllocation) obj; - return Objects.equals(this.lambda, other.lambda); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("lambda", lambda) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceRequest.java deleted file mode 100644 index 24d3d78d..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LambdaResourceRequest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import com.google.common.annotations.Beta; -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceRequest; -import org.onosproject.net.resource.ResourceType; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Representation of a request for lambda resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class LambdaResourceRequest implements ResourceRequest { - - private final LambdaResource lambda; - - /** - * Constructs a request specifying the given lambda. - * - * @param lambda lambda to be requested - */ - @Beta - public LambdaResourceRequest(LambdaResource lambda) { - this.lambda = checkNotNull(lambda); - } - - /** - * Constructs a request asking an arbitrary available lambda. - * - * @deprecated in Emu Release - */ - @Deprecated - public LambdaResourceRequest() { - this.lambda = null; - } - - /** - * Returns the lambda this request expects. - * - * @return the lambda this request expects - */ - @Beta - public LambdaResource lambda() { - return lambda; - } - - @Override - public ResourceType type() { - return ResourceType.LAMBDA; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("lambda", lambda) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResource.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResource.java deleted file mode 100644 index b06f16bf..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResource.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -/** - * Abstraction of link resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResource { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceAllocations.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceAllocations.java deleted file mode 100644 index d0211e26..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceAllocations.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Collection; -import java.util.Set; - -import org.onosproject.net.Link; -import org.onosproject.net.intent.IntentId; -import org.onosproject.net.resource.ResourceAllocation; -import org.onosproject.net.resource.ResourceRequest; - -/** - * Representation of allocated link resources. - * - * @deprecated - */ -@Deprecated -public interface LinkResourceAllocations extends ResourceAllocation { - - /** - * Returns the {@link IntentId} associated with the request. - * - * @return the {@link IntentId} associated with the request - */ - IntentId intentId(); - - /** - * Returns the set of target links. - * - * @return the set of target links - */ - Collection<Link> links(); - - /** - * Returns the set of resource requests. - * - * @return the set of resource requests - */ - Set<ResourceRequest> resources(); - - /** - * Returns allocated resource for the given link. - * - * @param link the target link - * @return allocated resource for the link - */ - Set<ResourceAllocation> getResourceAllocation(Link link); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceEvent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceEvent.java deleted file mode 100644 index a3702923..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceEvent.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Collection; - -import org.onosproject.event.AbstractEvent; - -import com.google.common.collect.ImmutableList; - -/** - * Describes an event related to a Link Resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public final class LinkResourceEvent - extends AbstractEvent<LinkResourceEvent.Type, Collection<LinkResourceAllocations>> { - - /** - * Type of resource this event is for. - */ - public enum Type { - /** Additional resources are now available. */ - ADDITIONAL_RESOURCES_AVAILABLE - } - - /** - * Constructs a link resource event. - * - * @param type type of resource event to create - * @param linkResourceAllocations allocations that are now available - */ - public LinkResourceEvent(Type type, - Collection<LinkResourceAllocations> linkResourceAllocations) { - super(type, ImmutableList.copyOf(linkResourceAllocations)); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceListener.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceListener.java deleted file mode 100644 index bbb02e2f..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceListener.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import org.onosproject.event.EventListener; - -/** - * Entity for receiving link resource events. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResourceListener extends EventListener<LinkResourceEvent> { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceRequest.java deleted file mode 100644 index 9774e8e7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceRequest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Collection; -import java.util.Map; -import java.util.Set; - -import com.google.common.annotations.Beta; -import org.onosproject.net.Link; -import org.onosproject.net.intent.Constraint; -import org.onosproject.net.intent.IntentId; -import org.onosproject.net.resource.ResourceRequest; - -/** - * Representation of a request for link resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResourceRequest extends ResourceRequest { - - /** - * Returns the {@link IntentId} associated with the request. - * - * @return the {@link IntentId} associated with the request - */ - IntentId intentId(); - - /** - * Returns the set of target links. - * - * @return the set of target links - */ - Collection<Link> links(); - - /** - * Returns the set of resource requests. - * - * @return the set of resource requests - */ - Set<ResourceRequest> resources(); - - /** - * Returns the set of resource request against the specified link. - * - * @param link link whose associated resource request is to be returned - * @return set of resource request against the specified link - */ - @Beta - Set<ResourceRequest> resources(Link link); - - /** - * Builder of link resource request. - */ - interface Builder { - /** - * Adds lambda request. - * - * @return self - * @deprecated in Emu Release - */ - @Deprecated - Builder addLambdaRequest(); - - /** - * Adds lambda request. - * - * @param lambda lambda to be requested - * @return self - */ - @Beta - Builder addLambdaRequest(LambdaResource lambda); - - /** - * Adds MPLS request. - * - * @return self - * @deprecated in Emu Release - */ - @Deprecated - Builder addMplsRequest(); - - /** - * Adds MPLS request. - * - * @param label MPLS label to be requested - * @return self - */ - @Beta - Builder addMplsRequest(MplsLabel label); - - /** - * Adds MPLS request against the specified links. - * - * @param labels MPLS labels to be requested against links - * @return self - */ - @Beta - Builder addMplsRequest(Map<Link, MplsLabel> labels); - - /** - * Adds bandwidth request with bandwidth value. - * - * @param bandwidth bandwidth value to be requested - * @return self - */ - Builder addBandwidthRequest(double bandwidth); - - /** - * Adds the resources required for a constraint. - * - * @param constraint the constraint - * @return self - */ - Builder addConstraint(Constraint constraint); - - /** - * Returns link resource request. - * - * @return link resource request - */ - LinkResourceRequest build(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceService.java deleted file mode 100644 index 71ea7e1a..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceService.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import org.onosproject.event.ListenerService; -import org.onosproject.net.Link; -import org.onosproject.net.intent.IntentId; -import org.onosproject.net.resource.ResourceRequest; - -/** - * Service for providing link resource allocation. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResourceService - extends ListenerService<LinkResourceEvent, LinkResourceListener> { - - /** - * Requests resources. - * - * @param req resources to be allocated - * @return allocated resources - * @deprecated in Emu Release - */ - @Deprecated - LinkResourceAllocations requestResources(LinkResourceRequest req); - - /** - * Releases resources. - * - * @param allocations resources to be released - * @deprecated in Emu Release - */ - @Deprecated - void releaseResources(LinkResourceAllocations allocations); - - /** - * Updates previously made allocations with a new resource request. - * - * @param req updated resource request - * @param oldAllocations old resource allocations - * @return new resource allocations - * @deprecated in Emu Release - */ - @Deprecated - LinkResourceAllocations updateResources(LinkResourceRequest req, - LinkResourceAllocations oldAllocations); - - /** - * Returns all allocated resources. - * - * @return allocated resources - * @deprecated in Emu Release - */ - @Deprecated - Iterable<LinkResourceAllocations> getAllocations(); - - /** - * Returns all allocated resources to given link. - * - * @param link a target link - * @return allocated resources - * @deprecated in Emu Release - */ - @Deprecated - Iterable<LinkResourceAllocations> getAllocations(Link link); - - /** - * Returns the resources allocated for an Intent. - * - * @param intentId the target Intent's id - * @return allocated resources for Intent - * @deprecated in Emu Release - */ - @Deprecated - LinkResourceAllocations getAllocations(IntentId intentId); - - /** - * Returns available resources for given link. - * - * @param link a target link - * @return available resources for the target link - * @deprecated in Emu Release - */ - @Deprecated - Iterable<ResourceRequest> getAvailableResources(Link link); - - /** - * Returns available resources for given link. - * - * @param link a target link - * @param allocations allocations to be included as available - * @return available resources for the target link - * @deprecated in Emu Release - */ - @Deprecated - Iterable<ResourceRequest> getAvailableResources(Link link, - LinkResourceAllocations allocations); - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStore.java deleted file mode 100644 index e8a295c2..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStore.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Set; - -import org.onosproject.net.Link; -import org.onosproject.net.intent.IntentId; -import org.onosproject.net.resource.ResourceAllocation; - -/** - * Manages link resources. - * - * @deprecated in Emu Release. - */ -@Deprecated -public interface LinkResourceStore { - /** - * Returns free resources for given link. - * - * @param link a target link - * @return free resources for given link - */ - Set<ResourceAllocation> getFreeResources(Link link); - - /** - * Allocates resources. - * - * @param allocations resources to be allocated - */ - void allocateResources(LinkResourceAllocations allocations); - - /** - * Releases resources. - * - * @param allocations resources to be released - * @return the link resource event - */ - LinkResourceEvent releaseResources(LinkResourceAllocations allocations); - - /** - * Returns resources allocated for an Intent. - * - * @param intentId the target Intent's ID - * @return allocated resources or null if no resource is allocated - */ - LinkResourceAllocations getAllocations(IntentId intentId); - - /** - * Returns resources allocated for a link. - * - * @param link the target link - * @return allocated resources - */ - Iterable<LinkResourceAllocations> getAllocations(Link link); - - /** - * Returns all allocated resources. - * - * @return allocated resources - */ - Iterable<LinkResourceAllocations> getAllocations(); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStoreDelegate.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStoreDelegate.java deleted file mode 100644 index dbfb3b04..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResourceStoreDelegate.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import org.onosproject.store.StoreDelegate; - -/** - * Link resource store delegate abstraction. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResourceStoreDelegate extends StoreDelegate<LinkResourceEvent> { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResources.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResources.java deleted file mode 100644 index 46450427..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/LinkResources.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Set; - -/** - * Abstraction of a resources of a link. - * - * @deprecated in Emu Release - */ -@Deprecated -public interface LinkResources { - - /** - * Returns resources as a set of {@link LinkResource}s. - * - * @return a set of {@link LinkResource}s - */ - Set<LinkResource> resources(); - - /** - * Builder of {@link LinkResources}. - * - * @deprecated in Emu Release - */ - @Deprecated - interface Builder { - - /** - * Adds bandwidth resource. - * <p> - * This operation adds given bandwidth to previous bandwidth and - * generates single bandwidth resource. - * - * @param bandwidth bandwidth value to be added - * @return self - */ - Builder addBandwidth(double bandwidth); - - /** - * Adds lambda resource. - * - * @param lambda lambda value to be added - * @return self - */ - Builder addLambda(int lambda); - - /** - * Builds an immutable link resources. - * - * @return link resources - */ - LinkResources build(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabel.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabel.java deleted file mode 100644 index 5138d02c..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabel.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import java.util.Objects; - -/** - * Representation of MPLS label resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public final class MplsLabel implements LinkResource { - - private final org.onlab.packet.MplsLabel mplsLabel; - - - /** - * Creates a new instance with given MPLS label. - * - * @param mplsLabel MPLS Label value to be assigned - */ - public MplsLabel(int mplsLabel) { - this.mplsLabel = org.onlab.packet.MplsLabel.mplsLabel(mplsLabel); - } - - /** - * Creates a new instance with given MPLS label. - * - * @param mplsLabel mplsLabel value to be assigned - * @return {@link MplsLabel} instance with given bandwidth - */ - public static MplsLabel valueOf(int mplsLabel) { - return new MplsLabel(mplsLabel); - } - - /** - * Returns MPLS Label as an MPLS Label Object. - * - * @return MPLS label as an MPLS Label Object. - */ - public org.onlab.packet.MplsLabel label() { - return mplsLabel; - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof MplsLabel) { - MplsLabel that = (MplsLabel) obj; - return Objects.equals(this.mplsLabel, that.mplsLabel); - } - return false; - } - - @Override - public int hashCode() { - return Objects.hashCode(this.mplsLabel); - } - - @Override - public String toString() { - return String.valueOf(this.mplsLabel); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceAllocation.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceAllocation.java deleted file mode 100644 index 7441bee9..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceAllocation.java +++ /dev/null @@ -1,81 +0,0 @@ - /* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceAllocation; -import org.onosproject.net.resource.ResourceType; - -import java.util.Objects; - -/** - * Representation of allocated MPLS label resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class MplsLabelResourceAllocation implements ResourceAllocation { - private final MplsLabel mplsLabel; - - @Override - public ResourceType type() { - return ResourceType.MPLS_LABEL; - } - - /** - * Creates a new {@link MplsLabelResourceAllocation} with {@link MplsLabel} - * object. - * - * @param mplsLabel allocated MPLS Label - */ - public MplsLabelResourceAllocation(MplsLabel mplsLabel) { - this.mplsLabel = mplsLabel; - } - - /** - * Returns the MPLS label resource. - * - * @return the MPLS label resource - */ - public MplsLabel mplsLabel() { - return mplsLabel; - } - - @Override - public int hashCode() { - return Objects.hashCode(mplsLabel); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || getClass() != obj.getClass()) { - return false; - } - final MplsLabelResourceAllocation other = (MplsLabelResourceAllocation) obj; - return Objects.equals(this.mplsLabel, other.mplsLabel); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("mplsLabel", mplsLabel) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceRequest.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceRequest.java deleted file mode 100644 index 5b9c4a0a..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/MplsLabelResourceRequest.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2014-2015 Open Networking Laboratory - * - * Licensed 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 org.onosproject.net.resource.link; - -import com.google.common.annotations.Beta; -import com.google.common.base.MoreObjects; -import org.onosproject.net.resource.ResourceRequest; -import org.onosproject.net.resource.ResourceType; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Representation of a request for lambda resource. - * - * @deprecated in Emu Release - */ -@Deprecated -public class MplsLabelResourceRequest implements ResourceRequest { - - private final MplsLabel mplsLabel; - - /** - * Constructs a request specifying the given MPLS label. - * - * @param mplsLabel MPLS label to be requested - */ - @Beta - public MplsLabelResourceRequest(MplsLabel mplsLabel) { - this.mplsLabel = checkNotNull(mplsLabel); - } - - /** - * Constructs a request asking an arbitrary available MPLS label. - * - * @deprecated in Emu Release - */ - @Deprecated - public MplsLabelResourceRequest() { - this.mplsLabel = null; - } - - /** - * Returns the MPLS label this request expects. - * - * @return the MPLS label this request expects - */ - @Beta - public MplsLabel mplsLabel() { - return mplsLabel; - } - - @Override - public ResourceType type() { - return ResourceType.MPLS_LABEL; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("mplsLabel", mplsLabel) - .toString(); - } -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/package-info.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/package-info.java deleted file mode 100644 index f374d778..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/link/package-info.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Open Networking Laboratory - * - * Licensed 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. - */ - -/** - * Services for reserving links and their capacity as network resources, - * e.g. bandwidth, lambdas. - * <p> - * Note: Classes under the package will be remove. - * Developers should not use the classes. - * This package is marked as deprecated in Emu Release. - * </p> - */ -@Deprecated -package org.onosproject.net.resource.link; diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/package-info.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/package-info.java deleted file mode 100644 index a05dfda1..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/resource/package-info.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed 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. - */ - -/** - * Abstractions for reserving network resources. - * <p> - * Note: Classes under the package will be removed. - * Developers should not use the classes. - * </p> - */ -package org.onosproject.net.resource; |