mv com/google/domain/registry google/registry

This change renames directories in preparation for the great package
rename. The repository is now in a broken state because the code
itself hasn't been updated. However this should ensure that git
correctly preserves history for each file.
This commit is contained in:
Justine Tunney 2016-05-13 18:55:08 -04:00
parent a41677aea1
commit 5012893c1d
2396 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,53 @@
package(
default_visibility = ["//java/com/google/domain/registry:registry_project"],
)
java_library(
name = "backend",
srcs = glob(["*.java"]),
deps = [
"//java/com/google/common/base",
"//java/com/google/common/collect",
"//java/com/google/common/net",
"//java/com/google/domain/registry/backup",
"//java/com/google/domain/registry/bigquery",
"//java/com/google/domain/registry/config",
"//java/com/google/domain/registry/cron",
"//java/com/google/domain/registry/dns",
"//java/com/google/domain/registry/dns/writer/api",
"//java/com/google/domain/registry/dns/writer/dnsupdate",
"//java/com/google/domain/registry/export",
"//java/com/google/domain/registry/export/sheet",
"//java/com/google/domain/registry/flows",
"//java/com/google/domain/registry/gcs",
"//java/com/google/domain/registry/groups",
"//java/com/google/domain/registry/keyring/api",
"//java/com/google/domain/registry/mapreduce",
"//java/com/google/domain/registry/model",
"//java/com/google/domain/registry/monitoring/whitebox",
"//java/com/google/domain/registry/rde",
"//java/com/google/domain/registry/request",
"//java/com/google/domain/registry/request:modules",
"//java/com/google/domain/registry/tmch",
"//java/com/google/domain/registry/util",
"//third_party/java/bouncycastle",
"//third_party/java/dagger",
"//third_party/java/jsr305_annotations",
"//third_party/java/jsr330_inject",
"//third_party/java/servlet/servlet_api",
],
)
# This rule is used so bazel can generate "backend_jar_deploy.jar" (which
# contains transitive dependencies) for deployment to App Engine. It MUST
# explicitly depend upon upon anything loaded at runtime, e.g. old servlets
# referenced by the module's web.xml file, that isn't statically linked above.
java_binary(
name = "backend_jar",
create_executable = 0,
runtime_deps = [
":backend",
"//java/com/google/domain/registry/monitoring/whitebox", # MetricsTaskServlet
],
)

View file

@ -0,0 +1,74 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.backend;
import com.google.domain.registry.bigquery.BigqueryModule;
import com.google.domain.registry.config.ConfigModule;
import com.google.domain.registry.dns.writer.api.VoidDnsWriterModule;
import com.google.domain.registry.export.DriveModule;
import com.google.domain.registry.export.sheet.SpreadsheetServiceModule;
import com.google.domain.registry.gcs.GcsServiceModule;
import com.google.domain.registry.groups.DirectoryModule;
import com.google.domain.registry.groups.GroupsModule;
import com.google.domain.registry.groups.GroupssettingsModule;
import com.google.domain.registry.keyring.api.KeyModule;
import com.google.domain.registry.keyring.api.VoidKeyringModule;
import com.google.domain.registry.rde.JSchModule;
import com.google.domain.registry.request.Modules.AppIdentityCredentialModule;
import com.google.domain.registry.request.Modules.DatastoreServiceModule;
import com.google.domain.registry.request.Modules.GoogleCredentialModule;
import com.google.domain.registry.request.Modules.Jackson2Module;
import com.google.domain.registry.request.Modules.ModulesServiceModule;
import com.google.domain.registry.request.Modules.URLFetchServiceModule;
import com.google.domain.registry.request.Modules.UrlFetchTransportModule;
import com.google.domain.registry.request.Modules.UseAppIdentityCredentialForGoogleApisModule;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.util.SystemClock.SystemClockModule;
import com.google.domain.registry.util.SystemSleeper.SystemSleeperModule;
import dagger.Component;
import javax.inject.Singleton;
/** Dagger component with instance lifetime for "backend" App Engine module. */
@Singleton
@Component(
modules = {
AppIdentityCredentialModule.class,
BigqueryModule.class,
ConfigModule.class,
DatastoreServiceModule.class,
DirectoryModule.class,
DriveModule.class,
GcsServiceModule.class,
GoogleCredentialModule.class,
GroupsModule.class,
GroupssettingsModule.class,
JSchModule.class,
Jackson2Module.class,
KeyModule.class,
ModulesServiceModule.class,
SpreadsheetServiceModule.class,
SystemClockModule.class,
SystemSleeperModule.class,
URLFetchServiceModule.class,
UrlFetchTransportModule.class,
UseAppIdentityCredentialForGoogleApisModule.class,
VoidDnsWriterModule.class,
VoidKeyringModule.class,
})
interface BackendComponent {
BackendRequestComponent startRequest(RequestModule requestModule);
}

