@Override protected boolean isDeleteAllowed(ServiceContext context, Entity entity) { Notification notification = (Notification) entity; Notification.State state = notification.getState(); return !(state.equals(Notification.State.CREATED) || state.equals(Notification.State.STARTED) || state.equals(Notification.State.SCHEDULED)); }
public static long extractExpiration(User user) { Long expiration = (Long) user.getProperty("expiration"); if (expiration == null) { expiration = (long) 7200; } return expiration * 1000; } }
public FileImport() { setLastUpdatedUUID(" "); setErrorMessage(" "); setState(FileImport.State.CREATED); }
public JobData jobExportDataCreator(HashMap<String, Object> payload,UUID exportUUID,S3Export s3Export) { JobData jobData = new JobData(); jobData.setProperty( "jobName", "exportJob" ); jobData.setProperty( "exportInfo", payload ); jobData.setProperty( "exportId", exportUUID ); jobData.setProperty( "s3Export", s3Export); return jobData; }
public UUID getApplicationId() { return application.getUuid(); }
private void replaceProviderId(EntityRef device, Notifier notifier, String newProviderId) throws Exception { Object value = em.getProperty(device, notifier.getName() + ApplicationQueueManager.NOTIFIER_ID_POSTFIX); if (value != null) { em.setProperty(device, notifier.getName() + ApplicationQueueManager.NOTIFIER_ID_POSTFIX, newProviderId); } else { value = em.getProperty(device, notifier.getUuid() + ApplicationQueueManager.NOTIFIER_ID_POSTFIX); if (value != null) { em.setProperty(device, notifier.getUuid() + ApplicationQueueManager.NOTIFIER_ID_POSTFIX, newProviderId); } } }
public WNSAdapter(EntityManager entityManager, Notifier notifier) { this.entityManager = entityManager; this.notifier = notifier; this.service = new WnsService(notifier.getSid(), notifier.getApiKey(), notifier.getLogging()); }
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) public String getPriority() { // simply default the priority to normal so it's never null if (priority == null || priority.isEmpty()){ priority = "normal"; } // validate that the priority available is a valid Usergrid notification priority String notificationPriority; try{ notificationPriority = Priority.valueOf(priority.toUpperCase()).toString(); }catch(IllegalArgumentException e){ // it's not a valid Usergrid notification priority, default to normal notificationPriority = Priority.NORMAL.toString(); } setPriority(notificationPriority.toLowerCase()); return priority; }
public Notification() { pathQuery = new PathTokens(); }
@JsonIgnore public InputStream getP12CertificateStream() { byte[] cert = getP12Certificate(); return cert != null ? new ByteArrayInputStream(cert) : null; }
public EntityPushManager( Notifier notifier, EntityManager entityManager, BlockingQueue<SimpleApnsPushNotification> queue, PushManagerConfiguration configuration) { super(getApnsEnvironment(notifier), getSSLContext(notifier), null, null, queue, configuration, notifier.getName()); this.notifier = notifier; this.entityManager = entityManager; }
public Notification getSourceNotification(EntityRef receipt) throws Exception { Receipt r = em.get(receipt.getUuid(), Receipt.class); return em.get(r.getNotificationUUID(), Notification.class); }
public FileImport( String fileName, UUID applicationId ) { this(); this.fileName = fileName; this.setApplicationId(applicationId); }
public void completed() { updateState( Status.IN_PROGRESS, "Attempted to complete job not in progress", Status.COMPLETED ); stats.setDuration( duration ); }
public void add( Activity activity ) { this.properties.putAll( activity.getProperties() ); }
private static ApnsEnvironment getApnsEnvironment(Notifier notifier){ return notifier.isProduction() ? ApnsEnvironment.getProductionEnvironment() : ApnsEnvironment.getSandboxEnvironment(); } private static SSLContext getSSLContext(Notifier notifier) {
public JobData jobDataCreator(HashMap<String, Object> payload,UUID exportUUID, S3Export s3Export) { JobData jobData = new JobData(); jobData.setProperty( "jobName", "exportJob" ); jobData.setProperty( "exportInfo", payload ); jobData.setProperty( "exportId", exportUUID ); jobData.setProperty( "s3Export", s3Export ); return jobData; }
public SignInAsProvider facebook( Application application ) { FacebookProvider facebookProvider = new FacebookProvider( emf.getEntityManager( application.getUuid() ), managementService ); facebookProvider.configure(); return facebookProvider; }
public JobData jobImportDataCreator(HashMap<String, Object> payload,UUID importUUID,S3Import s3Import) { JobData jobData = new JobData(); jobData.setProperty( "jobName", "importJob" ); jobData.setProperty( "importInfo", payload ); jobData.setProperty( "importId", importUUID ); jobData.setProperty( "s3Import", s3Import ); return jobData; }