public void setApiKey(String apiKey) { ExceptionUtils.assertNotNull(apiKey, "apiKey"); this.apiKey = apiKey; }
public void setDomainId(long domainId) { ExceptionUtils.assertNotNull(domainId, "domainId"); this.domainId = domainId; }
public ManagePluginApi(Domain domain, PushType pushType) { this.pushType = ExceptionUtils.assertNotNull(pushType, "pushType"); this.domain = ExceptionUtils.assertNotNull(domain, "domain"); }
public AccountRequest(AccountQuery query, AccountAction operation) { this.query = ExceptionUtils.assertNotNull(query, "query"); this.operation = ExceptionUtils.assertNotNull(operation, "operation"); }
public GoogleTalkDelegate(PluginContext pluginContext, Domain domain, PushRequest pushRequest, GoogleTalkPush push, GoogleTalkConfig config) { super(pluginContext, pushRequest); this.config = ExceptionUtils.assertNotNull(config, "config"); this.push = ExceptionUtils.assertNotNull(push, "push"); this.domain = ExceptionUtils.assertNotNull(domain, "domain"); this.appContext = pluginContext.getAppContext(); }
public SesEmailDelegate(PluginContext pluginContext, Domain domain, PushRequest pushRequest, SesEmailPush push, SesEmailConfig config) { super(pluginContext, pushRequest); this.push = ExceptionUtils.assertNotNull(push, "push"); this.config = ExceptionUtils.assertNotNull(config, "config"); this.domain = ExceptionUtils.assertNotNull(domain, "domain"); this.appContext = pluginContext.getAppContext(); }
public LqNotificationsDelegate(PluginContext pluginContext, Domain domain, PushRequest pushRequest, LqNotificationPush push, LqNotificationsConfig config) { super(pluginContext, pushRequest); this.appContext = pluginContext.getAppContext(); this.config = ExceptionUtils.assertNotNull(config, "config"); this.push = ExceptionUtils.assertNotNull(push, "push"); this.domain = ExceptionUtils.assertNotNull(domain, "domain"); }
public NotificationDelegateV1(PluginContext pluginContext, Domain domain, PushRequest pushRequest, NotificationPushV1 push) { super(pluginContext, pushRequest); this.push = ExceptionUtils.assertNotNull(push, "push"); this.pluginContext = ExceptionUtils.assertNotNull(pluginContext, "context"); this.domain = ExceptionUtils.assertNotNull(domain, "domain"); this.appContext = pluginContext.getAppContext(); }
public void setApiUrl(String apiUrl) { ExceptionUtils.assertNotNull(apiUrl, "apiUrl"); if (apiUrl.endsWith("/")) { apiUrl = apiUrl.substring(0, apiUrl.length()-1); } this.apiUrl = apiUrl; }
public Sequence(SequenceType sequenceType, String firstValue) { this.sequenceId = ExceptionUtils.assertNotNull(sequenceType, "sequenceType").getId(); this.lastValue = ExceptionUtils.assertNotNull(firstValue, "firstValue"); }
public void setResourceUrl(String resourceUrl) { ExceptionUtils.assertNotNull(resourceUrl, "resourceUrl"); if (resourceUrl.endsWith("/")) { resourceUrl = resourceUrl.substring(0, resourceUrl.length()-1); } this.resourceUrl = resourceUrl; } }
@Override public InputStream getResourceAsStream(final TemplateProcessingParameters templateProcessingParameters, final String resourceName) { ExceptionUtils.assertNotNull(resourceName, "resourceName"); InputStream is = getClass().getResourceAsStream(resourceName); if (is != null) return is; String msg = String.format("The resource \"%s\" was not found.", resourceName); throw new IllegalArgumentException(msg); } }
public DefaultCouchStore(CouchServer couchServer, String databaseName, Class<T> entityType) { this.entityType = ExceptionUtils.assertNotNull(entityType, "entityType"); ExceptionUtils.assertNotNull(databaseName, "databaseName"); this.database = couchServer.database(databaseName); if (database == null || database.exists() == false) { String msg = String.format("The database \"%s\" does not exist.", databaseName); throw new IllegalArgumentException(msg); } }
public CouchPropertyPlaceholderConfigurer(CouchServer couchServer, String databaseName, String entityName) throws MalformedURLException, URISyntaxException { ExceptionUtils.assertNotNull(couchServer, "couchServer"); ExceptionUtils.assertNotNull(entityName, "entityName"); AppConfigStore store = new AppConfigStore(couchServer, databaseName); CouchResourceLoader loader = new CouchResourceLoader(store); resources[0] = loader.getResource(entityName); }
public static DrivingDirections getDrivingDirections(LatLng locationA, LatLng locationB) throws IOException { // https://developers.google.com/maps/documentation/directions/ ExceptionUtils.assertNotNull(locationA, "locationA"); ExceptionUtils.assertNotNull(locationB, "locationB"); String url = "http://maps.googleapis.com/maps/api/directions/json"; url += String.format("?origin=%s,%s", locationA.getLatitude(), locationA.getLongitude()); url += String.format("&destination=%s,%s", locationB.getLatitude(), locationB.getLongitude()); url += "&sensor=false"; URLConnection connection = new URL(url).openConnection(); String json = IoUtils.toString(connection.getInputStream()); DrivingDirections directions = objectMapper.readValue(json, DrivingDirections.class); if (directions.getStatus().isNotOK()) { String msg = String.format("Unable to compute driving directions: %s (%s)", directions.getStatus(), directions.getStatus().getDescription()); throw ApiException.internalServerError(msg); } return directions; }
@Override public Account execute(AccountRequest purchaseRequest) { ExceptionUtils.assertNotNull(purchaseRequest, "request"); AccountAction accountOperation = purchaseRequest.getOperation();