Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.65 update #1

Merged
merged 2 commits into from
Dec 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.settings/
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SDK</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
</projectDescription>
152 changes: 151 additions & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,132 @@ Copyright 2012 Shared Learning Collaborative, LLC

This product includes software developed by SLC (http://www.slcedu.org/).

%% The following software may be included in this product: JAX-RS
Use of any of this software is governed by the terms of the license below:

Copyright (c) YYYY Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
http://glassfish.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.

When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.

GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.

Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"

Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.

%% The following software may be included in this product: Jersey-Client
Use of any of this software is governed by the terms of the license below:

Copyright (c) YYYY Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
and Distribution License("CDDL") (collectively, the "License"). You
may not use this file except in compliance with the License. You can
obtain a copy of the License at
http://glassfish.java.net/public/CDDL+GPL_1_1.html
or packager/legal/LICENSE.txt. See the License for the specific
language governing permissions and limitations under the License.

When distributing the software, include this License Header Notice in each
file and include the License file at packager/legal/LICENSE.txt.

GPL Classpath Exception:
Oracle designates this particular file as subject to the "Classpath"
exception as provided by Oracle in the GPL Version 2 section of the License
file that accompanied this code.

Modifications:
If applicable, add the following below the License Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyright [year] [name of copyright owner]"

Contributor(s):
If you wish your version of this file to be governed by only the CDDL or
only the GPL Version 2, indicate your decision by adding "[Contributor]
elects to include this software in this distribution under the [CDDL or GPL
Version 2] license." If you don't indicate a single choice of license, a
recipient has the option to distribute your version of this file under
either the CDDL, the GPL Version 2 or to extend the choice of license to
its licensees as provided above. However, if you add GPL Version 2 code
and therefore, elected the GPL Version 2 license, then the option applies
only if the new code is made subject to such option by the copyright
holder.


%% The following software may be included in this product: Apache Commons IO
Use of any of this software is governed by the terms of the license below:

Copyright 2002-2012 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

%% The following software may be included in this product: Apache Commons CLI
Use of any of this software is governed by the terms of the license below:

Copyright 2002-2012 The Apache Software Foundation

This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

%% The following software may be included in this product: Jackson
Use of any of this software is governed by the terms of the license below:

Copyright (c) 2007- Tatu Saloranta, [email protected]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
Expand All @@ -16,3 +140,29 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

%% The following software may be included in this product: Scribe
Use of any of this software is governed by the terms of the license below:

The MIT License

Copyright (c) 2010 Pablo Fernandez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


Binary file added client/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target/
7 changes: 7 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.8.5</version>
<scope>test</scope>
</dependency>

</dependencies>

Expand Down
45 changes: 27 additions & 18 deletions client/src/main/java/org/slc/sli/api/client/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,51 @@

package org.slc.sli.api.client;

import java.net.URL;
import java.util.List;
import java.util.Map;

/**
* Generic entity returned by the SLI API ReSTful service. Each entity has a unique
* identifier, a data collection, and a collection of resource links. This interface provides
* the most stripped down interface required by all entities.
*
*
* Each entity returned by the SLI API contains a type string. This type identifies
* the SLI data model type returned by the API. When creating or updating an entity, the
* entity type must be provided. The API will reject entities that are not typed.
*
*
* Data is represented as a map of maps. Value types are defined by the SLI data model.
* The API validates all incoming entities and rejects entities that are missing required
* fields or contain invalid values.
*
*
* The API does entity validation against the SLI XML Schema. Attempts to create or update
* an entity using data that does not conform to this schema are rejected by the API.
*
*
* Each Entity returned by the API contains one or more links to associated resources.
* These resources are context-sensitive. These links are read-only and cannot be altered
* by client applications.
*
*
* The fields returned by the API and the available resource links are context-sensitive based
* on the role(s) assigned by an identity provider and associations between the user and
* the resource, if any. Responses contain only the information available to the user
* based on these roles and associations. Resources that are not associated with the
* current user are not returned by the API.
*
*
* @author asaarela
*/
public interface Entity {

/** Key to locate 'links' field of the Entity. */
static final String LINKS_KEY = "links";

/** Key to locate the Entity's id field */
static final String ENTITY_ID_KEY = "id";

/**
* Get the data associated with this entity. If the entity has no data, returns
* an empty map. The key into this map is the property name. The values of this
* map can one of the following JSON types:
*
*
* <ul>
* <li>List</li>
* <li>Map</li>
Expand All @@ -71,32 +72,40 @@ public interface Entity {
* <li>Double</li>
* <li>String</li>
* </ul>
*
*
* @return Map of data.
*/
Map<String, Object> getData();

/**
* Get the type name for this entity.
*
*
* @return EntityType for this entity
*
*
* @see org.slc.sli.api.client.constants.EntityNames for a list of available names.
*/
String getEntityType();

/**
* Get the ID for the entity. Each entity in the system has a unique identifier
* assigned to it.
*
*
* @return id String
*/
String getId();

/**
* Get a list of links for this entity. If the entity has no links, returns an empty list.
*
*
* @return a List of links.
*/
@Deprecated
List<Link> getLinks();

/**
* Get a map of resource name to link.
*
* @return a Map of resource name to link
*/
Map<String, URL> getLinkMap();
}
Loading