Package org.gitana.platform.client.api

# Class ClientImpl

java.lang.Object
org.gitana.platform.support.GitanaObjectImpl
org.gitana.platform.client.document.DocumentImpl
org.gitana.platform.client.platform.AbstractPlatformDocumentImpl
org.gitana.platform.client.api.ClientImpl

All Implemented Interfaces:
  `Serializable`, `Client`, `Document`, `PlatformDocument`, `AccessControllable`, `Copyable`, `Referenceable`, `Selfable`, `TitleDescription`, `Transferable`, `TypedID`, `org.gitana.platform.GitanaObject`, `org.gitana.platform.JSONable`

public class ClientImpl extends AbstractPlatformDocumentImpl implements Client

Author:
  uzi
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class org.gitana.platform.support.GitanaObjectImpl

`serialVersionUID`

### Fields inherited from interface org.gitana.platform.client.api.Client

`FIELD_ACCESS_TOKEN_VALIDITY_SECONDS, FIELD_ALLOW_AUTO_APPROVAL_FOR_IMPLICIT_FLOW, FIELD_ALLOW_GUEST_LOGIN, FIELD_ALLOW_OPENDRIVER_AUTHENTICATION, FIELD_AUTHORIZED_GRANT_TYPES, FIELD_DEFAULT_TENANT_ID, FIELD_DOMAIN_URLS, FIELD_ENABLED, FIELD_IS_TENANT_DEFAULT, FIELD_KEY, FIELD_REFRESH_TOKEN_VALIDITY_SECONDS, FIELD_REGISTERED_REDIRECT_URI, FIELD_SCOPE, FIELD_SECRET`

### Fields inherited from interface org.gitana.platform.client.document.Document

`FIELD_ID, SYSTEM, SYSTEM_CREATED_BY, SYSTEM_CREATED_ON, SYSTEM_MODIFIED_BY, SYSTEM_MODIFIED_ON`

### Fields inherited from interface org.gitana.platform.client.support.TitleDescription

`FIELD_DESCRIPTION, FIELD_TITLE`

## Constructor Summary

Constructors
Constructor
Description
`ClientImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)`

## Method Summary

Modifier and Type
Method
Description
`void`
`delete()`
Delete
`boolean`
`equals(Object object)`
`int`
`getAccessTokenValiditySeconds()`
`ACL`
`getACL()`
`List<String>`
`getACL(String principalId)`
Retrieve the authorities that a principal has.
`boolean`
`getAllowAutoApprovalForImplicitFlow()`
`boolean`
`getAllowGuestLogin()`
`boolean`
`getAllowOpenDriverAuthentication()`
`Map<String,Map<String,org.gitana.platform.services.authority.AuthorityGrant>>`
`getAuthorityGrants(List<String> principalIds)`
Acquires a map of authority grants for a set of principals.
`Collection<String>`
`getAuthorizedGrantTypes()`
`String`
`getDefaultTenantId()`
`List<String>`
`getDomainUrls()`
`boolean`
`getEnabled()`
`boolean`
`getIsTenantDefault()`
`String`
`getKey()`
`int`
`getRefreshTokenValiditySeconds()`
`String`
`getRegisteredRedirectUri()`
`protected String`
`getResourceUri()`
`Collection<String>`
`getScope()`
`String`
`getSecret()`
`String`
`getTypeId()`
`void`
`grant(String principalId, String authorityId)`
Grants an authority to a principal.
`void`
`grant(DomainPrincipal principal, String authorityId)`
`boolean`
`hasAuthority(String principalId, String authorityId)`
Checks whether the principal has the given authority over this object.
`boolean`
`hasAuthority(DomainPrincipal principal, String authorityId)`
`boolean`
`hasPermission(String principalId, String permissionId)`
Checks whether the principal has the given permission over this object.
`boolean`
`hasPermission(DomainPrincipal principal, String authorityId)`
`void`
`reload()`
Reload
`void`
`revoke(String principalId, String authorityId)`
Revokes an authority for a principal.
`void`
`revoke(DomainPrincipal principal, String authorityId)`
`void`
`revokeAll(String principalId)`
Revoke all authorities for a principal.
`void`
`revokeAll(DomainPrincipal principal)`
`void`
`setAccessTokenValiditySeconds(int accessTokenValiditySeconds)`
`void`
`setAllowAutoApprovalForImplicitFlow(boolean allowAutoApprovalForImplicitFlow)`
`void`
`setAllowGuestLogin(boolean allowGuestLogin)`
`void`
`setAllowOpenDriverAuthentication(boolean allowOpenDriverAuthentication)`
`void`
`setAuthorizedGrantTypes(Collection<String> authorizedGrantTypes)`
`void`
`setDefaultTenantId(String tenantId)`
`void`
`setDomainUrls(List<String> domainUrls)`
`void`
`setEnabled(boolean enabled)`
`void`
`setIsTenantDefault(boolean isTenantDefault)`
`void`
`setKey(String key)`
`void`
`setRefreshTokenValiditySeconds(int refreshTokenValiditySeconds)`
`void`
`setRegisteredRedirectUri(String registeredRedirectUri)`
`void`
`setScope(Collection<String> scope)`
`void`
`setSecret(String secret)`
`void`
`update()`
Update

