com.esri.core.internal.catalog
Class Group

java.lang.Object
  extended by com.esri.core.internal.catalog.Group
All Implemented Interfaces:
PageableResultType

public class Group
extends Object
implements PageableResultType

This class represents a Group on arcgis.com. A Groups resource may represent either a shared group (e.g., "San Bernadino Fires") or an organization (e.g., "Redlands Fire Department"). An organization is a type of group. The owner is automatically an administrator and is returned in the list of Admins.


Nested Class Summary
static class Group.SortField
          The fields of a Group stored as a back-end database table on the server, that can be used to sort search results
 
Constructor Summary
protected Group()
          Constructs an empty Group.
 
Method Summary
<T extends PageableResultType>
int
compare(T arg0)
          Internal method that all instances of a PageableResultType must implement.
 boolean fromJson(org.codehaus.jackson.JsonParser parser, com.esri.core.internal.catalog.Filter filter, Catalog catalog)
          Sets the internal state of the Group with values contained in the Json response.
 List<User> getAdmins()
          Returns the administrators of this Group
 Date getCreatedDate()
          Returns the date on which this Group was created
 String getDescription()
          Returns a description for this Group
 String getFeaturedItemId()
          Returns the featured Item Id associated with this Group.
 String getId()
          Returns the Id of this Group
 ResultCursor<Item> getItems(Item.ItemType type)
          Returns a list of items belonging to this group filtered by the Item type.
 List<User> getMembers()
          Returns the memebers of this Group
 Date getModifiedDate()
          Returns the Date when this Group was last modified
 User getOwner()
          Returns the owner of this Group
 String getPhone()
          Returns a phone number associated with this Group
 String getSnippet()
          Returns a description snippet for the Group
 List<String> getTags()
          Returns a list of tags associated with this Group
 byte[] getThumbnail()
          Returns a thumbnail for this group.
 String getTitle()
          Returns the Title of this Group
 boolean isInvitationOnly()
          Tells if Users can join this Group by invitation only.
 boolean isOrganization()
          Tells if this Group is an organization
 boolean isPublic()
          Tells if this Group is a public Group
protected  void testAndSetOwner(User user)
          Tests if the passed in User is the owner of this Group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

protected Group()
Constructs an empty Group. Users will never programmatically create an instance of a Group.

Method Detail

testAndSetOwner

protected void testAndSetOwner(User user)
Tests if the passed in User is the owner of this Group. This method is called when the User info for a signed in user is being constructed during which the Groups that the user belongs to are also parsed. If the signed in user owns one of the Groups, then maintaining a reference to the User avoid the construction of another User when the Group is asked for the Owner of the group. This method must be called only when parsing the details of the User

Parameters:
user -

getOwner

public User getOwner()
Returns the owner of this Group

Returns:
the owner

getAdmins

public List<User> getAdmins()
Returns the administrators of this Group

Returns:
a list of Users that represent administrator of this Group

getMembers

public List<User> getMembers()
Returns the memebers of this Group

Returns:
a list of Users that represent members of this Group

getId

public String getId()
Returns the Id of this Group

Returns:
the id

getTitle

public String getTitle()
Returns the Title of this Group

Returns:
the tile

isOrganization

public boolean isOrganization()
Tells if this Group is an organization

Returns:
true, if this Group is an organization, else returns false

isPublic

public boolean isPublic()
Tells if this Group is a public Group

Returns:
true, if this Group is a public Group, else returns false

isInvitationOnly

public boolean isInvitationOnly()
Tells if Users can join this Group by invitation only.

Returns:
true, if Users can join this Group by invitation only, else returns false

getDescription

public String getDescription()
Returns a description for this Group

Returns:
the description

getSnippet

public String getSnippet()
Returns a description snippet for the Group

Returns:
the snippet

getTags

public List<String> getTags()
Returns a list of tags associated with this Group

Returns:
the tags

getPhone

public String getPhone()
Returns a phone number associated with this Group

Returns:
the phone

getFeaturedItemId

public String getFeaturedItemId()
Returns the featured Item Id associated with this Group. The featured Item Id

Returns:
the featuredItemId

getThumbnail

public byte[] getThumbnail()
Returns a thumbnail for this group. The consuming application (Android/Java SE) can use platform specific APIs to construct a image out of the bytes returned.

Returns:
An array of the image bytes

getCreatedDate

public Date getCreatedDate()
Returns the date on which this Group was created

Returns:
the creation Date

getItems

public ResultCursor<Item> getItems(Item.ItemType type)
                            throws CatalogException
Returns a list of items belonging to this group filtered by the Item type. The Server does not support paging on queries that ask for Items belonging to a Group. Hence this method returns a List as opposed to a ResultCursor returns by various methods on the Catalog

Returns:
a list of Items
Throws:
CatalogException

getModifiedDate

public Date getModifiedDate()
Returns the Date when this Group was last modified

Returns:
the last modified Date

fromJson

public boolean fromJson(org.codehaus.jackson.JsonParser parser,
                        com.esri.core.internal.catalog.Filter filter,
                        Catalog catalog)
Sets the internal state of the Group with values contained in the Json response.

Specified by:
fromJson in interface PageableResultType
Parameters:
parser - the Json response
filter - a client side filter
catalog - a reference to the Catalog
Returns:
true if this Group qualifies to be returned to the client after the filter has been applied, else false

compare

public <T extends PageableResultType> int compare(T arg0)
Description copied from interface: PageableResultType
Internal method that all instances of a PageableResultType must implement.

Specified by:
compare in interface PageableResultType
Parameters:
arg0 - an instance of a PageableResultType
Returns:
-1 if this instance is less than arg0, 1 if it is greater, 0 if they are equal.


Copyright © 2012. All Rights Reserved.