Package com.google.gerrit.entities
Class RefNames
- java.lang.Object
-
- com.google.gerrit.entities.RefNames
-
public class RefNames extends Object
Constants and utilities for Gerrit-specific ref names.
-
-
Field Summary
Fields Modifier and Type Field Description static String
EDIT_PREFIX
static String
HEAD
static String
META_SUFFIX
Suffix of a meta ref in the NoteDb.static String
REFS
static String
REFS_CACHE_AUTOMERGE
Prefix applied to merge commit base nodes.static String
REFS_CHANGES
static String
REFS_CONFIG
Configuration settings for a projectrefs/meta/config
static String
REFS_DASHBOARDS
Configurations of project-specific dashboards (canned search queries).static String
REFS_DELETED_GROUPS
NoteDb ref for deleted groupsrefs/deleted-groups
.static String
REFS_DRAFT_COMMENTS
Draft inline comments of a user on a changestatic String
REFS_EXTERNAL_IDS
Note tree listing external IDsstatic String
REFS_GROUPNAMES
NoteDb ref for the NoteMap of all group namesstatic String
REFS_GROUPS
NoteDb ref for a grouprefs/groups
static String
REFS_HEADS
static String
REFS_META
static String
REFS_REJECT_COMMITS
Note tree listing commits we refuserefs/meta/reject-commits
static String
REFS_SEQUENCES
Sequence counters in NoteDb.static String
REFS_STARRED_CHANGES
A change starred by a userstatic String
REFS_TAGS
static String
REFS_USERS
Preference settings for a userrefs/users
static String
REFS_USERS_DEFAULT
Default user preference settingsstatic String
REFS_USERS_SELF
Magic user branch in All-Usersrefs/users/self
static String
REFS_VERSION
NoteDb schema version number.static String
ROBOT_COMMENTS_SUFFIX
Suffix of a ref that stores robot comments in the NoteDb.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
changeMetaRef(Change.Id id)
static String
changeRefPrefix(Change.Id id)
static String
fullName(String ref)
static boolean
isConfigRef(String ref)
Whether the ref is the configuration branch, i.e.static boolean
isGerritRef(String ref)
Whether the ref is managed by Gerrit.static boolean
isGroupRef(String ref)
Whether the ref is used for storing group data in NoteDb.static boolean
isNoteDbMetaRef(String ref)
static boolean
isRefsChanges(String ref)
True if the provided ref is inrefs/changes/*
.static boolean
isRefsDeletedGroups(String ref)
Whether the ref is a group branch that stores NoteDb data of a deleted group.static boolean
isRefsEdit(String ref)
static boolean
isRefsGroups(String ref)
Whether the ref is a group branch that stores NoteDb data of a group.static boolean
isRefsUsers(String ref)
static String
parseShardedUuidFromRefPart(String name)
static String
patchSetRef(PatchSet.Id id)
static String
refsCacheAutomerge(String hash)
static String
refsDeletedGroups(AccountGroup.UUID groupUuid)
static String
refsDraftComments(Change.Id changeId, Account.Id accountId)
static String
refsDraftCommentsPrefix(Change.Id changeId)
static String
refsEdit(Account.Id accountId, Change.Id changeId, PatchSet.Id psId)
Returns reference for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/P.static String
refsEditPrefix(Account.Id accountId)
static String
refsEditPrefix(Account.Id accountId, Change.Id changeId)
Returns reference prefix for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/.static String
refsGroups(AccountGroup.UUID groupUuid)
static String
refsStarredChanges(Change.Id changeId, Account.Id accountId)
static String
refsStarredChangesPrefix(Change.Id changeId)
static String
refsUsers(Account.Id accountId)
static String
robotCommentsRef(Change.Id id)
static String
shard(int id)
static String
shardUuid(String uuid)
static String
shortName(String ref)
-
-
-
Field Detail
-
HEAD
public static final String HEAD
- See Also:
- Constant Field Values
-
REFS
public static final String REFS
- See Also:
- Constant Field Values
-
REFS_HEADS
public static final String REFS_HEADS
- See Also:
- Constant Field Values
-
REFS_TAGS
public static final String REFS_TAGS
- See Also:
- Constant Field Values
-
REFS_CHANGES
public static final String REFS_CHANGES
- See Also:
- Constant Field Values
-
REFS_META
public static final String REFS_META
- See Also:
- Constant Field Values
-
REFS_REJECT_COMMITS
public static final String REFS_REJECT_COMMITS
Note tree listing commits we refuserefs/meta/reject-commits
- See Also:
- Constant Field Values
-
REFS_CONFIG
public static final String REFS_CONFIG
Configuration settings for a projectrefs/meta/config
- See Also:
- Constant Field Values
-
REFS_EXTERNAL_IDS
public static final String REFS_EXTERNAL_IDS
Note tree listing external IDs- See Also:
- Constant Field Values
-
REFS_USERS_SELF
public static final String REFS_USERS_SELF
Magic user branch in All-Usersrefs/users/self
- See Also:
- Constant Field Values
-
REFS_USERS_DEFAULT
public static final String REFS_USERS_DEFAULT
Default user preference settings- See Also:
- Constant Field Values
-
REFS_DASHBOARDS
public static final String REFS_DASHBOARDS
Configurations of project-specific dashboards (canned search queries).- See Also:
- Constant Field Values
-
REFS_SEQUENCES
public static final String REFS_SEQUENCES
Sequence counters in NoteDb.- See Also:
- Constant Field Values
-
REFS_VERSION
public static final String REFS_VERSION
NoteDb schema version number.- See Also:
- Constant Field Values
-
REFS_CACHE_AUTOMERGE
public static final String REFS_CACHE_AUTOMERGE
Prefix applied to merge commit base nodes.References in this directory should take the form
refs/cache-automerge/xx/yyyy...
where xx is the first two digits of the merge commit's object name, and yyyyy... is the remaining 38. The reference should point to a treeish that is the automatic merge result of the merge commit's parents.- See Also:
- Constant Field Values
-
META_SUFFIX
public static final String META_SUFFIX
Suffix of a meta ref in the NoteDb.- See Also:
- Constant Field Values
-
ROBOT_COMMENTS_SUFFIX
public static final String ROBOT_COMMENTS_SUFFIX
Suffix of a ref that stores robot comments in the NoteDb.- See Also:
- Constant Field Values
-
EDIT_PREFIX
public static final String EDIT_PREFIX
- See Also:
- Constant Field Values
-
REFS_USERS
public static final String REFS_USERS
Preference settings for a userrefs/users
- See Also:
- Constant Field Values
-
REFS_GROUPS
public static final String REFS_GROUPS
NoteDb ref for a grouprefs/groups
- See Also:
- Constant Field Values
-
REFS_GROUPNAMES
public static final String REFS_GROUPNAMES
NoteDb ref for the NoteMap of all group names- See Also:
- Constant Field Values
-
REFS_DELETED_GROUPS
public static final String REFS_DELETED_GROUPS
NoteDb ref for deleted groupsrefs/deleted-groups
. This ref namespace is foreseen as an attic for deleted groups (it's reserved but not used yet)- See Also:
- Constant Field Values
-
REFS_DRAFT_COMMENTS
public static final String REFS_DRAFT_COMMENTS
Draft inline comments of a user on a change- See Also:
- Constant Field Values
-
REFS_STARRED_CHANGES
public static final String REFS_STARRED_CHANGES
A change starred by a user- See Also:
- Constant Field Values
-
-
Method Detail
-
patchSetRef
public static String patchSetRef(PatchSet.Id id)
-
isNoteDbMetaRef
public static boolean isNoteDbMetaRef(String ref)
-
isRefsChanges
public static boolean isRefsChanges(String ref)
True if the provided ref is inrefs/changes/*
.
-
refsGroups
public static String refsGroups(AccountGroup.UUID groupUuid)
-
refsDeletedGroups
public static String refsDeletedGroups(AccountGroup.UUID groupUuid)
-
refsUsers
public static String refsUsers(Account.Id accountId)
-
refsDraftComments
public static String refsDraftComments(Change.Id changeId, Account.Id accountId)
-
refsStarredChanges
public static String refsStarredChanges(Change.Id changeId, Account.Id accountId)
-
shard
public static String shard(int id)
-
refsEdit
public static String refsEdit(Account.Id accountId, Change.Id changeId, PatchSet.Id psId)
Returns reference for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/P.- Parameters:
accountId
- account idchangeId
- change numberpsId
- patch set number- Returns:
- reference for this change edit
-
refsEditPrefix
public static String refsEditPrefix(Account.Id accountId, Change.Id changeId)
Returns reference prefix for this change edit with sharded user and change number: refs/users/UU/UUUU/edit-CCCC/.- Parameters:
accountId
- account idchangeId
- change number- Returns:
- reference prefix for this change edit
-
refsEditPrefix
public static String refsEditPrefix(Account.Id accountId)
-
isRefsEdit
public static boolean isRefsEdit(String ref)
-
isRefsUsers
public static boolean isRefsUsers(String ref)
-
isRefsGroups
public static boolean isRefsGroups(String ref)
Whether the ref is a group branch that stores NoteDb data of a group. Returnstrue
for all refs that start withrefs/groups/
.
-
isRefsDeletedGroups
public static boolean isRefsDeletedGroups(String ref)
Whether the ref is a group branch that stores NoteDb data of a deleted group. Returnstrue
for all refs that start withrefs/deleted-groups/
.
-
isGroupRef
public static boolean isGroupRef(String ref)
Whether the ref is used for storing group data in NoteDb. Returnstrue
for all group branches, refs/meta/group-names and deleted group branches.
-
isConfigRef
public static boolean isConfigRef(String ref)
Whether the ref is the configuration branch, i.e.refs/meta/config
, for a project.
-
isGerritRef
public static boolean isGerritRef(String ref)
Whether the ref is managed by Gerrit. Covers all Gerrit-internal refs like refs/cache-automerge and refs/meta as well as refs/changes. Does not cover user-created refs like branches or custom ref namespaces like refs/my-company.Any ref for which this method evaluates to true will be served to users who have the
ACCESS_DATABASE
capability.CautionAny ref not in this list will be served if the user was granted a READ permission on it using Gerrit's permission model.
-
-