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
Thomas Vachuska
2014-10-21 00:44:10 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4926c1b06f487dfe92edbf354a1e9adae5e9e3c8
4926c1b0
1 parent
01fbcdf6
Refactoring intent API.
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
cli/src/main/java/org/onlab/onos/cli/net/IntentRemoveCommand.java
core/net/src/main/java/org/onlab/onos/net/intent/impl/IntentManager.java
cli/src/main/java/org/onlab/onos/cli/net/IntentRemoveCommand.java
View file @
4926c1b
...
...
@@ -7,6 +7,8 @@ import org.onlab.onos.net.intent.Intent;
import
org.onlab.onos.net.intent.IntentId
;
import
org.onlab.onos.net.intent.IntentService
;
import
java.math.BigInteger
;
/**
* Removes host-to-host connectivity intent.
*/
...
...
@@ -22,12 +24,11 @@ public class IntentRemoveCommand extends AbstractShellCommand {
protected
void
execute
()
{
IntentService
service
=
get
(
IntentService
.
class
);
int
radix
=
id
.
startsWith
(
"0x"
)
?
16
:
10
;
if
(
radix
==
16
)
{
if
(
id
.
startsWith
(
"0x"
))
{
id
=
id
.
replaceFirst
(
"0x"
,
""
);
}
IntentId
intentId
=
IntentId
.
valueOf
(
Long
.
parseLong
(
id
,
radix
));
IntentId
intentId
=
IntentId
.
valueOf
(
new
BigInteger
(
id
,
16
).
longValue
(
));
Intent
intent
=
service
.
getIntent
(
intentId
);
if
(
intent
!=
null
)
{
service
.
withdraw
(
intent
);
...
...
core/net/src/main/java/org/onlab/onos/net/intent/impl/IntentManager.java
View file @
4926c1b
...
...
@@ -257,8 +257,8 @@ public class IntentManager
* @return result of compilation
*/
private
List
<
Intent
>
compileIntent
(
Intent
intent
)
{
if
(
intent
instanceof
Intent
)
{
return
ImmutableList
.
of
(
(
Intent
)
intent
);
if
(
intent
.
isInstallable
()
)
{
return
ImmutableList
.
of
(
intent
);
}
List
<
Intent
>
installable
=
new
ArrayList
<>();
...
...
Please
register
or
login
to post a comment