Skip to content

Commit

Permalink
ocpsoft.org
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Mar 26, 2012
1 parent fbde398 commit 5c06a07
Show file tree
Hide file tree
Showing 337 changed files with 1,447 additions and 1,832 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependency-reduced-pom.xml
target/
*.iml
*.ipr
*.idea
*.iws
*.*~
bin/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ Get Started
2. Include OCPSoft Rewrite in your application's POM file:

<dependency>
<groupId>com.ocpsoft.rewrite</groupId>
<groupId>org.ocpsoft.rewrite</groupId>
<artifactId>rewrite-impl-servlet</artifactId>
<version>${rewrite.version}</version>
</dependency>

3. Add a configuration provider implementing the 'com.ocpsoft.rewrite.config.ConfigurationProvider' interface, or extending from the abstract HttpConfigurationProvider class for convenience:
3. Add a configuration provider implementing the 'org.ocpsoft.rewrite.config.ConfigurationProvider' interface, or extending from the abstract HttpConfigurationProvider class for convenience:

package com.example;
public class ExampleConfigurationProvider extends HttpConfigurationProvider
Expand All @@ -55,13 +55,13 @@ Get Started
}
}

4. Create a file named: '/META-INF/services/com.ocpsoft.rewrite.config.ConfigurationProvider' which contains the fully qualified name of your ConfigurationProvider implementation:
4. Create a file named: '/META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider' which contains the fully qualified name of your ConfigurationProvider implementation:

/META-INF/services/com.ocpsoft.rewrite.config.ConfigurationProvider
/META-INF/services/org.ocpsoft.rewrite.config.ConfigurationProvider
---
com.example.ExampleConfigurationProvider

5. Add rules to your configuration. Condition objects such as 'Direction.isInbound()' and 'Path.matches(...)' can be found in the 'com.ocpsoft.rewrite.config.*' and 'com.ocpsoft.rewrite.servlet.config.*' packages.
5. Add rules to your configuration. Condition objects such as 'Direction.isInbound()' and 'Path.matches(...)' can be found in the 'org.ocpsoft.rewrite.config.*' and 'org.ocpsoft.rewrite.servlet.config.*' packages.

