Tabnine Logo
org.restlet.ext.platform.internal.agent.bean
Code IndexAdd Tabnine to your IDE (free)

How to use org.restlet.ext.platform.internal.agent.bean

Best Java code snippets using org.restlet.ext.platform.internal.agent.bean (Showing top 20 results out of 315)

origin: org.restlet.jse/org.restlet.ext.platform

  @Override
  public Integer apply(FirewallRateLimit firewallRateLimit) {
    return firewallRateLimit.getPeriod();
  }
});
origin: org.restlet.jse/org.restlet.ext.platform

private void addIpFilterRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getIpFilters() != null) {
    for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) {
      if (ipFilter.isWhiteList()) {
        firewallConfig.addIpAddressesWhiteList(ipFilter.getIps());
      } else {
        firewallConfig.addIpAddressesBlackList(ipFilter.getIps());
      }
    }
  }
}
origin: org.restlet.jse/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Create a new Authentication module with the specified settings.
 * 
 * @param restletCloudConfig
 *            The agent configuration.
 * @param modulesSettings
 *            The modules settings.
 * @param context
 *            The context
 */
public AuthenticationModule(RestletCloudConfig restletCloudConfig,
    ModulesSettings modulesSettings, Context context) {
  super(context, ChallengeScheme.HTTP_BASIC, "realm");
  authenticationSettings = new AuthenticationSettings();
  authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled());
  authenticateClientResource = AgentUtils.getClientResource(
      restletCloudConfig, modulesSettings,
      AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH);
  // config ChallengeAuthenticator
  setOptional(authenticationSettings.isOptional());
  setVerifier(new AgentVerifier());
  // Initialize the cache
  initializeCache();
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Creates a new Thread that asynchronously posts call logs to Restlet Cloud
 */
public void flushLogs() {
  if (callLogs.isEmpty()) {
    return;
  }
  CallLogs logsToPost;
  synchronized (callLogs) {
    if (callLogs.isEmpty()) {
      return;
    }
    logsToPost = new CallLogs(callLogs.size());
    logsToPost.addAll(callLogs);
    callLogs.clear();
  }
  postLogs(logsToPost);
}
origin: org.restlet.jse/org.restlet.ext.platform

.maximumSize(authenticationSettings.getCacheSize())
.expireAfterWrite(
    authenticationSettings.getCacheTimeToLiveSeconds(),
    TimeUnit.SECONDS).build(userLoader);
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Create a new Authentication module with the specified settings.
 * 
 * @param restletCloudConfig
 *            The agent configuration.
 * @param modulesSettings
 *            The modules settings.
 * @param context
 *            The context
 */
public AuthenticationModule(RestletCloudConfig restletCloudConfig,
    ModulesSettings modulesSettings, Context context) {
  super(context, ChallengeScheme.HTTP_BASIC, "realm");
  authenticationSettings = new AuthenticationSettings();
  authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled());
  authenticateClientResource = AgentUtils.getClientResource(
      restletCloudConfig, modulesSettings,
      AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH);
  // config ChallengeAuthenticator
  setOptional(authenticationSettings.isOptional());
  setVerifier(new AgentVerifier());
  // Initialize the cache
  initializeCache();
}
origin: org.restlet.gae/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.jee/org.restlet.ext.platform

private void addIpFilterRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getIpFilters() != null) {
    for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) {
      if (ipFilter.isWhiteList()) {
        firewallConfig.addIpAddressesWhiteList(ipFilter.getIps());
      } else {
        firewallConfig.addIpAddressesBlackList(ipFilter.getIps());
      }
    }
  }
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Creates a new Thread that asynchronously posts call logs to Restlet Cloud
 */
public void flushLogs() {
  if (callLogs.isEmpty()) {
    return;
  }
  CallLogs logsToPost;
  synchronized (callLogs) {
    if (callLogs.isEmpty()) {
      return;
    }
    logsToPost = new CallLogs(callLogs.size());
    logsToPost.addAll(callLogs);
    callLogs.clear();
  }
  postLogs(logsToPost);
}
origin: org.restlet.jee/org.restlet.ext.platform

  @Override
  public Integer apply(FirewallRateLimit firewallRateLimit) {
    return firewallRateLimit.getPeriod();
  }
});
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Create a new Authentication module with the specified settings.
 * 
 * @param restletCloudConfig
 *            The agent configuration.
 * @param modulesSettings
 *            The modules settings.
 * @param context
 *            The context
 */
public AuthenticationModule(RestletCloudConfig restletCloudConfig,
    ModulesSettings modulesSettings, Context context) {
  super(context, ChallengeScheme.HTTP_BASIC, "realm");
  authenticationSettings = new AuthenticationSettings();
  authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled());
  authenticateClientResource = AgentUtils.getClientResource(
      restletCloudConfig, modulesSettings,
      AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH);
  // config ChallengeAuthenticator
  setOptional(authenticationSettings.isOptional());
  setVerifier(new AgentVerifier());
  // Initialize the cache
  initializeCache();
}
origin: org.restlet.jee/org.restlet.ext.platform