View file

@ -0,0 +1,39 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.backend;
import static com.google.domain.registry.model.registry.Registries.assertTldExists;
import static com.google.domain.registry.request.RequestParameters.extractRequiredParameter;
import com.google.domain.registry.request.Parameter;
import com.google.domain.registry.request.RequestParameters;
import dagger.Module;
import dagger.Provides;
import javax.servlet.http.HttpServletRequest;
/**
* Dagger module for injecting common settings for all Backend tasks.
*/
@Module
public class BackendModule {
@Provides
@Parameter(RequestParameters.PARAM_TLD)
static String provideTld(HttpServletRequest req) {
return assertTldExists(extractRequiredParameter(req, RequestParameters.PARAM_TLD));
}
}

View file

@ -0,0 +1,114 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.backend;
import com.google.domain.registry.backup.BackupModule;
import com.google.domain.registry.backup.CommitLogCheckpointAction;
import com.google.domain.registry.backup.DeleteOldCommitLogsAction;
import com.google.domain.registry.backup.ExportCommitLogDiffAction;
import com.google.domain.registry.backup.RestoreCommitLogsAction;
import com.google.domain.registry.cron.CommitLogFanoutAction;
import com.google.domain.registry.cron.CronModule;
import com.google.domain.registry.cron.TldFanoutAction;
import com.google.domain.registry.dns.DnsModule;
import com.google.domain.registry.dns.PublishDnsUpdatesAction;
import com.google.domain.registry.dns.ReadDnsQueueAction;
import com.google.domain.registry.dns.RefreshDnsAction;
import com.google.domain.registry.dns.WriteDnsAction;
import com.google.domain.registry.export.BigqueryPollJobAction;
import com.google.domain.registry.export.ExportDomainListsAction;
import com.google.domain.registry.export.ExportRequestModule;
import com.google.domain.registry.export.ExportReservedTermsAction;
import com.google.domain.registry.export.LoadSnapshotAction;
import com.google.domain.registry.export.SyncGroupMembersAction;
import com.google.domain.registry.export.UpdateSnapshotViewAction;
import com.google.domain.registry.export.sheet.SheetModule;
import com.google.domain.registry.export.sheet.SyncRegistrarsSheetAction;
import com.google.domain.registry.flows.async.AsyncFlowsModule;
import com.google.domain.registry.flows.async.DeleteContactResourceAction;
import com.google.domain.registry.flows.async.DeleteHostResourceAction;
import com.google.domain.registry.flows.async.DnsRefreshForHostRenameAction;
import com.google.domain.registry.mapreduce.MapreduceModule;
import com.google.domain.registry.monitoring.whitebox.MetricsExportAction;
import com.google.domain.registry.monitoring.whitebox.VerifyEntityIntegrityAction;
import com.google.domain.registry.monitoring.whitebox.WhiteboxModule;
import com.google.domain.registry.rde.BrdaCopyAction;
import com.google.domain.registry.rde.RdeModule;
import com.google.domain.registry.rde.RdeReportAction;
import com.google.domain.registry.rde.RdeReporter;
import com.google.domain.registry.rde.RdeStagingAction;
import com.google.domain.registry.rde.RdeUploadAction;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.request.RequestScope;
import com.google.domain.registry.tmch.NordnUploadAction;
import com.google.domain.registry.tmch.NordnVerifyAction;
import com.google.domain.registry.tmch.TmchCrlAction;
import com.google.domain.registry.tmch.TmchDnlAction;
import com.google.domain.registry.tmch.TmchModule;
import com.google.domain.registry.tmch.TmchSmdrlAction;
import dagger.Subcomponent;
/** Dagger component with per-request lifetime for "backend" App Engine module. */
@RequestScope
@Subcomponent(
modules = {
AsyncFlowsModule.class,
BackendModule.class,
BackupModule.class,
CronModule.class,
DnsModule.class,
ExportRequestModule.class,
MapreduceModule.class,
RdeModule.class,
RequestModule.class,
SheetModule.class,
TmchModule.class,
WhiteboxModule.class,
})
interface BackendRequestComponent {
BigqueryPollJobAction bigqueryPollJobAction();
BrdaCopyAction brdaCopyAction();
CommitLogCheckpointAction commitLogCheckpointAction();
CommitLogFanoutAction commitLogFanoutAction();
DeleteContactResourceAction deleteContactResourceAction();
DeleteHostResourceAction deleteHostResourceAction();
DeleteOldCommitLogsAction deleteOldCommitLogsAction();
DnsRefreshForHostRenameAction dnsRefreshForHostRenameAction();
ExportCommitLogDiffAction exportCommitLogDiffAction();
ExportDomainListsAction exportDomainListsAction();
ExportReservedTermsAction exportReservedTermsAction();
LoadSnapshotAction loadSnapshotAction();
MetricsExportAction metricsExportAction();
NordnUploadAction nordnUploadAction();
NordnVerifyAction nordnVerifyAction();
PublishDnsUpdatesAction publishDnsUpdatesAction();
ReadDnsQueueAction readDnsQueueAction();
RdeReportAction rdeReportAction();
RdeStagingAction rdeStagingAction();
RdeUploadAction rdeUploadAction();
RdeReporter rdeReporter();
RefreshDnsAction refreshDnsAction();
RestoreCommitLogsAction restoreCommitLogsAction();
SyncGroupMembersAction syncGroupMembersAction();
SyncRegistrarsSheetAction syncRegistrarsSheetAction();
TldFanoutAction tldFanoutAction();
TmchCrlAction tmchCrlAction();
TmchDnlAction tmchDnlAction();
TmchSmdrlAction tmchSmdrlAction();
UpdateSnapshotViewAction updateSnapshotViewAction();
WriteDnsAction writeDnsAction();
VerifyEntityIntegrityAction verifyEntityIntegrityAction();
}

