/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2014 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]"
*/
/**
*
* @author Laszlo Hordos
*/
public class ODataUtils {
private ODataUtils() {
//This is a util class
}
static ODataPrimitiveValue primitiveBuild(ODataObjectFactory factory, EdmPrimitiveType type, Object value) {
} else {
throw new InvalidAttributeValueException("Expecting value ${type.defaultType} but found ${value.class}");
}
}
return valueBuilder.build()
}
static ODataComplexValue<? extends CommonODataProperty> complexBuild(ODataObjectFactory factory, EdmComplexType
}
}
return complex
}
if (edmProperty.isPrimitive()) {
if (edmProperty.isCollection()) {
}
}
}
}
} else {
if (value instanceof Collection) {
}
}
}
if (edmProperty.isCollection()) {
}
def collectionValue = factory.newCollectionValue(edmProperty.annotationsTargetFQN.fullQualifiedNameAsString)
throw new InvalidAttributeValueException("Expecting Map to create ComplexValue for '${edmProperty.name}'");
}
//TODO What if Null?
}
}
} else {
if (value instanceof Collection) {
}
throw new InvalidAttributeValueException("Expecting Map to create ComplexValue for '${edmProperty.name}'");
}
}
}
}
/**
* Get the String representing plural format of a entity set.
*
* @return the String representing plural format of a entity set
*/
}
/**
* Build a URI pointing to an Entity
*
* @param builder
* @param edmEntityType
* @param id
* @return
*/
}
org.apache.http.client.utils.URIBuilder b = new org.apache.http.client.utils.URIBuilder(uri.build());
//b.addParameter("api-version", "1.21-preview");
/*
Beginning with version 1.5, the Graph API namespace is changed from Microsoft.WindowsAzure.ActiveDirectory
to Microsoft.DirectoryServices. Earlier versions of the Graph API continue to use the previous namespace;
for example, $filter=isof(‘Microsoft.WindowsAzure.ActiveDirectory.Contact’).
*/
return b.build();
}
"A conflicting object with one or more of the specified property values is present in the directory.".equals(exception.ODataError.message)) {
} else {
}
}
return entityType
}
return null
}
}
return type
}
}
if (null != keyProperty) {
if (keyProperty.hasPrimitiveValue()) {
} else {
}
}
}
}
}