aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java')
-rw-r--r--src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java
index 580800c..f182fd6 100644
--- a/src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java
+++ b/src/main/java/org/onap/dmaap/dbcapi/model/MR_Client.java
@@ -26,15 +26,25 @@ import javax.xml.bind.annotation.XmlRootElement;
import org.onap.dmaap.dbcapi.database.DatabaseClass;
+import io.swagger.annotations.ApiModelProperty;
+
@XmlRootElement
public class MR_Client extends DmaapObject {
+ @ApiModelProperty( value="a tag indicating a logical deployment site")
private String dcaeLocationName;
+ @ApiModelProperty( value="the URL for a MR instance - typically in the same dcaeLocation - that this client should use to access the topic")
private String topicURL;
+ @ApiModelProperty( value="Fully Qualified Topic Name constructed by dbcapi")
private String fqtn;
+ @ApiModelProperty( value="an AAF Role to be granted an appropriate Permission. If specified, takes precedence over clientIdentity, for backwards compatibility.")
private String clientRole;
+ @ApiModelProperty( value="one or more actions from the set (\"pub\", \"sub\", \"view\") for which this client needs Permission")
private String[] action;
+ @ApiModelProperty( value="a unique identifier generated by dbcapi for this client")
private String mrClientId;
+ @ApiModelProperty( value="an AAF identity to be associated to an appropriate topic Role")
+ private String clientIdentity;
public MR_Client() {
@@ -97,7 +107,24 @@ public class MR_Client extends DmaapObject {
public void setAction(String[] action) {
this.action = action;
}
-
+
+ @ApiModelProperty( hidden=true )
+ public boolean isPublisher() {
+ return hasAction( "pub");
+ }
+ @ApiModelProperty( hidden=true )
+ public boolean isSubscriber() {
+ return hasAction( "sub");
+ }
+
+ public boolean hasAction( String val ) {
+ for (String s: this.action) {
+ if ( s!= null && s.equals(val)) {
+ return true;
+ }
+ }
+ return false;
+ }
public String getMrClientId() {
return mrClientId;
}
@@ -115,5 +142,21 @@ public class MR_Client extends DmaapObject {
public void setTopicURL(String topicURL) {
this.topicURL = topicURL;
}
+
+ public String getClientIdentity() {
+ return clientIdentity;
+ }
+
+ public void setClientIdentity(String clientIdentity) {
+ this.clientIdentity = clientIdentity;
+ }
+ public boolean hasClientIdentity() {
+ if ( this.clientIdentity == null || this.clientIdentity.isEmpty() ) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
}