View file

@ -0,0 +1,58 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.backend;
import static java.util.Arrays.asList;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import com.google.domain.registry.request.RequestHandler;
import com.google.domain.registry.request.RequestModule;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.io.IOException;
import java.lang.reflect.Method;
import java.security.Security;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** Servlet that should handle all requests to our "backend" App Engine module. */
public final class BackendServlet extends HttpServlet {
private static final BackendComponent component = DaggerBackendComponent.create();
private static final RequestHandler<BackendRequestComponent> requestHandler =
RequestHandler.create(BackendRequestComponent.class, FluentIterable
.from(asList(BackendRequestComponent.class.getMethods()))
.transform(new Function<Method, Method>() {
@Override
public Method apply(Method method) {
method.setAccessible(true); // Make App Engine's security manager happy.
return method;
}}));
@Override
public void init() {
Security.addProvider(new BouncyCastleProvider());
}
@Override
public void service(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
requestHandler.handleRequest(req, rsp, component.startRequest(new RequestModule(req, rsp)));
}
}

View file

@ -0,0 +1,16 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.
@javax.annotation.ParametersAreNonnullByDefault
package com.google.domain.registry.module.backend;

View file

@ -0,0 +1,42 @@
package(
default_visibility = ["//java/com/google/domain/registry:registry_project"],
)
java_library(
name = "frontend",
srcs = glob(["*.java"]),
deps = [
"//java/com/google/common/base",
"//java/com/google/common/collect",
"//java/com/google/domain/registry/braintree",
"//java/com/google/domain/registry/config",
"//java/com/google/domain/registry/keyring/api",
"//java/com/google/domain/registry/rdap",
"//java/com/google/domain/registry/request",
"//java/com/google/domain/registry/request:modules",
"//java/com/google/domain/registry/ui",
"//java/com/google/domain/registry/ui/server/registrar",
"//java/com/google/domain/registry/util",
"//java/com/google/domain/registry/whois",
"//third_party/java/bouncycastle",
"//third_party/java/dagger",
"//third_party/java/jsr305_annotations",
"//third_party/java/jsr330_inject",
"//third_party/java/servlet/servlet_api",
],
)
# This rule is used so bazel can generate "frontend_jar_deploy.jar" (which
# contains transitive dependencies) for deployment to App Engine. It MUST
# explicitly depend upon upon anything loaded at runtime, e.g. old servlets
# referenced by the module's web.xml file, that isn't statically linked above.
java_binary(
name = "frontend_jar",
create_executable = 0,
runtime_deps = [
":frontend",
"//java/com/google/domain/registry/ui/server/api", # CheckApiServlet
"//java/com/google/domain/registry/ui/server/registrar", # ResourceServlet
],
)