private void addRateLimitationRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getRateLimits() != null) {
    List<FirewallRateLimit> rateLimits = firewallSettings
        .getRateLimits();
    Map<Integer, Collection<FirewallRateLimit>> rateLimitsByPeriod = sortRateLimitsByPeriod(rateLimits);
    for (Integer period : rateLimitsByPeriod.keySet()) {
      Map<String, Integer> limitsPerRole = new HashMap<>();
      int defaultRateLimit = Integer.MAX_VALUE;
      for (FirewallRateLimit firewallRateLimit : rateLimitsByPeriod
          .get(period)) {
        if (firewallRateLimit.isDefaultRateLimit()) {
          defaultRateLimit = firewallRateLimit.getRateLimit();
        } else {
          limitsPerRole.put(firewallRateLimit.getGroup(),
              firewallRateLimit.getRateLimit());
        }
      }
      firewallConfig.addRolesPeriodicCounter(period,
          TimeUnit.SECONDS, limitsPerRole, defaultRateLimit);
    }
  }
}
origin: org.restlet.gae/org.restlet.ext.platform

private void addIpFilterRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getIpFilters() != null) {
    for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) {
      if (ipFilter.isWhiteList()) {
        firewallConfig.addIpAddressesWhiteList(ipFilter.getIps());
      } else {
        firewallConfig.addIpAddressesBlackList(ipFilter.getIps());
      }
    }
  }
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Creates a new Thread that asynchronously posts call logs to Restlet Cloud
 */
public void flushLogs() {
  if (callLogs.isEmpty()) {
    return;
  }
  CallLogs logsToPost;
  synchronized (callLogs) {
    if (callLogs.isEmpty()) {
      return;
    }
    logsToPost = new CallLogs(callLogs.size());
    logsToPost.addAll(callLogs);
    callLogs.clear();
  }
  postLogs(logsToPost);
}
origin: org.restlet.gae/org.restlet.ext.platform

  @Override
  public Integer apply(FirewallRateLimit firewallRateLimit) {
    return firewallRateLimit.getPeriod();
  }
});
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Create a new Authentication module with the specified settings.
 * 
 * @param restletCloudConfig
 *            The agent configuration.
 * @param modulesSettings
 *            The modules settings.
 * @param context
 *            The context
 */
public AuthenticationModule(RestletCloudConfig restletCloudConfig,
    ModulesSettings modulesSettings, Context context) {
  super(context, ChallengeScheme.HTTP_BASIC, "realm");
  authenticationSettings = new AuthenticationSettings();
  authenticationSettings.setOptional(modulesSettings.isAuthorizationModuleEnabled());
  authenticateClientResource = AgentUtils.getClientResource(
      restletCloudConfig, modulesSettings,
      AuthenticationAuthenticateResource.class, AUTHENTICATE_PATH);
  // config ChallengeAuthenticator
  setOptional(authenticationSettings.isOptional());
  setVerifier(new AgentVerifier());
  // Initialize the cache
  initializeCache();
}
origin: org.restlet.osgi/org.restlet.ext.platform

private void addIpFilterRules(FirewallSettings firewallSettings,
    FirewallConfig firewallConfig) {
  if (firewallSettings.getIpFilters() != null) {
    for (FirewallIpFilter ipFilter : firewallSettings.getIpFilters()) {
      if (ipFilter.isWhiteList()) {
        firewallConfig.addIpAddressesWhiteList(ipFilter.getIps());
      } else {
        firewallConfig.addIpAddressesBlackList(ipFilter.getIps());
      }
    }
  }
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Creates a new Thread that asynchronously posts call logs to Restlet Cloud
 */
public void flushLogs() {
  if (callLogs.isEmpty()) {
    return;
  }
  CallLogs logsToPost;
  synchronized (callLogs) {
    if (callLogs.isEmpty()) {
      return;
    }
    logsToPost = new CallLogs(callLogs.size());
    logsToPost.addAll(callLogs);
    callLogs.clear();
  }
  postLogs(logsToPost);
}
origin: org.restlet.osgi/org.restlet.ext.platform

  @Override
  public Integer apply(FirewallRateLimit firewallRateLimit) {
    return firewallRateLimit.getPeriod();
  }
});
org.restlet.ext.platform.internal.agent.bean

Most used classes

  • AuthenticationSettings
  • CallLog
    Contains information about one call made to a Web API, used for communication with Restlet Cloud to
  • CallLogs
    List of CallLog element, used for communication with Restlet Cloud to store analytics about the Web
  • Credentials
  • FirewallIpFilter
  • FirewallSettings,
  • ModulesSettings,
  • OperationAuthorization,
  • User
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now