Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
4ccb4cc5
Commit
4ccb4cc5
authored
Feb 18, 2014
by
gmessner
Browse files
Moved from event package.
parent
da18e9a9
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/webhook/EventObject.java
0 → 100644
View file @
4ccb4cc5
package
com.messners.gitlab.api.webhook
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
EventObject
{
public
enum
ObjectKind
{
MERGE_REQUEST
,
ISSUE
;
public
String
toString
()
{
return
(
name
().
toLowerCase
());
}
}
private
EventObjectAttributes
objectAttributes
;
private
ObjectKind
objectKind
;
public
EventObjectAttributes
getObjectAttributes
()
{
return
this
.
objectAttributes
;
}
public
void
setObjectAttributes
(
EventObjectAttributes
objectAttributes
)
{
this
.
objectAttributes
=
objectAttributes
;
}
public
ObjectKind
getObjectKind
()
{
return
this
.
objectKind
;
}
public
void
setObjectKind
(
ObjectKind
objectKind
)
{
this
.
objectKind
=
objectKind
;
}
}
src/main/java/com/messners/gitlab/api/webhook/EventObjectAttributes.java
0 → 100644
View file @
4ccb4cc5
package
com.messners.gitlab.api.webhook
;
import
java.util.Date
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
@XmlRootElement
(
name
=
"object_attributes"
)
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
EventObjectAttributes
{
private
Integer
assigneeId
;
private
Integer
authorId
;
private
String
branchName
;
private
Date
createdAt
;
private
String
description
;
private
Integer
id
;
private
Integer
iid
;
private
String
mergeStatus
;
private
String
milestoneId
;
private
Integer
position
;
private
Integer
projectId
;
private
String
sourceBranch
;
private
Integer
sourceProjectId
;
private
String
stCommits
;
private
String
stDiffs
;
private
String
state
;
private
String
targetBranch
;
private
Integer
targetProjectId
;
private
String
title
;
private
Date
updatedAt
;
public
Integer
getAssigneeId
()
{
return
this
.
assigneeId
;
}
public
void
setAssigneeId
(
Integer
assigneeId
)
{
this
.
assigneeId
=
assigneeId
;
}
public
Integer
getAuthorId
()
{
return
this
.
authorId
;
}
public
void
setAuthorId
(
Integer
authorId
)
{
this
.
authorId
=
authorId
;
}
public
String
getBranchName
()
{
return
this
.
branchName
;
}
public
void
setBranchName
(
String
branchName
)
{
this
.
branchName
=
branchName
;
}
public
Date
getCreatedAt
()
{
return
this
.
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
public
String
getDescription
()
{
return
this
.
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
Integer
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getIid
()
{
return
this
.
iid
;
}
public
void
setIid
(
Integer
iid
)
{
this
.
iid
=
iid
;
}
public
String
getMergeStatus
()
{
return
this
.
mergeStatus
;
}
public
void
setMergeStatus
(
String
mergeStatus
)
{
this
.
mergeStatus
=
mergeStatus
;
}
public
String
getMilestoneId
()
{
return
this
.
milestoneId
;
}
public
void
setMilestoneId
(
String
milestoneId
)
{
this
.
milestoneId
=
milestoneId
;
}
public
Integer
getPosition
()
{
return
this
.
position
;
}
public
void
setPosition
(
Integer
position
)
{
this
.
position
=
position
;
}
public
Integer
getProjectId
()
{
return
this
.
projectId
;
}
public
void
setProjectId
(
Integer
projectId
)
{
this
.
projectId
=
projectId
;
}
public
String
getSourceBranch
()
{
return
this
.
sourceBranch
;
}
public
void
setSourceBranch
(
String
sourceBranch
)
{
this
.
sourceBranch
=
sourceBranch
;
}
public
Integer
getSourceProjectId
()
{
return
this
.
sourceProjectId
;
}
public
void
setSourceProjectId
(
Integer
sourceProjectId
)
{
this
.
sourceProjectId
=
sourceProjectId
;
}
public
String
getStCommits
()
{
return
this
.
stCommits
;
}
public
void
setStCommits
(
String
stCommits
)
{
this
.
stCommits
=
stCommits
;
}
public
String
getStDiffs
()
{
return
this
.
stDiffs
;
}
public
void
setStDiffs
(
String
stDiffs
)
{
this
.
stDiffs
=
stDiffs
;
}
public
String
getState
()
{
return
this
.
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
String
getTargetBranch
()
{
return
this
.
targetBranch
;
}
public
void
setTargetBranch
(
String
targetBranch
)
{
this
.
targetBranch
=
targetBranch
;
}
public
Integer
getTargetProjectId
()
{
return
this
.
targetProjectId
;
}
public
void
setTargetProjectId
(
Integer
targetProjectId
)
{
this
.
targetProjectId
=
targetProjectId
;
}
public
String
getTitle
()
{
return
this
.
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
Date
getUpdatedAt
()
{
return
this
.
updatedAt
;
}
public
void
setUpdatedAt
(
Date
updatedAt
)
{
this
.
updatedAt
=
updatedAt
;
}
}
src/main/java/com/messners/gitlab/api/webhook/PushEvent.java
0 → 100644
View file @
4ccb4cc5
package
com.messners.gitlab.api.webhook
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlAccessType
;
import
javax.xml.bind.annotation.XmlAccessorType
;
import
javax.xml.bind.annotation.XmlRootElement
;
import
com.messners.gitlab.api.Commit
;
import
com.messners.gitlab.api.Repository
;
@XmlRootElement
@XmlAccessorType
(
XmlAccessType
.
FIELD
)
public
class
PushEvent
{
private
String
after
;
private
String
before
;
private
List
<
Commit
>
commits
;
private
Number
projectId
;
private
String
ref
;
private
Repository
repository
;
private
Number
totalCommitsCount
;
private
Number
userId
;
private
String
userName
;
public
String
getAfter
()
{
return
this
.
after
;
}
public
void
setAfter
(
String
after
)
{
this
.
after
=
after
;
}
public
String
getBefore
()
{
return
this
.
before
;
}
public
void
setBefore
(
String
before
)
{
this
.
before
=
before
;
}
public
List
<
Commit
>
getCommits
()
{
return
this
.
commits
;
}
public
void
setCommits
(
List
<
Commit
>
commits
)
{
this
.
commits
=
commits
;
}
public
Number
getProjectId
()
{
return
this
.
projectId
;
}
public
void
setProjectId
(
Number
projectId
)
{
this
.
projectId
=
projectId
;
}
public
String
getRef
()
{
return
this
.
ref
;
}
public
void
setRef
(
String
ref
)
{
this
.
ref
=
ref
;
}
public
Repository
getRepository
()
{
return
this
.
repository
;
}
public
void
setRepository
(
Repository
repository
)
{
this
.
repository
=
repository
;
}
public
Number
getTotalCommitsCount
()
{
return
this
.
totalCommitsCount
;
}
public
void
setTotalCommitsCount
(
Number
totalCommitsCount
)
{
this
.
totalCommitsCount
=
totalCommitsCount
;
}
public
Number
getUserId
()
{
return
this
.
userId
;
}
public
void
setUserId
(
Number
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserName
()
{
return
this
.
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
}
src/main/java/com/messners/gitlab/api/webhook/WebHookListener.java
0 → 100644
View file @
4ccb4cc5
package
com.messners.gitlab.api.webhook
;
/**
* This class defines an event listener for the event fired when
* a WebHook notification has been received from a GitLab server.
*
* @author Greg Messner <gmessner@messners.com>
*/
public
interface
WebHookListener
extends
java
.
util
.
EventListener
{
/**
* This method is called when a WebHook issue notification has been received.
*
* @param event the EventObject instance containing info on the issue
*/
public
void
onIssue
(
EventObject
event
);
/**.
* This method is called when a WebHook merge request notification has been received
*
* @param event the EventObject instance containing info on the merge request
*/
public
void
onMergeRequest
(
EventObject
event
);
/**
* This method is called when a WebHook push notification has been received.
*
* @param pushEvent the PushEvent instance
*/
public
void
onPush
(
PushEvent
pushEvent
);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment