Move event attribute classes to a separate package

The Attribute classes are moved from:

  com.google.gerrit.server.events

to the newly created package:

  com.google.gerrit.server.data

The `QueryStats` class is renamed to `QueryStatsAttribute` to be
consistent with the other classes in the package.

This is only a code reorganisation.  No functionality is changed.

Change-Id: I5c125e8d45d8f8e6943021cd90ddba1c364a103e
This commit is contained in:
David Pursehouse
2013-04-09 12:22:31 +09:00
committed by Edwin Kempin
parent 0f2e820677
commit c4d0a135fe
25 changed files with 67 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ import com.google.gerrit.server.account.AccountState;
import com.google.gerrit.server.config.AnonymousCowardName;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.events.ApprovalAttribute;
import com.google.gerrit.server.data.ApprovalAttribute;
import com.google.gerrit.server.events.ChangeAbandonedEvent;
import com.google.gerrit.server.events.ChangeEvent;
import com.google.gerrit.server.events.ChangeMergedEvent;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class AccountAttribute {
public String name;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class ApprovalAttribute {
public String type;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
import com.google.gerrit.reviewdb.client.Change;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class DependencyAttribute {
public String id;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class MessageAttribute {
public Long timestamp;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
import com.google.gerrit.reviewdb.client.Patch.ChangeType;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
import java.util.List;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class PatchSetCommentAttribute {
public String file;

View File

@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class QueryStats {
public class QueryStatsAttribute {
public final String type = "stats";
public int rowCount;
public long runTimeMilliseconds;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class RefUpdateAttribute {
public String oldRev;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class SubmitLabelAttribute {
public String label;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
import java.util.List;

View File

@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.events;
package com.google.gerrit.server.data;
public class TrackingIdAttribute {
public String system;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class ChangeAbandonedEvent extends ChangeEvent {
public final String type = "change-abandoned";
public ChangeAttribute change;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class ChangeMergedEvent extends ChangeEvent {
public final String type = "change-merged";
public ChangeAttribute change;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class ChangeRestoredEvent extends ChangeEvent {
public final String type = "change-restored";
public ChangeAttribute change;

View File

@@ -14,6 +14,11 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ApprovalAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class CommentAddedEvent extends ChangeEvent {
public final String type = "comment-added";
public ChangeAttribute change;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class DraftPublishedEvent extends ChangeEvent {
public final String type = "draft-published";
public ChangeAttribute change;

View File

@@ -33,6 +33,18 @@ import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.GerritPersonIdent;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.config.CanonicalWebUrl;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ApprovalAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.DependencyAttribute;
import com.google.gerrit.server.data.MessageAttribute;
import com.google.gerrit.server.data.PatchAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
import com.google.gerrit.server.data.PatchSetCommentAttribute;
import com.google.gerrit.server.data.RefUpdateAttribute;
import com.google.gerrit.server.data.SubmitLabelAttribute;
import com.google.gerrit.server.data.SubmitRecordAttribute;
import com.google.gerrit.server.data.TrackingIdAttribute;
import com.google.gerrit.server.patch.PatchList;
import com.google.gerrit.server.patch.PatchListCache;
import com.google.gerrit.server.patch.PatchListEntry;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class MergeFailedEvent extends ChangeEvent {
public final String type = "merge-failed";
public ChangeAttribute change;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class PatchSetCreatedEvent extends ChangeEvent {
public final String type = "patchset-created";
public ChangeAttribute change;

View File

@@ -14,6 +14,9 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.RefUpdateAttribute;
public class RefUpdatedEvent extends ChangeEvent {
public final String type = "ref-updated";
public AccountAttribute submitter;

View File

@@ -14,6 +14,10 @@
package com.google.gerrit.server.events;
import com.google.gerrit.server.data.AccountAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
public class ReviewerAddedEvent extends ChangeEvent {
public final String type = "reviewer-added";
public ChangeAttribute change;

View File

@@ -21,10 +21,10 @@ import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.events.ChangeAttribute;
import com.google.gerrit.server.data.ChangeAttribute;
import com.google.gerrit.server.data.PatchSetAttribute;
import com.google.gerrit.server.data.QueryStatsAttribute;
import com.google.gerrit.server.events.EventFactory;
import com.google.gerrit.server.events.PatchSetAttribute;
import com.google.gerrit.server.events.QueryStats;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.project.ChangeControl;
import com.google.gerrit.server.project.NoSuchChangeException;
@@ -267,7 +267,7 @@ public class QueryProcessor {
}
try {
final QueryStats stats = new QueryStats();
final QueryStatsAttribute stats = new QueryStatsAttribute();
stats.runTimeMilliseconds = System.currentTimeMillis();
List<ChangeData> results = queryChanges(queryString);