public Object loadComponent(Class componentClass) { return JiraUtils.loadComponent(componentClass); } }
/** * Checks if Jira is setup or not * * @return true if jira is not setup, false if is not */ private boolean isFirstRun() { return !JiraUtils.isSetup(); }
/** * Used to validate the hours to see that the from hour is before the to hour, if specified. * Note: to allow the range to run "all-day" (eg. from 12AM to 12AM), we need to also allow the from and to times to * be equal. * * @return true if from is before to or if they have not been specified. */ public boolean isRangeHoursValid() { if (hoursFrom != null && hoursFromMeridian != null && hoursTo != null && hoursToMeridian != null && incrementInMinutes != null && !incrementInMinutes.equals("0")) { try { int hoursFromInt = Integer.parseInt(hoursFrom); int hoursToInt = Integer.parseInt(hoursTo); return JiraUtils.get24HourTime(hoursFromMeridian, hoursFromInt) <= JiraUtils.get24HourTime(hoursToMeridian, hoursToInt); } catch (NumberFormatException e) { // Something is freaky with the hours, hmmmm.... return false; } } return true; }
boolean isPublicMode() { return JiraUtils.isPublicMode(); }
/** * We are going to evaluate if the user set a hostname in the .properties file * if that is the case then we need to use that one all over the cluster * @return the ip/hostname */ protected String buildHostname() { String hostname = clusterNodeProperties.getProperty(DefaultEhCacheConfigurationFactory.EHCACHE_LISTENER_HOSTNAME); return hostname != null ? hostname : JiraUtils.getHostname(); }
public boolean isPublicMode() { return JiraUtils.isPublicMode(); }
private FactoryConfiguration buildPeerListenerFactory(final ClusterNodeProperties clusterNodeProperties) { final String hostname = clusterNodeProperties.getProperty(EHCACHE_LISTENER_HOSTNAME); final String port = clusterNodeProperties.getProperty(EHCACHE_LISTENER_PORT); final String socketTimeoutMillis = clusterNodeProperties.getProperty(EHCACHE_LISTENER_SOCKET_TIMEOUT_MILLIS); final Properties properties = new Properties(); // We add the JiraUtils to maintain consistency between Java 7 and 8. // EhCache uses the default Java 7 approach, and it will fail in the future. properties.put("hostName", hostname != null ? hostname : JiraUtils.getHostname()); properties.put("port", port != null ? port : DEFAULT_LISTENER_PORT); if (socketTimeoutMillis != null) { properties.put("socketTimeoutMillis", socketTimeoutMillis); } return new FactoryConfiguration() .className(RMICacheManagerPeerListenerFactory.class.getName()) .properties(propertiesToString(properties)); }
public <T> T create(final Class<T> tClass) throws IllegalArgumentException { return JiraUtils.loadComponent(tClass); } }
public boolean isApplicationSetUp() { return JiraUtils.isSetup(); }
public boolean isAllowSignUp() { return userManager.hasPasswordWritableDirectory() && JiraUtils.isPublicMode(); } }
/** * Indicates that the range of time specified spans across the full 24 hours in a day (which is indicated by the * computed hoursFrom in 24 hour time being equal to the computed hoursTo in 24 hour time). * * @return true only if we have specified a range, and that range spans across the 24 hours. */ public boolean is24HourRange() { boolean result = false; if (isRange()) { int hoursFromInt = Integer.parseInt(hoursFrom); int hoursToInt = Integer.parseInt(hoursTo); result = JiraUtils.get24HourTime(hoursFromMeridian, hoursFromInt) == JiraUtils.get24HourTime(hoursToMeridian, hoursToInt); } return result; }
public <T> T createObject(final Class<T> type) { return JiraUtils.loadComponent(type); }
public boolean isApplicationSetUp() { return JiraUtils.isSetup(); }
public boolean isAllowSignUp() { return userManager.hasPasswordWritableDirectory() && JiraUtils.isPublicMode(); } }
int atMins = getIntFromString(cronEditorBean.getMinutes()); atHours = JiraUtils.get24HourTime(cronEditorBean.getHoursRunOnceMeridian(), atHours); int fromHours = JiraUtils.get24HourTime(cronEditorBean.getHoursFromMeridian(), getIntFromString(cronEditorBean.getHoursFrom())); int toHours = JiraUtils.get24HourTime(cronEditorBean.getHoursToMeridian(), getIntFromString(cronEditorBean.getHoursTo()));
public Object loadComponent(String className, Class callingClass) throws ClassNotFoundException { return JiraUtils.loadComponent(className, callingClass); }
protected void doUpgradesIfSetup() { //only perform upgrades if JIRA is setup if (JiraUtils.isSetup()) { doUpgrades(); } }
public String doDefault() throws Exception { requireResources(); if (!JiraUtils.isPublicMode()) { return "modebreach"; } if (getLoggedInUser() != null) { return "alreadyloggedin"; } if (!validateSeats()) { return "limitexceeded"; } if (!validateApplicationAccess()) { return "appaccesserror"; } return super.doDefault(); }
public <T> T createObject(final Class<T> type, final Object... arguments) { if (arguments.length == 0) { return JiraUtils.loadComponent(type); } else { return JiraUtils.loadComponent(type, Arrays.asList(arguments)); } }
@Override public void start() { if (!JiraStartupChecklist.startupOK()) { LOGGER.debug("Skipping, JIRA is locked."); return; } // Fire a JiraStarted Event to the plugin framework. // This allows SAL to give a better LifecycleAware onStart() time, and the JIRA SAL implementation can fire start() on Startable OSGi components. // See http://jira.atlassian.com/browse/JRA-23876 if(JiraUtils.isSetup()) { getPluginEventManager().broadcast(new JiraStartedEvent()); } }