public final class

EntityType

extends Object
java.lang.Object
   ↳ org.mule.modules.jive.api.EntityType

Summary

Fields
private TypeOperation countOperation
private PayloadOperation createOperation
private ReferenceOperation deleteOperation
private EntityTypeName entityTypeName
private ReferenceOperation getOperation
private PayloadOperation putOperation
private String serviceUri
Public Constructors
EntityType(EntityTypeName entityType, String serviceNameException, PayloadOperation createOp, ReferenceOperation deleteOp, ReferenceOperation getOp, PayloadOperation putOp, TypeOperation countOp)
Public Methods
Long count(EntityType type, XmlMapper mapper, JiveClient resource)
Executes the count operation associated with this entity
Map<String, Object> create(EntityType type, Map<String, Object> entity, XmlMapper mapper, JiveClient resource)
Executes the create operation associated with this EntityType.
Map<String, Object> delete(EntityType type, String id, XmlMapper mapper, JiveClient resource)
Executes the delete method associated with this entity type.
Map<String, Object> get(String id, XmlMapper mapper, JiveClient resource)
Executes the get operation associated with this entity
String getBasePluralUri()
Generates the base uri for the service type given.
String getBaseSingularUri()
EntityTypeName getTypeName()
String getXmlRootElementName()
Map<String, Object> put(EntityType type, Map<String, Object> entityData, XmlMapper mapper, JiveClient resource)
Executes the update operation associated with this entity
Protected Methods
String getTypeUri()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private TypeOperation countOperation

private PayloadOperation createOperation

private ReferenceOperation deleteOperation

private EntityTypeName entityTypeName

private ReferenceOperation getOperation

private PayloadOperation putOperation

private String serviceUri

Public Constructors

public EntityType (EntityTypeName entityType, String serviceNameException, PayloadOperation createOp, ReferenceOperation deleteOp, ReferenceOperation getOp, PayloadOperation putOp, TypeOperation countOp)

Parameters
entityType
serviceNameException
createOp
deleteOp
getOp
putOp
countOp

Public Methods

public Long count (EntityType type, XmlMapper mapper, JiveClient resource)

Executes the count operation associated with this entity

Parameters
type The entity type to count
mapper The mapper to parse the data
resource The client that will make the request
Returns
  • The number of instances of the given entity

public Map<String, Object> create (EntityType type, Map<String, Object> entity, XmlMapper mapper, JiveClient resource)

Executes the create operation associated with this EntityType.

Parameters
type The entity type to create
entity The data to be send as payload in the post request
mapper The mapper to parsed the data
resource The client that will make the request
Returns
  • The response as a Map

public Map<String, Object> delete (EntityType type, String id, XmlMapper mapper, JiveClient resource)

Executes the delete method associated with this entity type.

Parameters
type The entity type to be deleted
id The path params separated by ':'
mapper The mapper to parsed the data
resource The client that will make the request
Returns
  • The server response as a Map

public Map<String, Object> get (String id, XmlMapper mapper, JiveClient resource)

Executes the get operation associated with this entity

Parameters
id The path params to separated by ':'
mapper The mapper to parse the data
resource The client that will make the request
Returns
  • The entity given by the server as a Map

public String getBasePluralUri ()

Generates the base uri for the service type given.

Returns
  • The service base uri. E.g. For the AVATAR service, the base uri would be /avatarService/avatars

public String getBaseSingularUri ()

public EntityTypeName getTypeName ()

public String getXmlRootElementName ()

Returns
  • the rootElement of the xml request

public Map<String, Object> put (EntityType type, Map<String, Object> entityData, XmlMapper mapper, JiveClient resource)

Executes the update operation associated with this entity

Parameters
type The entity to update
entityData The data to be send as payload
mapper The mapper to parse the data
resource The client that will make the request
Returns
  • The server response as a Map

Protected Methods

protected String getTypeUri ()

Returns
  • the serviceUri. E.g.: avatar -> "avatarService"