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
Kavitha Alagesan
2016-07-05 22:39:40 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7ee9d2e3bb962f000a994f1caadc323e0f722db9
7ee9d2e3
1 parent
5d7311eb
Fix For ONOS-4836
Change-Id: I2aab2049fbaaecfeae3e5e0beab98ca27155dd28
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
26 deletions
core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java
core/common/src/main/java/org/onosproject/codec/impl/ForwardingObjectiveCodec.java
core/common/src/main/java/org/onosproject/codec/impl/NextObjectiveCodec.java
web/api/src/main/resources/definitions/NextObjective.json
core/common/src/main/java/org/onosproject/codec/impl/FilteringObjectiveCodec.java
View file @
7ee9d2e
...
...
@@ -53,10 +53,6 @@ public class FilteringObjectiveCodec extends JsonCodec<FilteringObjective> {
" member is required in FilteringObjective"
;
private
static
final
String
NOT_NULL_MESSAGE
=
"FilteringObjective cannot be null"
;
private
static
final
String
INVALID_TYPE_MESSAGE
=
"The requested type {} is not defined in FilteringObjective."
;
private
static
final
String
INVALID_OP_MESSAGE
=
"The requested operation {} is not defined for FilteringObjective."
;
public
static
final
String
REST_APP_ID
=
"org.onosproject.rest"
;
...
...
@@ -133,8 +129,8 @@ public class FilteringObjectiveCodec extends JsonCodec<FilteringObjective> {
builder
.
deny
();
break
;
default
:
log
.
warn
(
INVALID_TYPE_MESSAGE
,
typeStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested type "
+
typeStr
+
" is not defined for FilteringObjective."
)
;
}
// decode key
...
...
@@ -163,7 +159,7 @@ public class FilteringObjectiveCodec extends JsonCodec<FilteringObjective> {
// decode operation
String
opStr
=
nullIsIllegal
(
json
.
get
(
OPERATION
),
OPERATION
+
MISSING_MEMBER_MESSAGE
).
asText
();
FilteringObjective
filteringObjective
;
FilteringObjective
filteringObjective
=
null
;
switch
(
opStr
)
{
case
"ADD"
:
...
...
@@ -173,8 +169,10 @@ public class FilteringObjectiveCodec extends JsonCodec<FilteringObjective> {
filteringObjective
=
builder
.
remove
();
break
;
default
:
log
.
warn
(
INVALID_OP_MESSAGE
,
opStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested operation "
+
opStr
+
" is not defined for FilteringObjective."
);
}
return
filteringObjective
;
...
...
core/common/src/main/java/org/onosproject/codec/impl/ForwardingObjectiveCodec.java
View file @
7ee9d2e
...
...
@@ -50,10 +50,6 @@ public class ForwardingObjectiveCodec extends JsonCodec<ForwardingObjective> {
" member is required in ForwardingObjective"
;
private
static
final
String
NOT_NULL_MESSAGE
=
"ForwardingObjective cannot be null"
;
private
static
final
String
INVALID_FLAG_MESSAGE
=
"The requested flag {} is not defined in ForwardingObjective."
;
private
static
final
String
INVALID_OP_MESSAGE
=
"The requested operation {} is not defined for FilteringObjective."
;
public
static
final
String
REST_APP_ID
=
"org.onosproject.rest"
;
...
...
@@ -129,8 +125,8 @@ public class ForwardingObjectiveCodec extends JsonCodec<ForwardingObjective> {
builder
.
withFlag
(
ForwardingObjective
.
Flag
.
VERSATILE
);
break
;
default
:
log
.
warn
(
INVALID_FLAG_MESSAGE
,
flagStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested flag "
+
flagStr
+
" is not defined for FilteringObjective."
)
;
}
// decode selector
...
...
@@ -155,7 +151,7 @@ public class ForwardingObjectiveCodec extends JsonCodec<ForwardingObjective> {
// decode operation
String
opStr
=
nullIsIllegal
(
json
.
get
(
OPERATION
),
OPERATION
+
MISSING_MEMBER_MESSAGE
).
asText
();
ForwardingObjective
forwardingObjective
;
ForwardingObjective
forwardingObjective
=
null
;
switch
(
opStr
)
{
case
"ADD"
:
...
...
@@ -165,8 +161,8 @@ public class ForwardingObjectiveCodec extends JsonCodec<ForwardingObjective> {
forwardingObjective
=
builder
.
remove
();
break
;
default
:
log
.
warn
(
INVALID_OP_MESSAGE
,
opStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested operation "
+
opStr
+
" is not defined for FilteringObjective."
)
;
}
return
forwardingObjective
;
...
...
core/common/src/main/java/org/onosproject/codec/impl/NextObjectiveCodec.java
View file @
7ee9d2e
...
...
@@ -53,10 +53,6 @@ public class NextObjectiveCodec extends JsonCodec<NextObjective> {
" member is required in NextObjective"
;
private
static
final
String
NOT_NULL_MESSAGE
=
"NextObjective cannot be null"
;
private
static
final
String
INVALID_TYPE_MESSAGE
=
"The requested flag {} is not defined in NextObjective."
;
private
static
final
String
INVALID_OP_MESSAGE
=
"The requested operation {} is not defined for NextObjective."
;
public
static
final
String
REST_APP_ID
=
"org.onosproject.rest"
;
...
...
@@ -141,8 +137,8 @@ public class NextObjectiveCodec extends JsonCodec<NextObjective> {
builder
.
withType
(
NextObjective
.
Type
.
SIMPLE
);
break
;
default
:
log
.
warn
(
INVALID_TYPE_MESSAGE
,
typeStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested type "
+
typeStr
+
" is not defined for FilteringObjective."
)
;
}
// decode treatments
...
...
@@ -174,8 +170,8 @@ public class NextObjectiveCodec extends JsonCodec<NextObjective> {
nextObjective
=
builder
.
remove
();
break
;
default
:
log
.
warn
(
INVALID_OP_MESSAGE
,
opStr
);
return
null
;
throw
new
IllegalArgumentException
(
"The requested operation "
+
opStr
+
" is not defined for FilteringObjective."
)
;
}
return
nextObjective
;
...
...
web/api/src/main/resources/definitions/NextObjective.json
View file @
7ee9d2e
...
...
@@ -3,6 +3,7 @@
"title"
:
"nextObjective"
,
"required"
:
[
"type"
,
"id"
,
"priority"
,
"timeout"
,
"isPermanent"
,
...
...
@@ -16,6 +17,11 @@
"type"
:
"string"
,
"example"
:
"HASHED"
},
"id"
:
{
"type"
:
"integer"
,
"format"
:
"int64"
,
"example"
:
1
},
"priority"
:
{
"type"
:
"integer"
,
"format"
:
"int64"
,
...
...
Please
register
or
login
to post a comment