Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-09-07 11:11:21 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4c6606f14f289b2b2e4f7a80217ae5246fa9ad93
4c6606f1
1 parent
ad2d2096
Added default link description & model entities.
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
9 deletions
net/api/src/main/java/org/onlab/onos/net/DefaultDevice.java
net/api/src/main/java/org/onlab/onos/net/DefaultLink.java
net/api/src/main/java/org/onlab/onos/net/Link.java
net/api/src/main/java/org/onlab/onos/net/link/DefaultLinkDescription.java
net/api/src/main/java/org/onlab/onos/net/link/LinkDescription.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkManager.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkStore.java
net/api/src/main/java/org/onlab/onos/net/DefaultDevice.java
View file @
4c6606f
...
...
@@ -7,7 +7,7 @@ import java.util.Objects;
import
static
com
.
google
.
common
.
base
.
Objects
.
toStringHelper
;
/**
* Default device model implementation.
* Default
infrastructure
device model implementation.
*/
public
class
DefaultDevice
extends
AbstractElement
implements
Device
{
...
...
net/api/src/main/java/org/onlab/onos/net/DefaultLink.java
0 → 100644
View file @
4c6606f
package
org
.
onlab
.
onos
.
net
;
import
org.onlab.onos.net.link.LinkDescription
;
import
java.util.Objects
;
import
static
com
.
google
.
common
.
base
.
Objects
.
toStringHelper
;
/**
* Default infrastructure link model implementation.
*/
public
class
DefaultLink
implements
LinkDescription
{
private
ConnectPoint
src
;
private
ConnectPoint
dst
;
/**
* Creates a link description using the supplied information.
*
* @param src link source
* @param dst link destination
*/
public
DefaultLink
(
ConnectPoint
src
,
ConnectPoint
dst
)
{
this
.
src
=
src
;
this
.
dst
=
dst
;
}
@Override
public
ConnectPoint
src
()
{
return
src
;
}
@Override
public
ConnectPoint
dst
()
{
return
dst
;
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
src
,
dst
);
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
obj
instanceof
DefaultDevice
)
{
final
DefaultLink
other
=
(
DefaultLink
)
obj
;
return
Objects
.
equals
(
this
.
src
,
other
.
src
)
&&
Objects
.
equals
(
this
.
dst
,
other
.
dst
);
}
return
false
;
}
@Override
public
String
toString
()
{
return
toStringHelper
(
this
)
.
add
(
"src"
,
src
)
.
add
(
"dst"
,
dst
)
.
toString
();
}
}
net/api/src/main/java/org/onlab/onos/net/Link.java
View file @
4c6606f
...
...
@@ -4,7 +4,6 @@ package org.onlab.onos.net;
* Abstraction of a network infrastructure link.
*/
public
interface
Link
extends
Provided
{
// TODO: Consider extending graph Edge<Element> once the graph module is available
/**
* Coarse representation of the link type.
...
...
net/api/src/main/java/org/onlab/onos/net/link/DefaultLinkDescription.java
0 → 100644
View file @
4c6606f
package
org
.
onlab
.
onos
.
net
.
link
;
import
org.onlab.onos.net.ConnectPoint
;
/**
* Default implementation of immutable link description entity.
*/
public
class
DefaultLinkDescription
implements
LinkDescription
{
private
ConnectPoint
src
;
private
ConnectPoint
dst
;
/**
* Creates a link description using the supplied information.
*
* @param src link source
* @param dst link destination
*/
public
DefaultLinkDescription
(
ConnectPoint
src
,
ConnectPoint
dst
)
{
this
.
src
=
src
;
this
.
dst
=
dst
;
}
@Override
public
ConnectPoint
src
()
{
return
src
;
}
@Override
public
ConnectPoint
dst
()
{
return
dst
;
}
}
net/api/src/main/java/org/onlab/onos/net/link/LinkDescription.java
View file @
4c6606f
package
org
.
onlab
.
onos
.
net
.
link
;
import
org.onlab.onos.net.ConnectPoint
;
/**
* Describes an infrastructure link.
*/
public
interface
LinkDescription
{
// TODO: src, dst connection points, which are pairs of (DeviceId, PortNumber)
// On the north:
// Link = (ConnectPoint src, ConnectPoint dst);
// ConnectPoint = (DeviceId, PortNumber);
/**
* Returns the link source.
*
* @return links source
*/
ConnectPoint
src
();
// On the south
// LinkDescription ~ Link
/**
* Returns the link destination.
*
* @return links destination
*/
ConnectPoint
dst
();
// Add further link attributes
}
...
...
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkManager.java
View file @
4c6606f
...
...
@@ -34,6 +34,8 @@ public class SimpleLinkManager
private
final
AbstractListenerRegistry
<
LinkEvent
,
LinkListener
>
listenerRegistry
=
new
AbstractListenerRegistry
<>();
private
final
SimpleLinkStore
store
=
new
SimpleLinkStore
();
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
private
EventDeliveryService
eventDispatcher
;
...
...
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkStore.java
0 → 100644
View file @
4c6606f
package
org
.
onlab
.
onos
.
net
.
trivial
.
impl
;
/**
* Manages inventory of infrastructure links using trivial in-memory link
* implementation.
*/
public
class
SimpleLinkStore
{
}
Please
register
or
login
to post a comment