Codota Logo
CasManagementConfigurationProperties
Code IndexAdd Codota to your IDE (free)

How to use
CasManagementConfigurationProperties
in
org.apereo.cas.configuration

Best Java code snippets using org.apereo.cas.configuration.CasManagementConfigurationProperties (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: org.apereo.cas/cas-mgmt-webapp-config

  @Override
  protected Locale determineDefaultLocale(final HttpServletRequest request) {
    val locale = request.getLocale();
    if (StringUtils.isEmpty(managementProperties.getDefaultLocale())
      || !locale.getLanguage().equals(managementProperties.getDefaultLocale())) {
      return locale;
    }
    return new Locale(managementProperties.getDefaultLocale());
  }
};
origin: org.apereo.cas/cas-mgmt-support-version-control

@SneakyThrows
private GitUtil userRepository(final String user) {
  return buildGitUtil(casProperties.getDelegated().getUserReposDir() + '/' + user);
}
origin: org.apereo.cas/cas-mgmt-support-version-control

/**
 * Method returns a GitUtil wrapping the master repository.
 *
 * @return - GitUtil
 */
@SneakyThrows
public GitUtil masterRepository() {
  return buildGitUtil(casProperties.getVersionControl().getServicesRepo());
}
origin: org.apereo.cas/cas-mgmt-core-authentication

  /**
   * create user profile for views.
   *
   * @param request  the request
   * @param response the response
   * @return the cas user profile
   */
  public CasUserProfile from(final HttpServletRequest request, final HttpServletResponse response) {
    val manager = new ProfileManager(new J2EContext(request, response));
    val profile = (Optional<UserProfile>) manager.get(true);
    if (profile.isPresent()) {
      val up = profile.get();
      val cas = new CasUserProfile(up, this.casProperties.getAdminRoles());
      LOGGER.debug("Located CAS user profile [{}]", cas);
      return cas;
    }
    throw new IllegalArgumentException("Could not determine authenticated profile");
  }
}
origin: org.apereo.cas/cas-mgmt-config-authentication

if (StringUtils.hasText(managementProperties.getAuthzIpRegex())) {
  LOGGER.info("Configuring an authentication strategy based on authorized IP addresses matching [{}]", managementProperties.getAuthzIpRegex());
  val ipClient = new IpClient(new IpRegexpAuthenticator(managementProperties.getAuthzIpRegex()));
  ipClient.setName("IpClient");
  ipClient.setAuthorizationGenerator(staticAdminRolesAuthorizationGenerator);
origin: org.apereo.cas/cas-mgmt-support-version-control

/**
 * If a syncScript is configured it will be executed.
 *
 * @throws SyncScriptFailureException - failed.
 */
private void runSyncScript() throws SyncScriptFailureException {
  if (managementProperties.getVersionControl().getSyncScript() != null) {
    try {
      val status = Runtime.getRuntime().exec(managementProperties.getVersionControl().getSyncScript()).waitFor();
      if (status > 0) {
        LOGGER.error("SyncScript returned value > 0");
        throw new SyncScriptFailureException();
      }
    } catch (final IOException e) {
      LOGGER.error(e.getMessage(), e);
      throw new SyncScriptFailureException();
    } catch (final InterruptedException e) {
      Thread.currentThread().interrupt();
      throw new SyncScriptFailureException();
    }
  }
}
origin: org.apereo.cas/cas-mgmt-support-version-control

/**
 * Method loads the git repository based on the user and their permissions.
 *
 * @param user - CasUserProfile of logged in user
 * @return - GitUtil wrapping the user's repository
 */
@SneakyThrows
public GitUtil from(final CasUserProfile user) {
  if (user.isAdministrator()) {
    LOGGER.debug("User [{}] is not an administrator. Loading objects from master repository", user);
    return masterRepository();
  }
  val path = Paths.get(casProperties.getDelegated().getUserReposDir() + '/' + user.getId());
  if (!Files.exists(path)) {
    clone(path.toString());
  }
  return userRepository(user.getId());
}
origin: org.apereo.cas/cas-mgmt-support-version-control

  /**
   * Clones the master repository into the passed in directory.
   *
   * @param clone - String representing dir to create the clone
   * @return - GitUtil
   */
  public GitUtil clone(final String clone) {
    try {
      val uri = casProperties.getVersionControl().getServicesRepo() + REPO_DIR;
      LOGGER.debug("Cloning repository [{}] to path [{}]", uri, clone);
      return new GitUtil(Git.cloneRepository()
        .setURI(uri)
        .setDirectory(new File(clone))
        .call());
    } catch (final Exception e) {
      LOGGER.error(e.getMessage(), e);
      return null;
    }
  }
}
origin: org.apereo.cas/cas-mgmt-support-version-control

/**
 * Init repository.
 */
@PostConstruct
public void initRepository() {
  val servicesRepo = Paths.get(managementProperties.getVersionControl().getServicesRepo());
  if (!Files.exists(servicesRepo)) {
    try {
      Git.init().setDirectory(servicesRepo.toFile()).call().commit().setMessage("Created").call();
    } catch (final Exception e) {
      return;
    }
    try (GitUtil git = repositoryFactory.masterRepository()) {
      val manager = new VersionControlServicesManager(createJSONServiceManager(git), namingStrategy, git);
      manager.loadFrom(servicesManager);
      git.addWorkingChanges();
      git.commit("Initial commit");
      git.setPublished();
    } catch (final Exception e) {
      LOGGER.error(e.getMessage(), e);
    }
  }
}
org.apereo.cas.configurationCasManagementConfigurationProperties

Javadoc

This is CasManagementConfigurationProperties.

Most used methods

  • getAdminRoles
  • getAuthzIpRegex
  • getDefaultLocale
  • getDelegated
  • getVersionControl

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • putExtra (Intent)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now