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:

committed by
Edwin Kempin

parent
0f2e820677
commit
c4d0a135fe
@@ -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;
|
||||
|
@@ -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;
|
@@ -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;
|
@@ -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;
|
||||
|
@@ -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;
|
@@ -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;
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
@@ -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;
|
@@ -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;
|
@@ -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;
|
@@ -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;
|
||||
|
@@ -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;
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user