repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/handlers/ZipArchiveHandlerTest.java | // Path: src/test/java/net/ozwolf/mockserver/raml/util/Fixtures.java
// public static File zipFixture(String path) throws ZipException {
// File source = new File(path);
// File target = new File("target/archives/zip-archive-test.zip");
// if (target.exists() && !target.delete())
// throw new Runtim... | import net.lingala.zip4j.exception.ZipException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.io.File;
import static net.ozwolf.mockserver.raml.util.Fixtures.zipFixture;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.spy... | package net.ozwolf.mockserver.raml.handlers;
public class ZipArchiveHandlerTest {
@Rule
public ExpectedException exception = ExpectedException.none();
@Test
public void shouldTakeZipFileAndUnpack() throws ZipException { | // Path: src/test/java/net/ozwolf/mockserver/raml/util/Fixtures.java
// public static File zipFixture(String path) throws ZipException {
// File source = new File(path);
// File target = new File("target/archives/zip-archive-test.zip");
// if (target.exists() && !target.delete())
// throw new Runtim... | File zip = zipFixture("src/test/resources/apispecs-test"); |
ozwolf-software/raml-mock-server | src/main/java/net/ozwolf/mockserver/raml/internal/domain/body/DefaultBodySpecification.java | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/BodySpecification.java
// public interface BodySpecification {
// MediaType getContentType();
//
// ValidationErrors validate(String body);
// }
//
// Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// publi... | import net.ozwolf.mockserver.raml.internal.domain.BodySpecification;
import net.ozwolf.mockserver.raml.internal.domain.ValidationErrors;
import javax.ws.rs.core.MediaType; | package net.ozwolf.mockserver.raml.internal.domain.body;
public class DefaultBodySpecification implements BodySpecification {
private final MediaType mediaType;
public DefaultBodySpecification(MediaType mediaType) {
this.mediaType = mediaType;
}
@Override | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/BodySpecification.java
// public interface BodySpecification {
// MediaType getContentType();
//
// ValidationErrors validate(String body);
// }
//
// Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// publi... | public ValidationErrors validate(String body) { |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/internal/domain/body/JsonBodySpecificationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | import net.ozwolf.mockserver.raml.internal.domain.ValidationErrors;
import org.junit.Test;
import org.raml.model.MimeType;
import java.io.IOException;
import static net.ozwolf.mockserver.raml.util.Fixtures.fixture;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import ... | package net.ozwolf.mockserver.raml.internal.domain.body;
public class JsonBodySpecificationTest {
@Test
public void shouldValidateSchemaAndEntityAsCorrect() throws IOException { | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | String schema = fixture("apispecs-test/schemas/greeting-response.json"); |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/internal/domain/body/JsonBodySpecificationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | import net.ozwolf.mockserver.raml.internal.domain.ValidationErrors;
import org.junit.Test;
import org.raml.model.MimeType;
import java.io.IOException;
import static net.ozwolf.mockserver.raml.util.Fixtures.fixture;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import ... | package net.ozwolf.mockserver.raml.internal.domain.body;
public class JsonBodySpecificationTest {
@Test
public void shouldValidateSchemaAndEntityAsCorrect() throws IOException {
String schema = fixture("apispecs-test/schemas/greeting-response.json");
String response = fixture("apispecs-test/... | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | ValidationErrors errors = new JsonBodySpecification("Response Body", mimeType).validate(response); |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/specification/RemoteSpecificationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/handlers/ZipArchiveHandler.java
// public class ZipArchiveHandler implements RamlResourceHandler {
// private final File targetDirectory;
// private final File specificationFile;
//
// /**
// * Create a new ZIP archive remote resource handler.
// ... | import net.lingala.zip4j.exception.ZipException;
import net.ozwolf.mockserver.raml.handlers.ZipArchiveHandler;
import org.junit.Test;
import org.raml.model.Raml;
import java.io.File;
import static net.ozwolf.mockserver.raml.util.Fixtures.zipFixture;
import static org.assertj.core.api.Assertions.assertThat; | package net.ozwolf.mockserver.raml.specification;
public class RemoteSpecificationTest {
@Test
public void shouldLoadRamlFromRemoteLocationAndUseProvidedFileHandler() throws ZipException { | // Path: src/main/java/net/ozwolf/mockserver/raml/handlers/ZipArchiveHandler.java
// public class ZipArchiveHandler implements RamlResourceHandler {
// private final File targetDirectory;
// private final File specificationFile;
//
// /**
// * Create a new ZIP archive remote resource handler.
// ... | File zip = zipFixture("src/test/resources/apispecs-test"); |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/specification/RemoteSpecificationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/handlers/ZipArchiveHandler.java
// public class ZipArchiveHandler implements RamlResourceHandler {
// private final File targetDirectory;
// private final File specificationFile;
//
// /**
// * Create a new ZIP archive remote resource handler.
// ... | import net.lingala.zip4j.exception.ZipException;
import net.ozwolf.mockserver.raml.handlers.ZipArchiveHandler;
import org.junit.Test;
import org.raml.model.Raml;
import java.io.File;
import static net.ozwolf.mockserver.raml.util.Fixtures.zipFixture;
import static org.assertj.core.api.Assertions.assertThat; | package net.ozwolf.mockserver.raml.specification;
public class RemoteSpecificationTest {
@Test
public void shouldLoadRamlFromRemoteLocationAndUseProvidedFileHandler() throws ZipException {
File zip = zipFixture("src/test/resources/apispecs-test");
File targetDirectory = new File("target/spec... | // Path: src/main/java/net/ozwolf/mockserver/raml/handlers/ZipArchiveHandler.java
// public class ZipArchiveHandler implements RamlResourceHandler {
// private final File targetDirectory;
// private final File specificationFile;
//
// /**
// * Create a new ZIP archive remote resource handler.
// ... | RemoteSpecification specification = new RemoteSpecification("my-service", zip.toURI().toString(), new ZipArchiveHandler(targetDirectory, specificationFile)); |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/RamlSpecificationRuleIntegrationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/specification/ClassPathSpecification.java
// public class ClassPathSpecification extends RamlSpecification {
// private final String resource;
//
// /**
// * Create a new RAML specification
// *
// * @param name The name of specification
// ... | import net.ozwolf.mockserver.raml.specification.ClassPathSpecification;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.JerseyClientBuilder;
import org.json.JSONException;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.mockserver.client.server.Mo... | package net.ozwolf.mockserver.raml;
public class RamlSpecificationRuleIntegrationTest {
@Rule
public MockServerRule server = new MockServerRule(this, 5000);
@ClassRule
public final static RamlSpecificationsRule SPECIFICATIONS = new RamlSpecificationsRule()
.withSpecifications( | // Path: src/main/java/net/ozwolf/mockserver/raml/specification/ClassPathSpecification.java
// public class ClassPathSpecification extends RamlSpecification {
// private final String resource;
//
// /**
// * Create a new RAML specification
// *
// * @param name The name of specification
// ... | new ClassPathSpecification("my-service", "apispecs-test/apispecs.raml") |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/RamlSpecificationRuleIntegrationTest.java | // Path: src/main/java/net/ozwolf/mockserver/raml/specification/ClassPathSpecification.java
// public class ClassPathSpecification extends RamlSpecification {
// private final String resource;
//
// /**
// * Create a new RAML specification
// *
// * @param name The name of specification
// ... | import net.ozwolf.mockserver.raml.specification.ClassPathSpecification;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.JerseyClientBuilder;
import org.json.JSONException;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import org.mockserver.client.server.Mo... | new ClassPathSpecification("my-service", "apispecs-test/apispecs.raml")
);
@Test
public void shouldCorrectlyVerifyMockServerExpectationsAgainstRamlSpecification() throws IOException {
MockServerClient mockClient = new MockServerClient("localhost", 5000);
mockCli... | // Path: src/main/java/net/ozwolf/mockserver/raml/specification/ClassPathSpecification.java
// public class ClassPathSpecification extends RamlSpecification {
// private final String resource;
//
// /**
// * Create a new RAML specification
// *
// * @param name The name of specification
// ... | assertThat(result.getFormattedErrorMessage()).isEqualTo(fixture("fixtures/expected-obey-errors-get-hello-john.txt")); |
ozwolf-software/raml-mock-server | src/test/java/net/ozwolf/mockserver/raml/util/ValidatorFactory.java | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | import net.ozwolf.mockserver.raml.internal.domain.ValidationErrors;
import net.ozwolf.mockserver.raml.internal.validator.Validator;
import org.apache.commons.lang.StringUtils;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; | package net.ozwolf.mockserver.raml.util;
public class ValidatorFactory {
public static Validator validator(String errorMessage) {
Validator validator = mock(Validator.class); | // Path: src/main/java/net/ozwolf/mockserver/raml/internal/domain/ValidationErrors.java
// public class ValidationErrors {
// private final List<String> messages;
//
// public ValidationErrors() {
// this.messages = newArrayList();
// }
//
// public void addMessage(String error, Object... form... | ValidationErrors errors = new ValidationErrors(); |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/MainActivityApp.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
| import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.backup.BackupManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle... | int idButton = v.getId();
int nButtonClicked = 0;
int calButtonIds[];
if (viewCurrent == R.id.calendar) {
calButtonIds = this.calButtonIds;
} else {
calButtonIds = calButtonIds_2;
}
while (nButtonClicked < 42) {
if (calButtonI... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
// Path: app/src/main/java/de/arnowelzel/android/periodical/MainAc... | if (type != PERIOD_START && type != PERIOD_CONFIRMED) { |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/MainActivityApp.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
| import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.backup.BackupManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle... | int idButton = v.getId();
int nButtonClicked = 0;
int calButtonIds[];
if (viewCurrent == R.id.calendar) {
calButtonIds = this.calButtonIds;
} else {
calButtonIds = calButtonIds_2;
}
while (nButtonClicked < 42) {
if (calButtonI... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
// Path: app/src/main/java/de/arnowelzel/android/periodical/MainAc... | if (type != PERIOD_START && type != PERIOD_CONFIRMED) { |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/ListActivity.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | import android.widget.ListView;
import java.util.Calendar;
import java.util.Iterator;
import de.arnowelzel.android.periodical.PeriodicalDatabase.DayEntry;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bu... | /*
* Periodical list activity
* Copyright (C) 2012-2020 Arno Welzel
*
* This code 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 3 of the License, or
* (at your option) any later version... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | Iterator<DayEntry> dayIterator = dbMain.dayEntries.iterator(); |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/CalendarCell.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | import android.annotation.SuppressLint;
import android.text.format.DateUtils;
import de.arnowelzel.android.periodical.PeriodicalDatabase.DayEntry;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import ... | private final Bitmap bitmapIntercourse;
/**
* Bitmap for entries with flag "intercourse" (black variant)
*/
private final Bitmap bitmapIntercourseBlack;
/**
* Bitmap for entries with flag "notes"
*/
private final Bitmap bitmapNotes;
/**
* Bitmap for entries with flag "no... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | type = DayEntry.EMPTY; |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/DetailsActivity.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
| import android.app.backup.BackupManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatCheckBox;
import and... |
// Set up view
setContentView(R.layout.activity_details);
// Activate "back button" in Action Bar
ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
// Get details
Intent intent = getIntent(... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
// Path: app/src/main/java/de/arnowelzel/android/periodical/Detail... | case PERIOD_START: |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/DetailsActivity.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
| import android.app.backup.BackupManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatCheckBox;
import and... | // Set up view
setContentView(R.layout.activity_details);
// Activate "back button" in Action Bar
ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
// Get details
Intent intent = getIntent()... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_CONFIRMED = 2;
//
// Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// final static int PERIOD_START = 1;
// Path: app/src/main/java/de/arnowelzel/android/periodical/Detail... | case PERIOD_CONFIRMED: |
arnowelzel/periodical | app/src/main/java/de/arnowelzel/android/periodical/ListDetailsActivity.java | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | import java.util.Calendar;
import java.util.Iterator;
import de.arnowelzel.android.periodical.PeriodicalDatabase.DayEntry;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.a... | /*
* Periodical list with details activity
* Copyright (C) 2012-2020 Arno Welzel
*
* This code 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 3 of the License, or
* (at your option) any ... | // Path: app/src/main/java/de/arnowelzel/android/periodical/PeriodicalDatabase.java
// public static class DayEntry {
// final static int EMPTY = 0;
// final static int PERIOD_START = 1;
// final static int PERIOD_CONFIRMED = 2;
// final static int PERIOD_PREDICTED = 3;
// final static int FERTILITY... | ArrayList<DayEntry> dayList = new ArrayList<>(); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
| // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒) |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒) | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int connectTimeout = DEFAULT_CONN_TIME;//连接超时时间(毫秒) |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒)
private int connectTimeout = D... | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int operateTimeout = DEFAULT_OPERATE_TIME;//数据操作超时时间(毫秒) |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒)
private int connectTimeout = D... | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int connectRetryCount = DEFAULT_RETRY_COUNT;//连接重试次数 |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒)
private int connectTimeout = D... | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int connectRetryInterval = DEFAULT_RETRY_INTERVAL;//连接重试间隔(毫秒) |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒)
private int connectTimeout = D... | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int maxConnectCount = DEFAULT_MAX_CONNECT_COUNT;//最大连接数量 |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/common/BleConfig.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | import static com.vise.baseble.common.BleConstant.DEFAULT_CONN_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_MAX_CONNECT_COUNT;
import static com.vise.baseble.common.BleConstant.DEFAULT_OPERATE_TIME;
import static com.vise.baseble.common.BleConstant.DEFAULT_RETRY_COUNT;
import static com.vise.baseble.... | package com.vise.baseble.common;
/**
* @Description: 蓝牙通信相关配置
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/16 11:46
*/
public class BleConfig {
private static BleConfig instance;
private int scanTimeout = DEFAULT_SCAN_TIME;//扫描超时时间(毫秒)
private int connectTimeout = D... | // Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_CONN_TIME = 10000;
//
// Path: baseble/src/main/java/com/vise/baseble/common/BleConstant.java
// public static final int DEFAULT_MAX_CONNECT_COUNT = 5;
//
// Path: baseble/src/main/java/com/vise/baseble/common/B... | private int scanRepeatInterval = DEFAULT_SCAN_REPEAT_INTERVAL;//每隔X时间重复扫描 (毫秒) |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/OtherException.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
| import com.vise.baseble.common.BleExceptionCode; | package com.vise.baseble.exception;
/**
* @Description: 其他异常
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:32.
*/
public class OtherException extends BleException {
public OtherException(String description) { | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
// Path: baseble/src/main/java/com/vise/baseble/exception/Other... | super(BleExceptionCode.OTHER_ERR, description); |
xiaoyaoyou1212/BLE | newapp/src/main/java/com/vise/bledemo/event/ScanEvent.java | // Path: baseble/src/main/java/com/vise/baseble/model/BluetoothLeDeviceStore.java
// public class BluetoothLeDeviceStore {
//
// private final Map<String, BluetoothLeDevice> mDeviceMap;
//
// public BluetoothLeDeviceStore() {
// mDeviceMap = new HashMap<>();
// }
//
// public void addDevice(B... | import com.vise.baseble.model.BluetoothLeDeviceStore;
import com.vise.xsnow.event.IEvent; | package com.vise.bledemo.event;
public class ScanEvent implements IEvent {
private boolean isScanTimeout;
private boolean isScanFinish; | // Path: baseble/src/main/java/com/vise/baseble/model/BluetoothLeDeviceStore.java
// public class BluetoothLeDeviceStore {
//
// private final Map<String, BluetoothLeDevice> mDeviceMap;
//
// public BluetoothLeDeviceStore() {
// mDeviceMap = new HashMap<>();
// }
//
// public void addDevice(B... | private BluetoothLeDeviceStore bluetoothLeDeviceStore; |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | protected void onConnectException(ConnectException e) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override
protected void onConnectException(ConnectException e) {
Vise... | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | protected void onGattException(GattException e) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override
protected void onConnectException(ConnectException e) {
Vise... | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | protected void onTimeoutException(TimeoutException e) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override
protected void onConnectException(ConnectException e) {
Vise... | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | protected void onInitiatedException(InitiatedException e) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override
protected void onConnectException(ConnectException e) {
Vise... | // Path: baseble/src/main/java/com/vise/baseble/exception/ConnectException.java
// public class ConnectException extends BleException {
// private BluetoothGatt bluetoothGatt;
// private int gattStatus;
//
// public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {
// super(BleExcepti... | protected void onOtherException(OtherException e) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/GattException.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
| import com.vise.baseble.common.BleExceptionCode; | package com.vise.baseble.exception;
/**
* @Description: Gatt异常
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:30.
*/
public class GattException extends BleException {
private int gattStatus;
public GattException(int gattStatus) { | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
// Path: baseble/src/main/java/com/vise/baseble/exception/GattE... | super(BleExceptionCode.GATT_ERR, "Gatt Exception Occurred! "); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/TimeoutException.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
| import com.vise.baseble.common.BleExceptionCode; | package com.vise.baseble.exception;
/**
* @Description: 超时异常
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:29.
*/
public class TimeoutException extends BleException {
public TimeoutException() { | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
// Path: baseble/src/main/java/com/vise/baseble/exception/Timeo... | super(BleExceptionCode.TIMEOUT, "Timeout Exception Occurred! "); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/BleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException;
import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public abstract class BleExceptionHandler {
public BleExceptionHandler handleException(BleException exception) {
if (exception != null) { | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | if (exception instanceof ConnectException) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/BleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException;
import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public abstract class BleExceptionHandler {
public BleExceptionHandler handleException(BleException exception) {
if (exception != null) {
... | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | } else if (exception instanceof GattException) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/BleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException;
import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public abstract class BleExceptionHandler {
public BleExceptionHandler handleException(BleException exception) {
if (exception != null) {
... | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | } else if (exception instanceof TimeoutException) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/BleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException;
import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public abstract class BleExceptionHandler {
public BleExceptionHandler handleException(BleException exception) {
if (exception != null) {
... | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | } else if (exception instanceof InitiatedException) { |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/BleExceptionHandler.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException;
import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public abstract class BleExceptionHandler {
public BleExceptionHandler handleException(BleException exception) {
if (exception != null) {
... | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | onOtherException((OtherException) exception); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/InitiatedException.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
| import com.vise.baseble.common.BleExceptionCode; | package com.vise.baseble.exception;
/**
* @Description: 初始化异常
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:30.
*/
public class InitiatedException extends BleException {
public InitiatedException() { | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
// Path: baseble/src/main/java/com/vise/baseble/exception/Initi... | super(BleExceptionCode.INITIATED_ERR, "Initiated Exception Occurred! "); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/model/adrecord/AdRecordStore.java | // Path: baseble/src/main/java/com/vise/baseble/utils/AdRecordUtil.java
// public class AdRecordUtil {
// private AdRecordUtil() {
// // TO AVOID INSTANTIATION
// }
//
// public static String getRecordDataAsString(final AdRecord nameRecord) {
// if (nameRecord == null) {
// retu... | import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
import com.vise.baseble.utils.AdRecordUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; | package com.vise.baseble.model.adrecord;
/**
* @Description: 广播包解析仓库
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/7 21:54.
*/
public class AdRecordStore implements Parcelable {
public static final Creator<AdRecordStore> CREATOR = new Creator<AdRecordStore>() {
public Ad... | // Path: baseble/src/main/java/com/vise/baseble/utils/AdRecordUtil.java
// public class AdRecordUtil {
// private AdRecordUtil() {
// // TO AVOID INSTANTIATION
// }
//
// public static String getRecordDataAsString(final AdRecord nameRecord) {
// if (nameRecord == null) {
// retu... | mLocalNameComplete = AdRecordUtil.getRecordDataAsString(mAdRecords.get(AdRecord.BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME)); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/callback/IRssiCallback.java | // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | import com.vise.baseble.exception.BleException; | package com.vise.baseble.callback;
/**
* @Description: 获取信号值回调
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/19 15:19
*/
public interface IRssiCallback {
void onSuccess(int rssi);
| // Path: baseble/src/main/java/com/vise/baseble/exception/BleException.java
// public class BleException implements Serializable {
// private BleExceptionCode code;
// private String description;
//
// public BleException(BleExceptionCode code, String description) {
// this.code = code;
// ... | void onFailure(BleException exception); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/ConnectException.java | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
| import android.bluetooth.BluetoothGatt;
import com.vise.baseble.common.BleExceptionCode; | package com.vise.baseble.exception;
/**
* @Description: 连接异常
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:29.
*/
public class ConnectException extends BleException {
private BluetoothGatt bluetoothGatt;
private int gattStatus;
public ConnectException(BluetoothGatt ... | // Path: baseble/src/main/java/com/vise/baseble/common/BleExceptionCode.java
// public enum BleExceptionCode {
// TIMEOUT, //超时
// CONNECT_ERR, //连接异常
// GATT_ERR, //GATT异常
// INITIATED_ERR, //初始化异常
// OTHER_ERR //其他异常
// }
// Path: baseble/src/main/java/com/vise/baseble/exception/Conne... | super(BleExceptionCode.CONNECT_ERR, "Connect Exception Occurred! "); |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/core/BluetoothGattChannel.java | // Path: baseble/src/main/java/com/vise/baseble/common/PropertyType.java
// public enum PropertyType {
// PROPERTY_READ(0x01),
// PROPERTY_WRITE(0x02),
// PROPERTY_NOTIFY(0x04),
// PROPERTY_INDICATE(0x08);
//
// private int propertyValue;
//
// PropertyType(int propertyValue) {
// this... | import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import com.vise.baseble.common.PropertyType;
import java.util.UUID; | package com.vise.baseble.core;
/**
* @Description: BluetoothGatt 相关信息
* @author: <a href="http://xiaoyaoyou1212.360doc.com">DAWI</a>
* @date: 2017/10/17 16:25
*/
public class BluetoothGattChannel {
private BluetoothGatt bluetoothGatt;
private BluetoothGattService service;
private BluetoothGattChara... | // Path: baseble/src/main/java/com/vise/baseble/common/PropertyType.java
// public enum PropertyType {
// PROPERTY_READ(0x01),
// PROPERTY_WRITE(0x02),
// PROPERTY_NOTIFY(0x04),
// PROPERTY_INDICATE(0x08);
//
// private int propertyValue;
//
// PropertyType(int propertyValue) {
// this... | private PropertyType propertyType; |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/Reaper.java | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | import com.tt.reaper.call.CallManager;
import com.tt.reaper.filter.FilterExecute;
import com.tt.reaper.http.WebServer;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.sip.ReaperStack; | package com.tt.reaper;
public class Reaper {
private static boolean initialized = false;
public static Reaper instance = new Reaper();
private Reaper() {
}
public synchronized void init() {
if (initialized == true)
return;
initialized = true;
ReaperLogger.init();
CollectorManager.instance.init();
... | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | ReaperStack.instance.init(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/Reaper.java | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | import com.tt.reaper.call.CallManager;
import com.tt.reaper.filter.FilterExecute;
import com.tt.reaper.http.WebServer;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.sip.ReaperStack; | package com.tt.reaper;
public class Reaper {
private static boolean initialized = false;
public static Reaper instance = new Reaper();
private Reaper() {
}
public synchronized void init() {
if (initialized == true)
return;
initialized = true;
ReaperLogger.init();
CollectorManager.instance.init();
... | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | CollectorStack.instance.init(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/Reaper.java | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | import com.tt.reaper.call.CallManager;
import com.tt.reaper.filter.FilterExecute;
import com.tt.reaper.http.WebServer;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.sip.ReaperStack; | package com.tt.reaper;
public class Reaper {
private static boolean initialized = false;
public static Reaper instance = new Reaper();
private Reaper() {
}
public synchronized void init() {
if (initialized == true)
return;
initialized = true;
ReaperLogger.init();
CollectorManager.instance.init();
... | // Path: src/com/tt/reaper/filter/FilterExecute.java
// public class FilterExecute extends Thread {
// private static Logger logger = Logger.getLogger(FilterExecute.class);
// public static final FilterExecute instance = new FilterExecute();
// private String command;
// private boolean running = false;
//
// pri... | FilterExecute.instance.init(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | test/com/tt/reaper/rtcp/TestRtcpPacket.java | // Path: src/com/tt/reaper/message/NotifyMessage.java
// public class NotifyMessage extends RequestMessage {
// public NotifyMessage(Request request) {
// super(Message.NOTIFY, request);
// }
//
// public NotifyMessage(String data)
// {
// super(SipMessage.NOTIFY, Request.NOTIFY, getNewCallId());
// init(da... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.FileInputStream;
import java.util.Iterator;
import org.junit.Test;
import com.tt.reaper.message.NotifyMessage; | package com.tt.reaper.rtcp;
public class TestRtcpPacket {
public static final String XRFILE = "data/rtcpxr.data";
public static final String RECEIVER_FILE = "data/rtcp_receiver_report.data";
public static final String SENDER_FILE = "data/rtcp_sender_report.data";
public static final String SOURCE_MAC = "00:00:... | // Path: src/com/tt/reaper/message/NotifyMessage.java
// public class NotifyMessage extends RequestMessage {
// public NotifyMessage(Request request) {
// super(Message.NOTIFY, request);
// }
//
// public NotifyMessage(String data)
// {
// super(SipMessage.NOTIFY, Request.NOTIFY, getNewCallId());
// init(da... | NotifyMessage message = createDatagram(fileName); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/CallContext.java | // Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// private String sourceMacAddress;
// private String sourceIPAddress;
// private int sourcePort;
// private String destinationMacAddress;
// private String destinationIPAddress;
// private int destinationPort;
// privat... | import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.tt.reaper.message.Message;
import com.tt.reaper.rtcp.DataPacket;
import com.tt.reaper.vq.LocalMetrics; | package com.tt.reaper.call;
public class CallContext {
protected static Logger logger = Logger.getLogger(CallContext.class);
public State state = StateInvited.instance;
public Date startTime;
public Date endTime;
public String from;
public String to;
public String callId;
public String fromMac;
public Stri... | // Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// private String sourceMacAddress;
// private String sourceIPAddress;
// private int sourcePort;
// private String destinationMacAddress;
// private String destinationIPAddress;
// private int destinationPort;
// privat... | public LocalMetrics localMetrics; |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/CallContext.java | // Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// private String sourceMacAddress;
// private String sourceIPAddress;
// private int sourcePort;
// private String destinationMacAddress;
// private String destinationIPAddress;
// private int destinationPort;
// privat... | import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import org.apache.log4j.Logger;
import com.tt.reaper.message.Message;
import com.tt.reaper.rtcp.DataPacket;
import com.tt.reaper.vq.LocalMetrics; | }
public void setAudioFrom(ArrayList<AudioData> list) {
if (list == null)
return;
Iterator<AudioData> it;
it = list.iterator();
while (it.hasNext()) {
AudioData data = it.next();
data.from = true;
CallManager.instance.register(this, data.getIpRtpPort());
CallManager.instance.register(this, da... | // Path: src/com/tt/reaper/rtcp/DataPacket.java
// public class DataPacket extends Message {
// private String sourceMacAddress;
// private String sourceIPAddress;
// private int sourcePort;
// private String destinationMacAddress;
// private String destinationIPAddress;
// private int destinationPort;
// privat... | LocalMetrics createMetrics(DataPacket packet) |
TerryHowe/SIP-Voice-Quality-Report-Reaper | test/com/tt/reaper/sip/MockCollector.java | // Path: src/com/tt/reaper/Configuration.java
// public class Configuration extends Properties {
// private static final long serialVersionUID = 1L;
// private static Logger logger = Logger.getLogger(Configuration.class);
// private static final String FILE_NAME = "config/reaper.properties";
// public static final ... | import java.io.FileInputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import com.tt.reaper.Configuration; | package com.tt.reaper.sip;
public class MockCollector extends Thread {
public static final MockCollector instance = new MockCollector();
DatagramSocket socket;
byte[] buffer = new byte[2048]; | // Path: src/com/tt/reaper/Configuration.java
// public class Configuration extends Properties {
// private static final long serialVersionUID = 1L;
// private static Logger logger = Logger.getLogger(Configuration.class);
// private static final String FILE_NAME = "config/reaper.properties";
// public static final ... | Configuration configuration = new Configuration(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/StateTerminating.java | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | import java.util.Iterator;
import com.tt.reaper.message.Message;
import com.tt.reaper.message.RtpPacket;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.vq.LocalMetrics;
import com.tt.reaper.vq.VQSessionReport; | package com.tt.reaper.call;
public class StateTerminating extends State {
public static final StateTerminating instance = new StateTerminating();
private StateTerminating()
{
}
State process(CallContext context, Message message)
{
switch (message.getType())
{
case Message.SUCCESS:
case Message.FAIL... | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | LocalMetrics metrics = new LocalMetrics(context, data); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/StateTerminating.java | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | import java.util.Iterator;
import com.tt.reaper.message.Message;
import com.tt.reaper.message.RtpPacket;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.vq.LocalMetrics;
import com.tt.reaper.vq.VQSessionReport; | package com.tt.reaper.call;
public class StateTerminating extends State {
public static final StateTerminating instance = new StateTerminating();
private StateTerminating()
{
}
State process(CallContext context, Message message)
{
switch (message.getType())
{
case Message.SUCCESS:
case Message.FAIL... | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | VQSessionReport report = new VQSessionReport(metrics); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/StateTerminating.java | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | import java.util.Iterator;
import com.tt.reaper.message.Message;
import com.tt.reaper.message.RtpPacket;
import com.tt.reaper.sip.CollectorStack;
import com.tt.reaper.vq.LocalMetrics;
import com.tt.reaper.vq.VQSessionReport; | package com.tt.reaper.call;
public class StateTerminating extends State {
public static final StateTerminating instance = new StateTerminating();
private StateTerminating()
{
}
State process(CallContext context, Message message)
{
switch (message.getType())
{
case Message.SUCCESS:
case Message.FAIL... | // Path: src/com/tt/reaper/sip/CollectorStack.java
// public class CollectorStack {
// private static final String STACK_NAME = "CollectorStack";
// private static Logger logger = Logger.getLogger(CollectorStack.class);
// public static CollectorStack instance = new CollectorStack();
// private SipProvider collecto... | CollectorStack.instance.sendMessage(report.toString()); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/filter/FilterExecute.java | // Path: src/com/tt/reaper/Configuration.java
// public class Configuration extends Properties {
// private static final long serialVersionUID = 1L;
// private static Logger logger = Logger.getLogger(Configuration.class);
// private static final String FILE_NAME = "config/reaper.properties";
// public static final ... | import org.apache.log4j.Logger;
import com.tt.reaper.Configuration; | package com.tt.reaper.filter;
public class FilterExecute extends Thread {
private static Logger logger = Logger.getLogger(FilterExecute.class);
public static final FilterExecute instance = new FilterExecute();
private String command;
private boolean running = false;
private FilterExecute() {
}
public synchr... | // Path: src/com/tt/reaper/Configuration.java
// public class Configuration extends Properties {
// private static final long serialVersionUID = 1L;
// private static Logger logger = Logger.getLogger(Configuration.class);
// private static final String FILE_NAME = "config/reaper.properties";
// public static final ... | command = new Configuration().getCommand(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/http/WebHandler.java | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | import java.io.IOException;
import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.tt.reaper.call.CallManager;
import com.tt.reaper.message.DataRequest;
import com.tt.reaper.message.DataResponse;
import com.tt.reaper.message.Message;
import com.tt.... | package com.tt.reaper.http;
public class WebHandler implements HttpHandler {
@Override
public void handle(HttpExchange xchange) throws IOException {
String body = "<title>Active Calls</title><h1>Active Calls</h1>";
body += "<pre>"; | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | MessageQueue queue = new MessageQueue(); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/http/WebHandler.java | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | import java.io.IOException;
import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.tt.reaper.call.CallManager;
import com.tt.reaper.message.DataRequest;
import com.tt.reaper.message.DataResponse;
import com.tt.reaper.message.Message;
import com.tt.... | package com.tt.reaper.http;
public class WebHandler implements HttpHandler {
@Override
public void handle(HttpExchange xchange) throws IOException {
String body = "<title>Active Calls</title><h1>Active Calls</h1>";
body += "<pre>";
MessageQueue queue = new MessageQueue(); | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | CallManager.instance.send(new DataRequest(queue)); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/http/WebHandler.java | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | import java.io.IOException;
import java.io.OutputStream;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.tt.reaper.call.CallManager;
import com.tt.reaper.message.DataRequest;
import com.tt.reaper.message.DataResponse;
import com.tt.reaper.message.Message;
import com.tt.... | package com.tt.reaper.http;
public class WebHandler implements HttpHandler {
@Override
public void handle(HttpExchange xchange) throws IOException {
String body = "<title>Active Calls</title><h1>Active Calls</h1>";
body += "<pre>";
MessageQueue queue = new MessageQueue();
CallManager.instance.send(new Dat... | // Path: src/com/tt/reaper/message/DataRequest.java
// public class DataRequest extends Message {
// public MessageQueue queue;
//
// public DataRequest(MessageQueue queue) {
// super(Message.DATA_REQUEST);
// this.queue = queue;
// }
// }
//
// Path: src/com/tt/reaper/message/DataResponse.java
// public clas... | if (response instanceof DataResponse) |
TerryHowe/SIP-Voice-Quality-Report-Reaper | test/com/tt/reaper/call/TestRtpPacketFactory.java | // Path: test/com/tt/reaper/message/TestRtpPacket.java
// public class TestRtpPacket {
// public static final String SOURCE_MAC = "1:1:1:1:1:1";
// public static final String SOURCE_IP = "10.0.0.1";
// public static final String SOURCE_PORT = "9090";
// public static final String DESTINATION_MAC = "2:2:2:2:2:2";
//... | import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.tt.reaper.message.RtpPacket;
import com.tt.reaper.message.TestRtpPacket; | package com.tt.reaper.call;
public class TestRtpPacketFactory {
@Test
public void testFactory() {
RtpPacketFactory factory = new RtpPacketFactory();
factory.init(null);
assertEquals(null, factory.getNext());
}
@Test
public void testFactoryOne()
{
RtpPacketFactory factory = new RtpPacketFactory(); | // Path: test/com/tt/reaper/message/TestRtpPacket.java
// public class TestRtpPacket {
// public static final String SOURCE_MAC = "1:1:1:1:1:1";
// public static final String SOURCE_IP = "10.0.0.1";
// public static final String SOURCE_PORT = "9090";
// public static final String DESTINATION_MAC = "2:2:2:2:2:2";
//... | factory.init(TestRtpPacket.create(1, 2).getBytes()); |
TerryHowe/SIP-Voice-Quality-Report-Reaper | src/com/tt/reaper/call/StateInvited.java | // Path: src/com/tt/reaper/message/InviteMessage.java
// public class InviteMessage extends RequestMessage {
// public InviteMessage()
// {
// super(Message.INVITE, Request.INVITE, getNewCallId());
// status = init();
// }
//
// public InviteMessage(Request request) {
// super(Message.INVITE, request);
// ... | import com.tt.reaper.message.InviteMessage;
import com.tt.reaper.message.Message;
import com.tt.reaper.message.RtpPacket;
import com.tt.reaper.message.SipMessage; | package com.tt.reaper.call;
class StateInvited extends State {
public static final StateInvited instance = new StateInvited();
private StateInvited()
{
}
State process(CallContext context, Message message)
{
switch (message.getType())
{
case Message.INVITE: | // Path: src/com/tt/reaper/message/InviteMessage.java
// public class InviteMessage extends RequestMessage {
// public InviteMessage()
// {
// super(Message.INVITE, Request.INVITE, getNewCallId());
// status = init();
// }
//
// public InviteMessage(Request request) {
// super(Message.INVITE, request);
// ... | InviteMessage invite = (InviteMessage)message; |
TerryHowe/SIP-Voice-Quality-Report-Reaper | test/com/tt/reaper/message/TestRtpPacket.java | // Path: src/com/tt/reaper/ReaperLogger.java
// public class ReaperLogger {
// private static boolean initialized = false;
// private static final String FILE_NAME = "config/log4j.properties";
//
// public static synchronized void init() {
// if (initialized == true)
// return;
// initialized = true;
// P... | import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import com.tt.reaper.ReaperLogger; | package com.tt.reaper.message;
public class TestRtpPacket {
public static final String SOURCE_MAC = "1:1:1:1:1:1";
public static final String SOURCE_IP = "10.0.0.1";
public static final String SOURCE_PORT = "9090";
public static final String DESTINATION_MAC = "2:2:2:2:2:2";
public static final String DESTINATI... | // Path: src/com/tt/reaper/ReaperLogger.java
// public class ReaperLogger {
// private static boolean initialized = false;
// private static final String FILE_NAME = "config/log4j.properties";
//
// public static synchronized void init() {
// if (initialized == true)
// return;
// initialized = true;
// P... | ReaperLogger.init(); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/MemoryTest.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java
// public final class SampleHeavyActivity extends MockActivity {
//
// private boolean isOutOfMemory = false;
//
// @Contract(pure = true)
// public boolean isOutOfMemory() {
// return isOutOfMemory;
//... | import com.redmadrobot.chronos.mock.gui.SampleHeavyActivity;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import java.util.LinkedList;
import java.util.List;
import static com.redmadrobot.chronos.util.TimingUtils.slee... | package com.redmadrobot.chronos;
/**
* Test for proper memory management.
*
* @author maximefimov
*/
public class MemoryTest extends AndroidTestCase {
@SmallTest
public void testSingleResultFits() { | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java
// public final class SampleHeavyActivity extends MockActivity {
//
// private boolean isOutOfMemory = false;
//
// @Contract(pure = true)
// public boolean isOutOfMemory() {
// return isOutOfMemory;
//... | final SampleHeavyActivity activity = new SampleHeavyActivity(); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/MemoryTest.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java
// public final class SampleHeavyActivity extends MockActivity {
//
// private boolean isOutOfMemory = false;
//
// @Contract(pure = true)
// public boolean isOutOfMemory() {
// return isOutOfMemory;
//... | import com.redmadrobot.chronos.mock.gui.SampleHeavyActivity;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.MediumTest;
import android.test.suitebuilder.annotation.SmallTest;
import java.util.LinkedList;
import java.util.List;
import static com.redmadrobot.chronos.util.TimingUtils.slee... | package com.redmadrobot.chronos;
/**
* Test for proper memory management.
*
* @author maximefimov
*/
public class MemoryTest extends AndroidTestCase {
@SmallTest
public void testSingleResultFits() {
final SampleHeavyActivity activity = new SampleHeavyActivity();
activity.start();
... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java
// public final class SampleHeavyActivity extends MockActivity {
//
// private boolean isOutOfMemory = false;
//
// @Contract(pure = true)
// public boolean isOutOfMemory() {
// return isOutOfMemory;
//... | sleep(); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/HeavyOperation.java
// public final class HeavyOperation extends ChronosOperation<BigObject> {
//
// private boolean hasOutOfMemory = false;
//
// @Contract(pure = true)
// public final boolean gotOutOfMemory() {
// retur... | import com.redmadrobot.chronos.mock.operation.HeavyOperation;
import com.redmadrobot.chronos.mock.operation.HeavyOperationResult;
import org.jetbrains.annotations.Contract; | package com.redmadrobot.chronos.mock.gui;
/**
* Mock activity that does memory-consuming operations.
*
* @author maximefimov
*/
public final class SampleHeavyActivity extends MockActivity {
private boolean isOutOfMemory = false;
@Contract(pure = true)
public boolean isOutOfMemory() {
return... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/HeavyOperation.java
// public final class HeavyOperation extends ChronosOperation<BigObject> {
//
// private boolean hasOutOfMemory = false;
//
// @Contract(pure = true)
// public final boolean gotOutOfMemory() {
// retur... | return runOperation(new HeavyOperation()); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SampleHeavyActivity.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/HeavyOperation.java
// public final class HeavyOperation extends ChronosOperation<BigObject> {
//
// private boolean hasOutOfMemory = false;
//
// @Contract(pure = true)
// public final boolean gotOutOfMemory() {
// retur... | import com.redmadrobot.chronos.mock.operation.HeavyOperation;
import com.redmadrobot.chronos.mock.operation.HeavyOperationResult;
import org.jetbrains.annotations.Contract; | package com.redmadrobot.chronos.mock.gui;
/**
* Mock activity that does memory-consuming operations.
*
* @author maximefimov
*/
public final class SampleHeavyActivity extends MockActivity {
private boolean isOutOfMemory = false;
@Contract(pure = true)
public boolean isOutOfMemory() {
return... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/HeavyOperation.java
// public final class HeavyOperation extends ChronosOperation<BigObject> {
//
// private boolean hasOutOfMemory = false;
//
// @Contract(pure = true)
// public final boolean gotOutOfMemory() {
// retur... | public final void onOperationFinished(final HeavyOperationResult result) { |
RedMadRobot/Chronos | app/src/main/java/com/redmadrobot/chronos_sample/samples/SimpleRun.java | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | import com.redmadrobot.chronos.gui.activity.ChronosActivity;
import com.redmadrobot.chronos_sample.R;
import com.redmadrobot.chronos_sample.operations.SimpleOperation;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView; | package com.redmadrobot.chronos_sample.samples;
/**
* A sample of how to use Chronos in a most minimalistic way.
*
* @author maximefimov
*/
public final class SimpleRun extends ChronosActivity {
private TextView mTextOutput;
@Override
protected void onCreate(final Bundle savedInstanceState) {
... | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | runOperation(new SimpleOperation(editInput.getText().toString())); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockFragment.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | package com.redmadrobot.chronos.mock.gui;
/**
* Fragment that can do a pre-defined operations and report its status.
*
* @author maximefimov
*/
public final class SimpleMockFragment extends MockFragment {
private final static String OPERATION_TAG = "fragment_operation_tag";
private String mResult;
... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | return runOperation(new SimpleOperation(input)); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockFragment.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | public String getBroadcastResult() {
return mBroadcastResult;
}
@Nullable
public Exception getBroadcastError() {
return mBroadcastError;
}
public int getBroadcastResultObtained() {
return mBroadcastResultObtained;
}
public final int runSimple(@NonNull final Str... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | return runOperation(new SimpleErrorOperation()); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockFragment.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | return runOperation(new SimpleErrorOperation());
}
public final int runErrorBroadcast() {
return runOperationBroadcast(new SimpleErrorOperation());
}
public final boolean cancel(final int id) {
return cancelOperation(id);
}
public final boolean cancelTagged() {
... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | public final void onOperationFinished(final SimpleOperationResult result) { |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/ActivityRunTest.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockActivity.java
// public final class SimpleMockActivity extends MockActivity {
//
// private final static String OPERATION_TAG = "activity_operation_tag";
//
// private String mResult;
//
// private Exception mError;
//
// ... | import com.redmadrobot.chronos.mock.gui.SimpleMockActivity;
import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import static com.redmadrobot.chronos... | package com.redmadrobot.chronos;
/**
* Test for operation runs in Activity.
*
* @author maximefimov
*/
public class ActivityRunTest extends AndroidTestCase {
@SmallTest
public void testNormalRun() { | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockActivity.java
// public final class SimpleMockActivity extends MockActivity {
//
// private final static String OPERATION_TAG = "activity_operation_tag";
//
// private String mResult;
//
// private Exception mError;
//
// ... | final SimpleMockActivity activity = new SimpleMockActivity(); |
RedMadRobot/Chronos | app/src/main/java/com/redmadrobot/chronos_sample/samples/DataLoadCancel.java | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | import com.redmadrobot.chronos.gui.activity.ChronosActivity;
import com.redmadrobot.chronos_sample.R;
import com.redmadrobot.chronos_sample.operations.SimpleOperation;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;
import android.widget.Toa... | protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_data_load_cancel);
mTextOutput = (TextView) findViewById(R.id.text_output);
if (savedInstanceState != null) {
mData = savedInstanceState.getSt... | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | runOperation(new SimpleOperation(""), TAG_DATA_LOADING); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockActivity.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | package com.redmadrobot.chronos.mock.gui;
/**
* Activity that can do a pre-defined operations and report its status.
*
* @author maximefimov
*/
public final class SimpleMockActivity extends MockActivity {
private final static String OPERATION_TAG = "activity_operation_tag";
private String mResult;
... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | return runOperation(new SimpleOperation(input)); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockActivity.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | public String getBroadcastResult() {
return mBroadcastResult;
}
@Nullable
public Exception getBroadcastError() {
return mBroadcastError;
}
public int getBroadcastResultObtained() {
return mBroadcastResultObtained;
}
public final int runSimple(@NonNull final Str... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | return runOperation(new SimpleErrorOperation()); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/mock/gui/SimpleMockActivity.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | import com.redmadrobot.chronos.mock.operation.SimpleErrorOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperation;
import com.redmadrobot.chronos.mock.operation.SimpleOperationResult;
import org.jetbrains.annotations.Contract;
import android.support.annotation.NonNull;
import android.support.annotation.... | return cancelOperation(id);
}
public final boolean cancelTagged() {
return cancelOperation(OPERATION_TAG);
}
public final boolean isRunning(final int id) {
return isOperationRunning(id);
}
public final boolean isRunningTagged() {
return isOperationRunning(OPERA... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/mock/operation/SimpleErrorOperation.java
// public final class SimpleErrorOperation extends ChronosOperation<String> {
//
// private final static RuntimeException EXCEPTION = new RuntimeException("Test exception");
//
// @Contract("null -> false")
... | public final void onOperationFinished(final SimpleOperationResult result) { |
RedMadRobot/Chronos | app/src/main/java/com/redmadrobot/chronos_sample/samples/DataLoad.java | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | import com.redmadrobot.chronos.gui.activity.ChronosActivity;
import com.redmadrobot.chronos_sample.R;
import com.redmadrobot.chronos_sample.operations.SimpleOperation;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.widget.TextView; | package com.redmadrobot.chronos_sample.samples;
/**
* A sample of how you can easily initiate your layout with data provided by some source, that takes
* some time to give a response, such as remote server, or a database.
*
* @author maximefimov
*/
public final class DataLoad extends ChronosActivity {
// a... | // Path: chronos/src/main/java/com/redmadrobot/chronos/gui/activity/ChronosActivity.java
// @SuppressWarnings("unused")
// public abstract class ChronosActivity extends Activity implements ChronosConnectorWrapper {
//
// /**
// * An entry point to access Chronos functions.
// */
// private final Chro... | runOperation(new SimpleOperation(""), TAG_DATA_LOADING); |
RedMadRobot/Chronos | chronos/src/androidTest/java/com/redmadrobot/chronos/util/TimingUtils.java | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/TestSettings.java
// public final class TestSettings {
//
// public final static long MICRO_WAIT = 10L;
//
// public final static long SHORT_WAIT = 50L;
//
// public final static long OPERATION_WAIT = 100L;
//
// public final static long ... | import com.redmadrobot.chronos.TestSettings; | package com.redmadrobot.chronos.util;
/**
* Utilities to mock waiting for long running tasks.
*
* @author maximefimov
*/
public final class TimingUtils {
private TimingUtils() {
}
/**
* Current thread sleeps for a predefined amount of time. If it has been interrupted, the method
* would be... | // Path: chronos/src/androidTest/java/com/redmadrobot/chronos/TestSettings.java
// public final class TestSettings {
//
// public final static long MICRO_WAIT = 10L;
//
// public final static long SHORT_WAIT = 50L;
//
// public final static long OPERATION_WAIT = 100L;
//
// public final static long ... | Thread.sleep(TestSettings.RESPONSE_WAIT); |
jembi/openhim-legacy | src/test/java/org/jembi/openhim/DefaultChannelComponentTest.java | // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.IOException;
import org.jembi.openhim.DefaultChannelComponent.URLMapping;
import org.jembi.openhim.RestfulHttpRequest.Scheme;
import org.jembi.openhim.exception.DefaultChannelInvalidConfigException;
import org.junit.Test;
import org.m... | package org.jembi.openhim;
public class DefaultChannelComponentTest {
@Test
public void test_findURLMapping_match() throws JsonParseException, JsonMappingException, IOException {
DefaultChannelComponent dcc = new DefaultChannelComponent();
dcc.readMappings();
| // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | URLMapping mapping = dcc.findURLMapping(Scheme.HTTPS, "test/sample/123"); |
jembi/openhim-legacy | src/test/java/org/jembi/openhim/DefaultChannelComponentTest.java | // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.IOException;
import org.jembi.openhim.DefaultChannelComponent.URLMapping;
import org.jembi.openhim.RestfulHttpRequest.Scheme;
import org.jembi.openhim.exception.DefaultChannelInvalidConfigException;
import org.junit.Test;
import org.m... | package org.jembi.openhim;
public class DefaultChannelComponentTest {
@Test
public void test_findURLMapping_match() throws JsonParseException, JsonMappingException, IOException {
DefaultChannelComponent dcc = new DefaultChannelComponent();
dcc.readMappings();
| // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | URLMapping mapping = dcc.findURLMapping(Scheme.HTTPS, "test/sample/123"); |
jembi/openhim-legacy | src/test/java/org/jembi/openhim/DefaultChannelComponentTest.java | // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.IOException;
import org.jembi.openhim.DefaultChannelComponent.URLMapping;
import org.jembi.openhim.RestfulHttpRequest.Scheme;
import org.jembi.openhim.exception.DefaultChannelInvalidConfigException;
import org.junit.Test;
import org.m... | @Test
public void test_findUnsecureURLMapping_match() throws JsonParseException, JsonMappingException, IOException {
DefaultChannelComponent dcc = new DefaultChannelComponent();
dcc.readMappings();
URLMapping mapping = dcc.findURLMapping(Scheme.HTTP, "test/unsecure");
assertNotNull(mapping);
assertEquals("... | // Path: src/main/java/org/jembi/openhim/DefaultChannelComponent.java
// public static class URLMapping {
// private String urlPattern;
// private String host;
// private String port;
// private String username;
// private String password;
// private String authType;
// private String allowUnsecured;
// private... | public void test_pathRedirection_pathConstant() throws DefaultChannelInvalidConfigException, JsonParseException, JsonMappingException, IOException { |
jembi/openhim-legacy | src/main/java/org/jembi/openhim/DefaultChannelComponent.java | // Path: src/main/java/org/jembi/openhim/RestfulHttpRequest.java
// public static enum Scheme { HTTP, HTTPS }
//
// Path: src/main/java/org/jembi/openhim/exception/DefaultChannelInvalidConfigException.java
// public class DefaultChannelInvalidConfigException extends Exception {
//
// private static final long serial... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jembi.openhim.RestfulHttpRequest.Scheme;
import org.jembi.openhim.exception.DefaultChannelInvalidConfigException;
import org.jembi.openhim... | package org.jembi.openhim;
public class DefaultChannelComponent implements Callable {
protected static List<URLMapping> mappings = new ArrayList<URLMapping>();
private static final String MAPPING_FILE = "/defaultchannel-mapping.json";
private static final String HTTP_AUTH_TYPE_BASIC = "basic";
@Override
pu... | // Path: src/main/java/org/jembi/openhim/RestfulHttpRequest.java
// public static enum Scheme { HTTP, HTTPS }
//
// Path: src/main/java/org/jembi/openhim/exception/DefaultChannelInvalidConfigException.java
// public class DefaultChannelInvalidConfigException extends Exception {
//
// private static final long serial... | protected void setMessagePropertiesFromMapping(RestfulHttpRequest request, MuleMessage msg, URLMapping mapping) throws DefaultChannelInvalidConfigException { |
jembi/openhim-legacy | src/main/java/org/jembi/openhim/DefaultChannelComponent.java | // Path: src/main/java/org/jembi/openhim/RestfulHttpRequest.java
// public static enum Scheme { HTTP, HTTPS }
//
// Path: src/main/java/org/jembi/openhim/exception/DefaultChannelInvalidConfigException.java
// public class DefaultChannelInvalidConfigException extends Exception {
//
// private static final long serial... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jembi.openhim.RestfulHttpRequest.Scheme;
import org.jembi.openhim.exception.DefaultChannelInvalidConfigException;
import org.jembi.openhim... | }
String path = null;
if (mapping.getPathTransform()!=null) {
path = transformPath(request.getPath(), mapping.getPathTransform());
} else {
path = mapping.getPath();
}
request.setPath(path);
}
private String transformPath(String path, String sPattern) throws DefaultChannelInvalidConfigExcep... | // Path: src/main/java/org/jembi/openhim/RestfulHttpRequest.java
// public static enum Scheme { HTTP, HTTPS }
//
// Path: src/main/java/org/jembi/openhim/exception/DefaultChannelInvalidConfigException.java
// public class DefaultChannelInvalidConfigException extends Exception {
//
// private static final long serial... | protected URLMapping findURLMapping(Scheme scheme, String actualPath) { |
jembi/openhim-legacy | src/test/java/org/jembi/openhim/transformers/HttpResponseToRestfulHttpResponseTransformerTest.java | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.Map;
import org.jembi.openhim.RestfulHttpResponse;
import org.jembi.openhim.transformers.HttpResponseToRestfulHttpResponseTransformer;
import org.junit.... |
}
/**
* Test transformMessage method with null uuid
*/
@Test
public void testTransformMessageMuleMessageString_nullUUID() throws Exception {
excecuteTestCase("200", "Test Response", null, sampleHttpHeaders);
}
/**
* Test transformMessage method with null status code
*/
@Test
public void t... | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | HttpResponseToRestfulHttpResponseTransformer trans = new HttpResponseToRestfulHttpResponseTransformer(); |
jembi/openhim-legacy | src/test/java/org/jembi/openhim/transformers/HttpResponseToRestfulHttpResponseTransformerTest.java | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.HashMap;
import java.util.Map;
import org.jembi.openhim.RestfulHttpResponse;
import org.jembi.openhim.transformers.HttpResponseToRestfulHttpResponseTransformer;
import org.junit.... | }
/**
* Test transformMessage method with null uuid
*/
@Test
public void testTransformMessageMuleMessageString_nullUUID() throws Exception {
excecuteTestCase("200", "Test Response", null, sampleHttpHeaders);
}
/**
* Test transformMessage method with null status code
*/
@Test
public void test... | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | RestfulHttpResponse res = (RestfulHttpResponse) trans.transformMessage(msg, "UTF-8"); |
jembi/openhim-legacy | src/main/java/org/jembi/openhim/transformers/HttpResponseToRestfulHttpResponseTransformer.java | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | import java.util.Map;
import org.jembi.openhim.RestfulHttpResponse;
import org.mule.api.MuleMessage;
import org.mule.api.transformer.TransformerException;
import org.mule.api.transport.PropertyScope;
import org.mule.transformer.AbstractMessageTransformer; | /* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.jembi.openhim.transformers;
public class HttpResponseToRestfulHttpResponseTransformer extends
Abst... | // Path: src/main/java/org/jembi/openhim/RestfulHttpResponse.java
// public class RestfulHttpResponse implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// private String uuid = UUID.randomUUID().toString();
//
// private RestfulHttpRequest originalRequest;
//
// private int h... | RestfulHttpResponse restRes = new RestfulHttpResponse(); |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/AccountBusiness.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness; | package is.idega.idegaweb.egov.citizen.business;
public interface AccountBusiness extends com.idega.business.IBOService {
public void acceptApplication(int p0, com.idega.user.data.User p1, boolean p2) throws java.rmi.RemoteException, javax.ejb.CreateException;
public void acceptApplication(int p0, com.idega.user.... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | public java.lang.String getAcceptMessageSubject(AccountApplication theCase) throws java.rmi.RemoteException; |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/CitizenMessages.java | // Path: src/java/is/idega/idegaweb/egov/citizen/CitizenConstants.java
// public class CitizenConstants {
// public static final String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
// public static final String NEEDED_SCRIPT_AND_STYLE_FILES = "needed_script_and_style_files";
// public static final String... | import is.idega.idegaweb.egov.citizen.CitizenConstants;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.context.FacesContext;
import com.idega.block.web2.business.JQuery;
import com.idega.block.web2.business.Web2Business;
import com.... | package is.idega.idegaweb.egov.citizen.presentation;
public class CitizenMessages extends IWBaseComponent{
@Override
protected void initializeComponent(FacesContext context) {
super.initializeComponent(context);
IWContext iwc = IWContext.getIWContext(context); | // Path: src/java/is/idega/idegaweb/egov/citizen/CitizenConstants.java
// public class CitizenConstants {
// public static final String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
// public static final String NEEDED_SCRIPT_AND_STYLE_FILES = "needed_script_and_style_files";
// public static final String... | IWBundle bundle = iwc.getIWMainApplication().getBundle(CitizenConstants.IW_BUNDLE_IDENTIFIER); |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/CitizenAccountApplication.java | // Path: src/java/is/idega/idegaweb/egov/citizen/business/WSCitizenAccountBusiness.java
// public interface WSCitizenAccountBusiness extends IBOService,
// CitizenAccountBusiness, CallbackHandler {
// /**
// * @see is.idega.idegaweb.egov.citizen.business.WSCitizenAccountBusinessBean#changePasswordAndSendLetterOrEm... | import is.idega.idegaweb.egov.citizen.business.WSCitizenAccountBusiness;
import java.io.IOException;
import java.rmi.RemoteException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.ut... | } else if (!SocialSecurityNumber.isValidIcelandicSocialSecurityNumber(ssn)) {
errors.add(this.iwrb.getLocalizedString("not_a_valid_personal_id", "The personal ID you've entered is not valid."));
hasErrors = true;
}
if (!isValidAge(iwc, ssn)) {
Object[] arguments = { iwc.getApplicationSettings().getProper... | // Path: src/java/is/idega/idegaweb/egov/citizen/business/WSCitizenAccountBusiness.java
// public interface WSCitizenAccountBusiness extends IBOService,
// CitizenAccountBusiness, CallbackHandler {
// /**
// * @see is.idega.idegaweb.egov.citizen.business.WSCitizenAccountBusinessBean#changePasswordAndSendLetterOrEm... | WSCitizenAccountBusiness business = getBusiness(iwc); |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/CitizenAccountBusinessBean.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.citizen.data.CitizenAccount;
import is.idega.idegaweb.egov.citizen.data.CitizenAccountHome;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import javax.ejb.CreateExceptio... | /*
* $Id$ Copyright (C) 2002 Idega hf. All Rights Reserved. This software is
* the proprietary information of Idega hf. Use is subject to license terms.
*/
package is.idega.idegaweb.egov.citizen.business;
/**
* Last modified: $Date$ by $Author$
*
* @author <a href="mail:palli@idega.is">Pall Helgason </a>
*... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | protected CitizenAccountHome getCitizenAccountHome() throws RemoteException { |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/CitizenAccountBusinessBean.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.citizen.data.CitizenAccount;
import is.idega.idegaweb.egov.citizen.data.CitizenAccountHome;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import javax.ejb.CreateExceptio... | /*
* $Id$ Copyright (C) 2002 Idega hf. All Rights Reserved. This software is
* the proprietary information of Idega hf. Use is subject to license terms.
*/
package is.idega.idegaweb.egov.citizen.business;
/**
* Last modified: $Date$ by $Author$
*
* @author <a href="mail:palli@idega.is">Pall Helgason </a>
*... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | return (CitizenAccountHome) IDOLookup.getHome(CitizenAccount.class); |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/CitizenAccountBusinessBean.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.citizen.data.CitizenAccount;
import is.idega.idegaweb.egov.citizen.data.CitizenAccountHome;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import javax.ejb.CreateExceptio... | try {
StringBuffer userSsn = new StringBuffer(ssn);
int i = ssn.indexOf('-');
if (i != -1) {
userSsn.deleteCharAt(i);
ssn = userSsn.toString();
}
user = ((UserHome) IDOLookup.getHome(User.class)).findByPersonalID(userSsn.toString());
}
catch (RemoteException e) {
return null;
}
catc... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/AccountApplication.java
// public interface AccountApplication extends com.idega.block.process.data.Case
// {
// public void setEmail(java.lang.String p0);
// public java.lang.String getEmail();
// public void setApplicantName(java.lang.String p0);
// public jav... | protected AccountApplication getApplication(int applicationID) throws FinderException { |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/CitizenAccountStatistics.java | // Path: src/java/is/idega/idegaweb/egov/citizen/business/CitizenAccountBusiness.java
// public interface CitizenAccountBusiness extends IBOService, AccountBusiness {
//
// public Integer insertApplication(IWContext iwc, User user, String ssn, String email, String phoneHome, String phoneWork, boolean sendEmail, boole... | import is.idega.idegaweb.egov.citizen.business.CitizenAccountBusiness;
import java.rmi.RemoteException;
import com.idega.business.IBOLookup;
import com.idega.business.IBORuntimeException;
import com.idega.idegaweb.IWApplicationContext;
import com.idega.idegaweb.IWResourceBundle;
import com.idega.presentation.IWContext;... | /*
* $Id$ Created on Mar 27, 2006
*
* Copyright (C) 2006 Idega Software hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf. Use is subject to license terms.
*/
package is.idega.idegaweb.egov.citizen.presentation;
public class CitizenAccountStatistics extends CitizenBlock {... | // Path: src/java/is/idega/idegaweb/egov/citizen/business/CitizenAccountBusiness.java
// public interface CitizenAccountBusiness extends IBOService, AccountBusiness {
//
// public Integer insertApplication(IWContext iwc, User user, String ssn, String email, String phoneHome, String phoneWork, boolean sendEmail, boole... | protected CitizenAccountBusiness getCitizenAccountBusiness(IWApplicationContext iwac) throws RemoteException { |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/CitizenBlock.java | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | import is.idega.idegaweb.egov.citizen.IWBundleStarter;
import java.util.Collection;
import com.idega.presentation.Block;
import com.idega.presentation.IWContext;
import com.idega.presentation.Layer;
import com.idega.presentation.text.Heading1;
import com.idega.presentation.text.ListItem;
import com.idega.presentation.t... | /*
* $Id$
* Created on Jan 15, 2006
*
* Copyright (C) 2006 Idega Software hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf.
* Use is subject to license terms.
*/
package is.idega.idegaweb.egov.citizen.presentation;
public abstract class CitizenBlock extends Block {
@Ov... | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | return IWBundleStarter.IW_BUNDLE_IDENTIFIER; |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/AccountApplicationBusinessBean.java | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | import is.idega.idegaweb.egov.accounting.business.CitizenBusiness;
import is.idega.idegaweb.egov.citizen.IWBundleStarter;
import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import java.text.MessageFormat;... | /*
* $Id$
*
* Copyright (C) 2002 Idega hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf. Use is subject to license terms.
*
*/
package is.idega.idegaweb.egov.citizen.business;
/**
* @author <a href="mailto:tryggvi@idega.is">Tryggvi Larusson</a>
* @version 1.0
*/
pu... | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | protected AccountApplication getApplication(int applicationID) throws FinderException { |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/business/AccountApplicationBusinessBean.java | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | import is.idega.idegaweb.egov.accounting.business.CitizenBusiness;
import is.idega.idegaweb.egov.citizen.IWBundleStarter;
import is.idega.idegaweb.egov.citizen.data.AccountApplication;
import is.idega.idegaweb.egov.message.business.CommuneMessageBusiness;
import java.rmi.RemoteException;
import java.text.MessageFormat;... | lt = getUserBusiness().generateUserLogin(citizen);
login = lt.getUserLogin();
try {
String password = lt.getUnencryptedUserPassword();
String messageBody = this.getAcceptMessageBody(theCase, login, password);
String messageSubject = this.getAcceptMessageSubject(theCase);
if (createUserMessage) {
... | // Path: src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java
// public class IWBundleStarter implements IWBundleStartable {
//
// public final static String IW_BUNDLE_IDENTIFIER = "is.idega.idegaweb.egov.citizen";
//
// @Override
// public void start(IWBundle starterBundle) {
// addDefaultRemoteService... | return IWBundleStarter.IW_BUNDLE_IDENTIFIER; |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import com.idega.builder.bea... | public void stop(IWBundle starterBundle) {
}
private void addDefaultContactPurposes() throws CreateException, IDOLookupException{
ContactPurposeHome contactPurposeHome = (ContactPurposeHome) IDOLookup.getHome(ContactPurpose.class);
Collection<ContactPurpose> contacts = contactPurposeHome.getContactPurposes(1);... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | CitizenRemoteServicesHome citizenRemoteServicesHome = null; |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/IWBundleStarter.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.CreateException;
import com.idega.builder.bea... |
private void addDefaultContactPurposes() throws CreateException, IDOLookupException{
ContactPurposeHome contactPurposeHome = (ContactPurposeHome) IDOLookup.getHome(ContactPurpose.class);
Collection<ContactPurpose> contacts = contactPurposeHome.getContactPurposes(1);
if(!ListUtil.isEmpty(contacts)){
return;
... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class); |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/SingleSingOn.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
import com.ideg... | layer.add(input);
cellInfo.addText(iwrb.getLocalizedString("name", "Name"));
// Password
layer = new Layer();
main.add(layer);
layer.setStyleClass("formItem");
PasswordInput passwordInput = new PasswordInput(passwordName);
cellInfo = new Label(passwordInput);
layer.add(cellInfo);
layer.add(passwo... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | CitizenRemoteServicesHome citizenRemoteServicesHome = null; |
idega/is.idega.idegaweb.egov.citizen | src/java/is/idega/idegaweb/egov/citizen/presentation/SingleSingOn.java | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServices;
import is.idega.idegaweb.egov.citizen.data.CitizenRemoteServicesHome;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.idega.data.IDOLookup;
import com.idega.data.IDOLookupException;
import com.ideg... |
// Password
layer = new Layer();
main.add(layer);
layer.setStyleClass("formItem");
PasswordInput passwordInput = new PasswordInput(passwordName);
cellInfo = new Label(passwordInput);
layer.add(cellInfo);
layer.add(passwordInput);
cellInfo.addText(iwrb.getLocalizedString("password", "Password"));
... | // Path: src/java/is/idega/idegaweb/egov/citizen/data/CitizenRemoteServices.java
// public interface CitizenRemoteServices extends IDOEntity {
// public String getServerName();
// public void setServerName(String name);
// public String getAddress();
// public void setAddress(String address);
// public Collection<... | citizenRemoteServicesHome = (CitizenRemoteServicesHome) IDOLookup.getHome(CitizenRemoteServices.class); |
twak/campskeleton | src/org/twak/camp/Feature.java | // Path: src/org/twak/camp/ui/Marker.java
// public class Marker extends Point2d
// {
// @Deprecated
// public Tag feature;
//
// public Bar bar;
//
// // what created this marker?
// public Object generator;
//
// @Deprecated
// public Map<String, Object> properties = new HashMap();
... | import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Comparator;
import javax.swing.ButtonGroup;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButtonMenuItem;
import org.twak.camp.ui.Marker;
imp... | package org.twak.camp;
/**
* "Tags" for output properties
*
* @author twak
*/
public class Feature
{
static Rainbow rainbow;
public Color color;
public String name;
String colorName;
public Feature (String name)
{
color = Rainbow.next( this.getClass() );
colorName =... | // Path: src/org/twak/camp/ui/Marker.java
// public class Marker extends Point2d
// {
// @Deprecated
// public Tag feature;
//
// public Bar bar;
//
// // what created this marker?
// public Object generator;
//
// @Deprecated
// public Map<String, Object> properties = new HashMap();
... | public JPopupMenu createMenu(final Marker m) |
twak/campskeleton | src/org/twak/camp/Feature.java | // Path: src/org/twak/camp/ui/Marker.java
// public class Marker extends Point2d
// {
// @Deprecated
// public Tag feature;
//
// public Bar bar;
//
// // what created this marker?
// public Object generator;
//
// @Deprecated
// public Map<String, Object> properties = new HashMap();
... | import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Comparator;
import javax.swing.ButtonGroup;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JRadioButtonMenuItem;
import org.twak.camp.ui.Marker;
imp... | colorName = Rainbow.lastAsString( this.getClass() );
this.name = name;
}
public static Comparator<Feature> nameComparator = new Comparator<Feature> ()
{
public int compare( Feature o1, Feature o2 )
{
return String.CASE_INSENSITIVE_ORDER.compare(o1.name, o2.name);... | // Path: src/org/twak/camp/ui/Marker.java
// public class Marker extends Point2d
// {
// @Deprecated
// public Tag feature;
//
// public Bar bar;
//
// // what created this marker?
// public Object generator;
//
// @Deprecated
// public Map<String, Object> properties = new HashMap();
... | for (Type t : Marker.Type.values()) |
twak/campskeleton | src/org/twak/camp/ui/Anchor.java | // Path: src/org/twak/camp/Tag.java
// public class Tag
// {
// static Rainbow rainbow;
// public Color color;
// public String name;
// String colorName;
//
// public Tag()
// {
// this ("unnamed");
// }
//
// public Tag (String name)
// {
// color = Rainbow.next( ... | import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.vecmath.Point2d;
import org.twak.camp.Tag; | package org.twak.camp.ui;
/**
* marks the locatino of a feature on a Bar
* @author twak
*/
public class Anchor extends Point2d
{ | // Path: src/org/twak/camp/Tag.java
// public class Tag
// {
// static Rainbow rainbow;
// public Color color;
// public String name;
// String colorName;
//
// public Tag()
// {
// this ("unnamed");
// }
//
// public Tag (String name)
// {
// color = Rainbow.next( ... | public Tag feature; |
twak/campskeleton | src/org/twak/camp/CollisionQ.java | // Path: src/org/twak/camp/debug/DebugDevice.java
// public class DebugDevice
// {
// // global debug switch
// public static boolean debug; // change in reset(), below
// public static DebugDevice instance = new DebugDevice();
//
// public static void reset() {
// debug = false;
// ... | import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Set;
import javax.vecmath.Point3d;
import javax.vecmath.Tuple3d;
import org.twak.camp.debug.DebugDevice;
| public void holdRemoves()
{
removes.clear();
holdRemoves = true;
}
public void resumeRemoves()
{
holdRemoves = false;
for (Corner c : removes)
if (skel.liveCorners.contains( c )) // if hasn't been removed by horiz decomp
removeCorne... | // Path: src/org/twak/camp/debug/DebugDevice.java
// public class DebugDevice
// {
// // global debug switch
// public static boolean debug; // change in reset(), below
// public static DebugDevice instance = new DebugDevice();
//
// public static void reset() {
// debug = false;
// ... | DebugDevice.dump("about to delete "+toAdd.toString(), skel);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.