conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringWriter;
=======
import java.io.*;
import java.net.URI;
>>>>>>>
import java.io.*; |
<<<<<<<
import com.stormpath.sdk.servlet.filter.ChangePasswordConfigResolver;
import com.stormpath.sdk.servlet.filter.ChangePasswordServletControllerConfigResolver;
=======
import com.stormpath.sdk.servlet.event.RequestEvent;
import com.stormpath.sdk.servlet.event.impl.Publisher;
>>>>>>>
import com.stormpath.sdk.servlet.filter.ChangePasswordConfigResolver;
import com.stormpath.sdk.servlet.filter.ChangePasswordServletControllerConfigResolver;
import com.stormpath.sdk.servlet.event.RequestEvent;
import com.stormpath.sdk.servlet.event.impl.Publisher; |
<<<<<<<
import com.github.dockerjava.api.model.Frame;
import com.github.dockerjava.core.async.FrameStreamProcessor;
import com.github.dockerjava.core.async.JsonStreamProcessor;
import com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier;
import com.github.dockerjava.jaxrs.async.POSTCallbackNotifier;
public class AttachContainerCmdExec extends AbstrDockerCmdExec<AttachContainerCmd, Void> implements
AttachContainerCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(AttachContainerCmdExec.class);
public AttachContainerCmdExec(WebTarget baseResource) {
super(baseResource);
}
@Override
protected Void execute(AttachContainerCmd command) {
WebTarget webTarget = getBaseResource().path("/containers/{id}/attach")
.resolveTemplate("id", command.getContainerId())
.queryParam("logs", command.hasLogsEnabled() ? "1" : "0")
// .queryParam("stdin", command.hasStdinEnabled() ? "1" : "0")
.queryParam("stdout", command.hasStdoutEnabled() ? "1" : "0")
.queryParam("stderr", command.hasStderrEnabled() ? "1" : "0")
.queryParam("stream", command.hasFollowStreamEnabled() ? "1" : "0");
LOGGER.trace("POST: {}", webTarget);
POSTCallbackNotifier<Frame> callbackNotifier = new POSTCallbackNotifier<Frame>(new FrameStreamProcessor(),
command.getResultCallback(), webTarget);
AbstractCallbackNotifier.startAsyncProcessing(callbackNotifier);
return null;
}
=======
import com.github.dockerjava.jaxrs.util.WrappedResponseInputStream;
public class AttachContainerCmdExec extends AbstrDockerCmdExec<AttachContainerCmd, InputStream> implements
AttachContainerCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(AttachContainerCmdExec.class);
public AttachContainerCmdExec(WebTarget baseResource) {
super(baseResource);
}
@Override
protected InputStream execute(AttachContainerCmd command) {
WebTarget webResource = getBaseResource().path("/containers/{id}/attach")
.resolveTemplate("id", command.getContainerId())
.queryParam("logs", command.hasLogsEnabled() ? "1" : "0")
// .queryParam("stdin", command.hasStdinEnabled() ? "1" : "0")
.queryParam("stdout", command.hasStdoutEnabled() ? "1" : "0")
.queryParam("stderr", command.hasStderrEnabled() ? "1" : "0")
.queryParam("stream", command.hasFollowStreamEnabled() ? "1" : "0");
LOGGER.trace("POST: {}", webResource);
Response response = webResource.request().accept(MediaType.APPLICATION_OCTET_STREAM_TYPE)
.post(null, Response.class);
return new WrappedResponseInputStream(response);
}
>>>>>>>
import com.github.dockerjava.api.model.Frame;
import com.github.dockerjava.core.async.FrameStreamProcessor;
import com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier;
import com.github.dockerjava.jaxrs.async.POSTCallbackNotifier;
public class AttachContainerCmdExec extends AbstrDockerCmdExec<AttachContainerCmd, Void> implements
AttachContainerCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(AttachContainerCmdExec.class);
public AttachContainerCmdExec(WebTarget baseResource) {
super(baseResource);
}
@Override
protected Void execute(AttachContainerCmd command) {
WebTarget webTarget = getBaseResource().path("/containers/{id}/attach")
.resolveTemplate("id", command.getContainerId())
.queryParam("logs", command.hasLogsEnabled() ? "1" : "0")
// .queryParam("stdin", command.hasStdinEnabled() ? "1" : "0")
.queryParam("stdout", command.hasStdoutEnabled() ? "1" : "0")
.queryParam("stderr", command.hasStderrEnabled() ? "1" : "0")
.queryParam("stream", command.hasFollowStreamEnabled() ? "1" : "0");
LOGGER.trace("POST: {}", webTarget);
POSTCallbackNotifier<Frame> callbackNotifier = new POSTCallbackNotifier<Frame>(new FrameStreamProcessor(),
command.getResultCallback(), webTarget);
AbstractCallbackNotifier.startAsyncProcessing(callbackNotifier);
return null;
} |
<<<<<<<
import com.android.build.gradle.internal.incremental.InstantRunBuildContext;
=======
import com.android.build.gradle.internal.dsl.AbiSplitOptions;
>>>>>>>
import com.android.build.gradle.internal.incremental.InstantRunBuildContext;
import com.android.build.gradle.internal.dsl.AbiSplitOptions; |
<<<<<<<
/**
* Whether this build type is configured to generate an APK with debuggable native code.
*/
=======
public void setTestCoverageEnabled(boolean testCoverageEnabled) {
mTestCoverageEnabled = testCoverageEnabled;
}
@Override
public boolean isTestCoverageEnabled() {
return mTestCoverageEnabled;
}
>>>>>>>
public void setTestCoverageEnabled(boolean testCoverageEnabled) {
mTestCoverageEnabled = testCoverageEnabled;
}
@Override
public boolean isTestCoverageEnabled() {
return mTestCoverageEnabled;
}
/**
* Whether this build type is configured to generate an APK with debuggable native code.
*/ |
<<<<<<<
=======
import com.google.common.base.Optional;
import com.google.common.base.Objects;
>>>>>>>
import com.google.common.base.Optional;
import com.google.common.base.Objects;
<<<<<<<
=======
public void createPreprocessResourcesTask(
@NonNull TaskFactory tasks,
@NonNull final VariantScope scope) {
if (!"true".equals(
project.getProperties().get(
"com.android.build.gradle.experimentalPreprocessResources"))) {
return;
}
final BaseVariantData<? extends BaseVariantOutputData> variantData = scope.getVariantData();
int minSdk = variantData.getVariantConfiguration().getMinSdkVersion().getApiLevel();
if (extension.getPreprocessingOptions().getPreprocessResources()
&& minSdk < PreprocessResourcesTask.MIN_SDK) {
// Otherwise mergeResources will rename files when merging and it's hard to keep track
// of PNGs that the user wanted to use instead of the generated ones.
checkArgument(extension.getBuildToolsRevision().compareTo(
MergeResources.NORMALIZE_RESOURCES_BUILD_TOOLS) >= 0,
"To preprocess resources, you have to use build tools >= %1$s",
MergeResources.NORMALIZE_RESOURCES_BUILD_TOOLS);
scope.setPreprocessResourcesTask(androidTasks.create(
tasks,
scope.getTaskName("preprocess", "Resources"),
PreprocessResourcesTask.class,
new Action<PreprocessResourcesTask>() {
@Override
public void execute(PreprocessResourcesTask preprocessResourcesTask) {
variantData.preprocessResourcesTask = preprocessResourcesTask;
preprocessResourcesTask.dependsOn(variantData.mergeResourcesTask);
preprocessResourcesTask.setVariantName(variantData.getName());
String variantDirName =
variantData.getVariantConfiguration().getDirName();
preprocessResourcesTask.setMergedResDirectory(
scope.getMergeResourcesOutputDir());
preprocessResourcesTask.setGeneratedResDirectory(new File(
scope.getGlobalScope().getGeneratedDir(),
"res/pngs/" + variantDirName));
preprocessResourcesTask.setOutputResDirectory(
scope.getPreprocessResourceOutputDir());
preprocessResourcesTask.setIncrementalFolder(new File(
scope.getGlobalScope().getIntermediatesDir(),
"incremental/preprocessResourcesTask/" + variantDirName));
preprocessResourcesTask.setDensitiesToGenerate(
extension.getPreprocessingOptions().getTypedDensities());
}
}));
}
}
>>>>>>> |
<<<<<<<
String endpoint;
if (logout) {
endpoint = SSO_LOGOUT_ENDPOINT;
} else {
endpoint = SSO_ENDPOINT;
}
StringBuilder urlBuilder = new StringBuilder(endpoint).append('?').append(queryString.toString());
=======
@SuppressWarnings("StringBufferReplaceableByString")
StringBuilder urlBuilder = new StringBuilder(SSO_ENDPOINT).append('?').append(queryString.toString());
>>>>>>>
String endpoint;
if (logout) {
endpoint = SSO_LOGOUT_ENDPOINT;
} else {
endpoint = SSO_ENDPOINT;
}
@SuppressWarnings("StringBufferReplaceableByString")
StringBuilder urlBuilder = new StringBuilder(endpoint).append('?').append(queryString.toString()); |
<<<<<<<
/**
* Returns all {@link ApiKey}s that belong to this account.
*
* @return all {@link ApiKey}s that belong to this account.
*
* @since 1.1.beta
*/
ApiKeyList getApiKeys();
/**
* Returns a paginated list of the account's api keys that match the specified query criteria.
* <p/>
* This method is mostly provided as a non-type-safe alternative to the
* {@link #getApiKeys(com.stormpath.sdk.api.ApiKeyCriteria)} method which might be useful in dynamic languages on the
* JVM (for example, with Groovy):
* <pre>
* def apiKeys = account.getApiKeys([expand: 'tenant'])
* </pre>
* The query parameter names and values must be equal to those documented in the Stormpath REST API product guide.
* <p/>
* Each {@code queryParams} key/value pair will be converted to String name to String value pairs and appended to
* the resource URL as query parameters, for example:
* <pre>
* .../accounts/accountId/apiKeys?param1=value1¶m2=value2&...
* </pre>
* <p/>
* If in doubt, use {@link #getApiKeys(com.stormpath.sdk.api.ApiKeyCriteria)} as all possible query options are available
* via type-safe guarantees that can be auto-completed by most IDEs.
*
* @param queryParams the query parameters to use when performing a request to the collection.
* @return a paginated list of the account's api keys that match the specified query criteria.
* @since 1.1.beta
*/
ApiKeyList getApiKeys(Map<String, Object> queryParams);
/**
* Returns a paginated list of the account's api keys that match the specified query criteria. The
* {@link com.stormpath.sdk.api.ApiKeys ApiKeys} utility class is available to help construct
* the criteria DSL - most modern IDEs can auto-suggest and auto-complete as you type, allowing for an easy
* query-building experience. For example:
* <pre>
* account.getApiKeys(ApiKeys.criteria().offsetBy(50).withTenant());
* </pre>
* or, if you use static imports:
* <pre>
* import static com.stormpath.sdk.api.ApiKeys.*;
*
* ...
*
* account.getApiKeys(criteria().offsetBy(50).withTenant());
* </pre>
*
* @param criteria the criteria to use when performing a request to the collection.
* @return a paginated list of the account's api keys that match the specified query criteria.
* @since 1.1.beta
*/
ApiKeyList getApiKeys(ApiKeyCriteria criteria);
/**
* Creates an {@link ApiKey} for this account and returns it.
*
* @return the created {@link ApiKey}.
* @since 1.1.beta
*/
ApiKey createApiKey();
/**
* Creates an {@link ApiKey} resource and ensures the returned {@link ApiKey} response reflects the specified {@link ApiKeyOptions}.
*
* @param options The {@link ApiKeyOptions} to use to customize the ApiKey resource returned in the create
* response.
* @since 1.1.beta
*/
ApiKey createApiKey(ApiKeyOptions options);
=======
/**
* Returns the ProviderData Resource belonging to the account.
*
* @return the ProviderData Resource belonging to the account.
*
* @since 1.0.beta
*/
ProviderData getProviderData();
>>>>>>>
/**
* Returns the ProviderData Resource belonging to the account.
*
* @return the ProviderData Resource belonging to the account.
*
* @since 1.0.beta
*/
ProviderData getProviderData();
/**
* Returns all {@link ApiKey}s that belong to this account.
*
* @return all {@link ApiKey}s that belong to this account.
*
* @since 1.1.beta
*/
ApiKeyList getApiKeys();
/**
* Returns a paginated list of the account's api keys that match the specified query criteria.
* <p/>
* This method is mostly provided as a non-type-safe alternative to the
* {@link #getApiKeys(com.stormpath.sdk.api.ApiKeyCriteria)} method which might be useful in dynamic languages on the
* JVM (for example, with Groovy):
* <pre>
* def apiKeys = account.getApiKeys([expand: 'tenant'])
* </pre>
* The query parameter names and values must be equal to those documented in the Stormpath REST API product guide.
* <p/>
* Each {@code queryParams} key/value pair will be converted to String name to String value pairs and appended to
* the resource URL as query parameters, for example:
* <pre>
* .../accounts/accountId/apiKeys?param1=value1¶m2=value2&...
* </pre>
* <p/>
* If in doubt, use {@link #getApiKeys(com.stormpath.sdk.api.ApiKeyCriteria)} as all possible query options are available
* via type-safe guarantees that can be auto-completed by most IDEs.
*
* @param queryParams the query parameters to use when performing a request to the collection.
* @return a paginated list of the account's api keys that match the specified query criteria.
* @since 1.1.beta
*/
ApiKeyList getApiKeys(Map<String, Object> queryParams);
/**
* Returns a paginated list of the account's api keys that match the specified query criteria. The
* {@link com.stormpath.sdk.api.ApiKeys ApiKeys} utility class is available to help construct
* the criteria DSL - most modern IDEs can auto-suggest and auto-complete as you type, allowing for an easy
* query-building experience. For example:
* <pre>
* account.getApiKeys(ApiKeys.criteria().offsetBy(50).withTenant());
* </pre>
* or, if you use static imports:
* <pre>
* import static com.stormpath.sdk.api.ApiKeys.*;
*
* ...
*
* account.getApiKeys(criteria().offsetBy(50).withTenant());
* </pre>
*
* @param criteria the criteria to use when performing a request to the collection.
* @return a paginated list of the account's api keys that match the specified query criteria.
* @since 1.1.beta
*/
ApiKeyList getApiKeys(ApiKeyCriteria criteria);
/**
* Creates an {@link ApiKey} for this account and returns it.
*
* @return the created {@link ApiKey}.
* @since 1.1.beta
*/
ApiKey createApiKey();
/**
* Creates an {@link ApiKey} resource and ensures the returned {@link ApiKey} response reflects the specified {@link ApiKeyOptions}.
*
* @param options The {@link ApiKeyOptions} to use to customize the ApiKey resource returned in the create
* response.
* @since 1.1.beta
*/
ApiKey createApiKey(ApiKeyOptions options); |
<<<<<<<
import com.stormpath.sdk.account.Account;
import com.stormpath.sdk.account.AccountCriteria;
import com.stormpath.sdk.account.AccountList;
import com.stormpath.sdk.account.Accounts;
import com.stormpath.sdk.account.CreateAccountRequest;
import com.stormpath.sdk.account.PasswordResetToken;
import com.stormpath.sdk.api.ApiKey;
import com.stormpath.sdk.api.ApiKeyList;
import com.stormpath.sdk.api.ApiKeyOptions;
import com.stormpath.sdk.application.AccountStoreMapping;
import com.stormpath.sdk.application.AccountStoreMappingCriteria;
import com.stormpath.sdk.application.AccountStoreMappingList;
import com.stormpath.sdk.application.Application;
import com.stormpath.sdk.application.ApplicationStatus;
=======
import com.stormpath.sdk.account.*;
import com.stormpath.sdk.application.*;
>>>>>>>
import com.stormpath.sdk.account.Account;
import com.stormpath.sdk.account.AccountCriteria;
import com.stormpath.sdk.account.AccountList;
import com.stormpath.sdk.account.Accounts;
import com.stormpath.sdk.account.CreateAccountRequest;
import com.stormpath.sdk.account.PasswordResetToken;
import com.stormpath.sdk.api.ApiKey;
import com.stormpath.sdk.api.ApiKeyList;
import com.stormpath.sdk.api.ApiKeyOptions;
import com.stormpath.sdk.application.AccountStoreMapping;
import com.stormpath.sdk.application.AccountStoreMappingCriteria;
import com.stormpath.sdk.application.AccountStoreMappingList;
import com.stormpath.sdk.application.Application;
import com.stormpath.sdk.application.ApplicationStatus;
import com.stormpath.sdk.account.*;
import com.stormpath.sdk.application.*;
<<<<<<<
import com.stormpath.sdk.group.CreateGroupRequest;
import com.stormpath.sdk.group.Group;
import com.stormpath.sdk.group.GroupCriteria;
import com.stormpath.sdk.group.GroupList;
import com.stormpath.sdk.group.Groups;
import com.stormpath.sdk.impl.api.DefaultApiKeyCriteria;
import com.stormpath.sdk.impl.api.DefaultApiKeyOptions;
=======
import com.stormpath.sdk.group.*;
>>>>>>>
import com.stormpath.sdk.group.CreateGroupRequest;
import com.stormpath.sdk.group.Group;
import com.stormpath.sdk.group.GroupCriteria;
import com.stormpath.sdk.group.GroupList;
import com.stormpath.sdk.group.Groups;
import com.stormpath.sdk.impl.api.DefaultApiKeyCriteria;
import com.stormpath.sdk.impl.api.DefaultApiKeyOptions;
import com.stormpath.sdk.group.*;
<<<<<<<
import com.stormpath.sdk.impl.query.DefaultEqualsExpressionFactory;
import com.stormpath.sdk.impl.query.Expandable;
import com.stormpath.sdk.impl.query.Expansion;
import com.stormpath.sdk.impl.resource.AbstractInstanceResource;
import com.stormpath.sdk.impl.resource.CollectionReference;
import com.stormpath.sdk.impl.resource.Property;
import com.stormpath.sdk.impl.resource.ResourceReference;
import com.stormpath.sdk.impl.resource.StatusProperty;
import com.stormpath.sdk.impl.resource.StringProperty;
=======
import com.stormpath.sdk.impl.provider.ProviderAccountResolver;
import com.stormpath.sdk.impl.resource.*;
>>>>>>>
import com.stormpath.sdk.impl.provider.ProviderAccountResolver;
import com.stormpath.sdk.impl.resource.*;
import com.stormpath.sdk.impl.query.DefaultEqualsExpressionFactory;
import com.stormpath.sdk.impl.query.Expandable;
import com.stormpath.sdk.impl.query.Expansion;
import com.stormpath.sdk.impl.resource.AbstractInstanceResource;
import com.stormpath.sdk.impl.resource.CollectionReference;
import com.stormpath.sdk.impl.resource.Property;
import com.stormpath.sdk.impl.resource.ResourceReference;
import com.stormpath.sdk.impl.resource.StatusProperty;
import com.stormpath.sdk.impl.resource.StringProperty; |
<<<<<<<
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform;
=======
import com.android.build.gradle.internal.tasks.databinding.DataBindingExportBuildInfoTask;
import com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask;
>>>>>>>
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform;
import com.android.build.gradle.internal.tasks.databinding.DataBindingExportBuildInfoTask;
import com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask; |
<<<<<<<
@Value("#{ @environment['stormpath.spring.security.enabled'] ?: true }")
protected boolean stormpathSecurityEnabled;
public SecurityConfigurerAdapter stormpathSecurityConfigurerAdapter() {
return new StormpathSecurityConfigurerAdapter();
=======
public StormpathWebSecurityConfigurer stormpathWebSecurityConfigurer() {
return new StormpathWebSecurityConfigurer();
>>>>>>>
public SecurityConfigurerAdapter stormpathSecurityConfigurerAdapter() {
return new StormpathSecurityConfigurerAdapter(); |
<<<<<<<
import com.android.build.gradle.tasks.BinaryFileProviderTask;
import com.android.build.gradle.tasks.IncrementalBuildType;
=======
>>>>>>>
import com.android.build.gradle.tasks.BinaryFileProviderTask;
import com.android.build.gradle.tasks.IncrementalBuildType;
<<<<<<<
import com.android.build.gradle.tasks.SourceCodeIncrementalSupport;
import com.android.builder.core.VariantConfiguration;
import com.android.builder.core.VariantType;
=======
>>>>>>>
import com.android.build.gradle.tasks.SourceCodeIncrementalSupport;
import com.android.builder.core.VariantConfiguration;
import com.android.builder.core.VariantType;
<<<<<<<
private Map<Abi, File> ndkDebuggableLibraryFolders = Maps.newHashMap();
@Nullable
private File mergeResourceOutputDir;
// Tasks
private AndroidTask<Task> preBuildTask;
private AndroidTask<PrepareDependenciesTask> prepareDependenciesTask;
private AndroidTask<ProcessAndroidResources> generateRClassTask;
private AndroidTask<Task> sourceGenTask;
private AndroidTask<Task> resourceGenTask;
private AndroidTask<Task> assetGenTask;
private AndroidTask<CheckManifest> checkManifestTask;
private AndroidTask<RenderscriptCompile> renderscriptCompileTask;
private AndroidTask<AidlCompile> aidlCompileTask;
@Nullable
private AndroidTask<MergeResources> mergeResourcesTask;
@Nullable
private AndroidTask<MergeAssets> mergeAssetsTask;
private AndroidTask<GenerateBuildConfig> generateBuildConfigTask;
private AndroidTask<GenerateResValues> generateResValuesTask;
@Nullable
private AndroidTask<Dex> dexTask;
@Nullable
private AndroidTask<Dex> incrementalDexTask;
@Nullable
private AndroidTask jacocoIntrumentTask;
private AndroidTask<Sync> processJavaResourcesTask;
private AndroidTask<MergeJavaResourcesTask> mergeJavaResourcesTask;
private JavaResourcesProvider javaResourcesProvider;
private AndroidTask<NdkCompile> ndkCompileTask;
/** @see BaseVariantData#javaCompilerTask */
@Nullable
private AndroidTask<? extends AbstractCompile> javaCompilerTask;
@Nullable
private AndroidTask<JavaCompile> javacTask;
@Nullable
private AndroidTask<JackTask> jackTask;
@Nullable
private AndroidTask<SourceCodeIncrementalSupport> initialIncrementalSupportTask;
// empty anchor compile task to set all compilations tasks as dependents.
private AndroidTask<Task> compileTask;
private AndroidTask<JacocoInstrumentTask> jacocoInstrumentTask;
private FileSupplier mappingFileProviderTask;
private AndroidTask<BinaryFileProviderTask> binayFileProviderTask;
// TODO : why is Jack not registered as the obfuscationTask ???
private AndroidTask<? extends Task> obfuscationTask;
private File resourceOutputDir;
public VariantScope(
@NonNull GlobalScope globalScope,
@NonNull BaseVariantData<? extends BaseVariantOutputData> variantData) {
this.globalScope = globalScope;
this.variantData = variantData;
}
@NonNull
public GlobalScope getGlobalScope() {
return globalScope;
}
=======
BaseVariantData<? extends BaseVariantOutputData> getVariantData();
>>>>>>>
BaseVariantData<? extends BaseVariantOutputData> getVariantData();
<<<<<<<
@NonNull
public File getDexOutputFolder(IncrementalBuildType processType) {
return processType == IncrementalBuildType.FULL
? getDexOutputFolder()
: getInitialIncrementalDexOutputFolder();
}
=======
@NonNull
Set<File> getJniFolders();
>>>>>>>
@NonNull
File getDexOutputFolder(IncrementalBuildType processType);
@NonNull
Set<File> getJniFolders();
<<<<<<<
public File getInitialIncrementalSupportJavaOutputDir() {
return new File(globalScope.getIntermediatesDir(), "/initial-incremental-classes/" +
variantData.getVariantConfiguration().getDirName());
}
@NonNull
public File getIncrementalSupportJavaOutputDir() {
return new File(globalScope.getIntermediatesDir(), "/incremental-classes/" +
variantData.getVariantConfiguration().getDirName());
}
@NonNull
public Iterable<File> getJavaOuptuts() {
return Iterables.concat(
getJavaClasspath(),
ImmutableList.of(
getJavaOutputDir(),
getJavaDependencyCache()));
}
=======
Iterable<File> getJavaOuptuts();
>>>>>>>
File getInitialIncrementalSupportJavaOutputDir();
@NonNull
File getIncrementalSupportJavaOutputDir();
@NonNull
Iterable<File> getJavaOuptuts();
<<<<<<<
public AndroidTask<Dex> getIncrementalDexTask() {
return incrementalDexTask;
}
public void setIncrementalDexTask(@Nullable AndroidTask<Dex> dexTask) {
this.incrementalDexTask = dexTask;
}
@Nullable
public AndroidTask<Dex> getDexTask() {
return dexTask;
}
public void setDexTask(@Nullable AndroidTask<Dex> dexTask) {
this.dexTask = dexTask;
}
public AndroidTask<Sync> getProcessJavaResourcesTask() {
return processJavaResourcesTask;
}
public void setProcessJavaResourcesTask(
AndroidTask<Sync> processJavaResourcesTask) {
this.processJavaResourcesTask = processJavaResourcesTask;
}
SignedJarBuilder.IZipEntryFilter packagingOptionsFilter;
public void setPackagingOptionsFilter(SignedJarBuilder.IZipEntryFilter filter) {
this.packagingOptionsFilter = filter;
}
/**
* Returns the {@link SignedJarBuilder.IZipEntryFilter} instance
* that manages all resources inclusion in the final APK following the rules defined in
* {@link com.android.builder.model.PackagingOptions} settings.
*/
public SignedJarBuilder.IZipEntryFilter getPackagingOptionsFilter() {
return packagingOptionsFilter;
}
public void setMergeJavaResourcesTask(AndroidTask<MergeJavaResourcesTask> mergeJavaResourcesTask) {
this.mergeJavaResourcesTask = mergeJavaResourcesTask;
}
/**
* Returns the task extracting java resources from libraries and merging those with java
* resources coming from the variant's source folders.
* @return the task merging resources.
*/
public AndroidTask<MergeJavaResourcesTask> getMergeJavaResourcesTask() {
return mergeJavaResourcesTask;
}
public void setJavaResourcesProvider(JavaResourcesProvider javaResourcesProvider) {
this.javaResourcesProvider = javaResourcesProvider;
}
/**
* Returns the {@link JavaResourcesProvider} responsible for providing final merged and possibly
* obfuscated java resources for inclusion in the final APK. The provider might change during
* the variant build process.
* @return the java resources provider.
*/
public JavaResourcesProvider getJavaResourcesProvider() {
return javaResourcesProvider;
}
=======
AndroidTask<Dex> getDexTask();
void setDexTask(@Nullable AndroidTask<Dex> dexTask);
AndroidTask<Sync> getProcessJavaResourcesTask();
void setProcessJavaResourcesTask(
AndroidTask<Sync> processJavaResourcesTask);
void setPackagingOptionsFilter(SignedJarBuilder.IZipEntryFilter filter);
SignedJarBuilder.IZipEntryFilter getPackagingOptionsFilter();
void setMergeJavaResourcesTask(AndroidTask<MergeJavaResourcesTask> mergeJavaResourcesTask);
AndroidTask<MergeJavaResourcesTask> getMergeJavaResourcesTask();
void setJavaResourcesProvider(JavaResourcesProvider javaResourcesProvider);
JavaResourcesProvider getJavaResourcesProvider();
>>>>>>>
AndroidTask<Dex> getIncrementalDexTask();
void setIncrementalDexTask(@Nullable AndroidTask<Dex> dexTask);
@Nullable
AndroidTask<Dex> getDexTask();
void setDexTask(@Nullable AndroidTask<Dex> dexTask);
AndroidTask<Sync> getProcessJavaResourcesTask();
void setProcessJavaResourcesTask(AndroidTask<Sync> processJavaResourcesTask);
void setPackagingOptionsFilter(SignedJarBuilder.IZipEntryFilter filter);
SignedJarBuilder.IZipEntryFilter getPackagingOptionsFilter();
void setMergeJavaResourcesTask(AndroidTask<MergeJavaResourcesTask> mergeJavaResourcesTask);
AndroidTask<MergeJavaResourcesTask> getMergeJavaResourcesTask() ;
void setJavaResourcesProvider(JavaResourcesProvider javaResourcesProvider);
JavaResourcesProvider getJavaResourcesProvider();
<<<<<<<
public AndroidTask<JavaCompile> getJavacTask() {
return javacTask;
}
public void setInitialIncrementalSupportTask(
AndroidTask<SourceCodeIncrementalSupport> initialIncrementalSupportTask) {
this.initialIncrementalSupportTask = initialIncrementalSupportTask;
}
@Nullable
public AndroidTask<SourceCodeIncrementalSupport> getInitialIncrementalSupportTask() {
return initialIncrementalSupportTask;
}
public void setJavacTask(
@Nullable AndroidTask<JavaCompile> javacTask) {
this.javacTask = javacTask;
}
public void setJavaCompilerTask(
@NonNull AndroidTask<? extends AbstractCompile> javaCompileTask) {
this.javaCompilerTask = javaCompileTask;
}
public AndroidTask<Task> getCompileTask() {
return compileTask;
}
public void setCompileTask(
AndroidTask<Task> compileTask) {
this.compileTask = compileTask;
}
public AndroidTask<? extends Task> getObfuscationTask() {
return obfuscationTask;
}
public void setObfuscationTask(
AndroidTask<? extends Task> obfuscationTask) {
this.obfuscationTask = obfuscationTask;
}
=======
AndroidTask<JavaCompile> getJavacTask();
void setJavacTask(
@Nullable AndroidTask<JavaCompile> javacTask);
void setJavaCompilerTask(
@NonNull AndroidTask<? extends AbstractCompile> javaCompileTask);
AndroidTask<Task> getCompileTask();
void setCompileTask(
AndroidTask<Task> compileTask);
AndroidTask<? extends Task> getObfuscationTask();
void setObfuscationTask(
AndroidTask<? extends Task> obfuscationTask);
>>>>>>>
AndroidTask<JavaCompile> getJavacTask();
void setInitialIncrementalSupportTask(
AndroidTask<SourceCodeIncrementalSupport> initialIncrementalSupportTask);
@Nullable
AndroidTask<SourceCodeIncrementalSupport> getInitialIncrementalSupportTask();
void setJavacTask(@Nullable AndroidTask<JavaCompile> javacTask);
void setJavaCompilerTask(@NonNull AndroidTask<? extends AbstractCompile> javaCompileTask);
AndroidTask<Task> getCompileTask();
void setCompileTask(AndroidTask<Task> compileTask);
AndroidTask<? extends Task> getObfuscationTask();
void setObfuscationTask(AndroidTask<? extends Task> obfuscationTask); |
<<<<<<<
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform;
import com.android.build.gradle.internal.variant.ApkVariantData;
=======
>>>>>>>
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform;
<<<<<<<
@NonNull
@Override
public File getDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/dex/" + getVariantConfiguration().getDirName());
}
@Override
@NonNull
public File getReloadDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/reload-dex/" + getVariantConfiguration().getDirName());
}
@Override
@NonNull
public File getRestartDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/restart-dex/" + getVariantConfiguration().getDirName());
}
=======
>>>>>>>
@NonNull
@Override
public File getDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/dex/" + getVariantConfiguration().getDirName());
}
@Override
@NonNull
public File getReloadDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/reload-dex/" + getVariantConfiguration().getDirName());
}
@Override
@NonNull
public File getRestartDexOutputFolder() {
return new File(globalScope.getIntermediatesDir(), "/restart-dex/" + getVariantConfiguration().getDirName());
} |
<<<<<<<
import com.stormpath.sdk.impl.resource.*;
import com.stormpath.sdk.impl.util.SoftHashMap;
=======
import com.stormpath.sdk.impl.resource.AbstractResource;
import com.stormpath.sdk.impl.resource.ArrayProperty;
import com.stormpath.sdk.impl.resource.CollectionProperties;
import com.stormpath.sdk.impl.resource.Property;
import com.stormpath.sdk.impl.resource.ReferenceFactory;
import com.stormpath.sdk.impl.resource.ResourceReference;
>>>>>>>
import com.stormpath.sdk.impl.resource.AbstractResource;
import com.stormpath.sdk.impl.resource.ArrayProperty;
import com.stormpath.sdk.impl.resource.CollectionProperties;
import com.stormpath.sdk.impl.resource.Property;
import com.stormpath.sdk.impl.resource.ReferenceFactory;
import com.stormpath.sdk.impl.resource.ResourceReference;
<<<<<<<
private volatile Map<String, Enlistment> hrefMapStore;
=======
private final ApiKey apiKey;
private final PropertiesFilterProcessor resourceDataFilterProcessor;
private final PropertiesFilterProcessor queryStringFilterProcessor;
>>>>>>>
private final ApiKey apiKey;
private final PropertiesFilterProcessor resourceDataFilterProcessor;
private final PropertiesFilterProcessor queryStringFilterProcessor;
private volatile Map<String, Enlistment> hrefMapStore;
<<<<<<<
this.hrefMapStore = new SoftHashMap<String, Enlistment>();
=======
this.apiKey = apiKey;
this.cacheMapInitializer = new DefaultCacheMapInitializer();
resourceDataFilterProcessor = new DefaultPropertiesFilterProcessor();
// Adding another processor for query strings because we don't want to mix
// the processing (filtering) of the query strings with the processing of the resource properties,
// even though they're both (resource properties and query string objects) Maps that might apply
// to the be added to the same filter. This separation also improves requests performance.
queryStringFilterProcessor = new DefaultPropertiesFilterProcessor();
initFilterProcessors();
>>>>>>>
this.hrefMapStore = new SoftHashMap<String, Enlistment>();
this.apiKey = apiKey;
this.cacheMapInitializer = new DefaultCacheMapInitializer();
resourceDataFilterProcessor = new DefaultPropertiesFilterProcessor();
// Adding another processor for query strings because we don't want to mix
// the processing (filtering) of the query strings with the processing of the resource properties,
// even though they're both (resource properties and query string objects) Maps that might apply
// to the be added to the same filter. This separation also improves requests performance.
queryStringFilterProcessor = new DefaultPropertiesFilterProcessor();
initFilterProcessors();
<<<<<<<
Map<String, ?> data = null;
//check if cached:
if (isCacheRetrievalEnabled(parent)) {
data = getCachedValue(href, parent);
}
if (Collections.isEmpty(data)) {
//not cached - execute a request:
Request request = createRequest(HttpMethod.GET, href, qs);
data = executeRequest(request);
if (!Collections.isEmpty(data) && isCacheUpdateEnabled(parent)) {
//cache for further use:
cache(parent, data);
}
//@since 1.0.RC
if (!Collections.isEmpty(data) && data.get("href") != null && !CollectionResource.class.isAssignableFrom(parent)) {
data = toEnlistment(data);
}
}
=======
Map<String, ?> data = retrieveResponseValue(href, parent, qs);
>>>>>>>
Map<String, ?> data = retrieveResponseValue(href, parent, qs);
//@since 1.0.0
if (!Collections.isEmpty(data) && data.get("href") != null && !CollectionResource.class.isAssignableFrom(parent)) {
data = toEnlistment(data);
}
<<<<<<<
private <T extends Resource, R extends Resource> R save(String href, T resource, Class<? extends R> returnType, QueryString queryString) {
return resourceFactory.instantiate(returnType, getResponseBody(href, resource, returnType, queryString));
}
private <T extends Resource, R extends Resource> Map<String, Object> getResponseBody(String href, T resource, Class<? extends R> returnType, QueryString queryString) {
=======
private <T extends Resource, R extends Resource> R save(String href, T resource, Class<? extends R> returnType, QueryString qs) {
>>>>>>>
private <T extends Resource, R extends Resource> R save(String href, T resource, Class<? extends R> returnType, QueryString qs) {
<<<<<<<
Request request = new DefaultRequest(HttpMethod.POST, href, queryString, null, body, length);
=======
QueryString filteredQs = (QueryString) queryStringFilterProcessor.process(returnType, qs);
Request request = new DefaultRequest(HttpMethod.POST, href, filteredQs, null, body, length);
>>>>>>>
QueryString filteredQs = (QueryString) queryStringFilterProcessor.process(returnType, qs);
Request request = new DefaultRequest(HttpMethod.POST, href, filteredQs, null, body, length);
<<<<<<<
return responseBody;
=======
return resourceFactory.instantiate(returnType, returnResponseBody);
>>>>>>>
return resourceFactory.instantiate(returnType, returnResponseBody);
<<<<<<<
/**
* Fix for https://github.com/stormpath/stormpath-sdk-java/issues/47. Data map is now shared among all
* Resource instances referencing the same Href.
* @since 1.0.RC
*/
private Enlistment toEnlistment(Map data) {
Enlistment enlistment;
Object responseHref = data.get("href");
if (this.hrefMapStore.containsKey(responseHref)) {
enlistment = this.hrefMapStore.get(responseHref);
enlistment.setProperties((Map<String, Object>) data);
} else {
enlistment = new Enlistment((Map<String, Object>) data);
this.hrefMapStore.put((String) responseHref, enlistment);
}
return enlistment;
}
=======
/**
* Initializes the filter processors with the filters that should always be present when calling
* {@link PropertiesFilterProcessor#process(Class,Map)}.
*
* @since 1.0.RC
*/
protected void initFilterProcessors() {
resourceDataFilterProcessor.add(new ApiKeyCachePropertiesFilter(apiKey));
queryStringFilterProcessor.add(new ApiKeyQueryPropertiesFilter());
}
/**
*
* @since 1.0.RC
*/
private boolean isApiKeyCollectionQuery(Class clazz, QueryString qs) {
return ApiKeyList.class.isAssignableFrom(clazz) && qs != null && qs.containsKey(ID.getName());
}
>>>>>>>
/**
* Initializes the filter processors with the filters that should always be present when calling
* {@link PropertiesFilterProcessor#process(Class,Map)}.
*
* @since 1.0.RC
*/
protected void initFilterProcessors() {
resourceDataFilterProcessor.add(new ApiKeyCachePropertiesFilter(apiKey));
queryStringFilterProcessor.add(new ApiKeyQueryPropertiesFilter());
}
/**
*
* @since 1.0.RC
*/
private boolean isApiKeyCollectionQuery(Class clazz, QueryString qs) {
return ApiKeyList.class.isAssignableFrom(clazz) && qs != null && qs.containsKey(ID.getName());
}
/**
* Fix for https://github.com/stormpath/stormpath-sdk-java/issues/47. Data map is now shared among all
* Resource instances referencing the same Href.
* @since 1.0.0
*/
private Enlistment toEnlistment(Map data) {
Enlistment enlistment;
Object responseHref = data.get("href");
if (this.hrefMapStore.containsKey(responseHref)) {
enlistment = this.hrefMapStore.get(responseHref);
enlistment.setProperties((Map<String, Object>) data);
} else {
enlistment = new Enlistment((Map<String, Object>) data);
this.hrefMapStore.put((String) responseHref, enlistment);
}
return enlistment;
} |
<<<<<<<
public boolean isActive(OptionalCompilationStep step) {
return optionalCompilationSteps.contains(step);
}
=======
@NonNull
public String getArchivesBaseName() {
return (String)getProject().getProperties().get("archivesBaseName");
}
>>>>>>>
public boolean isActive(OptionalCompilationStep step) {
return optionalCompilationSteps.contains(step);
}
@NonNull
public String getArchivesBaseName() {
return (String)getProject().getProperties().get("archivesBaseName");
} |
<<<<<<<
import com.android.build.gradle.tasks.fd.FastDeployRuntimeExtractorTask;
import com.android.build.gradle.tasks.fd.GenerateInstantRunAppInfoTask;
import com.android.build.api.transform.QualifiedContent.Scope;
=======
>>>>>>>
import com.android.build.gradle.tasks.fd.FastDeployRuntimeExtractorTask;
import com.android.build.gradle.tasks.fd.GenerateInstantRunAppInfoTask; |
<<<<<<<
File getReloadDexOutputFolder();
@NonNull
File getRestartDexOutputFolder();
@NonNull
=======
>>>>>>>
File getReloadDexOutputFolder();
@NonNull
File getRestartDexOutputFolder();
@NonNull
<<<<<<<
@Nullable
AndroidTask<Dex> getIncrementalDexTask();
void setIncrementalDexTask(@Nullable AndroidTask<Dex> dexTask);
@Nullable
AndroidTask<Dex> getDexTask();
void setDexTask(@Nullable AndroidTask<Dex> dexTask);
=======
>>>>>>> |
<<<<<<<
public String getParameter(String parameterName);
public Enumeration<String> getParameterNames();
=======
public String getMethod();
public Map<String, String[]> getParameterMap();
>>>>>>>
public String getMethod();
public Map<String, String[]> getParameterMap();
public String getParameter(String parameterName); |
<<<<<<<
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform;
=======
import com.android.build.gradle.internal.tasks.databinding.DataBindingExportBuildInfoTask;
import com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask;
>>>>>>>
import com.android.build.gradle.internal.tasks.databinding.DataBindingExportBuildInfoTask;
import com.android.build.gradle.internal.tasks.databinding.DataBindingProcessLayoutsTask;
import com.android.build.gradle.internal.transforms.InstantRunVerifierTransform; |
<<<<<<<
import com.stormpath.sdk.impl.resource.AbstractResource;
import com.stormpath.sdk.impl.resource.ArrayProperty;
import com.stormpath.sdk.impl.resource.CollectionProperties;
import com.stormpath.sdk.impl.resource.Property;
import com.stormpath.sdk.impl.resource.ReferenceFactory;
import com.stormpath.sdk.impl.resource.ResourceReference;
=======
import com.stormpath.sdk.impl.resource.*;
>>>>>>>
import com.stormpath.sdk.impl.resource.*;
<<<<<<<
return resourceFactory.instantiate(returnType, returnResponseBody);
=======
//since 1.0.beta: provider's account creation status (whether it is new or not) is returned in the HTTP response
//status. The resource factory does not provide a way to pass such information when instantiating a resource. Thus,
//after the resource has been instantiated we are going to manipulate it before returning it in order to set the
//"is new" status
int responseStatus = response.getHttpStatus();
if (ProviderAccountResultHelper.class.isAssignableFrom(returnType) && (responseStatus == 200 || responseStatus == 201)) {
if(response.getHttpStatus() == 200) { //is not a new account
responseBody.put("isNewAccount", false);
} else {
responseBody.put("isNewAccount", true);
}
}
return resourceFactory.instantiate(returnType, responseBody);
>>>>>>>
//since 1.0.beta: provider's account creation status (whether it is new or not) is returned in the HTTP response
//status. The resource factory does not provide a way to pass such information when instantiating a resource. Thus,
//after the resource has been instantiated we are going to manipulate it before returning it in order to set the
//"is new" status
int responseStatus = response.getHttpStatus();
if (ProviderAccountResultHelper.class.isAssignableFrom(returnType) && (responseStatus == 200 || responseStatus == 201)) {
if(response.getHttpStatus() == 200) { //is not a new account
responseBody.put("isNewAccount", false);
} else {
responseBody.put("isNewAccount", true);
}
}
return resourceFactory.instantiate(returnType, returnResponseBody); |
<<<<<<<
UColor fgColor, bgColor;
=======
Font font;
UColor fgColor, bgColor, borderColor;
>>>>>>>
UColor fgColor, bgColor, borderColor; |
<<<<<<<
void inject(Shapemask shape);
void inject(Icon icon);
void inject(RexFile rexfile);
=======
void inject(Shape shape);
>>>>>>>
void inject(Icon icon);
void inject(RexFile rexfile);
void inject(Shape shape); |
<<<<<<<
import com.onesignal.FCMBroadcastReceiver;
import com.onesignal.FCMIntentService;
=======
import com.onesignal.GcmBroadcastReceiver;
import com.onesignal.GcmIntentService;
import com.onesignal.MockOneSignalDBHelper;
>>>>>>>
import com.onesignal.FCMBroadcastReceiver;
import com.onesignal.FCMIntentService;
import com.onesignal.MockOneSignalDBHelper;
<<<<<<<
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ACTION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ANDROID_NOTIFICATION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService_NoWrap;
=======
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromGCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromGCMIntentService_NoWrap;
>>>>>>>
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ACTION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ANDROID_NOTIFICATION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService_NoWrap;
<<<<<<<
=======
private static final String notifMessage = "Robo test message";
private MockOneSignalDBHelper dbHelper;
>>>>>>>
private MockOneSignalDBHelper dbHelper;
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
NotificationBundleProcessor_ProcessFromGCMIntentService(blankActivity, bundle, null);
readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
NotificationBundleProcessor_ProcessFromGCMIntentService(blankActivity, bundle, null);
readableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase writableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase writableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase writableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
SQLiteDatabase writableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
SQLiteDatabase writableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
SQLiteDatabase writableDb = dbHelper.getSQLiteDatabaseWithRetries();
<<<<<<<
writableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
=======
writableDb = dbHelper.getSQLiteDatabaseWithRetries();
>>>>>>>
writableDb = dbHelper.getSQLiteDatabaseWithRetries(); |
<<<<<<<
private static final String VERSION = "031505";
public static String getSdkVersionRaw() {
return VERSION;
}
=======
public static final String VERSION = "031506";
>>>>>>>
private static final String VERSION = "031506";
public static String getSdkVersionRaw() {
return VERSION;
}
<<<<<<<
if (getRemoteParams().useEmailAuth && emailAuthHash == null) {
=======
if (remoteParams != null && remoteParams.useEmailAuth && (emailAuthHash == null || emailAuthHash.length() == 0)) {
>>>>>>>
if (getRemoteParams().useEmailAuth && (emailAuthHash == null || emailAuthHash.length() == 0)) {
<<<<<<<
if (taskController.shouldQueueTaskForInit(OSTaskController.SET_EXTERNAL_USER_ID)) {
logger.error("Waiting for remote params. " +
"Moving " + OSTaskController.SET_EXTERNAL_USER_ID + " operation to a pending task queue.");
taskController.addTaskToQueue(new Runnable() {
@Override
public void run() {
logger.debug("Running " + OSTaskController.SET_EXTERNAL_USER_ID + " operation from pending task queue.");
setExternalUserId(externalId, externalIdAuthHash, completionCallback);
=======
if (shouldLogUserPrivacyConsentErrorMessageForMethodName("setExternalUserId()"))
return;
Runnable runSetExternalUserId = new Runnable() {
@Override
public void run() {
if (externalId == null) {
OneSignal.Log(LOG_LEVEL.WARN, "External id can't be null, set an empty string to remove an external id");
return;
}
if (externalId.length() > 0 && remoteParams != null && remoteParams.useUserIdAuth && (externalIdAuthHash == null || externalIdAuthHash.length() == 0)) {
String errorMessage = "External Id authentication (auth token) is set to REQUIRED for this application. Please provide an auth token from your backend server or change the setting in the OneSignal dashboard.";
Log(LOG_LEVEL.ERROR, errorMessage);
return;
>>>>>>>
if (taskController.shouldQueueTaskForInit(OSTaskController.SET_EXTERNAL_USER_ID)) {
logger.error("Waiting for remote params. " +
"Moving " + OSTaskController.SET_EXTERNAL_USER_ID + " operation to a pending task queue.");
taskController.addTaskToQueue(new Runnable() {
@Override
public void run() {
logger.debug("Running " + OSTaskController.SET_EXTERNAL_USER_ID + " operation from pending task queue.");
setExternalUserId(externalId, externalIdAuthHash, completionCallback); |
<<<<<<<
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService_NoWrap;
=======
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ONESIGNAL_DATA;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTONS_LIST;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_TEXT;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ACTION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ANDROID_NOTIFICATION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromGCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromGCMIntentService_NoWrap;
>>>>>>>
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ONESIGNAL_DATA;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTONS_LIST;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor.PUSH_MINIFIED_BUTTON_TEXT;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ACTION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.GenerateNotification.BUNDLE_KEY_ANDROID_NOTIFICATION_ID;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService;
import static com.onesignal.OneSignalPackagePrivateHelper.NotificationBundleProcessor_ProcessFromFCMIntentService_NoWrap;
<<<<<<<
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalDbHelper.getInstance(blankActivity).getReadableDatabase();
=======
NotificationBundleProcessor_ProcessFromGCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(RuntimeEnvironment.application);
>>>>>>>
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
<<<<<<<
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalDbHelper.getInstance(blankActivity).getReadableDatabase();
=======
NotificationBundleProcessor_ProcessFromGCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(RuntimeEnvironment.application);
>>>>>>>
NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, bundle, null);
readableDb = OneSignalPackagePrivateHelper.OneSignal_getSQLiteDatabase(blankActivity);
<<<<<<<
bundle.putString("o", "[{\"n\": \"text1\", \"i\": \"id1\"}]");
intent.putExtras(bundle);
=======
addButtonsToReceivedPayload(bundle);
intentGcm.putExtras(bundle);
>>>>>>>
addButtonsToReceivedPayload(bundle);
intent.putExtras(bundle);
<<<<<<<
=======
@Test
@Config(shadows = {ShadowGcmBroadcastReceiver.class})
public void shouldPreventOtherGCMReceiversWhenSettingEnabled() throws Exception {
OneSignal.setInFocusDisplaying(OneSignal.OSInFocusDisplayOption.InAppAlert);
OneSignal.startInit(blankActivity).filterOtherGCMReceivers(true).init();
threadAndTaskWait();
Intent intentGcm = new Intent();
intentGcm.setAction("com.google.android.c2dm.intent.RECEIVE");
intentGcm.putExtra("message_type", "gcm");
Bundle bundle = getBaseNotifBundle();
addButtonsToReceivedPayload(bundle);
intentGcm.putExtras(bundle);
GcmBroadcastReceiver gcmBroadcastReceiver = new GcmBroadcastReceiver();
gcmBroadcastReceiver.onReceive(blankActivity, intentGcm);
assertEquals(Activity.RESULT_OK, (int)ShadowGcmBroadcastReceiver.lastResultCode);
assertTrue(ShadowGcmBroadcastReceiver.calledAbortBroadcast);
}
>>>>>>>
<<<<<<<
bundle.putString("o", "[{\"n\": \"text1\", \"i\": \"id1\"}]");
intentFCM.putExtras(bundle);
=======
addButtonsToReceivedPayload(bundle);
intentGcm.putExtras(bundle);
>>>>>>>
addButtonsToReceivedPayload(bundle);
intentFCM.putExtras(bundle); |
<<<<<<<
OneSignalStateSynchronizer.setNewSession();
if (inForeground) {
=======
OneSignal.onesignalLog(LOG_LEVEL.DEBUG, "Starting new session");
OneSignalStateSynchronizer.setNewSession();
if (foreground) {
>>>>>>>
OneSignal.onesignalLog(LOG_LEVEL.DEBUG, "Starting new session");
OneSignalStateSynchronizer.setNewSession();
if (inForeground) {
<<<<<<<
} else if (inForeground) {
getInAppMessageController().initWithCachedInAppMessages();
=======
} else if (foreground) {
OneSignal.onesignalLog(LOG_LEVEL.DEBUG, "Continue on same session");
>>>>>>>
} else if (inForeground) {
OneSignal.onesignalLog(LOG_LEVEL.DEBUG, "Continue on same session"); |
<<<<<<<
import static com.onesignal.OneSignalPackagePrivateHelper.FCMBroadcastReceiver_onReceived;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_getSessionDirectNotification;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_getSessionIndirectNotificationIds;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_getSessionType;
=======
import static com.onesignal.OneSignalPackagePrivateHelper.GcmBroadcastReceiver_onReceived;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_getSessionListener;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setSessionManager;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setSharedPreferences;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setTrackerFactory;
>>>>>>>
import static com.onesignal.OneSignalPackagePrivateHelper.FCMBroadcastReceiver_onReceived;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_getSessionListener;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setSessionManager;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setSharedPreferences;
import static com.onesignal.OneSignalPackagePrivateHelper.OneSignal_setTrackerFactory;
<<<<<<<
ShadowOneSignalRestClient.class,
ShadowPushRegistratorFCM.class,
ShadowOSUtils.class,
ShadowAdvertisingIdProviderGPS.class,
ShadowCustomTabsClient.class,
ShadowCustomTabsSession.class,
ShadowNotificationManagerCompat.class,
ShadowJobService.class
=======
ShadowOneSignalRestClient.class,
ShadowPushRegistratorGCM.class,
ShadowGMSLocationController.class,
ShadowOSUtils.class,
ShadowAdvertisingIdProviderGPS.class,
ShadowCustomTabsClient.class,
ShadowCustomTabsSession.class,
ShadowNotificationManagerCompat.class,
ShadowJobService.class
>>>>>>>
ShadowOneSignalRestClient.class,
ShadowPushRegistratorFCM.class,
ShadowGMSLocationController.class,
ShadowOSUtils.class,
ShadowAdvertisingIdProviderGPS.class,
ShadowCustomTabsClient.class,
ShadowCustomTabsSession.class,
ShadowNotificationManagerCompat.class,
ShadowJobService.class
<<<<<<<
Bundle bundle = getBaseNotifBundle(ONESIGNAL_NOTIFICATION_ID + "1");
FCMBroadcastReceiver_onReceived(blankActivity, bundle);
=======
Bundle bundle = getBaseNotifBundle(notificationID);
GcmBroadcastReceiver_onReceived(blankActivity, bundle);
>>>>>>>
Bundle bundle = getBaseNotifBundle(ONESIGNAL_NOTIFICATION_ID + "1");
FCMBroadcastReceiver_onReceived(blankActivity, bundle);
<<<<<<<
ShadowOSUtils.subscribableStatus = 1;
OneSignal.setAppId(ONESIGNAL_APP_ID);
OneSignal.setAppContext(blankActivity);
OneSignal.setNotificationOpenedHandler(getNotificationOpenedHandler());
=======
ShadowOSUtils.subscribableStatus = 1;
// Set mocks for mocking behaviour
OneSignal_setTrackerFactory(trackerFactory);
OneSignal_setSessionManager(sessionManager);
OneSignal.init(blankActivity, "123456789", ONESIGNAL_APP_ID, getNotificationOpenedHandler());
>>>>>>>
ShadowOSUtils.subscribableStatus = 1;
// Set mocks for mocking behaviour
OneSignal_setTrackerFactory(trackerFactory);
OneSignal_setSessionManager(sessionManager);
OneSignal.setAppId(ONESIGNAL_APP_ID);
OneSignal.setAppContext(blankActivity);
OneSignal.setNotificationOpenedHandler(getNotificationOpenedHandler());
<<<<<<<
ShadowOSUtils.subscribableStatus = 1;
OneSignal.setAppId(ONESIGNAL_APP_ID);
OneSignal.setAppContext(blankActivity);
OneSignal.setNotificationOpenedHandler(notificationOpenedHandler);
=======
ShadowOSUtils.subscribableStatus = 1;
// Set mocks for mocking behaviour
OneSignal_setTrackerFactory(trackerFactory);
OneSignal_setSessionManager(sessionManager);
OneSignal.init(blankActivity, "123456789", ONESIGNAL_APP_ID, notificationOpenedHandler);
>>>>>>>
ShadowOSUtils.subscribableStatus = 1;
// Set mocks for mocking behaviour
OneSignal_setTrackerFactory(trackerFactory);
OneSignal_setSessionManager(sessionManager);
OneSignal.setAppId(ONESIGNAL_APP_ID);
OneSignal.setAppContext(blankActivity);
OneSignal.setNotificationOpenedHandler(notificationOpenedHandler); |
<<<<<<<
public static final String LOGIN_URL = "stormpath.web.login.uri";
public static final String LOGIN_NEXT_URL = "stormpath.web.login.nextUri";
public static final String LOGOUT_URL = "stormpath.web.logout.uri";
public static final String LOGOUT_NEXT_URL = "stormpath.web.logout.nextUri";
public static final String LOGOUT_INVALIDATE_HTTP_SESSION = "stormpath.web.logout.invalidateHttpSession";
public static final String FORGOT_PASSWORD_URL = "stormpath.web.forgotPassword.uri";
public static final String FORGOT_PASSWORD_NEXT_URL = "stormpath.web.forgotPassword.nextUri";
public static final String CHANGE_PASSWORD_URL = "stormpath.web.changePassword.uri";
public static final String CHANGE_PASSWORD_NEXT_URL = "stormpath.web.changePassword.nextUri";
public static final String REGISTER_URL = "stormpath.web.register.uri";
public static final String REGISTER_NEXT_URL = "stormpath.web.register.nextUri";
public static final String VERIFY_URL = "stormpath.web.verifyEmail.uri";
public static final String VERIFY_NEXT_URL = "stormpath.web.verifyEmail.nextUri";
public static final String SEND_VERIFICATION_EMAIL_URL = "stormpath.web.sendVerificationEmail.uri";
public static final String VERIFY_ENABLED = "stormpath.web.verifyEmail.enabled";
=======
>>>>>>>
<<<<<<<
public static final String ACCESS_TOKEN_URL = "stormpath.web.oauth2.uri";
public static final String ACCESS_TOKEN_VALIDATION_STRATEGY = "stormpath.web.oauth2.validationStrategy";
=======
public static final String LOGOUT_INVALIDATE_HTTP_SESSION = "stormpath.web.logout.invalidateHttpSession";
public static final String ACCESS_TOKEN_URL = "stormpath.web.accessToken.uri";
public static final String ACCESS_TOKEN_VALIDATION_STRATEGY = "stormpath.web.accessToken.validationStrategy";
public static final String ACCOUNT_COOKIE_NAME = "stormpath.web.account.cookie.name";
public static final String ACCOUNT_COOKIE_COMMENT = "stormpath.web.account.cookie.comment";
public static final String ACCOUNT_COOKIE_DOMAIN = "stormpath.web.account.cookie.domain";
public static final String ACCOUNT_COOKIE_MAX_AGE = "stormpath.web.account.cookie.maxAge";
public static final String ACCOUNT_COOKIE_PATH = "stormpath.web.account.cookie.path";
public static final String ACCOUNT_COOKIE_HTTP_ONLY = "stormpath.web.account.cookie.httpOnly";
public static final String ACCOUNT_JWT_TTL = "stormpath.web.account.jwt.ttl";
>>>>>>>
public static final String LOGOUT_INVALIDATE_HTTP_SESSION = "stormpath.web.logout.invalidateHttpSession";
public static final String ACCESS_TOKEN_URL = "stormpath.web.oauth2.uri";
public static final String ACCESS_TOKEN_VALIDATION_STRATEGY = "stormpath.web.oauth2.validationStrategy"; |
<<<<<<<
=======
import com.onesignal.ShadowHMSFusedLocationProviderClient;
import com.onesignal.ShadowGcmBroadcastReceiver;
>>>>>>>
import com.onesignal.ShadowHMSFusedLocationProviderClient;
<<<<<<<
import com.onesignal.ShadowPushRegistratorFCM;
=======
import com.onesignal.ShadowPushRegistratorGCM;
import com.onesignal.ShadowPushRegistratorHMS;
>>>>>>>
import com.onesignal.ShadowPushRegistratorFCM;
import com.onesignal.ShadowPushRegistratorHMS; |
<<<<<<<
private static OSTime time = new OSTimeImpl();
=======
private static OSInAppMessageControllerFactory inAppMessageControllerFactory = new OSInAppMessageControllerFactory();
static OSInAppMessageController getInAppMessageController() {
return inAppMessageControllerFactory.getController(getDBHelperInstance());
}
>>>>>>>
private static OSInAppMessageControllerFactory inAppMessageControllerFactory = new OSInAppMessageControllerFactory();
static OSInAppMessageController getInAppMessageController() {
return inAppMessageControllerFactory.getController(getDBHelperInstance(), getLogger());
}
private static OSTime time = new OSTimeImpl();
<<<<<<<
} else if (inForeground) {
OSInAppMessageController.getController(OneSignal.getLogger()).initWithCachedInAppMessages();
=======
} else if (foreground) {
getInAppMessageController().initWithCachedInAppMessages();
>>>>>>>
} else if (inForeground) {
getInAppMessageController().initWithCachedInAppMessages();
<<<<<<<
inForeground = false;
=======
Log(LOG_LEVEL.DEBUG, "Application lost focus");
foreground = false;
>>>>>>>
Log(LOG_LEVEL.DEBUG, "Application lost focus");
inForeground = false;
<<<<<<<
inForeground = true;
=======
Log(LOG_LEVEL.DEBUG, "Application on focus");
foreground = true;
>>>>>>>
Log(LOG_LEVEL.DEBUG, "Application on focus");
inForeground = true;
<<<<<<<
OSInAppMessageController.getController(logger).addTriggers(triggers);
=======
getInAppMessageController().addTriggers(triggers);
>>>>>>>
getInAppMessageController().addTriggers(triggers);
<<<<<<<
OSInAppMessageController.getController(logger).addTriggers(triggerMap);
=======
getInAppMessageController().addTriggers(triggerMap);
>>>>>>>
getInAppMessageController().addTriggers(triggerMap);
<<<<<<<
OSInAppMessageController.getController(logger).removeTriggersForKeys(keys);
=======
getInAppMessageController().removeTriggersForKeys(keys);
>>>>>>>
getInAppMessageController().removeTriggersForKeys(keys);
<<<<<<<
logger.warning("removeTriggersForKeysFromJsonArrayString: Skipped removing non-String type keys ");
OSInAppMessageController.getController(logger).removeTriggersForKeys(keysCollection);
=======
OneSignal.Log(LOG_LEVEL.WARN, "removeTriggersForKeysFromJsonArrayString: Skipped removing non-String type keys ");
getInAppMessageController().removeTriggersForKeys(keysCollection);
>>>>>>>
OneSignal.Log(LOG_LEVEL.WARN, "removeTriggersForKeysFromJsonArrayString: Skipped removing non-String type keys ");
getInAppMessageController().removeTriggersForKeys(keysCollection);
<<<<<<<
OSInAppMessageController.getController(logger).removeTriggersForKeys(triggerKeys);
=======
getInAppMessageController().removeTriggersForKeys(triggerKeys);
>>>>>>>
getInAppMessageController().removeTriggersForKeys(triggerKeys);
<<<<<<<
return OSInAppMessageController.getController(logger).getTriggerValue(key);
=======
return getInAppMessageController().getTriggerValue(key);
>>>>>>>
return getInAppMessageController().getTriggerValue(key);
<<<<<<<
public static void pauseInAppMessages(final boolean pause) {
if (appContext == null) {
logger.error("Waiting initWithContext. " +
"Moving " + OSTaskController.PAUSE_IN_APP_MESSAGES + " operation to a pending task queue.");
taskController.addTaskToQueue(new Runnable() {
@Override
public void run() {
logger.debug("Running " + OSTaskController.PAUSE_IN_APP_MESSAGES + " operation from pending queue.");
pauseInAppMessages(pause);
}
});
return;
}
OSInAppMessageController.getController(logger).setInAppMessagingEnabled(!pause);
=======
public static void pauseInAppMessages(boolean pause) {
getInAppMessageController().setInAppMessagingEnabled(!pause);
>>>>>>>
public static void pauseInAppMessages(final boolean pause) {
if (appContext == null) {
logger.error("Waiting initWithContext. " +
"Moving " + OSTaskController.PAUSE_IN_APP_MESSAGES + " operation to a pending task queue.");
taskController.addTaskToQueue(new Runnable() {
@Override
public void run() {
logger.debug("Running " + OSTaskController.PAUSE_IN_APP_MESSAGES + " operation from pending queue.");
pauseInAppMessages(pause);
}
});
return;
}
getInAppMessageController().setInAppMessagingEnabled(!pause); |
<<<<<<<
boolean receiveReceiptEnabled;
=======
OutcomesParams outcomesParams;
>>>>>>>
boolean receiveReceiptEnabled;
OutcomesParams outcomesParams;
<<<<<<<
receiveReceiptEnabled = responseJson.optBoolean("receive_receipts_enable", false);
=======
outcomesParams = new OutcomesParams();
//Process outcomes params
if (responseJson.has(OUTCOME_PARAM)) {
JSONObject outcomes = responseJson.optJSONObject(OUTCOME_PARAM);
if (outcomes.has(DIRECT_PARAM)) {
JSONObject direct = outcomes.optJSONObject(DIRECT_PARAM);
outcomesParams.directEnabled = direct.optBoolean(ENABLED_PARAM);
}
if (outcomes.has(INDIRECT_PARAM)) {
JSONObject indirect = outcomes.optJSONObject(INDIRECT_PARAM);
outcomesParams.indirectEnabled = indirect.optBoolean(ENABLED_PARAM);
if (indirect.has(NOTIFICATION_ATTRIBUTION_PARAM)) {
JSONObject indirectNotificationAttribution = indirect.optJSONObject(NOTIFICATION_ATTRIBUTION_PARAM);
outcomesParams.indirectAttributionWindow = indirectNotificationAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW);
outcomesParams.notificationLimit = indirectNotificationAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT);
}
}
if (outcomes.has(UNATTRIBUTED_PARAM)) {
JSONObject unattributed = outcomes.optJSONObject(UNATTRIBUTED_PARAM);
outcomesParams.unattributedEnabled = unattributed.optBoolean(ENABLED_PARAM);
}
}
>>>>>>>
receiveReceiptEnabled = responseJson.optBoolean("receive_receipts_enable", false);
outcomesParams = new OutcomesParams();
//Process outcomes params
if (responseJson.has(OUTCOME_PARAM)) {
JSONObject outcomes = responseJson.optJSONObject(OUTCOME_PARAM);
if (outcomes.has(DIRECT_PARAM)) {
JSONObject direct = outcomes.optJSONObject(DIRECT_PARAM);
outcomesParams.directEnabled = direct.optBoolean(ENABLED_PARAM);
}
if (outcomes.has(INDIRECT_PARAM)) {
JSONObject indirect = outcomes.optJSONObject(INDIRECT_PARAM);
outcomesParams.indirectEnabled = indirect.optBoolean(ENABLED_PARAM);
if (indirect.has(NOTIFICATION_ATTRIBUTION_PARAM)) {
JSONObject indirectNotificationAttribution = indirect.optJSONObject(NOTIFICATION_ATTRIBUTION_PARAM);
outcomesParams.indirectAttributionWindow = indirectNotificationAttribution.optInt("minutes_since_displayed", DEFAULT_INDIRECT_ATTRIBUTION_WINDOW);
outcomesParams.notificationLimit = indirectNotificationAttribution.optInt("limit", DEFAULT_NOTIFICATION_LIMIT);
}
}
if (outcomes.has(UNATTRIBUTED_PARAM)) {
JSONObject unattributed = outcomes.optJSONObject(UNATTRIBUTED_PARAM);
outcomesParams.unattributedEnabled = unattributed.optBoolean(ENABLED_PARAM);
}
} |
<<<<<<<
=======
public static final String IN_APP_MESSAGES_JSON_KEY = "in_app_messages";
private static final String OS_SAVE_IN_APP_MESSAGE = "OS_SAVE_IN_APP_MESSAGE";
private static final Object LOCK = new Object();
>>>>>>>
<<<<<<<
for (OSInAppMessage message : redisplayedInAppMessages) {
if (!message.isTriggerChanged() && triggerController.isTriggerOnMessage(message, newTriggersKeys)) {
logger.debug("Trigger changed for message: " + message.toString());
=======
for (OSInAppMessage message : messages) {
if (!message.isTriggerChanged() && redisplayedInAppMessages.contains(message) &&
triggerController.isTriggerOnMessage(message, newTriggersKeys)) {
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "Trigger changed for message: " + message.toString());
>>>>>>>
for (OSInAppMessage message : messages) {
if (!message.isTriggerChanged() && redisplayedInAppMessages.contains(message) &&
triggerController.isTriggerOnMessage(message, newTriggersKeys)) {
logger.debug("Trigger changed for message: " + message.toString());
<<<<<<<
void addTriggers(@NonNull Map<String, Object> newTriggers) {
logger.debug("Triggers added: " + newTriggers.toString());
=======
void addTriggers(Map<String, Object> newTriggers) {
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "Add trigger called with: " + newTriggers.toString());
>>>>>>>
void addTriggers(@NonNull Map<String, Object> newTriggers) {
logger.debug("Triggers added: " + newTriggers.toString());
<<<<<<<
logger.debug("Triggers key to remove: " + keys.toString());
=======
OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "Remove trigger called with keys: " + keys);
>>>>>>>
logger.debug("Triggers key to remove: " + keys.toString()); |
<<<<<<<
/*
* Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source |
<<<<<<<
=======
/**
* An interface used to handle notifications that are received.
* <br/>
* Set this during OneSignal init in
* {@link OneSignal.Builder#setNotificationReceivedHandler(NotificationReceivedHandler) setNotificationReceivedHandler}
*<br/><br/>
* @see <a href="https://documentation.onesignal.com/docs/android-native-sdk#section--notificationreceivedhandler-">NotificationReceivedHandler | OneSignal Docs</a>
*/
public interface NotificationReceivedHandler {
/**
* Fires when a notification is received. It will be fired when your app is in focus or
* in the background.
* @param notification Contains both the user's response and properties of the notification
*/
void notificationReceived(OSNotification notification);
}
>>>>>>>
<<<<<<<
public static void inFocusDisplaying(OSInFocusDisplayOption displayOption) {
mDisplayOptionCarryOver = false;
mDisplayOption = displayOption;
=======
if (wasAppContextNull) {
sessionManager = new OSSessionManager(getNewSessionListener());
outcomeEventsController = new OutcomeEventsController(sessionManager, getDBHelperInstance());
// Prefs require a context to save
// If the previous state of appContext was null, kick off write in-case it was waiting
OneSignalPrefs.startDelayedWrite();
// Cleans out old cached data to prevent over using the storage on devices
OneSignalCacheCleaner.cleanOldCachedData(context);
}
>>>>>>>
public static void inFocusDisplaying(OSInFocusDisplayOption displayOption) {
mDisplayOptionCarryOver = false;
mDisplayOption = displayOption; |
<<<<<<<
public static final String PREFS_OS_RECEIVE_RECEIPTS_ENABLED = "PREFS_OS_RECEIVE_RECEIPTS_ENABLED";
=======
public static final String PREFS_OS_LAST_ATTRIBUTED_NOTIFICATION_OPEN = "PREFS_OS_LAST_ATTRIBUTED_NOTIFICATION_OPEN";
public static final String PREFS_OS_LAST_NOTIFICATIONS_RECEIVED = "PREFS_OS_LAST_NOTIFICATIONS_RECEIVED";
public static final String PREFS_OS_NOTIFICATION_LIMIT = "PREFS_OS_NOTIFICATION_LIMIT";
public static final String PREFS_OS_INDIRECT_ATTRIBUTION_WINDOW = "PREFS_OS_INDIRECT_ATTRIBUTION_WINDOW";
public static final String PREFS_OS_DIRECT_ENABLED = "PREFS_OS_DIRECT_ENABLED";
public static final String PREFS_OS_INDIRECT_ENABLED = "PREFS_OS_INDIRECT_ENABLED";
public static final String PREFS_OS_UNATTRIBUTED_ENABLED = "PREFS_OS_UNATTRIBUTED_ENABLED";
public static final String PREFS_OS_OUTCOMES_CURRENT_SESSION = "PREFS_OS_OUTCOMES_CURRENT_SESSION";
public static final String PREFS_OS_UNIQUE_OUTCOME_EVENTS_SENT = "PREFS_OS_UNIQUE_OUTCOME_EVENTS_SENT";
>>>>>>>
public static final String PREFS_OS_RECEIVE_RECEIPTS_ENABLED = "PREFS_OS_RECEIVE_RECEIPTS_ENABLED";
public static final String PREFS_OS_LAST_ATTRIBUTED_NOTIFICATION_OPEN = "PREFS_OS_LAST_ATTRIBUTED_NOTIFICATION_OPEN";
public static final String PREFS_OS_LAST_NOTIFICATIONS_RECEIVED = "PREFS_OS_LAST_NOTIFICATIONS_RECEIVED";
public static final String PREFS_OS_NOTIFICATION_LIMIT = "PREFS_OS_NOTIFICATION_LIMIT";
public static final String PREFS_OS_INDIRECT_ATTRIBUTION_WINDOW = "PREFS_OS_INDIRECT_ATTRIBUTION_WINDOW";
public static final String PREFS_OS_DIRECT_ENABLED = "PREFS_OS_DIRECT_ENABLED";
public static final String PREFS_OS_INDIRECT_ENABLED = "PREFS_OS_INDIRECT_ENABLED";
public static final String PREFS_OS_UNATTRIBUTED_ENABLED = "PREFS_OS_UNATTRIBUTED_ENABLED";
public static final String PREFS_OS_OUTCOMES_CURRENT_SESSION = "PREFS_OS_OUTCOMES_CURRENT_SESSION";
public static final String PREFS_OS_UNIQUE_OUTCOME_EVENTS_SENT = "PREFS_OS_UNIQUE_OUTCOME_EVENTS_SENT"; |
<<<<<<<
=======
private static boolean didEmailUpdateSucceed;
private static OneSignal.EmailUpdateError lastEmailUpdateFailure;
private static OneSignal.EmailUpdateHandler getEmailUpdateHandler() {
return new OneSignal.EmailUpdateHandler() {
@Override
public void onSuccess() {
didEmailUpdateSucceed = true;
}
@Override
public void onFailure(OneSignal.EmailUpdateError error) {
lastEmailUpdateFailure = error;
}
};
}
private static void GetTags() {
OneSignal.getTags(new OneSignal.GetTagsHandler() {
>>>>>>>
<<<<<<<
lastExternalUserIdResponse = null;
lastExternalUserIdError = null;
=======
lastExternalUserIdResponse = null;
lastEmailUpdateFailure = null;
didEmailUpdateSucceed = false;
>>>>>>>
lastExternalUserIdResponse = null;
lastExternalUserIdError = null;
lastEmailUpdateFailure = null;
didEmailUpdateSucceed = false; |
<<<<<<<
/**
* Prompts the user to update/enable Google Play Services if it's disabled on the device.
*
* @param disable if {@code false}, prompt users. if {@code true}, never show the out of date prompt.
* Default is {@code false}
* @return
*/
public static void disableGmsMissingPrompt(boolean disable) {
mDisableGmsMissingPrompt = disable;
}
public static void inFocusDisplaying(OSInFocusDisplayOption displayOption) {
mDisplayOptionCarryOver = false;
mDisplayOption = displayOption;
=======
if (wasAppContextNull) {
sessionManager = new OSSessionManager(getNewSessionListener());
outcomeEventsController = new OutcomeEventsController(sessionManager, getDBHelperInstance());
// Prefs require a context to save
// If the previous state of appContext was null, kick off write in-case it was waiting
OneSignalPrefs.startDelayedWrite();
// Cleans out old cached data to prevent over using the storage on devices
OneSignalCacheCleaner.cleanOldCachedData(context);
}
>>>>>>>
/**
* Prompts the user to update/enable Google Play Services if it's disabled on the device.
*
* @param disable if {@code false}, prompt users. if {@code true}, never show the out of date prompt.
* Default is {@code false}
* @return
*/
public static void disableGmsMissingPrompt(boolean disable) {
mDisableGmsMissingPrompt = disable;
}
public static void inFocusDisplaying(OSInFocusDisplayOption displayOption) {
mDisplayOptionCarryOver = false;
mDisplayOption = displayOption;
<<<<<<<
deviceType = osUtils.getDeviceType();
subscribableStatus = osUtils.initializationChecker(appContext, deviceType, appId);
=======
mInitBuilder = createInitBuilder(notificationOpenedHandler, notificationReceivedHandler);
if (!isGoogleProjectNumberRemote())
mGoogleProjectNumber = googleProjectNumber;
subscribableStatus = osUtils.initializationChecker(context, oneSignalAppId);
>>>>>>>
subscribableStatus = osUtils.initializationChecker(context, oneSignalAppId);
<<<<<<<
Log(LOG_LEVEL.DEBUG, "App id has changed:\nFrom: " + oldAppId + "\n To: " + appId + "\nClearing the user id, app state, and remoteParams as they are no longer valid");
SaveAppId(appId);
=======
Log(LOG_LEVEL.DEBUG, "APP ID changed, clearing user id as it is no longer valid.");
saveAppId(appId);
>>>>>>>
Log(LOG_LEVEL.DEBUG, "App id has changed:\nFrom: " + oldAppId + "\n To: " + appId + "\nClearing the user id, app state, and remoteParams as they are no longer valid");
saveAppId(appId); |
<<<<<<<
private static final String NOTIFICATION_ID = "notificationId";
private static final String DISMISSED = "dismissed";
private static final Class<?> NOTIFICATION_OPENED_ACTIVITY_CLASS = NotificationOpenedActivity.class;
=======
public static final String BUNDLE_KEY_ANDROID_NOTIFICATION_ID = "androidNotificationId";
public static final String BUNDLE_KEY_ACTION_ID = "actionId";
// Bundle key the whole OneSignal payload will be placed into as JSON and attached to the
// notification Intent.
public static final String BUNDLE_KEY_ONESIGNAL_DATA = "onesignalData";
private static Context currentContext = null;
>>>>>>>
public static final String BUNDLE_KEY_ANDROID_NOTIFICATION_ID = "androidNotificationId";
public static final String BUNDLE_KEY_ACTION_ID = "actionId";
// Bundle key the whole OneSignal payload will be placed into as JSON and attached to the
// notification Intent.
public static final String BUNDLE_KEY_ONESIGNAL_DATA = "onesignalData";
private static Context currentContext = null;
<<<<<<<
buttonIntent.putExtra("onesignal_data", fcmJson.toString());
if (fcmJson.has("grp"))
buttonIntent.putExtra("grp", fcmJson.optString("grp"));
=======
buttonIntent.putExtra(BUNDLE_KEY_ONESIGNAL_DATA, gcmJson.toString());
if (gcmJson.has("grp"))
buttonIntent.putExtra("grp", gcmJson.optString("grp"));
>>>>>>>
buttonIntent.putExtra(BUNDLE_KEY_ONESIGNAL_DATA, fcmJson.toString());
if (fcmJson.has("grp"))
buttonIntent.putExtra("grp", fcmJson.optString("grp"));
<<<<<<<
JSONObject newJsonData = new JSONObject(fcmJson.toString());
newJsonData.put("actionSelected", finalButtonIds.get(index));
finalButtonIntent.putExtra("onesignal_data", newJsonData.toString());
=======
JSONObject newJsonData = new JSONObject(gcmJson.toString());
newJsonData.put(BUNDLE_KEY_ACTION_ID, finalButtonIds.get(index));
finalButtonIntent.putExtra(BUNDLE_KEY_ONESIGNAL_DATA, newJsonData.toString());
>>>>>>>
JSONObject newJsonData = new JSONObject(fcmJson.toString());
newJsonData.put(BUNDLE_KEY_ACTION_ID, finalButtonIds.get(index));
finalButtonIntent.putExtra(BUNDLE_KEY_ONESIGNAL_DATA, newJsonData.toString());
<<<<<<<
private static Intent createBaseSummaryIntent(Context context, int summaryNotificationId, JSONObject fcmJson, String group) {
return getNewBaseIntent(context, summaryNotificationId).putExtra("onesignal_data", fcmJson.toString()).putExtra("summary", group);
=======
private static Intent createBaseSummaryIntent(int summaryNotificationId, JSONObject gcmBundle, String group) {
return getNewBaseIntent(summaryNotificationId).putExtra(BUNDLE_KEY_ONESIGNAL_DATA, gcmBundle.toString()).putExtra("summary", group);
>>>>>>>
private static Intent createBaseSummaryIntent(int summaryNotificationId, JSONObject fcmJson, String group) {
return getNewBaseIntent(summaryNotificationId).putExtra(BUNDLE_KEY_ONESIGNAL_DATA, fcmJson.toString()).putExtra("summary", group); |
<<<<<<<
AlbumListDetailsFragment fragment = (AlbumListDetailsFragment) getChildFragmentManager().findFragmentById(R.id.details_frag_content);
if (fragment == null) {
mLlAddNewPlayList.setVisibility(View.GONE);
fragment = AlbumListDetailsFragment.newInstance();
FragmentManager manager = getChildFragmentManager();
FragmentTransaction ft = manager.beginTransaction();
ft.replace(R.id.play_list_frag_content, fragment, null);
ft.addToBackStack(AlbumListDetailsFragment.albumTag);
ft.commit();
}
=======
>>>>>>> |
<<<<<<<
import android.annotation.SuppressLint;
=======
>>>>>>>
<<<<<<<
import com.yibao.music.fragment.AlbumFragment;
import com.yibao.music.fragment.AlbumListDetailsFragment;
import com.yibao.music.fragment.ArtistanListFragment;
import com.yibao.music.fragment.PlayListFragment;
import com.yibao.music.fragment.SongFragment;
=======
import com.yibao.music.fragment.AlbumFragment;
import com.yibao.music.fragment.ArtistanListFragment;
import com.yibao.music.fragment.FolderListFragment;
import com.yibao.music.fragment.PlayListFragment;
import com.yibao.music.fragment.SongFragment;
>>>>>>>
import com.yibao.music.fragment.AlbumFragment;
import com.yibao.music.fragment.ArtistanListFragment;
import com.yibao.music.fragment.FolderListFragment;
import com.yibao.music.fragment.PlayListFragment;
import com.yibao.music.fragment.SongFragment; |
<<<<<<<
=======
import android.annotation.SuppressLint;
>>>>>>>
import android.annotation.SuppressLint; |
<<<<<<<
import io.eventuate.tram.commands.producer.CommandProducer;
import io.eventuate.tram.commands.spring.producer.TramCommandProducerConfiguration;
import io.eventuate.tram.inmemory.spring.TramInMemoryConfiguration;
=======
import io.eventuate.tram.commands.producer.TramCommandProducerConfiguration;
import io.eventuate.tram.sagas.inmemory.TramSagaInMemoryConfiguration;
>>>>>>>
import io.eventuate.tram.commands.producer.CommandProducer;
import io.eventuate.tram.commands.spring.producer.TramCommandProducerConfiguration;
import io.eventuate.tram.sagas.inmemory.TramSagaInMemoryConfiguration; |
<<<<<<<
import io.eventuate.messaging.kafka.consumer.spring.MessageConsumerKafkaConfiguration;
import io.eventuate.tram.consumer.common.spring.TramConsumerCommonConfiguration;
import io.eventuate.tram.consumer.kafka.spring.EventuateTramKafkaMessageConsumerConfiguration;
=======
import io.eventuate.tram.consumer.common.TramConsumerCommonConfiguration;
import io.eventuate.tram.consumer.kafka.EventuateTramKafkaMessageConsumerConfiguration;
>>>>>>>
import io.eventuate.tram.consumer.common.spring.TramConsumerCommonConfiguration;
import io.eventuate.tram.consumer.kafka.spring.EventuateTramKafkaMessageConsumerConfiguration; |
<<<<<<<
import io.eventuate.tram.commands.spring.producer.TramCommandProducerConfiguration;
import io.eventuate.tram.inmemory.spring.TramInMemoryConfiguration;
=======
import io.eventuate.tram.commands.producer.TramCommandProducerConfiguration;
>>>>>>>
import io.eventuate.tram.commands.spring.producer.TramCommandProducerConfiguration; |
<<<<<<<
//TODO: ApiKeyCachePropertiesFilter here?
this.filters.add(new ReadCacheFilter(this.baseUrl, this.cacheResolver, COLLECTION_CACHING_ENABLED));
this.filters.add(new WriteCacheFilter(this.cacheResolver, COLLECTION_CACHING_ENABLED, referenceFactory));
=======
this.filters.add(new ReadCacheFilter(this.baseUrl, this.cacheResolver));
this.filters.add(new WriteCacheFilter(this.cacheResolver, referenceFactory));
//TODO: ApiKeyCachePropertiesFilter here?
>>>>>>>
this.filters.add(new ReadCacheFilter(this.baseUrl, this.cacheResolver, COLLECTION_CACHING_ENABLED));
this.filters.add(new WriteCacheFilter(this.cacheResolver, COLLECTION_CACHING_ENABLED, referenceFactory)); |
<<<<<<<
import org.vaadin.spring.VaadinUIScope;
import org.vaadin.spring.stuff.sidebar.SideBarItem;
import org.vaadin.spring.stuff.sidebar.ThemeIcon;
=======
import org.vaadin.spring.UIScope;
import org.vaadin.spring.sidebar.SideBarItem;
import org.vaadin.spring.sidebar.ThemeIcon;
>>>>>>>
import org.vaadin.spring.VaadinUIScope;
import org.vaadin.spring.sidebar.SideBarItem;
import org.vaadin.spring.sidebar.ThemeIcon; |
<<<<<<<
* Pratheek Rai - changes for BERT
=======
* Achim Kraus (Bosch Software Innovations GmbH) - keep original response, if
* current request is the original
>>>>>>>
* Achim Kraus (Bosch Software Innovations GmbH) - keep original response, if
* current request is the original
* Pratheek Rai - changes for BERT |
<<<<<<<
* Pratheek Rai - changes for BERT
=======
* Achim Kraus (Bosch Software Innovations GmbH) - use uniformly the response
* source endpoint context
* for next block requests
* Achim Kraus (Bosch Software Innovations GmbH) - replace byte array token by Token
* Achim Kraus (Bosch Software Innovations GmbH) - copy token and mid for error responses
* copy scheme to assembled blockwise
* payload.
* Achim Kraus (Bosch Software Innovations GmbH) - don't cleanup on send response failures.
* remove "is last", not longer meaningful
* remove addBlock2CleanUpObserver in
* sendResponse
* add health status logging
* for blockwise transfers
>>>>>>>
* Achim Kraus (Bosch Software Innovations GmbH) - use uniformly the response
* source endpoint context
* for next block requests
* Achim Kraus (Bosch Software Innovations GmbH) - replace byte array token by Token
* Achim Kraus (Bosch Software Innovations GmbH) - copy token and mid for error responses
* copy scheme to assembled blockwise
* payload.
* Achim Kraus (Bosch Software Innovations GmbH) - don't cleanup on send response failures.
* remove "is last", not longer meaningful
* remove addBlock2CleanUpObserver in
* sendResponse
* add health status logging
* for blockwise transfers
* Pratheek Rai - changes for BERT
<<<<<<<
protected void sendBlock1ErrorResponse(final KeyUri key, final Exchange exchange, final Request request,
final ResponseCode errorCode, final String message) {
=======
private void sendBlock1ErrorResponse(KeyUri key, Block1BlockwiseStatus status, Exchange exchange, Request request,
ResponseCode errorCode, String message) {
>>>>>>>
protected void sendBlock1ErrorResponse(KeyUri key, Block1BlockwiseStatus status, Exchange exchange, Request request,
ResponseCode errorCode, String message) {
<<<<<<<
protected Block1BlockwiseStatus getInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
=======
private Block1BlockwiseStatus getInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
Block1BlockwiseStatus status;
>>>>>>>
protected Block1BlockwiseStatus getInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
Block1BlockwiseStatus status;
<<<<<<<
protected Block1BlockwiseStatus resetInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
=======
private Block1BlockwiseStatus resetInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
Block1BlockwiseStatus removedStatus;
Block1BlockwiseStatus newStatus;
>>>>>>>
protected Block1BlockwiseStatus resetInboundBlock1Status(final KeyUri key, final Exchange exchange, final Request request) {
Block1BlockwiseStatus removedStatus;
Block1BlockwiseStatus newStatus;
<<<<<<<
protected Block1BlockwiseStatus clearBlock1Status(final KeyUri key) {
=======
private Block1BlockwiseStatus clearBlock1Status(KeyUri key, Block1BlockwiseStatus status) {
int size;
Block1BlockwiseStatus removedTracker;
>>>>>>>
protected Block1BlockwiseStatus clearBlock1Status(KeyUri key, Block1BlockwiseStatus status) {
int size;
Block1BlockwiseStatus removedTracker;
<<<<<<<
protected Block2BlockwiseStatus clearBlock2Status(final KeyUri key) {
=======
private Block2BlockwiseStatus clearBlock2Status(KeyUri key, Block2BlockwiseStatus status) {
int size;
Block2BlockwiseStatus removedTracker;
>>>>>>>
protected Block2BlockwiseStatus clearBlock2Status(KeyUri key, Block2BlockwiseStatus status) {
int size;
Block2BlockwiseStatus removedTracker;
<<<<<<<
protected MessageObserver addBlock1CleanUpObserver(final Message message, final KeyUri key) {
=======
private MessageObserver addBlock1CleanUpObserver(final Request message, final KeyUri key,
final Block1BlockwiseStatus status) {
>>>>>>>
protected MessageObserver addBlock1CleanUpObserver(final Request message, final KeyUri key,
final Block1BlockwiseStatus status) {
<<<<<<<
protected MessageObserver addBlock2CleanUpObserver(final Message message, final KeyUri key) {
=======
private MessageObserver addBlock2CleanUpObserver(final Request message, final KeyUri key,
final Block2BlockwiseStatus status) {
>>>>>>>
protected MessageObserver addBlock2CleanUpObserver(final Request message, final KeyUri key,
final Block2BlockwiseStatus status) { |
<<<<<<<
* Pratheek Rai - changes for BERT
=======
* Achim Kraus (Bosch Software Innovations GmbH) - disable transparent blockwise for multicast.
>>>>>>>
* Achim Kraus (Bosch Software Innovations GmbH) - disable transparent blockwise for multicast.
* Pratheek Rai - changes for BERT
<<<<<<<
// request next block
requestNextBlock(exchange, response, key, status);
=======
int currentSize = status.getCurrentSize();
// do late block size negotiation
int newSize, newSzx;
if (block2.getSzx() > preferredBlockSzx) {
newSize = preferredBlockSize;
newSzx = preferredBlockSzx;
} else {
newSize = currentSize;
newSzx = status.getCurrentSzx();
}
int nextNum = status.getCurrentNum() + currentSize / newSize;
Request request = exchange.getRequest();
Request block = new Request(request.getCode());
try {
// do not enforce CON, since NON could make sense over SMS or similar transports
block.setType(request.getType());
block.setDestinationContext(response.getSourceContext());
/*
* WARNING:
*
* For Observe, the Matcher then will store the same
* exchange under a different KeyToken in exchangesByToken,
* which is cleaned up in the else case below.
*/
if (!response.isNotification()) {
block.setToken(response.getToken());
} else if (exchange.isNotification()) {
// Recreate cleanup message observer
request.addMessageObserver(new CleanupMessageObserver(exchange));
}
// copy options
block.setOptions(new OptionSet(request.getOptions()));
block.getOptions().setBlock2(newSzx, false, nextNum);
// make sure NOT to use Observe for block retrieval
block.getOptions().removeObserve();
// copy message observers from original request so that they will be notified
// if something goes wrong with this blockwise request, e.g. if it times out
block.addMessageObservers(request.getMessageObservers());
// add an observer that cleans up the block2 transfer tracker if the
// block request fails
addBlock2CleanUpObserver(block, key, status);
status.setCurrentNum(nextNum);
LOGGER.debug("requesting next Block2 [num={}]: {}", nextNum, block);
exchange.setCurrentRequest(block);
prepareBlock2Cleanup(status, key);
lower().sendRequest(exchange, block);
} catch (RuntimeException ex) {
LOGGER.warn("cannot process next block request, aborting request!", ex);
block.setSendError(ex);
}
>>>>>>>
// request next block
requestNextBlock(exchange, response, key, status);
<<<<<<<
protected boolean requiresBlockwise(final Request request) {
boolean blockwiseRequired = false;
if (request.getCode() == Code.PUT || request.getCode() == Code.POST) {
blockwiseRequired = request.getPayloadSize() > maxMessageSize;
}
=======
private boolean requiresBlockwise(final Request request) {
boolean blockwiseRequired = request.getPayloadSize() > maxMessageSize;
>>>>>>>
protected boolean requiresBlockwise(final Request request) {
boolean blockwiseRequired = request.getPayloadSize() > maxMessageSize; |
<<<<<<<
private Request startBlockwiseUpload(final Exchange exchange, final Request request, int blocksize) {
=======
protected Request startBlockwiseUpload(final Exchange exchange, final Request request) {
>>>>>>>
protected Request startBlockwiseUpload(final Exchange exchange, final Request request, int blocksize) {
<<<<<<<
private void sendNextBlock(final Exchange exchange, final Response response, final KeyUri key,
final Block1BlockwiseStatus status) {
=======
protected void sendNextBlock(final Exchange exchange, final Response response, final KeyUri key, final Block1BlockwiseStatus status) {
>>>>>>>
protected void sendNextBlock(final Exchange exchange, final Response response, final KeyUri key,
final Block1BlockwiseStatus status) {
<<<<<<<
private boolean requestExceedsMaxBodySize(final Request request) {
return request.getOptions().hasSize1() && request.getOptions().getSize1() > getMaxResourceBodySize(request);
}
private int getMaxResourceBodySize(final Message message) {
int maxPayloadSize = message.getMaxResourceBodySize();
if (maxPayloadSize == 0) {
maxPayloadSize = maxResourceBodySize;
}
return maxPayloadSize;
=======
protected boolean requestExceedsMaxBodySize(final Request request) {
return request.getOptions().hasSize1() && request.getOptions().getSize1() > maxResourceBodySize;
>>>>>>>
protected boolean requestExceedsMaxBodySize(final Request request) {
return request.getOptions().hasSize1() && request.getOptions().getSize1() > getMaxResourceBodySize(request);
}
private int getMaxResourceBodySize(final Message message) {
int maxPayloadSize = message.getMaxResourceBodySize();
if (maxPayloadSize == 0) {
maxPayloadSize = maxResourceBodySize;
}
return maxPayloadSize; |
<<<<<<<
private static long longestTestDuration = 0;
private long currentTestStartTime = 0;
=======
>>>>>>>
<<<<<<<
currentTestStartTime = System.currentTimeMillis();
=======
>>>>>>> |
<<<<<<<
=======
private PageResult listToPageList(int currentPage, int rows, List list){
// TODO FROM 芋艿 to 鱿鱼须:可以直接使用数据库分页哇
currentPage = currentPage * rows;
Integer sum = list.size(); // TODO FROM 芋艿 to 鱿鱼须:这里 int 就可以啦。一般情况下,如果 IDEA 提示警告,要尽量去掉噢。
if (currentPage + rows > sum){
list = list.subList(currentPage, sum);
}else {
list = list.subList(currentPage, currentPage + rows);
}
// TODO FROM 芋艿 to 鱿鱼丝:泛型噢
return new PageResult().setList(list).setTotal(new Long(sum));
}
>>>>>>> |
<<<<<<<
//private static final String DEFAULT_HOST = "127.0.0.1";
private static final String DEFAULT_HOST = "dev.rapidftr.com";
=======
//private static final String DEFAULT_HOST = "10.14.3.44";
private static final String DEFAULT_HOST = "dev.rapidftr.com";
>>>>>>>
private static final String DEFAULT_HOST = "dev.rapidftr.com"; |
<<<<<<<
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.screens.SearchChildScreen;
import com.rapidftr.screens.internal.CustomScreen;
import com.rapidftr.screens.internal.UiStack;
public class SearchChildController extends Controller {
private final ChildrenRecordStore store;
public SearchChildController(CustomScreen screen, UiStack uiStack, ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
}
public void searchAndDisplayChildren(String searchQuery) {
Children children = store.search(searchQuery);
if (children.count() != 0) {
dispatcher.viewChildren(children.sortByName());
} else {
getSearchChildScreen().showNoSearchResultsAlert();
}
}
private SearchChildScreen getSearchChildScreen() {
return (SearchChildScreen) currentScreen;
}
}
=======
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.StringField;
import com.rapidftr.screens.SearchChildScreen;
import com.rapidftr.screens.internal.CustomScreen;
import com.rapidftr.screens.internal.UiStack;
public class SearchChildController extends Controller {
private final ChildrenRecordStore store;
public SearchChildController(CustomScreen screen, UiStack uiStack, ChildrenRecordStore store) {
super(screen, uiStack);
this.store = store;
}
public void showChildSearchScreen() {
show();
}
public void searchAndDisplayChildren(String searchQuery) {
Children children = store.search(searchQuery);
if (children.count() != 0) {
dispatcher.viewChildren(children.sortBy(new StringField("name")));
} else {
getSearchChildScreen().showNoSearchResultsAlert();
}
}
private SearchChildScreen getSearchChildScreen(){
return (SearchChildScreen)currentScreen;
}
}
>>>>>>>
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.StringField;
import com.rapidftr.screens.SearchChildScreen;
import com.rapidftr.screens.internal.CustomScreen;
import com.rapidftr.screens.internal.UiStack;
public class SearchChildController extends Controller {
private final ChildrenRecordStore store;
public SearchChildController(CustomScreen screen, UiStack uiStack, ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
}
public void showChildSearchScreen() {
show();
}
public void searchAndDisplayChildren(String searchQuery) {
Children children = store.search(searchQuery);
if (children.count() != 0) {
dispatcher.viewChildren(children.sortBy(new StringField("name")));
} else {
getSearchChildScreen().showNoSearchResultsAlert();
}
}
private SearchChildScreen getSearchChildScreen(){
return (SearchChildScreen)currentScreen;
}
} |
<<<<<<<
public String getParameter(String parameterName) {
return httpServletRequest.getParameter(parameterName);
}
@Override
public Enumeration<String> getParameterNames() {
return httpServletRequest.getParameterNames();
=======
public String getMethod() {
return httpServletRequest.getMethod();
>>>>>>>
public String getMethod() {
return httpServletRequest.getMethod();
}
@Override
public String getParameter(String parameterName) {
return httpServletRequest.getParameter(parameterName); |
<<<<<<<
import com.rapidftr.controllers.ChildHistoryController;
import com.rapidftr.controllers.ContactInformationController;
import com.rapidftr.controllers.HomeController;
import com.rapidftr.controllers.LoginController;
import com.rapidftr.controllers.ManageChildController;
import com.rapidftr.controllers.ResetDeviceController;
import com.rapidftr.controllers.SearchChildController;
import com.rapidftr.controllers.SyncController;
import com.rapidftr.controllers.ViewChildController;
import com.rapidftr.controllers.ViewChildPhotoController;
import com.rapidftr.controllers.ViewChildrenController;
=======
import com.rapidftr.controllers.*;
>>>>>>>
import com.rapidftr.controllers.*;
<<<<<<<
private final HomeController homeScreenController;
private final LoginController loginController;
private final ViewChildController childController;
private final SyncController syncController;
private ResetDeviceController resetDeviceController;
private ContactInformationController contactScreenController;
private final ManageChildController manageChildController;
private final ViewChildrenController viewChildrenController;
private final ViewChildPhotoController childPhotoController;
private final ChildHistoryController childHistoryController;
private final SearchChildController searchChildController;
public Dispatcher(HomeController homeScreenController,
LoginController loginController, ViewChildController childController,
SyncController syncController,
ResetDeviceController restController,
ContactInformationController contactScreenController,
ManageChildController manageChildController,
ViewChildrenController viewChildrenController,
ViewChildPhotoController childPhotoController,
ChildHistoryController showHistoryController, SearchChildController searchChildController) {
this.homeScreenController = homeScreenController;
this.manageChildController = manageChildController;
this.manageChildController.setDispatcher(this);
this.viewChildrenController = viewChildrenController;
this.viewChildrenController.setDispatcher(this);
this.childPhotoController = childPhotoController;
this.childPhotoController.setDispatcher(this);
this.childHistoryController = showHistoryController;
this.childHistoryController.setDispatcher(this);
this.searchChildController = searchChildController;
this.searchChildController.setDispatcher(this);
this.homeScreenController.setDispatcher(this);
this.loginController = loginController;
this.loginController.setDispatcher(this);
this.childController = childController;
this.childController.setDispatcher(this);
this.syncController = syncController;
this.syncController.setDispatcher(this);
this.resetDeviceController = restController;
this.contactScreenController = contactScreenController;
this.contactScreenController.setDispatcher(this);
}
public void homeScreen() {
homeScreenController.show();
}
public void viewChildren() {
viewChildrenController.viewAllChildren();
}
public void synchronizeForms() {
syncController.synchronizeForms();
}
public void newChild() {
manageChildController.newChild();
}
public void synchronize() {
syncController.synchronize();
}
public void searchChild() {
searchChildController.showChildSearchScreen();
}
public void syncChild(Child child) {
syncController.syncChildRecord(child);
}
public void resetDevice() {
resetDeviceController.resetDevice();
}
public void login(Process process) {
loginController.showLoginScreen(process);
}
public void showcontact() {
contactScreenController.show();
}
public void editChild(Child child, String selectedTab) {
manageChildController.editChild(child, selectedTab);
}
public void viewChild(Child child) {
childController.viewChild(child);
}
public void viewChildren(Children children) {
viewChildrenController.viewChildren(children);
}
public void viewChildPhoto(Child child) {
childPhotoController.viewChildPhoto(child);
}
public void showHistory(Child child) {
childHistoryController.showHistory(child);
}
=======
private final HomeController homeScreenController;
private final LoginController loginController;
private final ViewChildController childController;
private final SyncController syncController;
private ResetDeviceController resetDeviceController;
private ContactInformationController contactScreenController;
private final ManageChildController manageChildController;
private final ViewChildrenController viewChildrenController;
private final ViewChildPhotoController childPhotoController;
private final ChildHistoryController childHistoryController;
private final SearchChildController searchChildController;
public Dispatcher(ControllerFactory controllerFactory) {
this.homeScreenController = controllerFactory.homeScreenControllerWith(this);
this.manageChildController = controllerFactory.manageChildControllerWith(this);
this.viewChildrenController = controllerFactory.viewChildrenControllerWith(this);
this.childPhotoController = controllerFactory.viewChildPhotoControllerWith(this);
this.childHistoryController = controllerFactory.childHistoryControllerWith(this);
this.searchChildController = controllerFactory.searchChildControllerWith(this);
this.loginController = controllerFactory.loginControllerWith(this);
this.childController = controllerFactory.viewChildControllerWith(this);
this.syncController = controllerFactory.syncControllerWith(this);
this.resetDeviceController = controllerFactory.resetDeviceController();
this.contactScreenController = controllerFactory.contactScreenControllerWith(this);
}
public void homeScreen() {
homeScreenController.show();
}
public void viewChildren() {
viewChildrenController.viewAllChildren();
}
public void synchronizeForms() {
syncController.synchronizeForms();
}
public void newChild() {
manageChildController.newChild();
}
public void synchronize() {
syncController.synchronize();
}
public void searchChild() {
searchChildController.show();
}
public void syncChild(Child child) {
syncController.syncChildRecord(child);
}
public void resetDevice() {
resetDeviceController.resetDevice();
}
public void login(Process process) {
loginController.showLoginScreen(process);
}
public void showcontact() {
contactScreenController.show();
}
public void editChild(Child child) {
manageChildController.editChild(child);
}
public void viewChild(Child child) {
childController.viewChild(child);
}
public void viewChildren(Children children) {
viewChildrenController.viewChildren(children);
}
public void viewChildPhoto(Child child) {
childPhotoController.viewChildPhoto(child);
}
public void showHistory(Child child) {
childHistoryController.showHistory(child);
}
>>>>>>>
private final HomeController homeScreenController;
private final LoginController loginController;
private final ViewChildController childController;
private final SyncController syncController;
private ResetDeviceController resetDeviceController;
private ContactInformationController contactScreenController;
private final ManageChildController manageChildController;
private final ViewChildrenController viewChildrenController;
private final ViewChildPhotoController childPhotoController;
private final ChildHistoryController childHistoryController;
private final SearchChildController searchChildController;
public Dispatcher(ControllerFactory controllerFactory) {
this.homeScreenController = controllerFactory.homeScreenControllerWith(this);
this.manageChildController = controllerFactory.manageChildControllerWith(this);
this.viewChildrenController = controllerFactory.viewChildrenControllerWith(this);
this.childPhotoController = controllerFactory.viewChildPhotoControllerWith(this);
this.childHistoryController = controllerFactory.childHistoryControllerWith(this);
this.searchChildController = controllerFactory.searchChildControllerWith(this);
this.loginController = controllerFactory.loginControllerWith(this);
this.childController = controllerFactory.viewChildControllerWith(this);
this.syncController = controllerFactory.syncControllerWith(this);
this.resetDeviceController = controllerFactory.resetDeviceController();
this.contactScreenController = controllerFactory.contactScreenControllerWith(this);
}
public void homeScreen() {
homeScreenController.show();
}
public void viewChildren() {
viewChildrenController.viewAllChildren();
}
public void synchronizeForms() {
syncController.synchronizeForms();
}
public void newChild() {
manageChildController.newChild();
}
public void synchronize() {
syncController.synchronize();
}
public void searchChild() {
searchChildController.show();
}
public void syncChild(Child child) {
syncController.syncChildRecord(child);
}
public void resetDevice() {
resetDeviceController.resetDevice();
}
public void login(Process process) {
loginController.showLoginScreen(process);
}
public void showcontact() {
contactScreenController.show();
}
public void editChild(Child child, String selectedTab) {
manageChildController.editChild(child, selectedTab);
}
public void viewChild(Child child) {
childController.viewChild(child);
}
public void viewChildren(Children children) {
viewChildrenController.viewChildren(children);
}
public void viewChildPhoto(Child child) {
childPhotoController.viewChildPhoto(child);
}
public void showHistory(Child child) {
childHistoryController.showHistory(child);
} |
<<<<<<<
=======
add(new LabelField(key + ": " + value, LabelField.FOCUSABLE));
>>>>>>>
add(new LabelField(key + ": " + value, LabelField.FOCUSABLE)); |
<<<<<<<
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack, ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAllSortedByName());
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAllSortedByRecentlyAdded());
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAllSortedByRecentlyUpdated());
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
public Child getChildAt(int selectedIndex) {
return store.getChildAt(selectedIndex);
}
}
=======
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.DateField;
import com.rapidftr.datastore.StringField;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack,
ChildrenRecordStore store) {
super(screen, uiStack);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAll().sortBy(new StringField("name"), true));
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAll().sortBy(new DateField("created_at"), false));
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAll().sortBy(new DateField("last_update_at"),
false));
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
}
>>>>>>>
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.DateField;
import com.rapidftr.datastore.StringField;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack, ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAll().sortBy(new StringField("name"), true));
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAll().sortBy(new DateField("created_at"), false));
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAll().sortBy(new DateField("last_update_at"),
false));
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
} |
<<<<<<<
package com.rapidftr.datastore;
import com.rapidftr.model.Child;
import com.rapidftr.utilities.ImageHelper;
import java.util.Enumeration;
import java.util.Vector;
public class Children {
private final Vector vector;
public Children(Vector vector) {
this.vector = vector;
}
public Children(Child[] array) {
vector = new Vector();
for (int i = 0; i < array.length; i++) {
vector.addElement(array[i]);
}
}
public int count() {
return vector.size();
}
public void forEachChild(ChildAction action) {
Enumeration elements = vector.elements();
while (elements.hasMoreElements()) {
Child child = (Child) elements.nextElement();
action.execute(child);
}
}
public Child[] toArray() {
Child[] array = new Child[count()];
vector.copyInto(array);
return array;
}
public Children sortBy(final Field field, final boolean isAscending) {
Child[] children = toArray();
net.rim.device.api.util.Arrays.sort(children,
new net.rim.device.api.util.Comparator() {
public int compare(Object o1, Object o2) {
return !isAscending ? field.compare((Child) o2,
(Child) o1) : field.compare((Child) o1,
(Child) o2);
}
});
return new Children(children);
}
public Children sortByName() {
return sortBy(new StringField("name"), true);
}
public Object[] getChildrenAndImages() {
int size = pageSize() <= count() ? pageSize() : count();
Object[] childrenAndImages = new Object[size];
for (int i = 0; i < size; i++) {
childrenAndImages[i] = getImagePairAt(i);
}
return childrenAndImages;
}
public Object[] getImagePairAt(int i) {
Object[] childImagePair = new Object[2];
Child child = (Child) vector.elementAt(i);
childImagePair[0] = child;
childImagePair[1] = new ImageHelper().getThumbnail(child.getImageLocation());
return childImagePair;
}
private int pageSize() {
return 10;
}
public Children getChildrenToUpload() {
Vector result = new Vector();
Enumeration elements = vector.elements();
while (elements.hasMoreElements()) {
Child child = (Child) elements.nextElement();
if (child.isNewChild() || child.isUpdated()) {
result.addElement(child);
}
}
return new Children(result);
}
}
=======
package com.rapidftr.datastore;
import java.util.Enumeration;
import java.util.Vector;
import com.rapidftr.model.Child;
import com.rapidftr.utilities.ImageHelper;
public class Children {
private final Vector vector;
public Children(Vector vector) {
this.vector = vector;
}
public Children(Child[] array) {
vector = new Vector();
for (int i = 0; i < array.length; i++) {
vector.addElement(array[i]);
}
}
public int count() {
return vector.size();
}
public void forEachChild(ChildAction action) {
Enumeration elements = vector.elements();
while (elements.hasMoreElements()) {
Child child = (Child) elements.nextElement();
action.execute(child);
}
}
public Child[] toArray() {
Child[] array = new Child[count()];
vector.copyInto(array);
return array;
}
public Children sortBy(final Field field, final boolean isAscending) {
Child[] children = toArray();
net.rim.device.api.util.Arrays.sort(children,
new net.rim.device.api.util.Comparator() {
public int compare(Object o1, Object o2) {
return !isAscending ? field.compare((Child) o2,
(Child) o1) : field.compare((Child) o1,
(Child) o2);
}
});
return new Children(children);
}
public Children sortBy(StringField stringField) {
return sortBy(stringField,true);
}
public Object[] getChildrenAndImages() {
int size = pageSize() <= count() ? pageSize() : count();
Object[] childrenAndImages = new Object[size];
for (int i = 0; i < size; i++) {
childrenAndImages[i] = getImagePairAt(i);
}
return childrenAndImages;
}
public Object[] getImagePairAt(int i) {
Object[] childImagePair = new Object[2];
Child child = (Child) vector.elementAt(i);
childImagePair[0] = child;
childImagePair[1] = new ImageHelper().getThumbnail(child.getImageLocation());
return childImagePair;
}
private int pageSize(){
return 10;
}
public Children getChildrenToUpload() {
Vector result = new Vector();
Enumeration elements = vector.elements();
while(elements.hasMoreElements()){
Child child = (Child)elements.nextElement();
if (child.isNewChild() || child.isUpdated()) {
result.addElement(child);
}
}
return new Children(result);
}
}
>>>>>>>
package com.rapidftr.datastore;
import com.rapidftr.model.Child;
import com.rapidftr.utilities.ImageHelper;
import java.util.Enumeration;
import java.util.Vector;
public class Children {
private final Vector vector;
public Children(Vector vector) {
this.vector = vector;
}
public Children(Child[] array) {
vector = new Vector();
for (int i = 0; i < array.length; i++) {
vector.addElement(array[i]);
}
}
public int count() {
return vector.size();
}
public void forEachChild(ChildAction action) {
Enumeration elements = vector.elements();
while (elements.hasMoreElements()) {
Child child = (Child) elements.nextElement();
action.execute(child);
}
}
public Child[] toArray() {
Child[] array = new Child[count()];
vector.copyInto(array);
return array;
}
public Children sortBy(final Field field, final boolean isAscending) {
Child[] children = toArray();
net.rim.device.api.util.Arrays.sort(children,
new net.rim.device.api.util.Comparator() {
public int compare(Object o1, Object o2) {
return !isAscending ? field.compare((Child) o2,
(Child) o1) : field.compare((Child) o1,
(Child) o2);
}
});
return new Children(children);
}
public Children sortBy(StringField stringField) {
return sortBy(stringField,true);
}
public Object[] getChildrenAndImages() {
int size = pageSize() <= count() ? pageSize() : count();
Object[] childrenAndImages = new Object[size];
for (int i = 0; i < size; i++) {
childrenAndImages[i] = getImagePairAt(i);
}
return childrenAndImages;
}
public Object[] getImagePairAt(int i) {
Object[] childImagePair = new Object[2];
Child child = (Child) vector.elementAt(i);
childImagePair[0] = child;
childImagePair[1] = new ImageHelper().getThumbnail(child.getImageLocation());
return childImagePair;
}
private int pageSize(){
return 10;
}
public Children getChildrenToUpload() {
Vector result = new Vector();
Enumeration elements = vector.elements();
while(elements.hasMoreElements()){
Child child = (Child)elements.nextElement();
if (child.isNewChild() || child.isUpdated()) {
result.addElement(child);
}
}
return new Children(result);
}
} |
<<<<<<<
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.DateField;
import com.rapidftr.datastore.StringField;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack,
ChildrenRecordStore store) {
super(screen, uiStack);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAll().sortBy(new StringField("name"), true));
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAll().sortBy(new DateField("created_at"), false));
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAll().sortBy(new DateField("last_update_at"),
false));
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
}
=======
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack, ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAllSortedByName());
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAllSortedByRecentlyAdded());
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAllSortedByRecentlyUpdated());
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
public Child getChildAt(int selectedIndex) {
return store.getChildAt(selectedIndex);
}
}
>>>>>>>
package com.rapidftr.controllers;
import com.rapidftr.controllers.internal.Controller;
import com.rapidftr.controllers.internal.Dispatcher;
import com.rapidftr.datastore.Children;
import com.rapidftr.datastore.ChildrenRecordStore;
import com.rapidftr.datastore.DateField;
import com.rapidftr.datastore.StringField;
import com.rapidftr.model.Child;
import com.rapidftr.screens.ViewChildrenScreen;
import com.rapidftr.screens.internal.UiStack;
public class ViewChildrenController extends Controller {
private final ChildrenRecordStore store;
private int sortState;
private final int SORT_NAME = 0;
private final int SORT_ADDED = 1;
private final int SORT_UPDATED = 2;
public ViewChildrenController(ViewChildrenScreen screen, UiStack uiStack,
ChildrenRecordStore store, Dispatcher dispatcher) {
super(screen, uiStack, dispatcher);
this.store = store;
this.sortState = SORT_NAME;
}
public void viewAllChildren() {
uiStack.clear();
switch (sortState) {
case SORT_NAME:
sortByName();
break;
case SORT_ADDED:
sortByRecentlyAdded();
break;
case SORT_UPDATED:
sortByRecentlyUpdated();
break;
}
}
public void viewChildren(Children children) {
getViewChildrenScreen().setChildren(children);
show();
}
private ViewChildrenScreen getViewChildrenScreen() {
return (ViewChildrenScreen) currentScreen;
}
public void viewChild(Child child) {
dispatcher.viewChild(child);
}
public void sortByName() {
this.sortState = this.SORT_NAME;
viewChildren(store.getAllSortedByName());
}
public void sortByRecentlyAdded() {
this.sortState = this.SORT_ADDED;
viewChildren(store.getAllSortedByRecentlyAdded());
}
public void sortByRecentlyUpdated() {
this.sortState = this.SORT_UPDATED;
viewChildren(store.getAllSortedByRecentlyUpdated());
}
public void popScreen() {
this.sortState = SORT_NAME;
((ViewChildrenScreen) currentScreen).refresh();
homeScreen();
}
} |
<<<<<<<
/**
* @since 1.2.0
*/
List<String> getAllowedCorsOrigins();
/**
* @since 1.2.0
*/
boolean isCorsEnabled();
/**
* @since 1.2.0
*/
List<String> getAllowedCorsHaders();
/**
* @since 1.2.0
*/
List<String> getAllowedCorsMethods();
=======
GrantTypeStatusValidator getGrantTypeStatusValidator();
>>>>>>>
/**
* @since 1.2.0
*/
List<String> getAllowedCorsOrigins();
/**
* @since 1.2.0
*/
boolean isCorsEnabled();
/**
* @since 1.2.0
*/
List<String> getAllowedCorsHaders();
/**
* @since 1.2.0
*/
List<String> getAllowedCorsMethods();
/**
* @since 1.2.0
*/
GrantTypeStatusValidator getGrantTypeStatusValidator(); |
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>> |
<<<<<<<
=======
import java.io.InputStream;
import java.io.Reader;
import java.util.Properties;
>>>>>>>
<<<<<<<
* @see ApiKeyBuilder
* @since 0.9.4
=======
* You may load files from the filesystem, classpath, or URLs by prefixing the path with
* {@code file:}, {@code classpath:}, or {@code url:} respectively. See
* {@link #setApiKeyFileLocation(String)} for more information.
*
* @see #setApiKeyFileLocation(String)
* @since 1.0.alpha
>>>>>>>
* @see ApiKeyBuilder
* @since 1.0.alpha |
<<<<<<<
* retaining all precursor values
*
=======
* retaining all precursor values
*
* @param <N>
* type to convert to
*
>>>>>>>
* retaining all precursor values |
<<<<<<<
import github.scarsz.discordsrv.util.LangUtil;
=======
import github.scarsz.discordsrv.util.PlayerUtil;
>>>>>>>
import github.scarsz.discordsrv.util.LangUtil;
import github.scarsz.discordsrv.util.PlayerUtil; |
<<<<<<<
import java.util.function.Function;
=======
import java.util.UUID;
>>>>>>>
import java.util.function.Function;
<<<<<<<
Bukkit.getScheduler().scheduleSyncDelayedTask(DiscordSRV.getPlugin(), () -> {
String avatarUrl = DiscordSRV.getPlugin().getEmbedAvatarUrl(event.getPlayer());
String botAvatarUrl = DiscordUtil.getJda().getSelfUser().getEffectiveAvatarUrl();
String botName = DiscordSRV.getPlugin().getMainGuild() != null ? DiscordSRV.getPlugin().getMainGuild().getSelfMember().getEffectiveName() : DiscordUtil.getJda().getSelfUser().getName();
Function<String, String> translator = content -> {
if (content == null) return null;
=======
Bukkit.getScheduler().runTaskLater(DiscordSRV.getPlugin(), () -> {
final String displayName = player.getDisplayName();
final Message discordMessage = DiscordSRV.getPlugin().translateMessage(messageFormat, content -> {
>>>>>>>
Bukkit.getScheduler().runTaskLater(DiscordSRV.getPlugin(), () -> {
final String displayName = player.getDisplayName();
Function<String, String> translator = content -> {
if (content == null) return null;
<<<<<<<
.replace("%message%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(event.getJoinMessage())))
.replace("%username%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(event.getPlayer().getName())))
.replace("%displayname%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(event.getPlayer().getDisplayName())))
=======
.replace("%message%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(message)))
.replace("%username%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(name)))
.replace("%displayname%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(displayName)))
.replace("%effectiveavatarurl%", webhookDelivery ? botAvatarUrl : avatarUrl)
>>>>>>>
.replace("%message%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(message)))
.replace("%username%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(name)))
.replace("%displayname%", DiscordUtil.strip(DiscordUtil.escapeMarkdown(displayName)))
<<<<<<<
.replace("%botavatarurl%", botAvatarUrl)
.replace("%botname%", botName);
content = PlaceholderUtil.replacePlaceholdersToDiscord(content, event.getPlayer());
=======
.replace("%botavatarurl%", botAvatarUrl);
content = PlaceholderUtil.replacePlaceholdersToDiscord(content, player);
>>>>>>>
.replace("%botavatarurl%", botAvatarUrl)
.replace("%botname%", botName);
content = PlaceholderUtil.replacePlaceholdersToDiscord(content, player);
<<<<<<<
String avatarUrl = DiscordSRV.getPlugin().getEmbedAvatarUrl(event.getPlayer());
String botAvatarUrl = DiscordUtil.getJda().getSelfUser().getEffectiveAvatarUrl();
String botName = DiscordSRV.getPlugin().getMainGuild() != null ? DiscordSRV.getPlugin().getMainGuild().getSelfMember().getEffectiveName() : DiscordUtil.getJda().getSelfUser().getName();
Function<String, String> translator = content -> {
=======
final UUID uuid = player.getUniqueId();
final String displayName = player.getDisplayName();
final String message = event.getQuitMessage();
final boolean webhookDelivery = DiscordSRV.config().getBoolean("Experiment_WebhookChatMessageDelivery");
final String avatarUrl = DiscordSRV.getPlugin().getEmbedAvatarUrl(event.getPlayer());
final String botAvatarUrl = DiscordUtil.getJda().getSelfUser().getEffectiveAvatarUrl();
Message discordMessage = DiscordSRV.getPlugin().translateMessage(messageFormat, content -> {
>>>>>>>
final String displayName = player.getDisplayName();
final String message = event.getQuitMessage();
String avatarUrl = DiscordSRV.getPlugin().getEmbedAvatarUrl(event.getPlayer());
String botAvatarUrl = DiscordUtil.getJda().getSelfUser().getEffectiveAvatarUrl();
String botName = DiscordSRV.getPlugin().getMainGuild() != null ? DiscordSRV.getPlugin().getMainGuild().getSelfMember().getEffectiveName() : DiscordUtil.getJda().getSelfUser().getName();
Function<String, String> translator = content -> {
<<<<<<<
if (messageFormat.isUseWebhooks()) {
WebhookUtil.deliverMessage(DiscordSRV.getPlugin().getMainTextChannel(), webhookName, webhookAvatarUrl,
=======
if (webhookDelivery) {
WebhookUtil.deliverMessage(DiscordSRV.getPlugin().getMainTextChannel(), uuid, name, displayName,
>>>>>>>
if (messageFormat.isUseWebhooks()) {
WebhookUtil.deliverMessage(DiscordSRV.getPlugin().getMainTextChannel(), webhookName, webhookAvatarUrl, |
<<<<<<<
// -- Helper methods --
/** Creates a copy of the core metadata instantiated using the provided CoreMetadata type,
* matching the state of the given reader. */
protected <T extends CoreMetadata> List<CoreMetadata> copyCoreMetadata(Class<T> c, IFormatReader r) {
int count = 0;
int currentSeries = r.getSeries();
for (int i=0; i<r.getSeriesCount(); i++) {
r.setSeries(i);
count += r.getResolutionCount();
}
r.setSeries(currentSeries);
ArrayList<CoreMetadata> core = new ArrayList<CoreMetadata>();
for (int s=0; s<count; s++) {
T meta = null;
try {
meta = c.newInstance();
} catch (InstantiationException e) {
throw new IllegalArgumentException("Failed to create metadata:\n" + e);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException("Failed to create metadata:\n" + e);
}
meta.copy(r, s);
core.add(meta);
}
return core;
}
=======
>>>>>>> |
<<<<<<<
OME Bio-Formats package for reading and converting biological file formats.
Copyright (C) 2005-@year@ UW-Madison LOCI and Glencoe Software, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
=======
* #%L
* OME Bio-Formats package for reading and converting biological file formats.
* %%
* Copyright (C) 2005 - 2012 Open Microscopy Environment:
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* - University of Dundee
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
>>>>>>>
* #%L
* OME Bio-Formats package for reading and converting biological file formats.
* %%
* Copyright (C) 2005 - 2012 Open Microscopy Environment:
* - Board of Regents of the University of Wisconsin-Madison
* - Glencoe Software, Inc.
* - University of Dundee
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
<<<<<<<
=======
import ome.xml.model.primitives.PositiveFloat;
import ome.xml.model.primitives.PositiveInteger;
import ome.xml.model.primitives.Timestamp;
>>>>>>>
<<<<<<<
=======
if (key.startsWith("MultiChannel Color")) {
if (cIndex >= 0 && cIndex < effectiveSizeC) {
if (channelColors == null ||
effectiveSizeC > channelColors.length)
{
channelColors = new int[effectiveSizeC];
}
if (channelColors[cIndex] == 0) {
channelColors[cIndex] = Integer.parseInt(value);
}
}
else if (cIndex == effectiveSizeC && channelColors != null &&
channelColors[0] == 0)
{
System.arraycopy(
channelColors, 1, channelColors, 0, channelColors.length - 1);
channelColors[cIndex - 1] = Integer.parseInt(value);
}
}
else if (key.startsWith("Scale Factor for X") && physicalSizeX == null)
{
physicalSizeX = Double.parseDouble(value);
}
else if (key.startsWith("Scale Factor for Y") && physicalSizeY == null)
{
physicalSizeY = Double.parseDouble(value);
}
else if (key.startsWith("Scale Factor for Z") && physicalSizeZ == null)
{
physicalSizeZ = Double.parseDouble(value);
}
else if (key.startsWith("Emission Wavelength")) {
if (cIndex != -1) {
Integer wave = new Integer(value);
if (wave.intValue() > 0) {
emWavelength.put(cIndex, new PositiveInteger(wave));
}
else {
LOGGER.warn(
"Expected positive value for EmissionWavelength; got {}", wave);
}
}
}
else if (key.startsWith("Excitation Wavelength")) {
if (cIndex != -1) {
Integer wave = new Integer((int) Double.parseDouble(value));
if (wave.intValue() > 0) {
exWavelength.put(cIndex, new PositiveInteger(wave));
}
else {
LOGGER.warn(
"Expected positive value for ExcitationWavelength; got {}",
wave);
}
}
}
else if (key.startsWith("Channel Name")) {
if (cIndex != -1) {
channelName.put(cIndex, value);
}
}
else if (key.startsWith("Exposure Time [ms]")) {
if (exposureTime.get(new Integer(cIndex)) == null) {
double exp = Double.parseDouble(value) / 1000;
exposureTime.put(new Integer(cIndex), String.valueOf(exp));
}
}
else if (key.startsWith("User Name")) {
String[] username = value.split(" ");
if (username.length >= 2) {
store.setExperimenterFirstName(username[0], 0);
store.setExperimenterLastName(username[username.length - 1], 0);
}
}
else if (key.equals("User company")) {
store.setExperimenterInstitution(value, 0);
}
else if (key.startsWith("Objective Magnification")) {
int magnification = (int) Double.parseDouble(value);
if (magnification > 0) {
store.setObjectiveNominalMagnification(
new PositiveInteger(magnification), 0, 0);
}
else {
LOGGER.warn(
"Expected positive value for NominalMagnification; got {}",
magnification);
}
}
else if (key.startsWith("Objective ID")) {
store.setObjectiveID("Objective:" + value, 0, 0);
store.setObjectiveCorrection(getCorrection("Other"), 0, 0);
store.setObjectiveImmersion(getImmersion("Other"), 0, 0);
}
else if (key.startsWith("Objective N.A.")) {
store.setObjectiveLensNA(new Double(value), 0, 0);
}
else if (key.startsWith("Objective Name")) {
String[] tokens = value.split(" ");
for (int q=0; q<tokens.length; q++) {
int slash = tokens[q].indexOf("/");
if (slash != -1 && slash - q > 0) {
int mag = (int)
Double.parseDouble(tokens[q].substring(0, slash - q));
String na = tokens[q].substring(slash + 1);
if (mag > 0) {
store.setObjectiveNominalMagnification(
new PositiveInteger(mag), 0, 0);
}
else {
LOGGER.warn(
"Expected positive value for NominalMagnification; got {}",
mag);
}
store.setObjectiveLensNA(new Double(na), 0, 0);
store.setObjectiveCorrection(getCorrection(tokens[q - 1]), 0, 0);
break;
}
}
}
else if (key.startsWith("Objective Working Distance")) {
store.setObjectiveWorkingDistance(new Double(value), 0, 0);
}
else if (key.startsWith("Objective Immersion Type")) {
String immersion = "Other";
switch (Integer.parseInt(value)) {
// case 1: no immersion
case 2:
immersion = "Oil";
break;
case 3:
immersion = "Water";
break;
}
store.setObjectiveImmersion(getImmersion(immersion), 0, 0);
}
else if (key.startsWith("Stage Position X")) {
stageX.put(image, new Double(value));
addGlobalMeta("X position for position #" + stageX.size(), value);
}
else if (key.startsWith("Stage Position Y")) {
stageY.put(image, new Double(value));
addGlobalMeta("Y position for position #" + stageY.size(), value);
}
else if (key.startsWith("Orca Analog Gain")) {
detectorGain.put(cIndex, new Double(value));
}
else if (key.startsWith("Orca Analog Offset")) {
detectorOffset.put(cIndex, new Double(value));
}
else if (key.startsWith("Comments")) {
imageDescription = value;
}
else if (key.startsWith("Acquisition Date")) {
if (timepoint > 0) {
timestamps.put(new Integer(timepoint - 1), value);
addGlobalMeta("Timestamp " + timepoint, value);
}
timepoint++;
}
}
catch (NumberFormatException e) { }
}
>>>>>>>
<<<<<<<
nlayer.shapes.add(nshape);
=======
if (roiType == CURVE) {
store.setPolylineID(shapeID, imageNum, shapeIndex);
store.setPolylinePoints(points.toString(), imageNum, shapeIndex);
}
else {
store.setPolygonID(shapeID, imageNum, shapeIndex);
store.setPolygonPoints(points.toString(), imageNum, shapeIndex);
}
shapeIndex++;
}
else if (roiType == RECTANGLE || roiType == TEXT) {
store.setROIID(roiID, imageNum);
store.setRectangleID(shapeID, imageNum, shapeIndex);
store.setRectangleX(new Double(x), imageNum, shapeIndex);
store.setRectangleY(new Double(y), imageNum, shapeIndex);
store.setRectangleWidth(new Double(w), imageNum, shapeIndex);
store.setRectangleHeight(new Double(h), imageNum, shapeIndex);
shapeIndex++;
}
else if (roiType == LINE || roiType == SCALE_BAR) {
store.setROIID(roiID, imageNum);
double x1 = s.readDouble();
double y1 = s.readDouble();
double x2 = s.readDouble();
double y2 = s.readDouble();
store.setLineID(shapeID, imageNum, shapeIndex);
store.setLineX1(x1, imageNum, shapeIndex);
store.setLineY1(y1, imageNum, shapeIndex);
store.setLineX2(x2, imageNum, shapeIndex);
store.setLineY2(y2, imageNum, shapeIndex);
shapeIndex++;
}
>>>>>>>
nlayer.shapes.add(nshape); |
<<<<<<<
String experimenterID = MetadataTools.createLSID("Experimenter", 0);
store.setExperimenterID(experimenterID, 0);
store.setExperimenterEmail(userEmail, 0);
store.setExperimenterFirstName(userFirstName, 0);
store.setExperimenterInstitution(userInstitution, 0);
store.setExperimenterLastName(userLastName, 0);
store.setExperimenterMiddleName(userMiddleName, 0);
store.setExperimenterUserName(userName, 0);
=======
String experimenterID = null;
if (userDisplayName != null) {
experimenterID = MetadataTools.createLSID("Experimenter", 0);
store.setExperimenterID(experimenterID, 0);
store.setExperimenterDisplayName(userDisplayName, 0);
store.setExperimenterEmail(userEmail, 0);
store.setExperimenterFirstName(userFirstName, 0);
store.setExperimenterInstitution(userInstitution, 0);
store.setExperimenterLastName(userLastName, 0);
store.setExperimenterMiddleName(userMiddleName, 0);
store.setExperimenterUserName(userName, 0);
}
>>>>>>>
String experimenterID = MetadataTools.createLSID("Experimenter", 0);
store.setExperimenterID(experimenterID, 0);
store.setExperimenterEmail(userEmail, 0);
store.setExperimenterFirstName(userFirstName, 0);
store.setExperimenterInstitution(userInstitution, 0);
store.setExperimenterLastName(userLastName, 0);
store.setExperimenterMiddleName(userMiddleName, 0);
store.setExperimenterUserName(userName, 0);
<<<<<<<
store.setImageAcquisitionDate(new Timestamp(acquiredDate), i);
store.setImageExperimenterRef(experimenterID, i);
=======
store.setImageAcquiredDate(acquiredDate, i);
if (experimenterID != null) {
store.setImageExperimenterRef(experimenterID, i);
}
>>>>>>>
store.setImageAcquisitionDate(new Timestamp(acquiredDate), i);
if (experimenterID != null) {
store.setImageExperimenterRef(experimenterID, i);
}
<<<<<<<
store.setLineText(getFirstNodeValue(textElements, "Text"), i, shape);
=======
store.setLineName(getFirstNodeValue(attributes, "Name"), i, shape);
store.setLineName(getFirstNodeValue(attributes, "Name"), i, shape + 1);
store.setLineLabel(
getFirstNodeValue(textElements, "Text"), i, shape);
store.setLineLabel(
getFirstNodeValue(textElements, "Text"), i, shape + 1);
>>>>>>>
store.setLineText(getFirstNodeValue(textElements, "Text"), i, shape);
store.setLineText(getFirstNodeValue(textElements, "Text"), i, shape + 1); |
<<<<<<<
savedCore.add(core.get(i + c));
levels.put(new Integer(savedCore.get(c).sizeX), new Integer(c));
=======
savedCore[c] = core[i + c];
savedIFDs[c] = getIFDIndex(i+c);
levels.put(new Integer(savedCore[c].sizeX), new Integer(c));
>>>>>>>
savedCore.add(core.get(i + c));
savedIFDs[c] = getIFDIndex(i+c);
levels.put(new Integer(savedCore.get(c).sizeX), new Integer(c));
<<<<<<<
core.set(i + j, savedCore.get(levels.get(keys[resolutions - j - 1])));
=======
core[i + j] = savedCore[levels.get(keys[resolutions - j - 1])];
ifdmap[i + j] = savedIFDs[levels.get(keys[resolutions - j - 1])];
>>>>>>>
core.set(i + j, savedCore.get(levels.get(keys[resolutions - j - 1])));
ifdmap[i + j] = savedIFDs[levels.get(keys[resolutions - j - 1])]; |
<<<<<<<
core = handler.getCoreMetadataList();
=======
textString = null;
core = handler.getCoreMetadata();
>>>>>>>
textString = null;
core = handler.getCoreMetadataList(); |
<<<<<<<
CoreMetadata ms = core.get(s);
if (s == i.imageNumStart && !hasFlattenedResolutions()) {
ms.resolutionCount = i.pixels.sizeR;
=======
if (s == i.imageNumStart) {
core[s].resolutionCount = i.pixels.sizeR;
>>>>>>>
CoreMetadata ms = core.get(s);
if (s == i.imageNumStart) {
ms.resolutionCount = i.pixels.sizeR; |
<<<<<<<
'r', new ItemStack(Items.redstone),
'c', findItemStack("Copper Cable"),
'C', dictAdvancedChip);
=======
Character.valueOf('r'), new ItemStack(Items.redstone),
Character.valueOf('c'), findItemStack("Copper Cable"),
Character.valueOf('C'), dictAdvancedChip);
addRecipe(findItemStack("Lowpass filter"),
"CdC",
"cDc",
" s ",
'd', findItemStack("Dielectric"),
'c', findItemStack("Copper Cable"),
'C', findItemStack("Copper Plate"),
'D', findItemStack("Coal Dust"),
's', dictCheapChip);
>>>>>>>
'r', new ItemStack(Items.redstone),
'c', findItemStack("Copper Cable"),
'C', dictAdvancedChip);
addRecipe(findItemStack("Lowpass filter"),
"CdC",
"cDc",
" s ",
'd', findItemStack("Dielectric"),
'c', findItemStack("Copper Cable"),
'C', findItemStack("Copper Plate"),
'D', findItemStack("Coal Dust"),
's', dictCheapChip); |
<<<<<<<
ArrayList<NodeBase> nodes = NodeManager.instance.getNodes();
if(nodes.isEmpty()) return false;
=======
List<NodeBase> nodes = NodeManager.instance.getNodes();
if(nodes.size() == 0) return false;
>>>>>>>
List<NodeBase> nodes = NodeManager.instance.getNodes();
if(nodes.isEmpty()) return false; |
<<<<<<<
import org.eclipse.aether.repository.ArtifactRepository;
=======
>>>>>>> |
<<<<<<<
=======
import org.slf4j.LoggerFactory;
import org.sonatype.aether.transfer.AbstractTransferListener;
import org.sonatype.aether.transfer.TransferCancelledException;
import org.sonatype.aether.transfer.TransferEvent;
import org.sonatype.aether.transfer.TransferResource;
>>>>>>>
import org.slf4j.LoggerFactory; |
<<<<<<<
=======
/**
* Returns the deployment policy to which the specified id is mapped or null
*
* @param id Id of the deployment policy
* @return
*/
public DeploymentPolicy getDeploymentPolicyById(String id) {
DeploymentPolicy deploymentPolicy = null;
for (DeploymentPolicy deploymentPolicy1 : getDeploymentPolicies()) {
if (deploymentPolicy1.getId().equals(id)) {
deploymentPolicy = deploymentPolicy1;
}
}
return deploymentPolicy;
}
>>>>>>>
/**
* Returns the deployment policy to which the specified id is mapped or null
*
* @param id Id of the deployment policy
* @return
*/
public DeploymentPolicy getDeploymentPolicyById(String id) {
DeploymentPolicy deploymentPolicy = null;
for (DeploymentPolicy deploymentPolicy1 : getDeploymentPolicies()) {
if (deploymentPolicy1.getId().equals(id)) {
deploymentPolicy = deploymentPolicy1;
}
}
return deploymentPolicy;
}
<<<<<<<
private static class InstanceHolder {
private static final PolicyManager INSTANCE = new PolicyManager();
}
=======
/**
* Checks whether application policy exists in the tenant
* @param applicationPolicyId application policy id
* @param tenantId tenant id
* @return boolean value
*/
public Boolean checkApplicationPolicyInTenant(String applicationPolicyId, int tenantId) {
ApplicationPolicy[] applicationPolicies = getApplicationPolicies();
for (ApplicationPolicy applicationPolicy1 : applicationPolicies) {
if (applicationPolicy1.getId().equals(applicationPolicyId) && applicationPolicy1.getTenantId() ==
tenantId) {
return true;
}
}
return false;
}
>>>>>>>
/**
* Checks whether application policy exists in the tenant
* @param applicationPolicyId application policy id
* @param tenantId tenant id
* @return boolean value
*/
public Boolean checkApplicationPolicyInTenant(String applicationPolicyId, int tenantId) {
ApplicationPolicy[] applicationPolicies = getApplicationPolicies();
for (ApplicationPolicy applicationPolicy1 : applicationPolicies) {
if (applicationPolicy1.getId().equals(applicationPolicyId) && applicationPolicy1.getTenantId() ==
tenantId) {
return true;
}
}
return false;
} |
<<<<<<<
public String getLvsVirtualIP() {
return lvsVirtualIP;
}
public void setLvsVirtualIP(String lvsVirtualIP) {
this.lvsVirtualIP = lvsVirtualIP;
}
=======
public String getDeploymentPolicy() {
return deploymentPolicy;
}
public void setDeploymentPolicy(String deploymentPolicy) {
this.deploymentPolicy = deploymentPolicy;
}
public String getAutoscalingPolicy() {
return autoscalingPolicy;
}
public void setAutoscalingPolicy(String autoscalingPolicy) {
this.autoscalingPolicy = autoscalingPolicy;
}
>>>>>>>
public String getLvsVirtualIP() {
return lvsVirtualIP;
}
public void setLvsVirtualIP(String lvsVirtualIP) {
this.lvsVirtualIP = lvsVirtualIP;
}
public String getDeploymentPolicy() {
return deploymentPolicy;
}
public void setDeploymentPolicy(String deploymentPolicy) {
this.deploymentPolicy = deploymentPolicy;
}
public String getAutoscalingPolicy() {
return autoscalingPolicy;
}
public void setAutoscalingPolicy(String autoscalingPolicy) {
this.autoscalingPolicy = autoscalingPolicy;
} |
<<<<<<<
import org.apache.stratos.autoscaler.exception.InvalidPolicyException;
=======
import org.apache.stratos.autoscaler.exception.NonExistingLBException;
>>>>>>>
import org.apache.stratos.autoscaler.exception.InvalidPolicyException;
import org.apache.stratos.autoscaler.exception.NonExistingLBException; |
<<<<<<<
private Container container;
=======
private String[] exportingProperties;
>>>>>>>
private Container container;
private String[] exportingProperties;
<<<<<<<
public Container getContainer() {
return container;
}
public void setContainer(Container container) {
this.container = container;
}
public String getDeployerType() {
return deployerType;
}
public void setDeployerType(String deployerType) {
this.deployerType = deployerType;
}
=======
public String[] getExportingProperties() {
return exportingProperties;
}
public void setExportingProperties(String[] exportingProperties) {
this.exportingProperties = exportingProperties;
}
>>>>>>>
public String[] getExportingProperties() {
return exportingProperties;
}
public void setExportingProperties(String[] exportingProperties) {
this.exportingProperties = exportingProperties;
}
public Container getContainer() {
return container;
}
public void setContainer(Container container) {
this.container = container;
}
public String getDeployerType() {
return deployerType;
}
public void setDeployerType(String deployerType) {
this.deployerType = deployerType;
} |
<<<<<<<
String networkPartitionId,
int minMemberCount) throws SpawningException {
=======
String networkPartitionId, boolean isPrimary,
int minMemberCount, String autoscalingReason,
long scalingTime) throws SpawningException {
>>>>>>>
String networkPartitionId, boolean isPrimary,
int minMemberCount, String autoscalingReason,
long scalingTime) throws SpawningException {
<<<<<<<
=======
Property autoscalingReasonProp = new Property();
autoscalingReasonProp.setName(StratosConstants.SCALING_REASON);
autoscalingReasonProp.setValue(autoscalingReason);
Property scalingTimeProp = new Property();
scalingTimeProp.setName(StratosConstants.SCALING_TIME);
scalingTimeProp.setValue(String.valueOf(scalingTime));
memberContextProps.addProperty(isPrimaryProp);
>>>>>>>
Property autoscalingReasonProp = new Property();
autoscalingReasonProp.setName(StratosConstants.SCALING_REASON);
autoscalingReasonProp.setValue(autoscalingReason);
Property scalingTimeProp = new Property();
scalingTimeProp.setName(StratosConstants.SCALING_TIME);
scalingTimeProp.setValue(String.valueOf(scalingTime));
memberContextProps.addProperty(isPrimaryProp); |
<<<<<<<
setKubernetesCluster(cluster);
cluster.setStatus(ClusterStatus.Created);
=======
//cluster.setStatus(Status.Created);
>>>>>>>
//cluster.setStatus(Status.Created);
setKubernetesCluster(cluster);
cluster.setStatus(ClusterStatus.Created);
<<<<<<<
public static void handleMemberSpawned(String serviceName,
String clusterId, String partitionId,
String privateIp, String publicIp, MemberContext context) {
// adding the new member to the cluster after it is successfully started
// in IaaS.
Topology topology = TopologyManager.getTopology();
Service service = topology.getService(serviceName);
Cluster cluster = service.getCluster(clusterId);
String memberId = context.getMemberId();
String networkPartitionId = context.getNetworkPartitionId();
String lbClusterId = context.getLbClusterId();
long initTime = context.getInitTime();
if (cluster.memberExists(memberId)) {
log.warn(String.format("Member %s already exists", memberId));
return;
}
try {
TopologyManager.acquireWriteLock();
Member member = new Member(serviceName, clusterId,
networkPartitionId, partitionId, memberId, initTime);
member.setStatus(MemberStatus.Created);
member.setMemberIp(privateIp);
member.setLbClusterId(lbClusterId);
member.setMemberPublicIp(publicIp);
member.setProperties(CloudControllerUtil.toJavaUtilProperties(context.getProperties()));
try {
// Update port mappings with generated service proxy port
// TODO: Need to properly fix with the latest Kubernetes version
String serviceHostPortStr = CloudControllerUtil.getProperty(context.getProperties(), StratosConstants.ALLOCATED_SERVICE_HOST_PORT);
if(StringUtils.isEmpty(serviceHostPortStr)) {
log.warn("Kubernetes service host port not found for member: [member-id] " + memberId);
}
Cartridge cartridge = FasterLookUpDataHolder.getInstance().
getCartridge(serviceName);
List<PortMapping> portMappings = cartridge.getPortMappings();
Port port;
// Adding ports to the member
for (PortMapping portMapping : portMappings) {
if (cluster.isKubernetesCluster() && (StringUtils.isNotEmpty(serviceHostPortStr))) {
port = new Port(portMapping.getProtocol(),
Integer.parseInt(serviceHostPortStr),
Integer.parseInt(portMapping.getProxyPort()));
member.addPort(port);
} else {
port = new Port(portMapping.getProtocol(),
Integer.parseInt(portMapping.getPort()),
Integer.parseInt(portMapping.getProxyPort()));
member.addPort(port);
}
}
} catch (Exception e) {
log.error("Could not update member port-map: [member-id] " + memberId, e);
}
cluster.addMember(member);
TopologyManager.updateTopology(topology);
} finally {
TopologyManager.releaseWriteLock();
}
TopologyEventPublisher.sendInstanceSpawnedEvent(serviceName, clusterId,
networkPartitionId, partitionId, memberId, lbClusterId,
publicIp, privateIp, context);
}
=======
public static void handleMemberSpawned(String serviceName,
String clusterId, String partitionId,
String privateIp, String publicIp, MemberContext context) {
// adding the new member to the cluster after it is successfully started
// in IaaS.
Topology topology = TopologyManager.getTopology();
Service service = topology.getService(serviceName);
Cluster cluster = service.getCluster(clusterId);
String memberId = context.getMemberId();
String networkPartitionId = context.getNetworkPartitionId();
String lbClusterId = context.getLbClusterId();
if (cluster.memberExists(memberId)) {
log.warn(String.format("Member %s already exists", memberId));
return;
}
try {
TopologyManager.acquireWriteLock();
Member member = new Member(serviceName, clusterId,
networkPartitionId, partitionId, memberId);
//member.setStatus(MemberStatus.Created);
member.setMemberIp(privateIp);
member.setLbClusterId(lbClusterId);
member.setMemberPublicIp(publicIp);
member.setProperties(CloudControllerUtil.toJavaUtilProperties(context.getProperties()));
cluster.addMember(member);
TopologyManager.updateTopology(topology);
} finally {
TopologyManager.releaseWriteLock();
}
TopologyEventPublisher.sendInstanceSpawnedEvent(serviceName, clusterId,
networkPartitionId, partitionId, memberId, lbClusterId,
publicIp, privateIp, context);
}
>>>>>>>
public static void handleMemberSpawned(String serviceName,
String clusterId, String partitionId,
String privateIp, String publicIp, MemberContext context) {
// adding the new member to the cluster after it is successfully started
// in IaaS.
Topology topology = TopologyManager.getTopology();
Service service = topology.getService(serviceName);
Cluster cluster = service.getCluster(clusterId);
String memberId = context.getMemberId();
String networkPartitionId = context.getNetworkPartitionId();
String lbClusterId = context.getLbClusterId();
if (cluster.memberExists(memberId)) {
log.warn(String.format("Member %s already exists", memberId));
return;
}
try {
TopologyManager.acquireWriteLock();
Member member = new Member(serviceName, clusterId,
networkPartitionId, partitionId, memberId);
//member.setStatus(MemberStatus.Created);
member.setMemberIp(privateIp);
member.setLbClusterId(lbClusterId);
member.setMemberPublicIp(publicIp);
member.setProperties(CloudControllerUtil.toJavaUtilProperties(context.getProperties()));
cluster.addMember(member);
TopologyManager.updateTopology(topology);
} finally {
TopologyManager.releaseWriteLock();
}
TopologyEventPublisher.sendInstanceSpawnedEvent(serviceName, clusterId,
networkPartitionId, partitionId, memberId, lbClusterId,
publicIp, privateIp, context);
}
<<<<<<<
if (member == null) {
log.warn(String.format("Member with member id %s does not exist",
memberId));
return;
}
=======
if (member == null) {
log.warn(String.format("Member with nodeID %s does not exist",
memberId));
return;
}
>>>>>>>
if (member == null) {
log.warn(String.format("Member with nodeID %s does not exist",
memberId));
return;
} |
<<<<<<<
import org.apache.stratos.cloud.controller.pojo.CartridgeConfig;
import org.apache.stratos.cloud.controller.pojo.CartridgeInfo;
import org.apache.stratos.cloud.controller.pojo.Property;
=======
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPartitionExceptionException;
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPolicyExceptionException;
import org.apache.stratos.cloud.controller.pojo.*;
import org.apache.stratos.cloud.controller.pojo.Properties;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceIllegalArgumentExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeDefinitionExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeTypeExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidIaasProviderExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceUnregisteredCartridgeExceptionException;
>>>>>>>
import org.apache.stratos.cloud.controller.pojo.CartridgeConfig;
import org.apache.stratos.cloud.controller.pojo.CartridgeInfo;
import org.apache.stratos.cloud.controller.pojo.Property;
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPartitionExceptionException;
import org.apache.stratos.autoscaler.stub.AutoScalerServiceInvalidPolicyExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceIllegalArgumentExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeDefinitionExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidCartridgeTypeExceptionException;
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceInvalidIaasProviderExceptionException;
<<<<<<<
=======
// LB cartridges won't go thru this method.
//TODO: this is a temp fix. proper fix is to move this logic to CartridgeSubscriptionManager
// validate cartridge alias
CartridgeSubscriptionUtils.validateCartridgeAlias(ApplicationManagementUtil.getTenantId(configurationContext), cartridgeInfoBean.getCartridgeType(), cartridgeInfoBean.getAlias());
AutoscalerServiceClient autoscalerServiceClient = getAutoscalerServiceClient();
CloudControllerServiceClient cloudControllerServiceClient =
getCloudControllerServiceClient();
CartridgeInfo cartridgeInfo;
try {
cartridgeInfo = cloudControllerServiceClient.getCartridgeInfo(cartridgeInfoBean.getCartridgeType());
} catch (RemoteException e) {
String msg = "Cannot get cartridge info: " + cartridgeInfoBean.getCartridgeType()+". Cause: "+e.getMessage();
log.error(msg, e);
throw new ADCException(msg, e);
} catch (CloudControllerServiceUnregisteredCartridgeExceptionException e) {
String msg = e.getFaultMessage().getUnregisteredCartridgeException().getMessage();
log.error(msg, e);
throw new UnregisteredCartridgeException(msg, e);
}
String cartridgeType = cartridgeInfoBean.getCartridgeType();
String deploymentPolicy = cartridgeInfoBean.getDeploymentPolicy();
String autoscalingPolicy = cartridgeInfoBean.getAutoscalePolicy();
String dataCartridgeAlias = cartridgeInfoBean.getDataCartridgeAlias();
>>>>>>>
<<<<<<<
=======
}
// return the cluster id for the lb. This is a temp fix.
private static String subscribeToLb(String cartridgeType, String loadBalancedCartridgeType, String lbAlias,
String defaultAutoscalingPolicy, String deploymentPolicy,
ConfigurationContext configurationContext, String userName, String tenantDomain, Property[] props) throws ADCException {
CartridgeSubscription cartridgeSubscription;
try {
if(log.isDebugEnabled()) {
log.debug("Subscribing to a load balancer [cartridge] "+cartridgeType+" [alias] "+lbAlias);
}
SubscriptionData subscriptionData = new SubscriptionData();
subscriptionData.setCartridgeType(cartridgeType);
subscriptionData.setCartridgeAlias(lbAlias.trim());
subscriptionData.setAutoscalingPolicyName(defaultAutoscalingPolicy);
subscriptionData.setDeploymentPolicyName(deploymentPolicy);
subscriptionData.setTenantDomain(tenantDomain);
subscriptionData.setTenantId(ApplicationManagementUtil.getTenantId(configurationContext));
subscriptionData.setTenantAdminUsername(userName);
subscriptionData.setRepositoryType("git");
//subscriptionData.setProperties(props);
subscriptionData.setPrivateRepository(false);
cartridgeSubscription =
cartridgeSubsciptionManager.subscribeToCartridgeWithProperties(subscriptionData);
//set a payload parameter to indicate the load balanced cartridge type
cartridgeSubscription.getPayloadData().add("LOAD_BALANCED_SERVICE_TYPE", loadBalancedCartridgeType);
Properties lbProperties = new Properties();
lbProperties.setProperties(props);
cartridgeSubsciptionManager.registerCartridgeSubscription(cartridgeSubscription, lbProperties);
if(log.isDebugEnabled()) {
log.debug("Successfully subscribed to a load balancer [cartridge] "+cartridgeType+" [alias] "+lbAlias);
}
} catch (Exception e) {
String msg = "Error while subscribing to load balancer cartridge [type] "+cartridgeType+". Cause: "+e.getMessage();
log.error(msg, e);
throw new ADCException(msg, e);
}
return cartridgeSubscription.getClusterDomain();
>>>>>>>
}
// return the cluster id for the lb. This is a temp fix.
/*private static String subscribeToLb(String cartridgeType, String loadBalancedCartridgeType, String lbAlias,
String defaultAutoscalingPolicy, String deploymentPolicy,
ConfigurationContext configurationContext, String userName, String tenantDomain, Property[] props) throws ADCException {
CartridgeSubscription cartridgeSubscription;
try {
if(log.isDebugEnabled()) {
log.debug("Subscribing to a load balancer [cartridge] "+cartridgeType+" [alias] "+lbAlias);
}
SubscriptionData subscriptionData = new SubscriptionData();
subscriptionData.setCartridgeType(cartridgeType);
subscriptionData.setCartridgeAlias(lbAlias.trim());
subscriptionData.setAutoscalingPolicyName(defaultAutoscalingPolicy);
subscriptionData.setDeploymentPolicyName(deploymentPolicy);
subscriptionData.setTenantDomain(tenantDomain);
subscriptionData.setTenantId(ApplicationManagementUtil.getTenantId(configurationContext));
subscriptionData.setTenantAdminUsername(userName);
subscriptionData.setRepositoryType("git");
//subscriptionData.setProperties(props);
subscriptionData.setPrivateRepository(false);
cartridgeSubscription =
cartridgeSubsciptionManager.subscribeToCartridgeWithProperties(subscriptionData);
//set a payload parameter to indicate the load balanced cartridge type
cartridgeSubscription.getPayloadData().add("LOAD_BALANCED_SERVICE_TYPE", loadBalancedCartridgeType);
Properties lbProperties = new Properties();
lbProperties.setProperties(props);
cartridgeSubsciptionManager.registerCartridgeSubscription(cartridgeSubscription, lbProperties);
if(log.isDebugEnabled()) {
log.debug("Successfully subscribed to a load balancer [cartridge] "+cartridgeType+" [alias] "+lbAlias);
}
} catch (Exception e) {
String msg = "Error while subscribing to load balancer cartridge [type] "+cartridgeType+". Cause: "+e.getMessage();
log.error(msg, e);
throw new ADCException(msg, e);
}
return cartridgeSubscription.getClusterDomain();
} */
static StratosAdminResponse unsubscribe(String alias, String tenantDomain) throws RestAPIException {
try {
cartridgeSubsciptionManager.unsubscribeFromCartridge(tenantDomain, alias);
} catch (ADCException e) {
String msg = "Failed to unsubscribe from [alias] "+alias+". Cause: "+ e.getMessage();
log.error(msg, e);
throw new RestAPIException(msg, e);
} catch (NotSubscribedException e) {
log.error(e.getMessage(), e);
throw new RestAPIException(e.getMessage(), e);
}
StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
stratosAdminResponse.setMessage("Successfully terminated the subscription with alias " + alias);
return stratosAdminResponse;
}
/**
*
* Super tenant will deploy multitenant service.
*
* get domain , subdomain as well..
* @param clusterDomain
* @param clusterSubdomain
*
*/
static StratosAdminResponse deployService(String cartridgeType, String alias, String autoscalingPolicy, String deploymentPolicy,
String tenantDomain, String tenantUsername, int tenantId, String clusterDomain, String clusterSubdomain, String tenantRange) throws RestAPIException {
log.info("Deploying service..");
try {
serviceDeploymentManager.deployService(cartridgeType, autoscalingPolicy, deploymentPolicy, tenantId, tenantRange, tenantDomain, tenantUsername);
} catch (Exception e) {
String msg = String.format("Failed to deploy the Service [Cartridge type] %s [alias] %s . Cause: %s", cartridgeType, alias, e.getMessage());
log.error(msg, e);
throw new RestAPIException(msg, e);
}
StratosAdminResponse stratosAdminResponse = new StratosAdminResponse();
stratosAdminResponse.setMessage("Successfully deployed service cluster definition with type " + cartridgeType);
return stratosAdminResponse; |
<<<<<<<
import org.apache.stratos.autoscaler.applications.pojo.ApplicationClusterContext;
import org.apache.stratos.autoscaler.applications.pojo.ApplicationContext;
import org.apache.stratos.autoscaler.applications.pojo.ArtifactRepositoryContext;
import org.apache.stratos.autoscaler.applications.pojo.CartridgeContext;
import org.apache.stratos.autoscaler.applications.pojo.ComponentContext;
import org.apache.stratos.autoscaler.applications.pojo.GroupContext;
import org.apache.stratos.autoscaler.applications.pojo.SubscribableInfoContext;
=======
import org.apache.stratos.autoscaler.applications.pojo.*;
>>>>>>>
import org.apache.stratos.autoscaler.applications.pojo.*;
<<<<<<<
=======
/**
* Validate the Auto Scalar policy removal
*
* @param autoscalePolicyId Auto Scalar policy id boolean
* @return
*/
private boolean removableAutoScalerPolicy(String autoscalePolicyId) {
Collection<ApplicationContext> applicationContexts = AutoscalerContext.getInstance().
getApplicationContexts();
for (ApplicationContext applicationContext : applicationContexts) {
if(applicationContext.getComponents().getCartridgeContexts() != null) {
for(CartridgeContext cartridgeContext : applicationContext.getComponents().
getCartridgeContexts()) {
if(autoscalePolicyId.equals(cartridgeContext.getSubscribableInfoContext().
getAutoscalingPolicyUuid())) {
return false;
}
}
}
if(applicationContext.getComponents().getGroupContexts() != null) {
return findAutoscalingPolicyInGroup(applicationContext.getComponents().getGroupContexts(),
autoscalePolicyId);
}
}
return true;
}
private boolean findAutoscalingPolicyInGroup(GroupContext[] groupContexts,
String autoscalePolicyId) {
for(GroupContext groupContext : groupContexts) {
if(groupContext.getCartridgeContexts() != null) {
for(CartridgeContext cartridgeContext : groupContext.getCartridgeContexts()) {
if(autoscalePolicyId.equals(cartridgeContext.getSubscribableInfoContext().
getAutoscalingPolicyUuid())) {
return false;
}
}
}
if(groupContext.getGroupContexts() != null) {
return findAutoscalingPolicyInGroup(groupContext.getGroupContexts(),
autoscalePolicyId);
}
}
return true;
}
/**
* Validate the deployment policy removal
*
* @param deploymentPolicyId
* @return
*/
private boolean removableDeploymentPolicy(String deploymentPolicyId) {
boolean canRemove = true;
Map<String, Application> applications = ApplicationHolder.getApplications().getApplications();
for (Application application : applications.values()) {
List<String> deploymentPolicyIdsReferredInApplication = AutoscalerUtil.
getDeploymentPolicyIdsReferredInApplication(application.getUniqueIdentifier());
for (String deploymentPolicyIdInApp : deploymentPolicyIdsReferredInApplication) {
if (deploymentPolicyId.equals(deploymentPolicyIdInApp)) {
canRemove = false;
}
}
}
return canRemove;
}
>>>>>>>
/**
* Validate the Auto Scalar policy removal
*
* @param autoscalePolicyId Auto Scalar policy id boolean
* @return
*/
private boolean removableAutoScalerPolicy(String autoscalePolicyId) {
Collection<ApplicationContext> applicationContexts = AutoscalerContext.getInstance().
getApplicationContexts();
for (ApplicationContext applicationContext : applicationContexts) {
if(applicationContext.getComponents().getCartridgeContexts() != null) {
for(CartridgeContext cartridgeContext : applicationContext.getComponents().
getCartridgeContexts()) {
if(autoscalePolicyId.equals(cartridgeContext.getSubscribableInfoContext().
getAutoscalingPolicyUuid())) {
return false;
}
}
}
if(applicationContext.getComponents().getGroupContexts() != null) {
return findAutoscalingPolicyInGroup(applicationContext.getComponents().getGroupContexts(),
autoscalePolicyId);
}
}
return true;
}
private boolean findAutoscalingPolicyInGroup(GroupContext[] groupContexts,
String autoscalePolicyId) {
for(GroupContext groupContext : groupContexts) {
if(groupContext.getCartridgeContexts() != null) {
for(CartridgeContext cartridgeContext : groupContext.getCartridgeContexts()) {
if(autoscalePolicyId.equals(cartridgeContext.getSubscribableInfoContext().
getAutoscalingPolicyUuid())) {
return false;
}
}
}
if(groupContext.getGroupContexts() != null) {
return findAutoscalingPolicyInGroup(groupContext.getGroupContexts(),
autoscalePolicyId);
}
}
return true;
}
/**
* Validate the deployment policy removal
*
* @param deploymentPolicyId
* @return
*/
private boolean removableDeploymentPolicy(String deploymentPolicyId) {
boolean canRemove = true;
Map<String, Application> applications = ApplicationHolder.getApplications().getApplications();
for (Application application : applications.values()) {
List<String> deploymentPolicyIdsReferredInApplication = AutoscalerUtil.
getDeploymentPolicyIdsReferredInApplication(application.getUniqueIdentifier());
for (String deploymentPolicyIdInApp : deploymentPolicyIdsReferredInApplication) {
if (deploymentPolicyId.equals(deploymentPolicyIdInApp)) {
canRemove = false;
}
}
}
return canRemove;
}
<<<<<<<
// Create application clusters in cloud controller and send application created event
ApplicationBuilder.handleApplicationDeployment(application,
applicationContext.getComponents().getApplicationClusterContexts());
log.info("Waiting for application clusters to be created: [application-id] " +
applicationId);
=======
log.info("Waiting for application clusters to be created: [application-uuid] " + applicationUuid);
>>>>>>>
log.info("Waiting for application clusters to be created: [application-uuid] " + applicationUuid);
<<<<<<<
String msg = String.format("Partition algorithm is not valid: [deployment-policy-id] %s " +
"[network-partition-id] %s [partition-algorithm] %s. : " +
"Partition algorithm should be either one-after-another or round-robin ",
deploymentPolicyId, networkPartitionId, partitionAlgorithm);
log.error(msg);
throw new InvalidDeploymentPolicyException(msg);
=======
String message = String.format("Partition algorithm is not valid: [tenant-id] %d " +
"[deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-uuid] %s " +
"[network-partition-id] %s [partition-algorithm] %s", deploymentPolicy.getTenantId(),
deploymentPolicyUuid, deploymentPolicyId, networkPartitionRef.getUuid(), networkPartitionId,
partitionAlgorithm);
log.error(message);
throw new InvalidDeploymentPolicyException(message);
>>>>>>>
String message = String.format("Partition algorithm is not valid: [tenant-id] %d " +
"[deployment-policy-uuid] %s [deployment-policy-id] %s [network-partition-uuid] %s " +
"[network-partition-id] %s [partition-algorithm] %s", deploymentPolicy.getTenantId(),
deploymentPolicyUuid, deploymentPolicyId, networkPartitionRef.getUuid(), networkPartitionId,
partitionAlgorithm);
log.error(message);
throw new InvalidDeploymentPolicyException(message);
<<<<<<<
NetworkPartitionContext clusterLevelNetworkPartitionContext
= clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getId());
if (clusterLevelNetworkPartitionContext != null) {
try {
addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
deploymentPolicy.getDeploymentPolicyID(), clusterMonitor.getClusterContext().getServiceId());
} catch (RemoteException e) {
String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
" [deployment-policy] " + deploymentPolicy.getDeploymentPolicyID();
log.error(message);
throw new CloudControllerConnectionException(message, e);
} catch (CloudControllerServiceInvalidPartitionExceptionException e) {
String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getDeploymentPolicyID();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
} catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getDeploymentPolicyID() + " [cartridge] "
+ clusterMonitor.getClusterContext().getServiceId();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
}
removeOldPartitionsFromClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition);
=======
ClusterLevelNetworkPartitionContext clusterLevelNetworkPartitionContext
= clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getUuid());
try {
addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
deploymentPolicy.getUuid(), clusterMonitor.getClusterContext().getServiceId());
} catch (RemoteException e) {
String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
" [deployment-policy] " + deploymentPolicy.getId();
log.error(message);
throw new CloudControllerConnectionException(message, e);
} catch (CloudControllerServiceInvalidPartitionExceptionException e) {
String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getId();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
} catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getId() + " [cartridge] "
+ clusterMonitor.getClusterContext().getServiceId();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
>>>>>>>
NetworkPartitionContext clusterLevelNetworkPartitionContext
= clusterMonitor.getClusterContext().getNetworkPartitionCtxt(networkPartition.getId());
if (clusterLevelNetworkPartitionContext != null) {
try {
addNewPartitionsToClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition,
deploymentPolicy.getUuid(), clusterMonitor.getClusterContext().getServiceId());
} catch (RemoteException e) {
String message = "Connection to cloud controller failed, Cluster monitor update failed for" +
" [deployment-policy] " + deploymentPolicy.getId();
log.error(message);
throw new CloudControllerConnectionException(message, e);
} catch (CloudControllerServiceInvalidPartitionExceptionException e) {
String message = "Invalid partition, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getId();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
} catch (CloudControllerServiceInvalidCartridgeTypeExceptionException e) {
String message = "Invalid cartridge type, Cluster monitor update failed for [deployment-policy] "
+ deploymentPolicy.getId() + " [cartridge] "
+ clusterMonitor.getClusterContext().getServiceId();
log.error(message);
throw new InvalidDeploymentPolicyException(message, e);
}
removeOldPartitionsFromClusterMonitor(clusterLevelNetworkPartitionContext, networkPartition);
<<<<<<<
if (AutoscalerUtil.removableDeploymentPolicy(deploymentPolicyID)) {
PolicyManager.getInstance().removeDeploymentPolicy(deploymentPolicyID);
=======
if (removableDeploymentPolicy(deploymentPolicyId)) {
PolicyManager.getInstance().removeDeploymentPolicy(deploymentPolicyId);
>>>>>>>
if (removableDeploymentPolicy(deploymentPolicyId)) {
PolicyManager.getInstance().removeDeploymentPolicy(deploymentPolicyId); |
<<<<<<<
=======
import org.apache.stratos.cloud.controller.stub.domain.NetworkPartition;
import org.apache.stratos.common.client.CloudControllerServiceClient;
>>>>>>>
import org.apache.stratos.cloud.controller.stub.domain.NetworkPartition;
import org.apache.stratos.common.client.CloudControllerServiceClient;
<<<<<<<
=======
* @param isPrimary Is a primary member
* @param autoscalingReason scaling reason for member
* @param scalingTime scaling time
>>>>>>>
* @param isPrimary Is a primary member
* @param autoscalingReason scaling reason for member
* @param scalingTime scaling time
<<<<<<<
String clusterInstanceId) {
=======
String clusterInstanceId, boolean isPrimary, String autoscalingReason, long scalingTime) {
>>>>>>>
String clusterInstanceId, boolean isPrimary, String autoscalingReason, long scalingTime) {
<<<<<<<
minimumCountOfNetworkPartition);
=======
isPrimary,
minimumCountOfNetworkPartition, autoscalingReason, scalingTime);
>>>>>>>
isPrimary,
minimumCountOfNetworkPartition, autoscalingReason, scalingTime); |
<<<<<<<
log.debug("Adding meta data details");
=======
>>>>>>>
log.debug("Adding meta data details");
<<<<<<<
if(log.isDebugEnabled())
log.debug(String.format("A resource added to: %s", resourcePath));
=======
if(log.isDebugEnabled()){
log.debug("A resource added to: " + resourcePath);
}
>>>>>>>
if(log.isDebugEnabled()){
log.debug("A resource added to: " + resourcePath);
}
<<<<<<<
=======
>>>>>>> |
<<<<<<<
=======
import org.apache.stratos.messaging.message.receiver.application.status.ApplicationStatusEventReceiver;
import org.apache.stratos.messaging.util.Constants;
>>>>>>>
import org.apache.stratos.messaging.message.receiver.application.status.ApplicationStatusEventReceiver;
import org.apache.stratos.messaging.util.Constants;
<<<<<<<
private static final Log LOG = LogFactory
.getLog(CloudControllerDSComponent.class);
protected void activate(ComponentContext context) {
try {
// Start instance status event message listener
TopicSubscriber subscriber = new TopicSubscriber(
CloudControllerConstants.INSTANCE_TOPIC);
subscriber.setMessageListener(
new InstanceStatusEventMessageListener());
Thread tsubscriber = new Thread(subscriber);
tsubscriber.start();
// Start instance status message delegator
InstanceStatusEventMessageDelegator delegator =
new InstanceStatusEventMessageDelegator();
Thread tdelegator = new Thread(delegator);
tdelegator.start();
// Register cloud controller service
BundleContext bundleContext = context.getBundleContext();
bundleContext.registerService(CloudControllerService.class.getName(),
new CloudControllerServiceImpl(), null);
if (LOG.isInfoEnabled()) {
LOG.info("Scheduling tasks");
}
TopologySynchronizerTaskScheduler.schedule(ServiceReferenceHolder
.getInstance().getTaskService());
} catch (Throwable e) {
LOG.error("Cloud Controller Service bundle is failed to activate.", e);
}
}
protected void setTaskService(TaskService taskService) {
if (LOG.isDebugEnabled()) {
LOG.debug("Setting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(taskService);
}
protected void unsetTaskService(TaskService taskService) {
if (LOG.isDebugEnabled()) {
LOG.debug("Unsetting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(null);
}
=======
private static final Log log = LogFactory.getLog(CloudControllerDSComponent.class);
private ApplicationStatusTopicReceiver applicationStatusTopicReceiver;
protected void activate(ComponentContext context) {
try {
// Start instance status event message listener
TopicSubscriber subscriber = new TopicSubscriber(CloudControllerConstants.INSTANCE_TOPIC);
subscriber.setMessageListener(new InstanceStatusEventMessageListener());
Thread tsubscriber = new Thread(subscriber);
tsubscriber.start();
// Start instance status message delegator
InstanceStatusEventMessageDelegator delegator = new InstanceStatusEventMessageDelegator();
Thread tdelegator = new Thread(delegator);
tdelegator.start();
applicationStatusTopicReceiver = new ApplicationStatusTopicReceiver();
Thread appThread = new Thread(applicationStatusTopicReceiver);
appThread.start();
if (log.isDebugEnabled()) {
log.debug("Application status Receiver thread started");
}
// Register cloud controller service
BundleContext bundleContext = context.getBundleContext();
bundleContext.registerService(CloudControllerService.class.getName(), new CloudControllerServiceImpl(), null);
if(log.isInfoEnabled()) {
log.info("Scheduling tasks");
}
TopologySynchronizerTaskScheduler
.schedule(ServiceReferenceHolder.getInstance()
.getTaskService());
} catch (Throwable e) {
log.error("******* Cloud Controller Service bundle is failed to activate ****", e);
}
}
protected void setTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Setting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(taskService);
}
protected void unsetTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Unsetting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(null);
}
>>>>>>>
private static final Log log = LogFactory.getLog(CloudControllerDSComponent.class);
protected void activate(ComponentContext context) {
try {
// Start instance status event message listener
TopicSubscriber subscriber = new TopicSubscriber(CloudControllerConstants.INSTANCE_TOPIC);
subscriber.setMessageListener(new InstanceStatusEventMessageListener());
Thread tsubscriber = new Thread(subscriber);
tsubscriber.start();
// Start instance status message delegator
InstanceStatusEventMessageDelegator delegator = new InstanceStatusEventMessageDelegator();
Thread tdelegator = new Thread(delegator);
tdelegator.start();
// Register cloud controller service
BundleContext bundleContext = context.getBundleContext();
bundleContext.registerService(CloudControllerService.class.getName(), new CloudControllerServiceImpl(), null);
if(log.isInfoEnabled()) {
log.info("Scheduling tasks");
}
TopologySynchronizerTaskScheduler
.schedule(ServiceReferenceHolder.getInstance()
.getTaskService());
} catch (Throwable e) {
log.error("******* Cloud Controller Service bundle is failed to activate ****", e);
}
}
protected void setTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Setting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(taskService);
}
protected void unsetTaskService(TaskService taskService) {
if (log.isDebugEnabled()) {
log.debug("Unsetting the Task Service");
}
ServiceReferenceHolder.getInstance().setTaskService(null);
} |
<<<<<<<
=======
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceUnregisteredCartridgeExceptionException;
import org.apache.stratos.manager.client.AutoscalerServiceClient;
>>>>>>>
import org.apache.stratos.cloud.controller.stub.CloudControllerServiceUnregisteredCartridgeExceptionException; |
<<<<<<<
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
=======
import java.util.*;
>>>>>>>
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.*;
<<<<<<<
this.pendingMembers = new ArrayList<MemberContext>();
this.activeMembers = new ArrayList<MemberContext>();
this.terminationPendingMembers = new ArrayList<MemberContext>();
this.obsoletedMembers = new ConcurrentHashMap<String, MemberContext>();
=======
// TODO: fix properly, maybe with CopyOnWriteArrayList?
this.pendingMembers = Collections.synchronizedList(new ArrayList<MemberContext>());
this.activeMembers = Collections.synchronizedList(new ArrayList<MemberContext>());
this.terminationPendingMembers = Collections.synchronizedList(new ArrayList<MemberContext>());
this.obsoletedMembers = new CopyOnWriteArrayList<String>();
>>>>>>>
this.pendingMembers = new ArrayList<MemberContext>();
this.activeMembers = new ArrayList<MemberContext>();
this.terminationPendingMembers = new ArrayList<MemberContext>();
this.obsoletedMembers = new ConcurrentHashMap<String, MemberContext>(); |
<<<<<<<
private Set<String> domains;
private Persistence persistence;
private Properties properties;
public SubscriptionData() {
this.domains = new HashSet<String>();
}
=======
private Set<String> domains;
private String serviceName;
public SubscriptionData() {
this.domains = new HashSet<String>();
}
>>>>>>>
private Set<String> domains;
private Persistence persistence;
private Properties properties;
private String serviceName;
public SubscriptionData() {
this.domains = new HashSet<String>();
}
<<<<<<<
public void addDomains(Set<String> domains) {
domains.addAll(domains);
}
public void removeDomain(String domain) {
domains.remove(domain);
}
public void removeDomains(Set<String> domains) {
domains.removeAll(domains);
}
public Set<String> getDomains() {
return Collections.unmodifiableSet(domains);
}
public Persistence getPersistence() {
return persistence;
}
public void setPersistence(Persistence persistence) {
this.persistence = persistence;
}
public Properties getProperties() {
return properties;
}
public void setProperties(Properties properties) {
this.properties = properties;
}
=======
public void addDomains(Set<String> domains) {
domains.addAll(domains);
}
public void removeDomain(String domain) {
domains.remove(domain);
}
public void removeDomains(Set<String> domains) {
domains.removeAll(domains);
}
public Set<String> getDomains() {
return Collections.unmodifiableSet(domains);
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
}
>>>>>>>
public void addDomains(Set<String> domains) {
domains.addAll(domains);
}
public void removeDomain(String domain) {
domains.remove(domain);
}
public void removeDomains(Set<String> domains) {
domains.removeAll(domains);
}
public Set<String> getDomains() {
return Collections.unmodifiableSet(domains);
}
public Persistence getPersistence() {
return persistence;
}
public void setPersistence(Persistence persistence) {
this.persistence = persistence;
}
public Properties getProperties() {
return properties;
}
public void setProperties(Properties properties) {
this.properties = properties;
}
public String getServiceName() {
return serviceName;
}
public void setServiceName(String serviceName) {
this.serviceName = serviceName;
} |
<<<<<<<
private PersistenceBean persistence;
private List<PropertyBean> property;
public CartridgeInfoBean() {
}
=======
private List<String> domains;
public CartridgeInfoBean() {
this.domains = new ArrayList<String>();
}
>>>>>>>
private PersistenceBean persistence;
private List<PropertyBean> property;
private List<String> domains;
public CartridgeInfoBean() {
this.domains = new ArrayList<String>();
}
<<<<<<<
public PersistenceBean getPersistence() {
return persistence;
}
public void setPersistence(PersistenceBean persistence) {
this.persistence = persistence;
}
public List<PropertyBean> getProperty() {
return property;
}
public void setProperty(List<PropertyBean> property) {
this.property = property;
}
=======
public List<String> getDomains() { return domains; }
public void setDomains(List<String> domains) { this.domains = domains; }
>>>>>>>
public PersistenceBean getPersistence() {
return persistence;
}
public void setPersistence(PersistenceBean persistence) {
this.persistence = persistence;
}
public List<PropertyBean> getProperty() {
return property;
}
public void setProperty(List<PropertyBean> property) {
this.property = property;
}
public List<String> getDomains() { return domains; }
public void setDomains(List<String> domains) { this.domains = domains; } |
<<<<<<<
public static final String VMService_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.vm.service";
public static final String VMLb_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.vm.lb";
public static final String KubernetesService_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.kubernetes.service";
/**
* PortRange min max
*/
public static final int PORT_RANGE_MAX = 65535;
public static final int PORT_RANGE_MIN = 1;
=======
public static final String AUTOSCALER_MONITOR_INTERVAL = "autoscaler.monitorInterval";
public static final String SERVICE_GROUP = "/groups";
>>>>>>>
public static final String AUTOSCALER_MONITOR_INTERVAL = "autoscaler.monitorInterval";
public static final String SERVICE_GROUP = "/groups";
public static final String VMService_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.vm.service";
public static final String VMLb_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.vm.lb";
public static final String KubernetesService_Cluster_MONITOR_INTERVAL = "autoscaler.monitorInterval.kubernetes.service";
/**
* PortRange min max
*/
public static final int PORT_RANGE_MAX = 65535;
public static final int PORT_RANGE_MIN = 1; |
<<<<<<<
import org.apache.stratos.autoscaler.stub.*;
import org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster;
import org.apache.stratos.autoscaler.stub.policy.model.AutoscalePolicy;
=======
import org.apache.stratos.autoscaler.applications.pojo.stub.ApplicationContext;
import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
import org.apache.stratos.autoscaler.stub.*;
import org.apache.stratos.autoscaler.stub.pojo.ServiceGroup;
>>>>>>>
import org.apache.stratos.autoscaler.stub.*;
import org.apache.stratos.autoscaler.stub.deployment.policy.DeploymentPolicy;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesGroup;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesHost;
import org.apache.stratos.autoscaler.stub.kubernetes.KubernetesMaster;
import org.apache.stratos.autoscaler.stub.policy.model.AutoscalePolicy;
import org.apache.stratos.autoscaler.applications.pojo.stub.ApplicationContext;
import org.apache.stratos.autoscaler.deployment.policy.DeploymentPolicy;
import org.apache.stratos.autoscaler.policy.model.AutoscalePolicy;
import org.apache.stratos.autoscaler.stub.*;
import org.apache.stratos.autoscaler.stub.pojo.ServiceGroup;
<<<<<<<
public void updateClusterMonitor(String clusterId, Properties properties) throws RemoteException, AutoScalerServiceInvalidArgumentExceptionException {
stub.updateClusterMonitor(clusterId, properties);
}
=======
public ServiceGroup getServiceGroup(String serviceGroupDefinitionName) throws RemoteException {
return stub.getServiceGroup(serviceGroupDefinitionName);
}
public void deployServiceGroup(ServiceGroup serviceGroup) throws AutoScalerServiceInvalidServiceGroupExceptionException, RemoteException {
stub.deployServiceGroup(serviceGroup);
}
public void deployApplication (ApplicationContext applicationContext) throws
AutoScalerServiceApplicationDefinitionExceptionException, RemoteException {
stub.deployApplicationDefinition(applicationContext);
}
public void undeployApplication (String applicationId, int tenantId, String tenantDomain) throws
AutoScalerServiceApplicationDefinitionExceptionException, RemoteException {
stub.unDeployApplicationDefinition(applicationId, tenantId, tenantDomain);
}
>>>>>>>
public void updateClusterMonitor(String clusterId, Properties properties) throws RemoteException, AutoScalerServiceInvalidArgumentExceptionException {
stub.updateClusterMonitor(clusterId, properties);
} |
<<<<<<<
if (!ctxt.getListOfVolumes().isEmpty()) {
for (Volume volume : ctxt.getListOfVolumes()) {
iaas.attachVolume(instanceId, volume.getId(), volume.getDevice());
}
}
=======
try {
iaas.attachVolume(instanceId, ctxt.getVolumeId(),
ctxt.getDeviceName());
} catch (Exception e) {
//continue without throwing an exception, since there is an instance already running
log.error("Attaching Volume to Instance [ " + instanceId + " ] failed!", e);
}
>>>>>>>
if (!ctxt.getListOfVolumes().isEmpty()) {
for (Volume volume : ctxt.getListOfVolumes()) {
try {
iaas.attachVolume(instanceId, volume.getId(), volume.getDevice());
} catch (Exception e) {
//continue without throwing an exception, since there is an instance already running
log.error("Attaching Volume to Instance [ " + instanceId + " ] failed!", e);
}
}
} |
<<<<<<<
import org.apache.stratos.autoscaler.exception.NonExistingKubernetesGroupException;
=======
import org.apache.stratos.autoscaler.exception.CartridgeInformationException;
>>>>>>>
import org.apache.stratos.autoscaler.exception.NonExistingKubernetesGroupException;
import org.apache.stratos.autoscaler.exception.CartridgeInformationException;
<<<<<<<
import org.apache.stratos.cloud.controller.stub.pojo.ContainerClusterContext;
=======
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo;
>>>>>>>
import org.apache.stratos.cloud.controller.stub.pojo.ContainerClusterContext;
import org.apache.stratos.cloud.controller.stub.pojo.CartridgeInfo; |
<<<<<<<
=======
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
import org.apache.stratos.messaging.util.Constants;
>>>>>>>
import org.apache.stratos.messaging.message.receiver.topology.TopologyManager;
import org.apache.stratos.messaging.util.Constants;
<<<<<<<
RepositoryTransportException {
=======
RepositoryTransportException, RestAPIException {
// LB cartridges won't go thru this method.
>>>>>>>
RepositoryTransportException, RestAPIException { |
<<<<<<<
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import java.rmi.RemoteException;
import java.util.*;
import java.util.regex.Pattern;
=======
>>>>>>>
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import java.rmi.RemoteException;
import java.util.*;
import java.util.regex.Pattern; |
<<<<<<<
import org.apache.stratos.rest.endpoint.ServiceHolder;
import org.apache.stratos.rest.endpoint.Utils;
import org.apache.stratos.tenant.mgt.core.TenantPersistor;
import org.apache.stratos.tenant.mgt.util.TenantMgtUtil;
=======
import org.wso2.carbon.tenant.mgt.core.TenantPersistor;
import org.wso2.carbon.tenant.mgt.util.TenantMgtUtil;
>>>>>>>
import org.apache.stratos.rest.endpoint.ServiceHolder;
import org.apache.stratos.rest.endpoint.Utils;
import org.wso2.carbon.tenant.mgt.core.TenantPersistor;
import org.wso2.carbon.tenant.mgt.util.TenantMgtUtil; |
<<<<<<<
//has scaling dependents
protected boolean hasScalingDependents;
=======
protected boolean isGroupScalingEnabled;
>>>>>>>
//has scaling dependents
protected boolean isGroupScalingEnabled;
<<<<<<<
/**
* Return whether this monitor has scaling dependencies
*
* @return startup dependencies exist or not
*/
public boolean hasScalingDependents() {
return hasScalingDependents;
=======
public boolean isGroupScalingEnabled() {
return isGroupScalingEnabled;
>>>>>>>
/**
* Return whether this monitor has scaling dependencies
*
* @return startup dependencies exist or not
*/
public boolean isGroupScalingEnabled() {
return isGroupScalingEnabled;
<<<<<<<
/**
* To set whether monitor has any scaling dependencies
*
* @param hasDependent
*/
public void setHasScalingDependents(boolean hasDependent) {
this.hasScalingDependents = hasDependent;
=======
public void setGroupScalingEnabled(boolean hasDependent) {
this.isGroupScalingEnabled = hasDependent;
>>>>>>>
/**
* To set whether monitor has any scaling dependencies
*
* @param hasDependent
*/
public void setGroupScalingEnabled(boolean hasDependent) {
this.isGroupScalingEnabled = hasDependent; |
<<<<<<<
/** package */
CharDifference.Builder newCharDifference(
int leftIndex, int rightIndex, char difference, DifferenceType type) {
return CharDifference.newBuilder()
.setFirstStringIndex(leftIndex)
.setSecondStringIndex(rightIndex)
=======
TextChange.Builder newTextChange(int index, char difference, Type type) {
return TextChange.newBuilder()
.setIndex(index)
>>>>>>>
/** package */
TextChange.Builder newTextChange(int leftIndex, int rightIndex, char difference, Type type) {
return TextChange.newBuilder()
.setFirstStringIndex(leftIndex)
.setSecondStringIndex(rightIndex)
<<<<<<<
newCharDifference(0, 0, 'A', DifferenceType.ADDITION).build(),
newCharDifference(0, 1, 'd', DifferenceType.ADDITION).build(),
newCharDifference(0, 2, 'd', DifferenceType.ADDITION).build(),
newCharDifference(0, 3, 'i', DifferenceType.ADDITION).build(),
newCharDifference(0, 4, 't', DifferenceType.ADDITION).build(),
newCharDifference(0, 5, 'i', DifferenceType.ADDITION).build(),
newCharDifference(0, 6, 'o', DifferenceType.ADDITION).build(),
newCharDifference(0, 7, 'n', DifferenceType.ADDITION).build(),
newCharDifference(0, 8, '.', DifferenceType.ADDITION).build()),
TextDifferencer.getAllTextDifferences("", "Addition."));
=======
newTextChange(0, 'A', Type.ADD).build(),
newTextChange(1, 'd', Type.ADD).build(),
newTextChange(2, 'd', Type.ADD).build(),
newTextChange(3, 'i', Type.ADD).build(),
newTextChange(4, 't', Type.ADD).build(),
newTextChange(5, 'i', Type.ADD).build(),
newTextChange(6, 'o', Type.ADD).build(),
newTextChange(7, 'n', Type.ADD).build(),
newTextChange(8, '.', Type.ADD).build()),
TextDifferencer.getAllTextChanges("", "Addition."));
>>>>>>>
newTextChange(0, 0, 'A', Type.ADD).build(),
newTextChange(0, 1, 'd', Type.ADD).build(),
newTextChange(0, 2, 'd', Type.ADD).build(),
newTextChange(0, 3, 'i', Type.ADD).build(),
newTextChange(0, 4, 't', Type.ADD).build(),
newTextChange(0, 5, 'i', Type.ADD).build(),
newTextChange(0, 6, 'o', Type.ADD).build(),
newTextChange(0, 7, 'n', Type.ADD).build(),
newTextChange(0, 8, '.', Type.ADD).build()),
TextDifferencer.getAllTextChanges("", "Addition."));
<<<<<<<
newCharDifference(0, 0, 'D', DifferenceType.DELETION).build(),
newCharDifference(1, 0, 'e', DifferenceType.DELETION).build(),
newCharDifference(2, 0, 'l', DifferenceType.DELETION).build(),
newCharDifference(3, 0, 'e', DifferenceType.DELETION).build(),
newCharDifference(4, 0, 't', DifferenceType.DELETION).build(),
newCharDifference(5, 0, 'i', DifferenceType.DELETION).build(),
newCharDifference(6, 0, 'o', DifferenceType.DELETION).build(),
newCharDifference(7, 0, 'n', DifferenceType.DELETION).build(),
newCharDifference(8, 0, '.', DifferenceType.DELETION).build()),
TextDifferencer.getAllTextDifferences("Deletion.", ""));
=======
newTextChange(0, 'D', Type.DELETE).build(),
newTextChange(1, 'e', Type.DELETE).build(),
newTextChange(2, 'l', Type.DELETE).build(),
newTextChange(3, 'e', Type.DELETE).build(),
newTextChange(4, 't', Type.DELETE).build(),
newTextChange(5, 'i', Type.DELETE).build(),
newTextChange(6, 'o', Type.DELETE).build(),
newTextChange(7, 'n', Type.DELETE).build(),
newTextChange(8, '.', Type.DELETE).build()),
TextDifferencer.getAllTextChanges("Deletion.", ""));
>>>>>>>
newTextChange(0, 0, 'D', Type.DELETE).build(),
newTextChange(1, 0, 'e', Type.DELETE).build(),
newTextChange(2, 0, 'l', Type.DELETE).build(),
newTextChange(3, 0, 'e', Type.DELETE).build(),
newTextChange(4, 0, 't', Type.DELETE).build(),
newTextChange(5, 0, 'i', Type.DELETE).build(),
newTextChange(6, 0, 'o', Type.DELETE).build(),
newTextChange(7, 0, 'n', Type.DELETE).build(),
newTextChange(8, 0, '.', Type.DELETE).build()),
TextDifferencer.getAllTextChanges("Deletion.", ""));
<<<<<<<
newCharDifference(0, 0, 'N', DifferenceType.NO_CHANGE).build(),
newCharDifference(1, 1, 'o', DifferenceType.NO_CHANGE).build(),
newCharDifference(2, 2, ' ', DifferenceType.NO_CHANGE).build(),
newCharDifference(3, 3, 'C', DifferenceType.NO_CHANGE).build(),
newCharDifference(4, 4, 'h', DifferenceType.NO_CHANGE).build(),
newCharDifference(5, 5, 'a', DifferenceType.NO_CHANGE).build(),
newCharDifference(6, 6, 'n', DifferenceType.NO_CHANGE).build(),
newCharDifference(7, 7, 'g', DifferenceType.NO_CHANGE).build(),
newCharDifference(8, 8, 'e', DifferenceType.NO_CHANGE).build(),
newCharDifference(9, 9, '.', DifferenceType.NO_CHANGE).build()),
TextDifferencer.getAllTextDifferences("No Change.", "No Change."));
=======
newTextChange(0, 'N', Type.NO_CHANGE).build(),
newTextChange(1, 'o', Type.NO_CHANGE).build(),
newTextChange(2, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 'e', Type.NO_CHANGE).build(),
newTextChange(9, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("No Change.", "No Change."));
>>>>>>>
newTextChange(0, 0, 'N', Type.NO_CHANGE).build(),
newTextChange(1, 1, 'o', Type.NO_CHANGE).build(),
newTextChange(2, 2, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 3, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 4, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 5, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 6, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 7, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 8, 'e', Type.NO_CHANGE).build(),
newTextChange(9, 9, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("No Change.", "No Change."));
<<<<<<<
newCharDifference(0, 0, 'N', DifferenceType.DELETION).build(),
newCharDifference(1, 0, 'o', DifferenceType.DELETION).build(),
newCharDifference(1, 0, 'W', DifferenceType.ADDITION).build(),
newCharDifference(1, 1, 'i', DifferenceType.ADDITION).build(),
newCharDifference(1, 2, 't', DifferenceType.ADDITION).build(),
newCharDifference(1, 3, 'h', DifferenceType.ADDITION).build(),
newCharDifference(2, 4, ' ', DifferenceType.NO_CHANGE).build(),
newCharDifference(3, 5, 'C', DifferenceType.NO_CHANGE).build(),
newCharDifference(4, 6, 'h', DifferenceType.NO_CHANGE).build(),
newCharDifference(5, 7, 'a', DifferenceType.NO_CHANGE).build(),
newCharDifference(6, 8, 'n', DifferenceType.NO_CHANGE).build(),
newCharDifference(7, 9, 'g', DifferenceType.NO_CHANGE).build(),
newCharDifference(8, 10, 'e', DifferenceType.NO_CHANGE).build(),
newCharDifference(9, 11, '.', DifferenceType.NO_CHANGE).build()),
TextDifferencer.getAllTextDifferences("No Change.", "With Change."));
=======
newTextChange(0, 'N', Type.DELETE).build(),
newTextChange(1, 'o', Type.DELETE).build(),
newTextChange(0, 'W', Type.ADD).build(),
newTextChange(1, 'i', Type.ADD).build(),
newTextChange(2, 't', Type.ADD).build(),
newTextChange(3, 'h', Type.ADD).build(),
newTextChange(2, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 'e', Type.NO_CHANGE).build(),
newTextChange(9, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("No Change.", "With Change."));
>>>>>>>
newTextChange(0, 0, 'N', Type.DELETE).build(),
newTextChange(1, 0, 'o', Type.DELETE).build(),
newTextChange(1, 0, 'W', Type.ADD).build(),
newTextChange(1, 1, 'i', Type.ADD).build(),
newTextChange(1, 2, 't', Type.ADD).build(),
newTextChange(1, 3, 'h', Type.ADD).build(),
newTextChange(2, 4, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 5, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 6, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 7, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 8, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 9, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 10, 'e', Type.NO_CHANGE).build(),
newTextChange(9, 11, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("No Change.", "With Change."));
<<<<<<<
newCharDifference(0, 0, 'W', DifferenceType.NO_CHANGE).build(),
newCharDifference(1, 1, 'i', DifferenceType.NO_CHANGE).build(),
newCharDifference(2, 2, 't', DifferenceType.NO_CHANGE).build(),
newCharDifference(3, 3, 'h', DifferenceType.NO_CHANGE).build(),
newCharDifference(4, 4, ' ', DifferenceType.NO_CHANGE).build(),
newCharDifference(5, 5, 'a', DifferenceType.ADDITION).build(),
newCharDifference(5, 6, ' ', DifferenceType.ADDITION).build(),
newCharDifference(5, 7, 'C', DifferenceType.NO_CHANGE).build(),
newCharDifference(6, 8, 'h', DifferenceType.NO_CHANGE).build(),
newCharDifference(7, 9, 'a', DifferenceType.NO_CHANGE).build(),
newCharDifference(8, 10, 'n', DifferenceType.NO_CHANGE).build(),
newCharDifference(9, 11, 'g', DifferenceType.NO_CHANGE).build(),
newCharDifference(10, 12, 'e', DifferenceType.NO_CHANGE).build(),
newCharDifference(11, 13, '.', DifferenceType.NO_CHANGE).build()),
TextDifferencer.getAllTextDifferences("With Change.", "With a Change."));
=======
newTextChange(0, 'W', Type.NO_CHANGE).build(),
newTextChange(1, 'i', Type.NO_CHANGE).build(),
newTextChange(2, 't', Type.NO_CHANGE).build(),
newTextChange(3, 'h', Type.NO_CHANGE).build(),
newTextChange(4, ' ', Type.NO_CHANGE).build(),
newTextChange(5, 'a', Type.ADD).build(),
newTextChange(6, ' ', Type.ADD).build(),
newTextChange(5, 'C', Type.NO_CHANGE).build(),
newTextChange(6, 'h', Type.NO_CHANGE).build(),
newTextChange(7, 'a', Type.NO_CHANGE).build(),
newTextChange(8, 'n', Type.NO_CHANGE).build(),
newTextChange(9, 'g', Type.NO_CHANGE).build(),
newTextChange(10, 'e', Type.NO_CHANGE).build(),
newTextChange(11, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("With Change.", "With a Change."));
>>>>>>>
newTextChange(0, 0, 'W', Type.NO_CHANGE).build(),
newTextChange(1, 1, 'i', Type.NO_CHANGE).build(),
newTextChange(2, 2, 't', Type.NO_CHANGE).build(),
newTextChange(3, 3, 'h', Type.NO_CHANGE).build(),
newTextChange(4, 4, ' ', Type.NO_CHANGE).build(),
newTextChange(5, 5, 'a', Type.ADD).build(),
newTextChange(5, 6, ' ', Type.ADD).build(),
newTextChange(5, 7, 'C', Type.NO_CHANGE).build(),
newTextChange(6, 8, 'h', Type.NO_CHANGE).build(),
newTextChange(7, 9, 'a', Type.NO_CHANGE).build(),
newTextChange(8, 10, 'n', Type.NO_CHANGE).build(),
newTextChange(9, 11, 'g', Type.NO_CHANGE).build(),
newTextChange(10, 12, 'e', Type.NO_CHANGE).build(),
newTextChange(11, 13, '.', Type.NO_CHANGE).build()),
TextDifferencer.getAllTextChanges("With Change.", "With a Change."));
<<<<<<<
newCharDifference(0, 0, 'N', DifferenceType.NO_CHANGE).build(),
newCharDifference(1, 1, 'o', DifferenceType.NO_CHANGE).build(),
newCharDifference(2, 2, ' ', DifferenceType.NO_CHANGE).build(),
newCharDifference(3, 3, 'C', DifferenceType.NO_CHANGE).build(),
newCharDifference(4, 4, 'h', DifferenceType.NO_CHANGE).build(),
newCharDifference(5, 5, 'a', DifferenceType.NO_CHANGE).build(),
newCharDifference(6, 6, 'n', DifferenceType.NO_CHANGE).build(),
newCharDifference(7, 7, 'g', DifferenceType.NO_CHANGE).build(),
newCharDifference(8, 8, 'e', DifferenceType.NO_CHANGE).build(),
newCharDifference(9, 9, '.', DifferenceType.DELETION).build(),
newCharDifference(9, 9, '!', DifferenceType.ADDITION).build()),
TextDifferencer.getAllTextDifferences("No Change.", "No Change!"));
=======
newTextChange(0, 'N', Type.NO_CHANGE).build(),
newTextChange(1, 'o', Type.NO_CHANGE).build(),
newTextChange(2, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 'e', Type.NO_CHANGE).build(),
newTextChange(9, '.', Type.DELETE).build(),
newTextChange(9, '!', Type.ADD).build()),
TextDifferencer.getAllTextChanges("No Change.", "No Change!"));
>>>>>>>
newTextChange(0, 0, 'N', Type.NO_CHANGE).build(),
newTextChange(1, 1, 'o', Type.NO_CHANGE).build(),
newTextChange(2, 2, ' ', Type.NO_CHANGE).build(),
newTextChange(3, 3, 'C', Type.NO_CHANGE).build(),
newTextChange(4, 4, 'h', Type.NO_CHANGE).build(),
newTextChange(5, 5, 'a', Type.NO_CHANGE).build(),
newTextChange(6, 6, 'n', Type.NO_CHANGE).build(),
newTextChange(7, 7, 'g', Type.NO_CHANGE).build(),
newTextChange(8, 8, 'e', Type.NO_CHANGE).build(),
newTextChange(9, 9, '.', Type.DELETE).build(),
newTextChange(9, 9, '!', Type.ADD).build()),
TextDifferencer.getAllTextChanges("No Change.", "No Change!")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.