Skip to content

Commit a224b51

Browse files
committed
fix missing apache header
1 parent c673a19 commit a224b51

File tree

56 files changed

+1184
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1184
-128
lines changed

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/Admin.java

+21
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
import org.apache.eventmesh.common.remote.Task;
421
import org.apache.eventmesh.common.remote.request.ReportHeartBeatRequest;
522
import org.apache.eventmesh.common.utils.PagedList;
623

724
public interface Admin extends ComponentLifeCycle {
25+
826
/**
927
* support for web or ops
1028
**/
1129
boolean createOrUpdateTask(Task task);
30+
1231
boolean deleteTask(Long id);
32+
1333
Task getTask(Long id);
34+
1435
// paged list
1536
PagedList<Task> getTaskPaged(Task task);
1637

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServer.java

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
import lombok.extern.slf4j.Slf4j;
21+
422
import org.apache.commons.lang3.StringUtils;
23+
524
import org.apache.eventmesh.common.Constants;
625
import org.apache.eventmesh.common.config.CommonConfiguration;
726
import org.apache.eventmesh.common.config.ConfigService;
@@ -13,6 +32,7 @@
1332
import org.apache.eventmesh.registry.RegisterServerInfo;
1433
import org.apache.eventmesh.registry.RegistryFactory;
1534
import org.apache.eventmesh.registry.RegistryService;
35+
1636
import org.springframework.boot.context.event.ApplicationReadyEvent;
1737
import org.springframework.context.ApplicationListener;
1838
import org.springframework.stereotype.Service;
@@ -31,7 +51,7 @@ public class AdminServer implements Admin, ApplicationListener<ApplicationReadyE
3151

3252
public AdminServer(AdminServerProperties properties) {
3353
configuration =
34-
ConfigService.getInstance().buildConfigInstance(CommonConfiguration.class);
54+
ConfigService.getInstance().buildConfigInstance(CommonConfiguration.class);
3555
if (configuration == null) {
3656
throw new AdminServerRuntimeException(ErrorCode.STARTUP_CONFIG_MISS, "common configuration file miss");
3757
}

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerProperties.java

+19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
import lombok.Getter;
421
import lombok.Setter;
22+
523
import org.springframework.boot.context.properties.ConfigurationProperties;
624

725
@ConfigurationProperties("event-mesh.admin-server")
826
@Getter
927
@Setter
1028
public class AdminServerProperties {
29+
1130
private int port;
1231
private boolean enableSSL;
1332
private String configurationPath;

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/AdminServerRuntimeException.java

+19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
import lombok.Getter;
421

522
public class AdminServerRuntimeException extends RuntimeException {
23+
624
@Getter
725
private final int code;
26+
827
public AdminServerRuntimeException(int code, String message) {
928
super(message);
1029
this.code = code;
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
public interface ComponentLifeCycle {
21+
422
void start() throws Exception;
23+
524
void destroy();
625
}

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/ExampleAdminServer.java

+20
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server;
219

320
import com.apache.eventmesh.admin.server.constatns.AdminServerConstants;
21+
422
import org.apache.eventmesh.common.config.ConfigService;
23+
524
import org.springframework.boot.SpringApplication;
625
import org.springframework.boot.autoconfigure.SpringBootApplication;
726

827
@SpringBootApplication
928
public class ExampleAdminServer {
29+
1030
public static void main(String[] args) throws Exception {
1131
ConfigService.getInstance().setConfigPath(AdminServerConstants.EVENTMESH_CONF_HOME).setRootConfig(AdminServerConstants.EVENTMESH_CONF_FILE);
1232
SpringApplication.run(ExampleAdminServer.class);

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/AdminGrpcServer.java

+28-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
import com.apache.eventmesh.admin.server.AdminServerRuntimeException;
421
import com.apache.eventmesh.admin.server.web.handler.BaseRequestHandler;
522
import com.apache.eventmesh.admin.server.web.handler.RequestHandlerFactory;
23+
624
import io.grpc.stub.ServerCallStreamObserver;
725
import io.grpc.stub.StreamObserver;
26+
827
import lombok.extern.slf4j.Slf4j;
28+
929
import org.apache.commons.lang3.StringUtils;
30+
1031
import org.apache.eventmesh.common.protocol.grpc.adminserver.AdminServiceGrpc;
1132
import org.apache.eventmesh.common.protocol.grpc.adminserver.Payload;
1233
import org.apache.eventmesh.common.remote.exception.ErrorCode;
@@ -15,26 +36,28 @@
1536
import org.apache.eventmesh.common.remote.response.BaseRemoteResponse;
1637
import org.apache.eventmesh.common.remote.response.EmptyAckResponse;
1738
import org.apache.eventmesh.common.remote.response.FailResponse;
39+
1840
import org.springframework.beans.factory.annotation.Autowired;
1941
import org.springframework.stereotype.Service;
2042

2143
@Service
2244
@Slf4j
2345
public class AdminGrpcServer extends AdminServiceGrpc.AdminServiceImplBase {
46+
2447
@Autowired
2548
RequestHandlerFactory handlerFactory;
2649

2750
private Payload process(Payload value) {
2851
if (value == null || StringUtils.isBlank(value.getMetadata().getType())) {
2952
return PayloadUtil.from(FailResponse.build(ErrorCode.BAD_REQUEST, "bad request: type not " +
30-
"exists"));
53+
"exists"));
3154
}
3255
try {
3356
BaseRequestHandler<BaseRemoteRequest, BaseRemoteResponse> handler =
34-
handlerFactory.getHandler(value.getMetadata().getType());
57+
handlerFactory.getHandler(value.getMetadata().getType());
3558
if (handler == null) {
3659
return PayloadUtil.from(FailResponse.build(BaseRemoteResponse.UNKNOWN,
37-
"not match any request handler"));
60+
"not match any request handler"));
3861
}
3962
BaseRemoteResponse response = handler.handlerRequest((BaseRemoteRequest) PayloadUtil.parse(value), value.getMetadata());
4063
if (response == null || response instanceof EmptyAckResponse) {
@@ -44,8 +67,8 @@ private Payload process(Payload value) {
4467
} catch (Exception e) {
4568
log.warn("process payload {} fail", value.getMetadata().getType(), e);
4669
if (e instanceof AdminServerRuntimeException) {
47-
return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException)e).getCode(),
48-
e.getMessage()));
70+
return PayloadUtil.from(FailResponse.build(((AdminServerRuntimeException) e).getCode(),
71+
e.getMessage()));
4972
}
5073
return PayloadUtil.from(FailResponse.build(ErrorCode.INTERNAL_ERR, "admin server internal err"));
5174
}

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/BaseServer.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
import com.apache.eventmesh.admin.server.ComponentLifeCycle;

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/GrpcServer.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
import com.apache.eventmesh.admin.server.AdminServerProperties;

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/HttpServer.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
import org.springframework.web.bind.annotation.RequestMapping;

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Request.java

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
public class Request<T> {

Diff for: eventmesh-admin-server/src/main/java/com/apache/eventmesh/admin/server/web/Response.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
package com.apache.eventmesh.admin.server.web;
219

320
public class Response<T> {
21+
422
private boolean success;
523

624
private String desc;

0 commit comments

Comments
 (0)