Skip to content

Instantly share code, notes, and snippets.

View pentaho-nbaker's full-sized avatar

Nick Baker pentaho-nbaker

  • Pentaho Corp.
  • Orlando, FL
View GitHub Profile
@pentaho-nbaker
pentaho-nbaker / gist:3443857441c827bd6d93
Last active August 29, 2015 14:05
executeLockedOperation
private T executeLockedOperation( Callable<T> callee ) throws MetaStoreException{
readLock.lock();
try {
return calee.call()
} catch( Exception e){
if( e instance of MetaStoreException){
throw (MetaStoreException) e;
}
throw new MetaStoreException( e );
} finally {
<!--
~ This program is free software; you can redistribute it and/or modify it under the
~ terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
~ Foundation.
~
~ You should have received a copy of the GNU Lesser General Public License along with this
~ program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
~ or from the Free Software Foundation, Inc.,
~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
~
@pentaho-nbaker
pentaho-nbaker / SnmpProcessor.java
Created August 19, 2014 18:24
Filtering XML content
/*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
Aug 07, 2014 11:01:39 PM com.sun.jersey.spi.container.ContainerResponse mapMappableContainerException
SEVERE: The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
org.springframework.transaction.CannotCreateTransactionException: Could not open JCR session for transaction; nested exception is java.lang.IllegalStateException: getAttribute: Session already invalidated
at org.springframework.extensions.jcr.jackrabbit.LocalTransactionManager.doBegin(LocalTransactionManager.java:160)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at o
<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
<properties environment="env" />
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local" override="true" />
<property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]"
override="false" />
<!-- Repository for Pentaho-hosted artifacts -->
<property name="pentaho.artifactory.resolve.repo" value="http://repo.pentaho.org/artifactory/repo" override="false" />
<property name="pentaho.resolve.repo" value="http://nexus.pentaho.org:8080/content/groups/omni" override="false" />
/**
* Save or update a User in the system.
*
* Create or update a system user with the values from the supplied XML document. Existing user
* records will be overwritten if the overwrite flag is true. If a user was overwritten,
* <code>true</code> will be returned in the Response object.
*
* @param userDoc list of files to be restored
* <pre>
* {@code
package org.pentaho.platform.web.http.request;
import org.apache.commons.io.IOUtils;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
/*!
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
@pentaho-nbaker
pentaho-nbaker / SecurityHelper.java
Created June 11, 2014 02:09
Moving PentahoSessionHolder.setSession up above call to createAuthentication()
/*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License, version 2 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/gpl-2.0.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
<?xml version="1.0" encoding="UTF-8"?>
<plugin title="common-ui">
<!-- uncomment these menu items to access the test pages via the User Console menu -->
<!-- menu-items>
<menu-item id="test-index" anchor="tools-submenu" label="Common UI Tests" command="content/common-ui/resources/web/test/testindex.html" type="MENU_ITEM" how="LAST_CHILD"/>
</menu-items -->
<static-paths>