View file

@ -0,0 +1,44 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.frontend;
import com.google.domain.registry.braintree.BraintreeModule;
import com.google.domain.registry.config.ConfigModule;
import com.google.domain.registry.keyring.api.KeyModule;
import com.google.domain.registry.keyring.api.VoidKeyringModule;
import com.google.domain.registry.request.Modules.UserServiceModule;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.ui.ConsoleConfigModule;
import com.google.domain.registry.util.SystemClock.SystemClockModule;
import dagger.Component;
import javax.inject.Singleton;
/** Dagger component with instance lifetime for "default" App Engine module. */
@Singleton
@Component(
modules = {
BraintreeModule.class,
ConfigModule.class,
ConsoleConfigModule.class,
KeyModule.class,
SystemClockModule.class,
UserServiceModule.class,
VoidKeyringModule.class,
})
interface FrontendComponent {
FrontendRequestComponent startRequest(RequestModule requestModule);
}

View file

@ -0,0 +1,63 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.frontend;
import com.google.domain.registry.rdap.RdapAutnumAction;
import com.google.domain.registry.rdap.RdapDomainAction;
import com.google.domain.registry.rdap.RdapDomainSearchAction;
import com.google.domain.registry.rdap.RdapEntityAction;
import com.google.domain.registry.rdap.RdapEntitySearchAction;
import com.google.domain.registry.rdap.RdapHelpAction;
import com.google.domain.registry.rdap.RdapIpAction;
import com.google.domain.registry.rdap.RdapModule;
import com.google.domain.registry.rdap.RdapNameserverAction;
import com.google.domain.registry.rdap.RdapNameserverSearchAction;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.request.RequestScope;
import com.google.domain.registry.ui.server.registrar.ConsoleUiAction;
import com.google.domain.registry.ui.server.registrar.RegistrarPaymentAction;
import com.google.domain.registry.ui.server.registrar.RegistrarPaymentSetupAction;
import com.google.domain.registry.ui.server.registrar.RegistrarUserModule;
import com.google.domain.registry.whois.WhoisHttpServer;
import com.google.domain.registry.whois.WhoisModule;
import com.google.domain.registry.whois.WhoisServer;
import dagger.Subcomponent;
/** Dagger component with per-request lifetime for "default" App Engine module. */
@RequestScope
@Subcomponent(
modules = {
RdapModule.class,
RegistrarUserModule.class,
RequestModule.class,
WhoisModule.class,
})
interface FrontendRequestComponent {
ConsoleUiAction consoleUiAction();
RdapAutnumAction rdapAutnumAction();
RegistrarPaymentAction registrarPaymentAction();
RegistrarPaymentSetupAction registrarPaymentSetupAction();
RdapDomainAction rdapDomainAction();
RdapDomainSearchAction rdapDomainSearchAction();
RdapEntityAction rdapEntityAction();
RdapEntitySearchAction rdapEntitySearchAction();
RdapHelpAction rdapHelpAction();
RdapIpAction rdapDefaultAction();
RdapNameserverAction rdapNameserverAction();
RdapNameserverSearchAction rdapNameserverSearchAction();
WhoisHttpServer whoisHttpServer();
WhoisServer whoisServer();
}

View file

@ -0,0 +1,58 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.frontend;
import static java.util.Arrays.asList;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import com.google.domain.registry.request.RequestHandler;
import com.google.domain.registry.request.RequestModule;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.io.IOException;
import java.lang.reflect.Method;
import java.security.Security;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** Servlet that should handle all requests to our "default" App Engine module. */
public final class FrontendServlet extends HttpServlet {
private static final FrontendComponent component = DaggerFrontendComponent.create();
private static final RequestHandler<FrontendRequestComponent> requestHandler =
RequestHandler.create(FrontendRequestComponent.class, FluentIterable
.from(asList(FrontendRequestComponent.class.getMethods()))
.transform(new Function<Method, Method>() {
@Override
public Method apply(Method method) {
method.setAccessible(true); // Make App Engine's security manager happy.
return method;
}}));
@Override
public void init() {
Security.addProvider(new BouncyCastleProvider());
}
@Override
public void service(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
requestHandler.handleRequest(req, rsp, component.startRequest(new RequestModule(req, rsp)));
}
}

