forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pinpoint-apm#1511 extract commons-server module
- Loading branch information
Showing
44 changed files
with
1,279 additions
and
1,147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.settings/ | ||
/*.iml | ||
/.project | ||
/target/ | ||
/.classpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
RMRqrdbgbKFhbaVnDxHUdDQvrOQXxIBklnvcmahheubVC | ||
mh2KM35CLkwUHS4DH7QVhxy52J5hnWbyEm6Cyd3KkF<mV | ||
RmmnSVOqOMnOnMMrmMqwXomoroNrqPNRrPSsWwtUxXuUU | ||
sRONqpnmqmUUnqonmstsmmmmmUUnqonmstsmmmmmUUGfk | ||
mlfkqUUnmmmm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<FindBugsFilter> | ||
|
||
</FindBugsFilter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.navercorp.pinpoint</groupId> | ||
<artifactId>pom</artifactId> | ||
<version>1.5.2-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>pinpoint-commons-server</artifactId> | ||
<name>pinpoint-commons-server</name> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.navercorp.pinpoint</groupId> | ||
<artifactId>pinpoint-thrift</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.navercorp.pinpoint</groupId> | ||
<artifactId>pinpoint-commons</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<!-- commons module may be used at agent so there will be problems. you should set optional --> | ||
<dependency> | ||
<groupId>org.apache.thrift</groupId> | ||
<artifactId>libthrift</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
|
||
<!-- Logging dependencies --> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<!-- thrift logging lib --> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-log4j12</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>log4j</groupId> | ||
<artifactId>log4j</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<!--<dependency> --> | ||
<!--<groupId>org.slf4j</groupId> --> | ||
<!--<artifactId>slf4j-jdk14</artifactId> --> | ||
<!--<version>1.6.6</version> --> | ||
<!--<scope>test</scope> --> | ||
<!--</dependency> --> | ||
|
||
<dependency> | ||
<groupId>com.google.guava</groupId> | ||
<artifactId>guava</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
|
||
</project> |
282 changes: 141 additions & 141 deletions
282
...corp/pinpoint/common/bo/AgentEventBo.java → ...corp/pinpoint/common/bo/AgentEventBo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,141 @@ | ||
/* | ||
* Copyright 2015 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.navercorp.pinpoint.common.bo; | ||
|
||
import com.navercorp.pinpoint.common.util.AgentEventType; | ||
|
||
/** | ||
* @author HyunGil Jeong | ||
*/ | ||
public class AgentEventBo { | ||
|
||
public static final int CURRENT_VERSION = 0; | ||
|
||
private final byte version; | ||
private final String agentId; | ||
private final long startTimestamp; | ||
private final long eventTimestamp; | ||
private final AgentEventType eventType; | ||
private byte[] eventBody; | ||
|
||
public AgentEventBo(String agentId, long startTimestamp, long eventTimestamp, AgentEventType eventType) { | ||
this(CURRENT_VERSION, agentId, startTimestamp, eventTimestamp, eventType); | ||
} | ||
|
||
public AgentEventBo(int version, String agentId, long startTimestamp, long eventTimestamp, AgentEventType eventType) { | ||
if (version < 0 || version > 255) { | ||
throw new IllegalArgumentException("version out of range (0~255)"); | ||
} | ||
if (agentId == null) { | ||
throw new IllegalArgumentException("agentId cannot be null"); | ||
} | ||
if (agentId.isEmpty()) { | ||
throw new IllegalArgumentException("agentId cannot be empty"); | ||
} | ||
if (startTimestamp < 0) { | ||
throw new IllegalArgumentException("startTimestamp cannot be less than 0"); | ||
} | ||
if (eventTimestamp < 0) { | ||
throw new IllegalArgumentException("eventTimestamp cannot be less than 0"); | ||
} | ||
if (eventType == null) { | ||
throw new IllegalArgumentException("agentEventType cannot be null"); | ||
} | ||
this.version = (byte)(version & 0xFF); | ||
this.agentId = agentId; | ||
this.startTimestamp = startTimestamp; | ||
this.eventTimestamp = eventTimestamp; | ||
this.eventType = eventType; | ||
} | ||
|
||
public int getVersion() { | ||
return this.version & 0xFF; | ||
} | ||
|
||
public String getAgentId() { | ||
return agentId; | ||
} | ||
|
||
public long getStartTimestamp() { | ||
return startTimestamp; | ||
} | ||
|
||
public long getEventTimestamp() { | ||
return eventTimestamp; | ||
} | ||
|
||
public AgentEventType getEventType() { | ||
return eventType; | ||
} | ||
|
||
public byte[] getEventBody() { | ||
return eventBody; | ||
} | ||
|
||
public void setEventBody(byte[] eventBody) { | ||
this.eventBody = eventBody; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((agentId == null) ? 0 : agentId.hashCode()); | ||
result = prime * result + (int)(eventTimestamp ^ (eventTimestamp >>> 32)); | ||
result = prime * result + ((eventType == null) ? 0 : eventType.hashCode()); | ||
result = prime * result + (int)(startTimestamp ^ (startTimestamp >>> 32)); | ||
result = prime * result + version; | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
AgentEventBo other = (AgentEventBo)obj; | ||
if (agentId == null) { | ||
if (other.agentId != null) | ||
return false; | ||
} else if (!agentId.equals(other.agentId)) | ||
return false; | ||
if (eventTimestamp != other.eventTimestamp) | ||
return false; | ||
if (eventType != other.eventType) | ||
return false; | ||
if (startTimestamp != other.startTimestamp) | ||
return false; | ||
if (version != other.version) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("AgentEventBo{"); | ||
sb.append("version=").append(this.version); | ||
sb.append(", agentId='").append(this.agentId).append('\''); | ||
sb.append(", startTimestamp=").append(this.startTimestamp); | ||
sb.append(", eventTimestamp=").append(this.eventTimestamp); | ||
sb.append(", eventType='").append(this.getEventType().getDesc()).append('\''); | ||
return sb.toString(); | ||
} | ||
|
||
} | ||
/* | ||
* Copyright 2015 NAVER Corp. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.navercorp.pinpoint.common.bo; | ||
|
||
import com.navercorp.pinpoint.common.util.AgentEventType; | ||
|
||
/** | ||
* @author HyunGil Jeong | ||
*/ | ||
public class AgentEventBo { | ||
|
||
public static final int CURRENT_VERSION = 0; | ||
|
||
private final byte version; | ||
private final String agentId; | ||
private final long startTimestamp; | ||
private final long eventTimestamp; | ||
private final AgentEventType eventType; | ||
private byte[] eventBody; | ||
|
||
public AgentEventBo(String agentId, long startTimestamp, long eventTimestamp, AgentEventType eventType) { | ||
this(CURRENT_VERSION, agentId, startTimestamp, eventTimestamp, eventType); | ||
} | ||
|
||
public AgentEventBo(int version, String agentId, long startTimestamp, long eventTimestamp, AgentEventType eventType) { | ||
if (version < 0 || version > 255) { | ||
throw new IllegalArgumentException("version out of range (0~255)"); | ||
} | ||
if (agentId == null) { | ||
throw new IllegalArgumentException("agentId cannot be null"); | ||
} | ||
if (agentId.isEmpty()) { | ||
throw new IllegalArgumentException("agentId cannot be empty"); | ||
} | ||
if (startTimestamp < 0) { | ||
throw new IllegalArgumentException("startTimestamp cannot be less than 0"); | ||
} | ||
if (eventTimestamp < 0) { | ||
throw new IllegalArgumentException("eventTimestamp cannot be less than 0"); | ||
} | ||
if (eventType == null) { | ||
throw new IllegalArgumentException("agentEventType cannot be null"); | ||
} | ||
this.version = (byte)(version & 0xFF); | ||
this.agentId = agentId; | ||
this.startTimestamp = startTimestamp; | ||
this.eventTimestamp = eventTimestamp; | ||
this.eventType = eventType; | ||
} | ||
|
||
public int getVersion() { | ||
return this.version & 0xFF; | ||
} | ||
|
||
public String getAgentId() { | ||
return agentId; | ||
} | ||
|
||
public long getStartTimestamp() { | ||
return startTimestamp; | ||
} | ||
|
||
public long getEventTimestamp() { | ||
return eventTimestamp; | ||
} | ||
|
||
public AgentEventType getEventType() { | ||
return eventType; | ||
} | ||
|
||
public byte[] getEventBody() { | ||
return eventBody; | ||
} | ||
|
||
public void setEventBody(byte[] eventBody) { | ||
this.eventBody = eventBody; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((agentId == null) ? 0 : agentId.hashCode()); | ||
result = prime * result + (int)(eventTimestamp ^ (eventTimestamp >>> 32)); | ||
result = prime * result + ((eventType == null) ? 0 : eventType.hashCode()); | ||
result = prime * result + (int)(startTimestamp ^ (startTimestamp >>> 32)); | ||
result = prime * result + version; | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) | ||
return true; | ||
if (obj == null) | ||
return false; | ||
if (getClass() != obj.getClass()) | ||
return false; | ||
AgentEventBo other = (AgentEventBo)obj; | ||
if (agentId == null) { | ||
if (other.agentId != null) | ||
return false; | ||
} else if (!agentId.equals(other.agentId)) | ||
return false; | ||
if (eventTimestamp != other.eventTimestamp) | ||
return false; | ||
if (eventType != other.eventType) | ||
return false; | ||
if (startTimestamp != other.startTimestamp) | ||
return false; | ||
if (version != other.version) | ||
return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("AgentEventBo{"); | ||
sb.append("version=").append(this.version); | ||
sb.append(", agentId='").append(this.agentId).append('\''); | ||
sb.append(", startTimestamp=").append(this.startTimestamp); | ||
sb.append(", eventTimestamp=").append(this.eventTimestamp); | ||
sb.append(", eventType='").append(this.getEventType().getDesc()).append('\''); | ||
return sb.toString(); | ||
} | ||
|
||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.