code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public Client findClient(String clientUUID, Integer profileId) throws Exception {
Client client = null;
/* ERROR CODE: 500 WHEN TRYING TO DELETE A SERVER GROUP.
THIS APPEARS TO BE BECAUSE CLIENT UUID IS NULL.
*/
/* CODE ADDED TO PREVENT NULL POINTERS. */
if (clientUU... | java |
private Client getClientFromResultSet(ResultSet result) throws Exception {
Client client = new Client();
client.setId(result.getInt(Constants.GENERIC_ID));
client.setUUID(result.getString(Constants.CLIENT_CLIENT_UUID));
client.setFriendlyName(result.getString(Constants.CLIENT_FRIENDLY_NA... | java |
public Client setFriendlyName(int profileId, String clientUUID, String friendlyName) throws Exception {
// first see if this friendlyName is already in use
Client client = this.findClientFromFriendlyName(profileId, friendlyName);
if (client != null && !client.getUUID().equals(clientUUID)) {
... | java |
public void updateActive(int profileId, String clientUUID, Boolean active) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_CLIENT +
... | java |
public void reset(int profileId, String clientUUID) throws Exception {
PreparedStatement statement = null;
// TODO: need a better way to do this than brute force.. but the iterative approach is too slow
try (Connection sqlConnection = sqlService.getConnection()) {
// first remove a... | java |
public String getProfileIdFromClientId(int id) {
return (String) sqlService.getFromTable(Constants.CLIENT_PROFILE_ID, Constants.GENERIC_ID, id, Constants.DB_TABLE_CLIENT);
} | java |
@RequestMapping(value = "/scripts", method = RequestMethod.GET)
public String scriptView(Model model) throws Exception {
return "script";
} | java |
@RequestMapping(value = "/api/scripts", method = RequestMethod.GET)
public
@ResponseBody
HashMap<String, Object> getScripts(Model model,
@RequestParam(required = false) Integer type) throws Exception {
Script[] scripts = ScriptService.getInstance().getScripts(t... | java |
@RequestMapping(value = "/api/scripts", method = RequestMethod.POST)
public
@ResponseBody
Script addScript(Model model,
@RequestParam(required = true) String name,
@RequestParam(required = true) String script) throws Exception {
return ScriptService.getInst... | java |
@RequestMapping(value = "group", method = RequestMethod.GET)
public String newGroupGet(Model model) {
model.addAttribute("groups",
pathOverrideService.findAllGroups());
return "groups";
} | java |
protected void createKeystore() {
java.security.cert.Certificate signingCert = null;
PrivateKey caPrivKey = null;
if(_caCert == null || _caPrivKey == null)
{
try
{
log.debug("Keystore or signing cert & keypair not found. Generating...");
KeyPair caKeypair = getRSAKeyPair();
caPrivKey = c... | java |
public synchronized void addCertAndPrivateKey(String hostname, final X509Certificate cert, final PrivateKey privKey)
throws KeyStoreException, CertificateException, NoSuchAlgorithmException
{
// String alias = ThumbprintUtil.getThumbprint(cert);
_ks.deleteEntry(hostname);
_ks.setCertificateEntry(hostname... | java |
public synchronized X509Certificate getCertificateByHostname(final String hostname) throws KeyStoreException, CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, Unrec... | java |
public synchronized X509Certificate getMappedCertificate(final X509Certificate cert)
throws CertificateEncodingException,
InvalidKeyException,
CertificateException,
CertificateNotYetValidException,
NoSuchAlgorithmException,
NoSuchProviderException,
SignatureException,
KeyStoreException,
UnrecoverableKeyExcepti... | java |
public X509Certificate getMappedCertificateForHostname(String hostname) throws CertificateParsingException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, UnrecoverableKeyE... | java |
public synchronized PrivateKey getPrivateKeyForLocalCert(final X509Certificate cert)
throws CertificateEncodingException, KeyStoreException, UnrecoverableKeyException,
NoSuchAlgorithmException
{
String thumbprint = ThumbprintUtil.getThumbprint(cert);
return (PrivateKey)_ks.getKey(thumbprint, _keypassword);
} | java |
public synchronized void mapPublicKeys(final PublicKey original, final PublicKey substitute)
{
_mappedPublicKeys.put(original, substitute);
if(persistImmediately) { persistPublicKeyMap(); }
} | java |
public Script getScript(int id) {
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants.DB_TABLE_SCRIPT +
... | java |
public Script[] getScripts(Integer type) {
ArrayList<Script> returnData = new ArrayList<>();
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(... | java |
public Script updateName(int id, String name) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SCRIPT +
... | java |
public void removeScript(int id) throws Exception {
PreparedStatement statement = null;
try (Connection sqlConnection = SQLService.getInstance().getConnection()) {
statement = sqlConnection.prepareStatement(
"DELETE FROM " + Constants.DB_TABLE_SCRIPT +
" ... | java |
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
final ServletRequest r1 = request;
chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) response) {
@SuppressWarnings("unchec... | java |
public static int[] arrayFromStringOfIntegers(String str) throws IllegalArgumentException {
StringTokenizer tokenizer = new StringTokenizer(str, ",");
int n = tokenizer.countTokens();
int[] list = new int[n];
for (int i = 0; i < n; i++) {
String token = tokenizer.nextToken();... | java |
public static File copyResourceToLocalFile(String sourceResource, String destFileName) throws Exception {
try {
Resource keystoreFile = new ClassPathResource(sourceResource);
InputStream in = keystoreFile.getInputStream();
File outKeyStoreFile = new File(destFileName);
... | java |
public static int getSystemPort(String portIdentifier) {
int defaultPort = 0;
if (portIdentifier.compareTo(Constants.SYS_API_PORT) == 0) {
defaultPort = Constants.DEFAULT_API_PORT;
} else if (portIdentifier.compareTo(Constants.SYS_DB_PORT) == 0) {
defaultPort = Constants... | java |
public static String getPublicIPAddress() throws Exception {
final String IPV4_REGEX = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z";
String ipAddr = null;
Enumeration e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
... | java |
public Configuration getConfiguration(String name) {
Configuration[] values = getConfigurations(name);
if (values == null) {
return null;
}
return values[0];
} | java |
public Configuration[] getConfigurations(String name) {
ArrayList<Configuration> valuesList = new ArrayList<Configuration>();
logger.info("Getting data for {}", name);
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getC... | java |
@RequestMapping(value = "api/edit/disableAll", method = RequestMethod.POST)
public
@ResponseBody
String disableAll(Model model, int profileID,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) {
editService.disableAll(profileID, clientUUID);
... | java |
@RequestMapping(value = "api/edit/repeatNumber", method = RequestMethod.POST)
public
@ResponseBody
String updateRepeatNumber(Model model, int newNum, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
log... | java |
@RequestMapping(value = "api/edit/enable/custom", method = RequestMethod.POST)
public
@ResponseBody
String enableCustomResponse(Model model, String custom, int path_id,
@RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
... | java |
@RequestMapping(value = "api/edit/disable", method = RequestMethod.POST)
public
@ResponseBody
String disableResponses(Model model, int path_id, @RequestParam(defaultValue = Constants.PROFILE_CLIENT_DEFAULT_ID) String clientUUID) throws Exception {
OverrideService.getInstance().disableAllOverrides(pa... | java |
public void startServer() throws Exception {
if (!externalDatabaseHost) {
try {
this.port = Utils.getSystemPort(Constants.SYS_DB_PORT);
server = Server.createTcpServer("-tcpPort", String.valueOf(port), "-tcpAllowOthers").start();
} catch (SQLException e) {... | java |
public void stopServer() throws Exception {
if (!externalDatabaseHost) {
try (Connection sqlConnection = getConnection()) {
sqlConnection.prepareStatement("SHUTDOWN").execute();
} catch (Exception e) {
}
try {
server.stop();
... | java |
public static SQLService getInstance() throws Exception {
if (_instance == null) {
_instance = new SQLService();
_instance.startServer();
// default pool size is 20
// can be overriden by env variable
int dbPool = 20;
if (Utils.getEnvironm... | java |
public void updateSchema(String migrationPath) {
try {
logger.info("Updating schema... ");
int current_version = 0;
// first check the current schema version
HashMap<String, Object> configuration = getFirstResult("SELECT * FROM " + Constants.DB_TABLE_CONFIGURATIO... | java |
public int executeUpdate(String query) throws Exception {
int returnVal = 0;
Statement queryStatement = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createStatement();
returnVal = queryStatement.executeUpdate(query);
} c... | java |
public HashMap<String, Object> getFirstResult(String query)
throws Exception {
HashMap<String, Object> result = null;
Statement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = getConnection()) {
queryStatement = sqlConnection.createSt... | java |
public Clob toClob(String stringName, Connection sqlConnection) {
Clob clobName = null;
try {
clobName = sqlConnection.createClob();
clobName.setString(1, stringName);
} catch (SQLException e) {
// TODO Auto-generated catch block
logger.info("Unabl... | java |
private String[] getColumnNames(ResultSetMetaData rsmd) throws Exception {
ArrayList<String> names = new ArrayList<String>();
// Get result set meta data
int numColumns = rsmd.getColumnCount();
// Get the column names; column indices start from 1
for (int i = 1; i < numColumns ... | java |
public List<ServerRedirect> tableServers(int clientId) {
List<ServerRedirect> servers = new ArrayList<>();
try {
Client client = ClientService.getInstance().getClient(clientId);
servers = tableServers(client.getProfile().getId(), client.getActiveServerGroup());
} catch (... | java |
public List<ServerRedirect> tableServers(int profileId, int serverGroupId) {
ArrayList<ServerRedirect> servers = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement... | java |
public List<ServerGroup> tableServerGroups(int profileId) {
ArrayList<ServerGroup> serverGroups = new ArrayList<>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnectio... | java |
public ServerRedirect getRedirect(int id) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
queryStatement = sqlConnection.prepareStatement(
"SELECT * FROM " + Constants... | java |
public ServerGroup getServerGroup(int id, int profileId) throws Exception {
PreparedStatement queryStatement = null;
ResultSet results = null;
if (id == 0) {
return new ServerGroup(0, "Default", profileId);
}
try (Connection sqlConnection = sqlService.getConnection(... | java |
public int addServerRedirectToProfile(String region, String srcUrl, String destUrl, String hostHeader,
int profileId, int clientId) throws Exception {
int serverId = -1;
try {
Client client = ClientService.getInstance().getClient(clientId);
... | java |
public int addServerRedirect(String region, String srcUrl, String destUrl, String hostHeader, int profileId, int groupId) throws Exception {
int serverId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
... | java |
public int addServerGroup(String groupName, int profileId) throws Exception {
int groupId = -1;
PreparedStatement statement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement("INSERT INTO... | java |
public void setGroupName(String name, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVER_GROUPS +
" SET " + Constant... | java |
public void setSourceUrl(String newUrl, int id) {
PreparedStatement statement = null;
try (Connection sqlConnection = sqlService.getConnection()) {
statement = sqlConnection.prepareStatement(
"UPDATE " + Constants.DB_TABLE_SERVERS +
" SET " + Constants.SE... | java |
public void deleteRedirect(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
} catch (Exception e) {
e.printStackTrace();
}
} | java |
public void deleteServerGroup(int id) {
try {
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVER_GROUPS +
" WHERE " + Constants.GENERIC_ID + " = " + id + ";");
sqlService.executeUpdate("DELETE FROM " + Constants.DB_TABLE_SERVERS ... | java |
public Profile[] getProfilesForServerName(String serverName) throws Exception {
int profileId = -1;
ArrayList<Profile> returnProfiles = new ArrayList<Profile>();
PreparedStatement queryStatement = null;
ResultSet results = null;
try (Connection sqlConnection = sqlService.getConn... | java |
public static PluginManager getInstance() {
if (_instance == null) {
_instance = new PluginManager();
_instance.classInformation = new HashMap<String, ClassInformation>();
_instance.methodInformation = new HashMap<String, com.groupon.odo.proxylib.models.Method>();
... | java |
public void identifyClasses(final String pluginDirectory) throws Exception {
methodInformation.clear();
jarInformation.clear();
try {
new FileTraversal() {
public void onDirectory(final File d) {
}
public void onFile(final File f) {
... | java |
private String getClassNameFromPath(String path) {
String className = path.replace(".class", "");
// for *nix
if (className.startsWith("/")) {
className = className.substring(1, className.length());
}
className = className.replace("/", ".");
// for windows
... | java |
public void loadClass(String className) throws Exception {
ClassInformation classInfo = classInformation.get(className);
logger.info("Loading plugin.: {}, {}", className, classInfo.pluginPath);
// get URL for proxylib
// need to load this also otherwise the annotations cannot be found ... | java |
public void callFunction(String className, String methodName, PluginArguments pluginArgs, Object... args) throws Exception {
Class<?> cls = getClass(className);
ArrayList<Object> newArgs = new ArrayList<>();
newArgs.add(pluginArgs);
com.groupon.odo.proxylib.models.Method m = preparePlug... | java |
private synchronized Class<?> getClass(String className) throws Exception {
// see if we need to invalidate the class
ClassInformation classInfo = classInformation.get(className);
File classFile = new File(classInfo.pluginPath);
if (classFile.lastModified() > classInfo.lastModified) {
... | java |
public String[] getMethods(String pluginClass) throws Exception {
ArrayList<String> methodNames = new ArrayList<String>();
Method[] methods = getClass(pluginClass).getDeclaredMethods();
for (Method method : methods) {
logger.info("Checking {}", method.getName());
com.gr... | java |
public List<com.groupon.odo.proxylib.models.Method> getMethodsNotInGroup(int groupId) throws Exception {
List<com.groupon.odo.proxylib.models.Method> allMethods = getAllMethods();
List<com.groupon.odo.proxylib.models.Method> methodsNotInGroup = new ArrayList<com.groupon.odo.proxylib.models.Method>();
... | java |
public Plugin[] getPlugins(Boolean onlyValid) {
Configuration[] configurations = ConfigurationService.getInstance().getConfigurations(Constants.DB_TABLE_CONFIGURATION_PLUGIN_PATH);
ArrayList<Plugin> plugins = new ArrayList<Plugin>();
if (configurations == null) {
return new Plugin[... | java |
public byte[] getResource(String pluginName, String fileName) throws Exception {
// TODO: This is going to be slow.. future improvement is to cache the data instead of searching all jars
for (String jarFilename : jarInformation) {
JarFile jarFile = new JarFile(new File(jarFilename));
... | java |
public static boolean changeHost(String hostName,
boolean enable,
boolean disable,
boolean remove,
boolean isEnabled,
boolean exists) t... | java |
public static String getByteArrayDataAsString(String contentEncoding, byte[] bytes) {
ByteArrayOutputStream byteout = null;
if (contentEncoding != null &&
contentEncoding.equals("gzip")) {
// GZIP
ByteArrayInputStream bytein = null;
GZIPInputStream zis... | java |
@SuppressWarnings("deprecation")
@RequestMapping(value = "/api/backup", method = RequestMethod.GET)
public
@ResponseBody
String getBackup(Model model, HttpServletResponse response) throws Exception {
response.addHeader("Content-Disposition", "attachment; filename=backup.json");
response.... | java |
@RequestMapping(value = "/api/backup", method = RequestMethod.POST)
public
@ResponseBody
Backup processBackup(@RequestParam("fileData") MultipartFile fileData) throws Exception {
// Method taken from: http://spring.io/guides/gs/uploading-files/
if (!fileData.isEmpty()) {
try {
... | java |
public static void enableHost(String hostName) throws Exception {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
impl.enableHost(hostName... | java |
public static boolean isAvailable() throws Exception {
try {
Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);
return tru... | java |
protected String getContextPath(){
if(context != null) return context;
if(get("context_path") == null){
throw new ViewException("context_path missing - red alarm!");
}
return get("context_path").toString();
} | java |
protected void process(String text, Map params, Writer writer){
try{
Template t = new Template("temp", new StringReader(text), FreeMarkerTL.getEnvironment().getConfiguration());
t.process(params, writer);
}catch(Exception e){
throw new ViewException(e);
... | java |
protected Map getAllVariables(){
try{
Iterator names = FreeMarkerTL.getEnvironment().getKnownVariableNames().iterator();
Map vars = new HashMap();
while (names.hasNext()) {
Object name =names.next();
vars.put(name, get(name.toString()));
... | java |
@Value("${org.apereo.portal.portlets.favorites.MarketplaceFunctionalName:null}")
public void setMarketplaceFName(String marketplaceFunctionalName) {
// interpret null, non-text-having, or literal "null" as
// signaling lack of Marketplace functional name.
if (!StringUtils.hasText(marketplac... | java |
@EventMapping(SearchConstants.SEARCH_RESULTS_QNAME_STRING)
public void handleSearchResult(EventRequest request) {
// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet
// instance receive
// searchRequest and searchResult events because they are in the sam... | java |
@RequestMapping
public ModelAndView showSearchForm(RenderRequest request, RenderResponse response) {
final Map<String, Object> model = new HashMap<>();
String viewName;
// Determine if the new REST search should be used
if (isRestSearch(request)) {
viewName = "/jsp/Searc... | java |
private String calculateSearchLaunchUrl(RenderRequest request, RenderResponse response) {
final HttpServletRequest httpRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
final IPortalUrlBuilder portalUrlBuilder =
this.portalUrlProvider.getPortalUrlBuilderBy... | java |
@ResourceMapping(value = "retrieveSearchJSONResults")
public ModelAndView showJSONSearchResults(PortletRequest request) {
PortletPreferences prefs = request.getPreferences();
int maxTextLength =
Integer.parseInt(prefs.getValue(AUTOCOMPLETE_MAX_TEXT_LENGTH_PREF_NAME, "180"));
... | java |
private SortedMap<Integer, List<AutocompleteResultsModel>> getCleanedAndSortedMapResults(
ConcurrentMap<String, List<Tuple<SearchResult, String>>> resultsMap,
int maxTextLength) {
SortedMap<Integer, List<AutocompleteResultsModel>> prioritizedResultsMap =
createAutocomplet... | java |
protected void modifySearchResultLinkTitle(
SearchResult result,
final HttpServletRequest httpServletRequest,
final IPortletWindowId portletWindowId) {
// If the title contains a SpEL expression, parse it with the portlet definition in the
// evaluation context.
... | java |
protected String getResultUrl(
HttpServletRequest httpServletRequest,
SearchResult result,
IPortletWindowId portletWindowId) {
final String externalUrl = result.getExternalUrl();
if (externalUrl != null) {
return externalUrl;
}
UrlType url... | java |
public String getParameterValue(String name) {
NodeList parms = node.getChildNodes();
for (int i = 0; i < parms.getLength(); i++) {
Element parm = (Element) parms.item(i);
if (parm.getTagName().equals(Constants.ELM_PARAMETER)) {
String parmName = parm.getAttribut... | java |
@RequestMapping(
value = USERINFO_ENDPOINT_URI,
produces = USERINFO_CONTENT_TYPE,
method = {RequestMethod.GET, RequestMethod.POST})
public String userInfo(
HttpServletRequest request,
@RequestParam(value = "claims", required = false) String claims,
... | java |
public void setTargets(Collection<IPermissionTarget> targets) {
// clear out any existing targets
targetMap.clear();
// add each target to the internal map and index it by the target key
for (IPermissionTarget target : targets) {
targetMap.put(target.getKey(), target);
... | java |
@Override
public IPersonAttributes getPerson(String uid) {
final IPersonAttributes rslt = delegatePersonAttributeDao.getPerson(uid);
if (rslt == null) {
// Nothing we can do with that
return null;
}
return postProcessPerson(rslt, uid);
} | java |
@Override
public synchronized String register(ServletConfig config) throws PortletContainerException {
ServletContext servletContext = config.getServletContext();
String contextPath = servletContext.getContextPath();
if (!portletContexts.containsKey(contextPath)) {
PortletApplic... | java |
public synchronized PortletApplicationDefinition getPortletAppDD(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp =
this.portletAppDefinitionCache.get(servletContext);
if (p... | java |
private PortletApplicationDefinition createDefinition(
ServletContext servletContext, String name, String contextPath)
throws PortletContainerException {
PortletApplicationDefinition portletApp = null;
try {
InputStream paIn = servletContext.getResourceAsStream(PORTLE... | java |
protected ClusterMutex getClusterMutexInternal(final String mutexName) {
final TransactionOperations transactionOperations = this.getTransactionOperations();
return transactionOperations.execute(
new TransactionCallback<ClusterMutex>() {
@Override
... | java |
protected void createClusterMutex(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager e... | java |
protected void validateLockedMutex(ClusterMutex clusterMutex) {
if (!clusterMutex.isLocked()) {
throw new IllegalMonitorStateException(
"Mutex is not currently locked, it cannot be updated: " + clusterMutex);
}
final String serverName = this.portalInfoProvider.get... | java |
protected void unlockAbandonedLock(final String mutexName) {
this.executeIgnoreRollback(
new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
final EntityManager ... | java |
protected <T> T executeIgnoreRollback(TransactionCallback<T> action, T rollbackValue) {
try {
// Try to create the mutex in a new TX
return this.newTransactionTemplate.execute(action);
} catch (TransactionSystemException e) {
if (e.getCause() instanceof RollbackExcept... | java |
public boolean hasAnyFavorites(IUserLayout layout) {
Validate.notNull(layout, "Cannot determine whether a null layout contains favorites.");
// (premature) performance optimization: short circuit returns true if nonzero favorite
// portlets
return (!getFavoritePortletLayoutNodes(layout)... | java |
@Override
public void perform() throws PortalException {
// push the change into the PLF
if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
// we are dealing with an incorporated node, so get a plf ghost
// node, set its attribute, then add a directive indicating the... | java |
protected Map<String, String> getUserInfo(
String remoteUser, HttpServletRequest httpServletRequest, IPortletWindow portletWindow)
throws PortletContainerException {
// Get the list of user attributes the portal knows about the user
final IPersonAttributes personAttributes = this... | java |
protected Map<String, String> generateUserInfo(
final IPersonAttributes personAttributes,
final List<? extends UserAttribute> expectedUserAttributes,
HttpServletRequest httpServletRequest) {
final Map<String, String> portletUserAttributes =
new HashMap<String,... | java |
@RequestMapping
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
// create... | java |
protected void selectFormDefaultPortlet(final F report) {
final Set<AggregatedPortletMapping> portlets = this.getPortlets();
if (!portlets.isEmpty()) {
report.getPortlets().add(portlets.iterator().next().getFname());
}
} | java |
private void getMetaData(final Connection conn) {
try {
final DatabaseMetaData dmd = conn.getMetaData();
this.databaseProductName = dmd.getDatabaseProductName();
this.databaseProductVersion = dmd.getDatabaseProductVersion();
this.driverName = dmd.getDriverName();... | java |
@RequestMapping(
headers = {"org.apereo.portal.url.UrlType=ACTION"},
method = RequestMethod.POST)
public void actionRequest(HttpServletRequest request, HttpServletResponse response)
throws IOException {
final IPortalRequestInfo portalRequestInfo =
this.ur... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.