### Methods inherited from class org.gitana.platform.client.platform.AbstractPlatformDocumentImpl

`copy, copy, copyAsync, copyAsync, exportArchive, exportArchive, exportArchive, getCluster, getDriver, getFactory, getPlatform, getPlatformId, getRemote, importArchive, importArchive, importArchive, ref`

### Methods inherited from class org.gitana.platform.client.document.DocumentImpl

`dateCreated, dateModified, getCreatedBy, getDescription, getId, getModifiedBy, getSystemObject, getTitle, isSaved, mergeProperties, mergePropertyIfExists, reload, reload, setDescription, setId, setSaved, setTitle`

### Methods inherited from class org.gitana.platform.support.GitanaObjectImpl

`_objectGetFloat, _objectGetInt, _objectGetLong, _objectGetObject, _objectGetString, _objectSet, get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, putObject, remove, set, toJSON, toJSONString, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.gitana.platform.client.support.Copyable

`copy, copy, copyAsync, copyAsync`

### Methods inherited from interface org.gitana.platform.client.document.Document

`dateCreated, dateModified, getCreatedBy, getId, getModifiedBy, getSystemObject, isSaved, reload, reload, setId, setSaved`

### Methods inherited from interface org.gitana.platform.GitanaObject

`get, getArray, getAsJsonNode, getBigDecimal, getBoolean, getDouble, getInt, getLong, getObject, getObject, getString, has, putAll, putAll, remove, set`

### Methods inherited from interface org.gitana.platform.JSONable

`toJSON, toJSONString`

### Methods inherited from interface org.gitana.platform.client.platform.PlatformDocument

`getPlatform, getPlatformId`

### Methods inherited from interface org.gitana.platform.client.support.Referenceable

`ref`

### Methods inherited from interface org.gitana.platform.client.support.TitleDescription

`getDescription, getTitle, setDescription, setTitle`

### Methods inherited from interface org.gitana.platform.client.support.Transferable

`exportArchive, exportArchive, exportArchive, importArchive, importArchive, importArchive`

### Methods inherited from interface org.gitana.platform.client.support.TypedID

`getId`

## Constructor Details

### ClientImpl

public ClientImpl(Platform platform, com.fasterxml.jackson.databind.node.ObjectNode obj, boolean isSaved)

## Method Details

### getTypeId

public String getTypeId()

Specified by:
  `getTypeId` in interface `TypedID`

### getResourceUri

protected String getResourceUri()

Specified by:
  `getResourceUri` in class `AbstractPlatformDocumentImpl`

### equals

public boolean equals(Object object)

Overrides:
  `equals` in class `Object`

### getKey

public String getKey()

Specified by:
  `getKey` in interface `Client`

### setKey

public void setKey(String key)

Specified by:
  `setKey` in interface `Client`

### getSecret

public String getSecret()

Specified by:
  `getSecret` in interface `Client`

### setSecret

public void setSecret(String secret)

Specified by:
  `setSecret` in interface `Client`

### getDomainUrls

public List<String> getDomainUrls()

Specified by:
  `getDomainUrls` in interface `Client`

### setDomainUrls

public void setDomainUrls(List<String> domainUrls)

Specified by:
  `setDomainUrls` in interface `Client`

### getIsTenantDefault

public boolean getIsTenantDefault()

Specified by:
  `getIsTenantDefault` in interface `Client`

### setIsTenantDefault

public void setIsTenantDefault(boolean isTenantDefault)

Specified by:
  `setIsTenantDefault` in interface `Client`

### getDefaultTenantId

public String getDefaultTenantId()

Specified by:
  `getDefaultTenantId` in interface `Client`

### setDefaultTenantId

public void setDefaultTenantId(String tenantId)

Specified by:
  `setDefaultTenantId` in interface `Client`

### getAuthorizedGrantTypes

public Collection<String> getAuthorizedGrantTypes()

Specified by:
  `getAuthorizedGrantTypes` in interface `Client`

### setAuthorizedGrantTypes

public void setAuthorizedGrantTypes(Collection<String> authorizedGrantTypes)

Specified by:
  `setAuthorizedGrantTypes` in interface `Client`

### getScope

public Collection<String> getScope()

Specified by:
  `getScope` in interface `Client`

### setScope

public void setScope(Collection<String> scope)

Specified by:
  `setScope` in interface `Client`

### getRegisteredRedirectUri

public String getRegisteredRedirectUri()

Specified by:
  `getRegisteredRedirectUri` in interface `Client`

### setRegisteredRedirectUri

public void setRegisteredRedirectUri(String registeredRedirectUri)

Specified by:
  `setRegisteredRedirectUri` in interface `Client`

### getAllowOpenDriverAuthentication

public boolean getAllowOpenDriverAuthentication()

Specified by:
  `getAllowOpenDriverAuthentication` in interface `Client`

### setAllowOpenDriverAuthentication

public void setAllowOpenDriverAuthentication(boolean allowOpenDriverAuthentication)

Specified by:
  `setAllowOpenDriverAuthentication` in interface `Client`

### getEnabled

public boolean getEnabled()

Specified by:
  `getEnabled` in interface `Client`

### setEnabled

public void setEnabled(boolean enabled)

Specified by:
  `setEnabled` in interface `Client`

### getAllowAutoApprovalForImplicitFlow

public boolean getAllowAutoApprovalForImplicitFlow()

Specified by:
  `getAllowAutoApprovalForImplicitFlow` in interface `Client`

### setAllowAutoApprovalForImplicitFlow

public void setAllowAutoApprovalForImplicitFlow(boolean allowAutoApprovalForImplicitFlow)

Specified by:
  `setAllowAutoApprovalForImplicitFlow` in interface `Client`

### getAccessTokenValiditySeconds

public int getAccessTokenValiditySeconds()

Specified by:
  `getAccessTokenValiditySeconds` in interface `Client`

### setAccessTokenValiditySeconds

public void setAccessTokenValiditySeconds(int accessTokenValiditySeconds)

Specified by:
  `setAccessTokenValiditySeconds` in interface `Client`

### getRefreshTokenValiditySeconds

public int getRefreshTokenValiditySeconds()

Specified by:
  `getRefreshTokenValiditySeconds` in interface `Client`

### setRefreshTokenValiditySeconds

public void setRefreshTokenValiditySeconds(int refreshTokenValiditySeconds)

Specified by:
  `setRefreshTokenValiditySeconds` in interface `Client`

### getAllowGuestLogin

public boolean getAllowGuestLogin()

Specified by:
  `getAllowGuestLogin` in interface `Client`

### setAllowGuestLogin

public void setAllowGuestLogin(boolean allowGuestLogin)

Specified by:
  `setAllowGuestLogin` in interface `Client`

### reload

public void reload()
Description copied from interface: `Selfable`
Reload

Specified by:
  `reload` in interface `Selfable`

### update

public void update()
Description copied from interface: `Selfable`
Update

Specified by:
  `update` in interface `Selfable`

### delete

public void delete()
Description copied from interface: `Selfable`
Delete

Specified by:
  `delete` in interface `Selfable`

### getACL

public ACL getACL()

Specified by:
  `getACL` in interface `AccessControllable`
Returns:
  access control list

### getACL

public List<String> getACL(String principalId)
Description copied from interface: `AccessControllable`
Retrieve the authorities that a principal has.

Specified by:
  `getACL` in interface `AccessControllable`
Parameters:
  `principalId` -
Returns:
  list

### grant

public void grant(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Grants an authority to a principal.

Specified by:
  `grant` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -

### grant

public void grant(DomainPrincipal principal, String authorityId)

Specified by:
  `grant` in interface `AccessControllable`

### revoke

public void revoke(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Revokes an authority for a principal.

Specified by:
  `revoke` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -

### revoke

public void revoke(DomainPrincipal principal, String authorityId)

Specified by:
  `revoke` in interface `AccessControllable`

### revokeAll

public void revokeAll(String principalId)
Description copied from interface: `AccessControllable`
Revoke all authorities for a principal.

Specified by:
  `revokeAll` in interface `AccessControllable`
Parameters:
  `principalId` -

### revokeAll

public void revokeAll(DomainPrincipal principal)

Specified by:
  `revokeAll` in interface `AccessControllable`

### hasAuthority

public boolean hasAuthority(String principalId, String authorityId)
Description copied from interface: `AccessControllable`
Checks whether the principal has the given authority over this object.

Specified by:
  `hasAuthority` in interface `AccessControllable`
Parameters:
  `principalId` -
  `authorityId` -
Returns:

### hasAuthority

public boolean hasAuthority(DomainPrincipal principal, String authorityId)

Specified by:
  `hasAuthority` in interface `AccessControllable`

### getAuthorityGrants

public Map<String,Map<String,org.gitana.platform.services.authority.AuthorityGrant>> getAuthorityGrants(List<String> principalIds)
Description copied from interface: `AccessControllable`
Acquires a map of authority grants for a set of principals.

Specified by:
  `getAuthorityGrants` in interface `AccessControllable`
Parameters:
  `principalIds` -
Returns:

### hasPermission

public boolean hasPermission(String principalId, String permissionId)
Description copied from interface: `AccessControllable`
Checks whether the principal has the given permission over this object.

Specified by:
  `hasPermission` in interface `AccessControllable`
Parameters:
  `principalId` -
  `permissionId` -
Returns:

### hasPermission

public boolean hasPermission(DomainPrincipal principal, String authorityId)

Specified by:
  `hasPermission` in interface `AccessControllable`