6. Consider using Rewrite extensions for extra power:
* [JodaTime Integration](https://github.com/ocpsoft/rewrite/tree/master/config-jodatime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet;
package org.ocpsoft.rewrite.servlet;

import java.util.List;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.ocpsoft.rewrite.context.Context;
import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer;
import com.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer;
import com.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper;
import com.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener;
import com.ocpsoft.rewrite.spi.RewriteProvider;
import org.ocpsoft.rewrite.context.Context;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer;
import org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer;
import org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper;
import org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener;
import org.ocpsoft.rewrite.spi.RewriteProvider;

/**
* Stores implementations of all Rewrite lifecycle services.
Expand All @@ -48,17 +48,17 @@ public interface RewriteLifecycleContext extends Context
List<RequestCycleWrapper<ServletRequest, ServletResponse>> getRequestCycleWrappers();

/**
* Get all available {@link RewriteProvider} instances.
* Get all available {@link org.ocpsoft.rewrite.spi.RewriteProvider} instances.
*/
List<RewriteProvider<Rewrite>> getRewriteProviders();

/**
* Get all available {@link InboundRewriteProducer} instances.
* Get all available {@link org.ocpsoft.rewrite.servlet.spi.InboundRewriteProducer} instances.
*/
List<InboundRewriteProducer<ServletRequest, ServletResponse>> getInboundRewriteEventProducers();

/**
* Get all available {@link OutboundRewriteProducer} instances.
* Get all available {@link org.ocpsoft.rewrite.servlet.spi.OutboundRewriteProducer} instances.
*/
List<OutboundRewriteProducer<ServletRequest, ServletResponse, Object>> getOutboundProducers();
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet;
package org.ocpsoft.rewrite.servlet;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.event.ServletRewrite;
import com.ocpsoft.rewrite.spi.RewriteProvider;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.event.ServletRewrite;
import org.ocpsoft.rewrite.spi.RewriteProvider;

/**
* Abstract implementation of {@link RewriteProvider} which only handles {@link ServletRewrite} events.
* Abstract implementation of {@link org.ocpsoft.rewrite.spi.RewriteProvider} which only handles {@link org.ocpsoft.rewrite.servlet.event.ServletRewrite} events.
*
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.config;
package org.ocpsoft.rewrite.servlet.config;

import com.ocpsoft.rewrite.config.ConditionBuilder;
import com.ocpsoft.rewrite.context.EvaluationContext;
import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import org.ocpsoft.rewrite.config.ConditionBuilder;
import org.ocpsoft.rewrite.context.EvaluationContext;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;

/**
* A condition that only applies to {@link HttpServletRewrite} events.
Expand All @@ -28,7 +28,7 @@
public abstract class HttpCondition extends ConditionBuilder
{
/**
* Evaluate this condition against the given {@link HttpServletRewrite} event. If this condition does not apply to
* Evaluate this condition against the given {@link org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite} event. If this condition does not apply to
* the given event, it must return false. If the condition applies and is satisfied, return true.
*/
public abstract boolean evaluateHttp(final HttpServletRewrite event, EvaluationContext context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.config;
package org.ocpsoft.rewrite.servlet.config;

import javax.servlet.ServletContext;

import com.ocpsoft.rewrite.config.ConfigurationProvider;
import org.ocpsoft.rewrite.config.ConfigurationProvider;

/**
* Configuration provider for HTTP/Servlet environments.
*
* @see ConfigurationProvider
* @see org.ocpsoft.rewrite.config.ConfigurationProvider
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.config;
package org.ocpsoft.rewrite.servlet.config;

import com.ocpsoft.rewrite.config.Operation;
import com.ocpsoft.rewrite.config.OperationBuilder;
import com.ocpsoft.rewrite.context.EvaluationContext;
import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import org.ocpsoft.rewrite.config.Operation;
import org.ocpsoft.rewrite.config.OperationBuilder;
import org.ocpsoft.rewrite.context.EvaluationContext;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;

/**
* An {@link Operation} that is only performed if the current {@link Rewrite} event is an instance of
* An {@link Operation} that is only performed if the current {@link org.ocpsoft.rewrite.event.Rewrite} event is an instance of
* {@link HttpServletRewrite}
*
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.event;
package org.ocpsoft.rewrite.servlet.event;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.ocpsoft.rewrite.config.Rule;
import com.ocpsoft.rewrite.context.Context;
import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.exception.RewriteException;
import com.ocpsoft.rewrite.servlet.RewriteLifecycleContext;
import org.ocpsoft.rewrite.context.Context;
import org.ocpsoft.rewrite.exception.RewriteException;
import org.ocpsoft.rewrite.servlet.RewriteLifecycleContext;

/**
* Base implementation of {@link InboundServletRewriteEvent}
Expand Down Expand Up @@ -59,7 +57,7 @@ public void abort()
}

/**
* Continue processing {@link Rule} definitions for the current {@link ServletRequest}, even if a call to
* Continue processing {@link org.ocpsoft.rewrite.config.Rule} definitions for the current {@link ServletRequest}, even if a call to
* {@link #abort()}, {@link #handled()}, {@link #forward(String)}, or any other life-cycle control method has
* previously been made.
*/
Expand All @@ -69,7 +67,7 @@ public void proceed()
}

/**
* Stop processing {@link Rule} definitions and pass control of the the current {@link ServletRequest} to the
* Stop processing {@link org.ocpsoft.rewrite.config.Rule} definitions and pass control of the the current {@link ServletRequest} to the
* underlying application, even if a call to {@link #abort()}, {@link #proceed()}, {@link #forward(String)}, or any
* other life-cycle control method has previously been made.
*/
Expand All @@ -79,7 +77,7 @@ public void handled()
}

