Skip to content

Commit

Permalink
Merge pull request Azure#113 from gcheng/updateProperties
Browse files Browse the repository at this point in the history
update Topic, Subscription and Rule.
  • Loading branch information
Albert Cheng committed Apr 30, 2013
2 parents 8f51a94 + 824372a commit 3ffbe25
Show file tree
Hide file tree
Showing 8 changed files with 1,575 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ public QueueInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvai
/**
* Gets the forward to.
*
* @return the forward to
* @return A <code>String</code> object represents which queue the messages will be forwarded to.
*/
public String getForwardTo() {
return getModel().getForwardTo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package com.microsoft.windowsazure.services.serviceBus.models;

import java.util.Calendar;

import javax.ws.rs.core.MediaType;

import com.microsoft.windowsazure.services.serviceBus.implementation.Content;
Expand All @@ -35,7 +37,7 @@
public class RuleInfo extends EntryModel<RuleDescription> {

/**
* Creates an instance of the <code>Rule</code> class.
* Creates an instance of the <code>RuleInfo</code> class.
*/
public RuleInfo() {
super(new Entry(), new RuleDescription());
Expand All @@ -45,7 +47,7 @@ public RuleInfo() {
}

/**
* Creates an instance of the <code>Rule</code> class using the specified entry.
* Creates an instance of the <code>RuleInfo</code> class using the specified entry.
*
* @param entry
* An <code>Entry</code> object.
Expand All @@ -56,7 +58,7 @@ public RuleInfo(Entry entry) {
}

/**
* Creates an instance of the <code>Rule</code> class using the specified name.
* Creates an instance of the <code>RuleInfo</code> class using the specified name.
*
* @param name
* A <code>String</code> object that represents the name of the rule.
Expand All @@ -82,7 +84,7 @@ public String getName() {
* @param value
* A <code>String</code> object that represents the name of the rule.
*
* @return A <code>Rule</code> object that represents the updated rule.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo setName(String value) {
getEntry().setTitle(value);
Expand All @@ -104,7 +106,7 @@ public Filter getFilter() {
* @param value
* A <code>Filter</code> object that represents the filter of the rule.
*
* @return A <code>Rule</code> object that represents the updated rule.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo setFilter(Filter value) {
getModel().setFilter(value);
Expand All @@ -126,49 +128,127 @@ public RuleAction getAction() {
* @param value
* A <code>RuleAction</code> object that represents the rule action.
*
* @return A <code>Rule</code> object that represents the updated rule.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo setAction(RuleAction value) {
getModel().setAction(value);
return this;
}

/**
* With correlation id filter.
*
* @param correlationId
* the correlation id
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withCorrelationIdFilter(String correlationId) {
CorrelationFilter filter = new CorrelationFilter();
filter.setCorrelationId(correlationId);
return setFilter(filter);
}

/**
* With sql expression filter.
*
* @param sqlExpression
* the sql expression
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withSqlExpressionFilter(String sqlExpression) {
SqlFilter filter = new SqlFilter();
filter.setSqlExpression(sqlExpression);
filter.setCompatibilityLevel(20);
return setFilter(filter);
}

/**
* With true filter.
*
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withTrueFilter() {
TrueFilter filter = new TrueFilter();
filter.setCompatibilityLevel(20);
filter.setSqlExpression("1=1");
return setFilter(filter);
}

/**
* With false filter.
*
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withFalseFilter() {
FalseFilter filter = new FalseFilter();
filter.setCompatibilityLevel(20);
filter.setSqlExpression("1=0");
return setFilter(filter);
}

/**
* With empty rule action.
*
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withEmptyRuleAction() {
EmptyRuleAction action = new EmptyRuleAction();
return setAction(action);
}

/**
* With sql rule action.
*
* @param sqlExpression
* A <code>String</code> instance of the sql expression.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo withSqlRuleAction(String sqlExpression) {
SqlRuleAction action = new SqlRuleAction();
action.setSqlExpression(sqlExpression);
action.setCompatibilityLevel(20);
return setAction(action);
}

/**
* Sets the tag.
*
* @param tag
* A <code>String</code> instance representing the tag.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo setTag(String tag) {
getModel().setTag(tag);
return this;
}

/**
* Gets the tag.
*
* @return A <code>String</code> instance representing the tag.
*/
public String getTag() {
return getModel().getTag();
}

/**
* Sets the created at.
*
* @param createdAt
* A <code>Calendar> object which represents the time that the rule was created at.
* @return A <code>RuleInfo</code> object that represents the updated rule.
*/
public RuleInfo setCreatedAt(Calendar createdAt) {
getModel().setCreatedAt(createdAt);
return this;
}

/**
* Gets the created at.
*
* @return A <code>Calendar> object which represents the time that the rule was created at.
*/
public Calendar getCreatedAt() {
return getModel().getCreatedAt();
}
}
Loading

0 comments on commit 3ffbe25

Please sign in to comment.