Class CollectionPropsInjector
- java.lang.Object
-
- org.restheart.mongodb.interceptors.CollectionPropsInjector
-
- All Implemented Interfaces:
ConfigurablePlugin,ExchangeTypeResolver<MongoRequest,MongoResponse>,Interceptor<MongoRequest,MongoResponse>,MongoInterceptor,Plugin
public class CollectionPropsInjector extends Object implements MongoInterceptor
Injects the collection properties into the Request It is also responsible of sending NOT_FOUND in case of requests involving not existing collections (that are not PUT)- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Constructor Summary
Constructors Constructor Description CollectionPropsInjector()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancheckCollection(MongoRequest request)protected voiddoesNotExists(MongoRequest request, MongoResponse response)voidhandle(MongoRequest request, MongoResponse response)voidinit(com.mongodb.MongoClient mclient)Makes sure that dbsDAO is instantiated after MongoClient initializationbooleanresolve(MongoRequest request, MongoResponse response)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.restheart.plugins.ExchangeTypeResolver
requestType, responseType
-
-
-
-
Method Detail
-
init
public void init(com.mongodb.MongoClient mclient)
Makes sure that dbsDAO is instantiated after MongoClient initialization- Parameters:
mclient-
-
handle
public void handle(MongoRequest request, MongoResponse response) throws Exception
- Specified by:
handlein interfaceInterceptor<MongoRequest,MongoResponse>- Parameters:
request-response-- Throws:
Exception
-
resolve
public boolean resolve(MongoRequest request, MongoResponse response)
- Specified by:
resolvein interfaceInterceptor<MongoRequest,MongoResponse>
-
doesNotExists
protected void doesNotExists(MongoRequest request, MongoResponse response) throws Exception
- Parameters:
request-response-- Throws:
Exception
-
checkCollection
public static boolean checkCollection(MongoRequest request)
- Parameters:
request-- Returns:
-
-