View file

@ -0,0 +1,16 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.
@javax.annotation.ParametersAreNonnullByDefault
package com.google.domain.registry.module.frontend;

View file

@ -0,0 +1,42 @@
package(
default_visibility = ["//java/com/google/domain/registry:registry_project"],
)
java_library(
name = "tools",
srcs = glob(["*.java"]),
deps = [
"//java/com/google/common/base",
"//java/com/google/common/collect",
"//java/com/google/domain/registry/config",
"//java/com/google/domain/registry/export",
"//java/com/google/domain/registry/gcs",
"//java/com/google/domain/registry/groups",
"//java/com/google/domain/registry/keyring/api",
"//java/com/google/domain/registry/loadtest",
"//java/com/google/domain/registry/mapreduce",
"//java/com/google/domain/registry/request",
"//java/com/google/domain/registry/request:modules",
"//java/com/google/domain/registry/tools/server",
"//java/com/google/domain/registry/tools/server/javascrap",
"//java/com/google/domain/registry/util",
"//third_party/java/bouncycastle",
"//third_party/java/dagger",
"//third_party/java/jsr305_annotations",
"//third_party/java/jsr330_inject",
"//third_party/java/servlet/servlet_api",
],
)
# This rule is used so bazel can generate "tools_jar_deploy.jar" (which
# contains transitive dependencies) for deployment to App Engine. It MUST
# explicitly depend upon upon anything loaded at runtime, e.g. old servlets
# referenced by the module's web.xml file, that isn't statically linked above.
java_binary(
name = "tools_jar",
create_executable = 0,
runtime_deps = [
":tools",
],
)

View file

@ -0,0 +1,62 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.tools;
import com.google.domain.registry.config.ConfigModule;
import com.google.domain.registry.export.DriveModule;
import com.google.domain.registry.gcs.GcsServiceModule;
import com.google.domain.registry.groups.DirectoryModule;
import com.google.domain.registry.groups.GroupsModule;
import com.google.domain.registry.groups.GroupssettingsModule;
import com.google.domain.registry.keyring.api.KeyModule;
import com.google.domain.registry.keyring.api.VoidKeyringModule;
import com.google.domain.registry.request.Modules.AppIdentityCredentialModule;
import com.google.domain.registry.request.Modules.DatastoreServiceModule;
import com.google.domain.registry.request.Modules.GoogleCredentialModule;
import com.google.domain.registry.request.Modules.Jackson2Module;
import com.google.domain.registry.request.Modules.UrlFetchTransportModule;
import com.google.domain.registry.request.Modules.UseAppIdentityCredentialForGoogleApisModule;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.util.SystemClock.SystemClockModule;
import com.google.domain.registry.util.SystemSleeper.SystemSleeperModule;
import dagger.Component;
import javax.inject.Singleton;
/** Dagger component with instance lifetime for "tools" App Engine module. */
@Singleton
@Component(
modules = {
AppIdentityCredentialModule.class,
ConfigModule.class,
DatastoreServiceModule.class,
DirectoryModule.class,
DriveModule.class,
GcsServiceModule.class,
GoogleCredentialModule.class,
GroupsModule.class,
GroupssettingsModule.class,
Jackson2Module.class,
KeyModule.class,
UrlFetchTransportModule.class,
UseAppIdentityCredentialForGoogleApisModule.class,
SystemClockModule.class,
SystemSleeperModule.class,
VoidKeyringModule.class,
})
interface ToolsComponent {
ToolsRequestComponent startRequest(RequestModule requestModule);
}

View file

