OpenIDMELResolver.java revision 8d50d56a56b1ad306c415e4fc0578a22a62ec9a0
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright © 2011 ForgeRock AS. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/**
* Custom ExpressionResolver for OpenIDM
* @author $author$
* @version $Revision$ $Date$
*/
public class OpenIDMELResolver extends ELResolver {
private ServerContext router;
// according to javadoc, can only be a String
context.setPropertyResolved(true);
return router;
} else {
context.setPropertyResolved(true);
}
}
}
}
return null;
}
}
}
}
return true;
}
}
return Object.class;
}
return null;
}
return Object.class;
}
/**
* Called when openidm.xxx() is called from an Expression
* @return result of the call
*/
public Object invoke(ELContext context, Object base, Object method, Class<?>[] paramTypes, Object[] params) {
if (base instanceof ServerContext) {
context.setPropertyResolved(true);
try {
// switch (SimpleJsonResource.Method.valueOf((String) method)) {
// case read:
// return router.read((String) params[0]);
// case query:
// return router.query((String) params[0], (Map<String, Object>) params[1]);
// case create:
// router.create((String) params[0], (Map<String, Object>) params[1]);
// return null;
// case update:
// router.update((String) params[0], (String) params[1], (Map<String, Object>) params[2]);
// return null;
// case delete:
// router.delete((String) params[0], (String) params[1]);
// return null;
// case action:
// return router.action((String) params[0], (Map<String, Object>) params[1]);
// case patch:
// router.patch((String) params[0], (String) params[1], (Patch) params[2]);
// return null;
// default:
// throw new BadRequestException("The requested method is not available: " + method);
// }
} catch (ResourceException ex) {
}
}
return null;
}
}