forked from apache/geode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug/geode 4798: Add JDBC Connector classes to sanctioned serializables (
apache#1592) * Added infrastructure to handle sanctioning serializables in JDBC Connector and improve use of serializable in the module
- Loading branch information
Nick Reich
authored
Mar 12, 2018
1 parent
386b92b
commit 0908acb
Showing
23 changed files
with
137 additions
and
31 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
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
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
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
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
43 changes: 43 additions & 0 deletions
43
...onnectors/src/main/java/org/apache/geode/internal/ConnectorsDistributedSystemService.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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work for additional information regarding | ||
* copyright ownership. The ASF licenses this file to You 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 org.apache.geode.internal; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.util.Collection; | ||
|
||
import org.apache.geode.distributed.internal.DistributedSystemService; | ||
import org.apache.geode.distributed.internal.InternalDistributedSystem; | ||
import org.apache.geode.internal.ClassPathLoader; | ||
import org.apache.geode.internal.InternalDataSerializer; | ||
|
||
public class ConnectorsDistributedSystemService implements DistributedSystemService { | ||
@Override | ||
public void init(InternalDistributedSystem internalDistributedSystem) { | ||
|
||
} | ||
|
||
@Override | ||
public Class getInterface() { | ||
return getClass(); | ||
} | ||
|
||
@Override | ||
public Collection<String> getSerializationWhitelist() throws IOException { | ||
URL sanctionedSerializables = ClassPathLoader.getLatest().getResource(getClass(), | ||
"sanctioned-geode-connectors-serializables.txt"); | ||
return InternalDataSerializer.loadClassNames(sanctionedSerializables); | ||
} | ||
} |
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
...esources/META-INF/services/org.apache.geode.distributed.internal.DistributedSystemService
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,16 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You 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. | ||
org.apache.geode.internal.ConnectorsDistributedSystemService | ||
|
18 changes: 18 additions & 0 deletions
18
...rc/main/resources/org/apache/geode/internal/sanctioned-geode-connectors-serializables.txt
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,18 @@ | ||
org/apache/geode/connectors/jdbc/JdbcConnectorException,true,1 | ||
org/apache/geode/connectors/jdbc/internal/ConnectionConfigExistsException,false | ||
org/apache/geode/connectors/jdbc/internal/ConnectionConfigNotFoundException,false | ||
org/apache/geode/connectors/jdbc/internal/ConnectionConfiguration,false,name:java/lang/String,parameters:java/util/Map,password:java/lang/String,url:java/lang/String,user:java/lang/String | ||
org/apache/geode/connectors/jdbc/internal/RegionMapping,false,columnToFieldMap:java/util/Map,connectionConfigName:java/lang/String,fieldToColumnMap:java/util/Map,pdxClassName:java/lang/String,primaryKeyInValue:java/lang/Boolean,regionName:java/lang/String,tableName:java/lang/String | ||
org/apache/geode/connectors/jdbc/internal/RegionMappingExistsException,false | ||
org/apache/geode/connectors/jdbc/internal/RegionMappingNotFoundException,false | ||
org/apache/geode/connectors/jdbc/internal/cli/AlterConnectionFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/AlterMappingFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/CreateConnectionFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/CreateMappingFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/DescribeConnectionFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/DescribeMappingFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/DestroyMappingFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/JdbcCliFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/ListConnectionFunction,false | ||
org/apache/geode/connectors/jdbc/internal/cli/ListMappingFunction,false |
30 changes: 30 additions & 0 deletions
30
.../src/test/java/org/apache/geode/codeAnalysis/AnalyzeConnectorsSerializablesJUnitTest.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license | ||
* agreements. See the NOTICE file distributed with this work for additional information regarding | ||
* copyright ownership. The ASF licenses this file to You 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 org.apache.geode.codeAnalysis; | ||
|
||
import org.junit.experimental.categories.Category; | ||
|
||
import org.apache.geode.test.junit.categories.IntegrationTest; | ||
import org.apache.geode.test.junit.categories.LuceneTest; | ||
|
||
|
||
@Category({IntegrationTest.class}) | ||
public class AnalyzeConnectorsSerializablesJUnitTest extends AnalyzeSerializablesJUnitTest { | ||
|
||
@Override | ||
protected String getModuleName() { | ||
return "geode-connectors"; | ||
} | ||
} |
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
5 changes: 5 additions & 0 deletions
5
geode-connectors/src/test/resources/org/apache/geode/codeAnalysis/excludedClasses.txt
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 @@ | ||
org/apache/geode/connectors/jdbc/internal/xml/ElementType | ||
org/apache/geode/connectors/jdbc/internal/xml/ElementType$1 | ||
org/apache/geode/connectors/jdbc/internal/xml/ElementType$2 | ||
org/apache/geode/connectors/jdbc/internal/xml/ElementType$3 | ||
org/apache/geode/connectors/jdbc/internal/xml/ElementType$4 |
Empty file.
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