diff options
Diffstat (limited to 'framework/src/onos/core/api/src/main/java/org/onosproject/net/link')
12 files changed, 0 insertions, 668 deletions
diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/DefaultLinkDescription.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/DefaultLinkDescription.java deleted file mode 100644 index cba17640..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/DefaultLinkDescription.java +++ /dev/null @@ -1,93 +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.link; - -import com.google.common.base.MoreObjects; -import org.onosproject.net.AbstractDescription; -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.Link; -import org.onosproject.net.SparseAnnotations; -import com.google.common.base.Objects; - -/** - * Default implementation of immutable link description entity. - */ -public class DefaultLinkDescription extends AbstractDescription - implements LinkDescription { - - private final ConnectPoint src; - private final ConnectPoint dst; - private final Link.Type type; - - /** - * Creates a link description using the supplied information. - * - * @param src link source - * @param dst link destination - * @param type link type - * @param annotations optional key/value annotations - */ - public DefaultLinkDescription(ConnectPoint src, ConnectPoint dst, - Link.Type type, SparseAnnotations... annotations) { - super(annotations); - this.src = src; - this.dst = dst; - this.type = type; - } - - @Override - public ConnectPoint src() { - return src; - } - - @Override - public ConnectPoint dst() { - return dst; - } - - @Override - public Link.Type type() { - return type; - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("src", src()) - .add("dst", dst()) - .add("type", type()).toString(); - } - - @Override - public int hashCode() { - return Objects.hashCode(super.hashCode(), src, dst, type); - } - - @Override - public boolean equals(Object object) { - if (object != null && getClass() == object.getClass()) { - if (!super.equals(object)) { - return false; - } - DefaultLinkDescription that = (DefaultLinkDescription) object; - return Objects.equal(this.src, that.src) - && Objects.equal(this.dst, that.dst) - && Objects.equal(this.type, that.type); - } - return false; - } - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkAdminService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkAdminService.java deleted file mode 100644 index a0b5e1e2..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkAdminService.java +++ /dev/null @@ -1,50 +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.link; - -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.DeviceId; - -/** - * Service for administering the inventory of infrastructure links. - */ -public interface LinkAdminService extends LinkService { - - /** - * Removes all infrastructure links leading to and from the - * specified connection point. - * - * @param connectPoint connection point - */ - void removeLinks(ConnectPoint connectPoint); - - /** - * Removes all infrastructure links leading to and from the - * specified device. - * - * @param deviceId device identifier - */ - void removeLinks(DeviceId deviceId); - - /** - * Removes all links between between the specified src and - * dst connection points. - * - * @param src link source - * @param dst link destination - */ - void removeLink(ConnectPoint src, ConnectPoint dst); -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkDescription.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkDescription.java deleted file mode 100644 index f85718b7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkDescription.java +++ /dev/null @@ -1,49 +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.link; - -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.Description; -import org.onosproject.net.Link; - -/** - * Describes an infrastructure link. - */ -public interface LinkDescription extends Description { - - /** - * Returns the link source. - * - * @return links source - */ - ConnectPoint src(); - - /** - * Returns the link destination. - * - * @return links destination - */ - ConnectPoint dst(); - - /** - * Returns the link type. - * - * @return link type - */ - Link.Type type(); - - // Add further link attributes -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkEvent.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkEvent.java deleted file mode 100644 index d87bce06..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkEvent.java +++ /dev/null @@ -1,68 +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.link; - -import org.onosproject.event.AbstractEvent; -import org.onosproject.net.Link; - -/** - * Describes infrastructure link event. - */ -public class LinkEvent extends AbstractEvent<LinkEvent.Type, Link> { - - /** - * Type of link events. - */ - public enum Type { - /** - * Signifies that a new link has been detected. - */ - LINK_ADDED, - - /** - * Signifies that a link has been updated or changed state. - */ - LINK_UPDATED, - - /** - * Signifies that a link has been removed. - */ - LINK_REMOVED - } - - /** - * Creates an event of a given type and for the specified link and the - * current time. - * - * @param type link event type - * @param link event link subject - */ - public LinkEvent(Type type, Link link) { - super(type, link); - } - - /** - * Creates an event of a given type and for the specified link and time. - * - * @param type link event type - * @param link event link subject - * @param time occurrence time - */ - public LinkEvent(Type type, Link link, long time) { - super(type, link, time); - } - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkListener.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkListener.java deleted file mode 100644 index 82f6bdb9..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkListener.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. - */ -package org.onosproject.net.link; - -import org.onosproject.event.EventListener; - -/** - * Entity capable of receiving infrastructure link related events. - */ -public interface LinkListener extends EventListener<LinkEvent> { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProvider.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProvider.java deleted file mode 100644 index ed4348c7..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProvider.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.link; - -import org.onosproject.net.provider.Provider; - -/** - * Abstraction of an entity providing information about infrastructure links - * to the core. - */ -public interface LinkProvider extends Provider { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderRegistry.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderRegistry.java deleted file mode 100644 index 57a05d93..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderRegistry.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.link; - -import org.onosproject.net.provider.ProviderRegistry; - -/** - * Abstraction of an infrastructure link provider registry. - */ -public interface LinkProviderRegistry - extends ProviderRegistry<LinkProvider, LinkProviderService> { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderService.java deleted file mode 100644 index f5ef52a2..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkProviderService.java +++ /dev/null @@ -1,57 +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.link; - -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.DeviceId; -import org.onosproject.net.provider.ProviderService; - -/** - * Means for injecting link information into the core. - */ -public interface LinkProviderService extends ProviderService<LinkProvider> { - - /** - * Signals that an infrastructure link has been detected. - * - * @param linkDescription link information - */ - void linkDetected(LinkDescription linkDescription); - - /** - * Signals that an infrastructure link has disappeared. - * - * @param linkDescription link information - */ - void linkVanished(LinkDescription linkDescription); - - /** - * Signals that infrastructure links associated with the specified - * connect point have vanished. - * - * @param connectPoint connect point - */ - void linksVanished(ConnectPoint connectPoint); - - /** - * Signals that infrastructure links associated with the specified - * device have vanished. - * - * @param deviceId device identifier - */ - void linksVanished(DeviceId deviceId); - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkService.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkService.java deleted file mode 100644 index c27e3110..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkService.java +++ /dev/null @@ -1,116 +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.link; - -import java.util.Set; - -import org.onosproject.event.ListenerService; -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.DeviceId; -import org.onosproject.net.Link; - -/** - * Service for interacting with the inventory of infrastructure links. - */ -public interface LinkService - extends ListenerService<LinkEvent, LinkListener> { - - /** - * Returns the count of all known infrastructure links. - * - * @return number of infrastructure links - */ - int getLinkCount(); - - /** - * Returns a collection of all known infrastructure links. - * - * @return all infrastructure links - */ - Iterable<Link> getLinks(); - - /** - * Returns a collection of all active infrastructure links. - * - * @return all infrastructure links - */ - Iterable<Link> getActiveLinks(); - - /** - * Returns set of all infrastructure links leading to and from the - * specified device. - * - * @param deviceId device identifier - * @return set of device links - */ - Set<Link> getDeviceLinks(DeviceId deviceId); - - /** - * Returns set of all infrastructure links leading from the specified device. - * - * @param deviceId device identifier - * @return set of device egress links - */ - Set<Link> getDeviceEgressLinks(DeviceId deviceId); - - /** - * Returns set of all infrastructure links leading to the specified device. - * - * @param deviceId device identifier - * @return set of device ingress links - */ - Set<Link> getDeviceIngressLinks(DeviceId deviceId); - - /** - * Returns set of all infrastructure links leading to and from the - * specified connection point. - * - * @param connectPoint connection point - * @return set of links - */ - Set<Link> getLinks(ConnectPoint connectPoint); - - /** - * Returns set of all infrastructure links leading from the specified - * connection point. - * - * @param connectPoint connection point - * @return set of device egress links - */ - Set<Link> getEgressLinks(ConnectPoint connectPoint); - - /** - * Returns set of all infrastructure links leading to the specified - * connection point. - * - * @param connectPoint connection point - * @return set of device ingress links - */ - Set<Link> getIngressLinks(ConnectPoint connectPoint); - - // FIXME: I don't think this makes sense; discuss and remove or adjust return - // to be a Set<Link> or add Link.Type parameter - /** - * Returns the infrastructure links between the specified source - * and destination connection points. - * - * @param src source connection point - * @param dst destination connection point - * @return link from source to destination; null if none found - */ - Link getLink(ConnectPoint src, ConnectPoint dst); - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStore.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStore.java deleted file mode 100644 index 04c8773b..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStore.java +++ /dev/null @@ -1,117 +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.link; - -import org.onosproject.net.ConnectPoint; -import org.onosproject.net.DeviceId; -import org.onosproject.net.Link; -import org.onosproject.net.provider.ProviderId; -import org.onosproject.store.Store; - -import java.util.Set; - -/** - * Manages inventory of infrastructure links; not intended for direct use. - */ -public interface LinkStore extends Store<LinkEvent, LinkStoreDelegate> { - - /** - * Returns the number of links in the store. - * - * @return number of links - */ - int getLinkCount(); - - /** - * Returns an iterable collection of all links in the inventory. - * - * @return collection of all links - */ - Iterable<Link> getLinks(); - - /** - * Returns all links egressing from the specified device. - * - * @param deviceId device identifier - * @return set of device links - */ - Set<Link> getDeviceEgressLinks(DeviceId deviceId); - - /** - * Returns all links ingressing from the specified device. - * - * @param deviceId device identifier - * @return set of device links - */ - Set<Link> getDeviceIngressLinks(DeviceId deviceId); - - /** - * Returns the link between the two end-points. - * - * @param src source connection point - * @param dst destination connection point - * @return link or null if one not found between the end-points - */ - Link getLink(ConnectPoint src, ConnectPoint dst); - - /** - * Returns all links egressing from the specified connection point. - * - * @param src source connection point - * @return set of connection point links - */ - Set<Link> getEgressLinks(ConnectPoint src); - - /** - * Returns all links ingressing to the specified connection point. - * - * @param dst destination connection point - * @return set of connection point links - */ - Set<Link> getIngressLinks(ConnectPoint dst); - - /** - * Creates a new link, or updates an existing one, based on the given - * information. - * - * @param providerId provider identity - * @param linkDescription link description - * @return create or update link event, or null if no change resulted - */ - LinkEvent createOrUpdateLink(ProviderId providerId, - LinkDescription linkDescription); - - /** - * Removes the link, or marks it as inactive if the link is durable, - * based on the specified information. - * - * @param src link source - * @param dst link destination - * @return remove or update link event, or null if no change resulted - */ - LinkEvent removeOrDownLink(ConnectPoint src, ConnectPoint dst); - - /** - * Removes the link based on the specified information. - * - * @param src link source - * @param dst link destination - * @return remove link event, or null if no change resulted - */ - LinkEvent removeLink(ConnectPoint src, ConnectPoint dst); - - -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStoreDelegate.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStoreDelegate.java deleted file mode 100644 index 1f66dd49..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/LinkStoreDelegate.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. - */ -package org.onosproject.net.link; - -import org.onosproject.store.StoreDelegate; - -/** - * Infrastructure link store delegate abstraction. - */ -public interface LinkStoreDelegate extends StoreDelegate<LinkEvent> { -} diff --git a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/package-info.java b/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/package-info.java deleted file mode 100644 index 57aa5fa2..00000000 --- a/framework/src/onos/core/api/src/main/java/org/onosproject/net/link/package-info.java +++ /dev/null @@ -1,20 +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. - */ - -/** - * Infrastructure link model & related services API definitions. - */ -package org.onosproject.net.link; |