@ -0,0 +1,77 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.tools;
import com.google.domain.registry.export.PublishDetailReportAction;
import com.google.domain.registry.loadtest.LoadTestAction;
import com.google.domain.registry.loadtest.LoadTestModule;
import com.google.domain.registry.mapreduce.MapreduceModule;
import com.google.domain.registry.request.RequestModule;
import com.google.domain.registry.request.RequestScope;
import com.google.domain.registry.tools.server.CreateGroupsAction;
import com.google.domain.registry.tools.server.CreatePremiumListAction;
import com.google.domain.registry.tools.server.DeleteEntityAction;
import com.google.domain.registry.tools.server.DeleteProberDataAction;
import com.google.domain.registry.tools.server.GenerateZoneFilesAction;
import com.google.domain.registry.tools.server.KillAllCommitLogsAction;
import com.google.domain.registry.tools.server.KillAllCrossTldEntitiesAction;
import com.google.domain.registry.tools.server.KillAllEppResourcesAction;
import com.google.domain.registry.tools.server.ListDomainsAction;
import com.google.domain.registry.tools.server.ListHostsAction;
import com.google.domain.registry.tools.server.ListPremiumListsAction;
import com.google.domain.registry.tools.server.ListRegistrarsAction;
import com.google.domain.registry.tools.server.ListReservedListsAction;
import com.google.domain.registry.tools.server.ListTldsAction;
import com.google.domain.registry.tools.server.ResaveAllEppResourcesAction;
import com.google.domain.registry.tools.server.ToolsServerModule;
import com.google.domain.registry.tools.server.UpdatePremiumListAction;
import com.google.domain.registry.tools.server.VerifyOteAction;
import com.google.domain.registry.tools.server.javascrap.BackfillAutorenewBillingFlagAction;
import com.google.domain.registry.tools.server.javascrap.CountRecurringBillingEventsAction;
import dagger.Subcomponent;
/** Dagger component with per-request lifetime for "tools" App Engine module. */
@RequestScope
@Subcomponent(
modules = {
LoadTestModule.class,
MapreduceModule.class,
RequestModule.class,
ToolsServerModule.class,
})
interface ToolsRequestComponent {
BackfillAutorenewBillingFlagAction backfillAutorenewBillingFlagAction();
CountRecurringBillingEventsAction countRecurringBillingEventsAction();
CreateGroupsAction createGroupsAction();
CreatePremiumListAction createPremiumListAction();
DeleteEntityAction deleteEntityAction();
DeleteProberDataAction deleteProberDataAction();
GenerateZoneFilesAction generateZoneFilesAction();
KillAllCommitLogsAction killAllCommitLogsAction();
KillAllCrossTldEntitiesAction killAllCrossTldEntitiesAction();
KillAllEppResourcesAction killAllEppResourcesAction();
ListDomainsAction listDomainsAction();
ListHostsAction listHostsAction();
ListPremiumListsAction listPremiumListsAction();
ListRegistrarsAction listRegistrarsAction();
ListReservedListsAction listReservedListsAction();
ListTldsAction listTldsAction();
LoadTestAction loadTestAction();
PublishDetailReportAction publishDetailReportAction();
ResaveAllEppResourcesAction resaveAllEppResourcesAction();
UpdatePremiumListAction updatePremiumListAction();
VerifyOteAction verifyOteAction();
}

View file

@ -0,0 +1,58 @@
// Copyright 2016 The Domain Registry Authors. All Rights Reserved.
//
// 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.google.domain.registry.module.tools;
import static java.util.Arrays.asList;
import com.google.common.base.Function;
import com.google.common.collect.FluentIterable;
import com.google.domain.registry.request.RequestHandler;
import com.google.domain.registry.request.RequestModule;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import java.io.IOException;
import java.lang.reflect.Method;
import java.security.Security;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/** Servlet that should handle all requests to our "tools" App Engine module. */
public final class ToolsServlet extends HttpServlet {
private static final ToolsComponent component = DaggerToolsComponent.create();
private static final RequestHandler<ToolsRequestComponent> requestHandler =
RequestHandler.create(ToolsRequestComponent.class, FluentIterable
.from(asList(ToolsRequestComponent.class.getMethods()))
.transform(new Function<Method, Method>() {
@Override
public Method apply(Method method) {
method.setAccessible(true); // Make App Engine's security manager happy.
return method;
}}));
@Override
public void init() {
Security.addProvider(new BouncyCastleProvider());
}
@Override
public void service(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
requestHandler.handleRequest(req, rsp, component.startRequest(new RequestModule(req, rsp)));
}
}