/**
* Once {@link Rule} processing has completed, perform a
* Once {@link org.ocpsoft.rewrite.config.Rule} processing has completed, perform a
* {@link RequestDispatcher#include(ServletRequest, ServletResponse)} of the given resource target.
*/
public void include(final String resource)
Expand All @@ -89,7 +87,7 @@ public void include(final String resource)
}

/**
* Once {@link Rule} processing has completed, perform a
* Once {@link org.ocpsoft.rewrite.config.Rule} processing has completed, perform a
* {@link RequestDispatcher#forward(ServletRequest, ServletResponse)} to the given resource target.
*/
public void forward(final String resource)
Expand Down Expand Up @@ -235,7 +233,7 @@ public String toString()
}

/**
* Get the {@link Context} for the current {@link Rewrite}.
* Get the {@link org.ocpsoft.rewrite.context.Context} for the current {@link org.ocpsoft.rewrite.event.Rewrite}.
*/
public Context getRewriteContext()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,25 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.event;
package org.ocpsoft.rewrite.servlet.event;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestWrapper;
import javax.servlet.ServletResponse;
import javax.servlet.ServletResponseWrapper;

import com.ocpsoft.rewrite.event.InboundRewrite;
import com.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener;
import com.ocpsoft.rewrite.spi.RewriteProvider;
import org.ocpsoft.rewrite.event.InboundRewrite;
import org.ocpsoft.rewrite.spi.RewriteProvider;

/**
* Immutable event propagated to registered {@link RewriteLifecycleListener} and {@link RewriteProvider} instances when
* Immutable event propagated to registered {@link org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener} and {@link RewriteProvider} instances when
* an inbound as the rewrite lifecycle is executed.
*
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
*/
public interface InboundServletRewrite<IN extends ServletRequest, OUT extends ServletResponse> extends
InboundRewrite, ServletRewrite<IN, OUT>
InboundRewrite, ServletRewrite<IN, OUT>
{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.event;
package org.ocpsoft.rewrite.servlet.event;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.ocpsoft.rewrite.event.OutboundRewrite;
import org.ocpsoft.rewrite.event.OutboundRewrite;

/**
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
*/
public interface OutboundServletRewrite<IN extends ServletRequest, OUT extends ServletResponse> extends
OutboundRewrite, ServletRewrite<IN, OUT>
OutboundRewrite, ServletRewrite<IN, OUT>
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.event;
package org.ocpsoft.rewrite.servlet.event;

import javax.servlet.FilterChain;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.event.BaseRewrite.Flow;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.event.BaseRewrite.Flow;

/**
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.http;
package org.ocpsoft.rewrite.servlet.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import com.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import org.ocpsoft.rewrite.servlet.spi.RequestCycleWrapper;

/**
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.http;
package org.ocpsoft.rewrite.servlet.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import com.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import org.ocpsoft.rewrite.servlet.spi.RewriteLifecycleListener;

/**
* A {@link RewriteLifecycleListener} that only listens on {@link HttpServletRequest} and {@link HttpServletResponse}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.ocpsoft.rewrite.servlet.http;
package org.ocpsoft.rewrite.servlet.http;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.ocpsoft.rewrite.event.Rewrite;
import com.ocpsoft.rewrite.servlet.ServletRewriteProvider;
import com.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
import com.ocpsoft.rewrite.spi.RewriteProvider;
import org.ocpsoft.rewrite.event.Rewrite;
import org.ocpsoft.rewrite.servlet.ServletRewriteProvider;
import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;

/**
* A {@link RewriteProvider} that only operates on {@link HttpServletRequest} and {@link HttpServletResponse} request
* A {@link org.ocpsoft.rewrite.spi.RewriteProvider} that only operates on {@link HttpServletRequest} and {@link HttpServletResponse} request
* cycle types.
*
* @author <a href="mailto:[email protected]">Lincoln Baxter, III</a>
Expand Down
Loading

0 comments on commit 5c06a07

Please sign in to comment.