Class EntitiesModelImpl
- java.lang.Object
-
- com.sun.identity.console.base.model.AMModelBase
-
- com.sun.identity.console.idm.model.EntitiesModelImpl
-
- All Implemented Interfaces:
AMAdminConstants,AMModel,EntitiesModel
public class EntitiesModelImpl extends AMModelBase implements EntitiesModel
-
-
Field Summary
-
Fields inherited from class com.sun.identity.console.base.model.AMModelBase
debug, locale, locationDN
-
Fields inherited from interface com.sun.identity.console.base.model.AMAdminConstants
ADMIN_CONSOLE_SERVICE, ADMIN_DISPLAY_ATTRIBUTE, ADMIN_DISPLAY_READONLY_ATTRIBUTE, AGENT_REPOSITORY_LOCATION_ATTR, AGENTS_NODE_ID, AMSDK_DEBUG_FILENAME, ATTR_USER_OLD_PASSWORD, ATTR_USER_PASSWORD, ATTR_USER_RESOURCE_OFFERING, ATTR_USER_STATUS, AUTH_CONFIG_SERVICE, CDM_CONTENT_TYPE_PROPERTY_NAME, CHOICES, CONFIGURATION_NODE_ID, CONSOLE_DEBUG_FILENAME, CONSOLE_LOCATION_DN, CONSOLE_ORG_CUSTOM_JSP_DIRECTORY, CONSOLE_UM_ENABLED_ATTR, CONSOLE_USER_ATTRS_SEARCH_KEY, CONSOLE_USER_SEARCH_KEY, CONSOLE_USER_SEARCH_RETURN_KEY, CORE_AUTH_SERVICE, CURRENT_ORG, CURRENT_PROFILE, CURRENT_REALM, DEFAULT_RB, DEFAULT_SEARCH_TIMEOUT, DISCOVERY_SERVICE, DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF, DISCOVERY_SERVICE_NAME_DYNAMIC_DISCO_ENTRIES, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_ID_MAPPER, DISCOVERY_SERVICE_PROVIDER_RESOURCE_ID_MAPPER_PROVIDER_ID, DISPLAY_ATTRIBUTE, DISPLAY_READONLY_ATTRIBUTE, DYN_LINK_COMPONENT_NAME, ENCRYPTED, FED_TAB_ID, G11N_SERIVCE_COMMON_NAME_FORMAT, G11N_SERVICE_NAME, IDREPO_SERVICE_NAME, IMAGES_PRIMARY_PRODUCT_NAME_PNG, OPERATION_ADD, OPERATION_EDIT, OPTIONAL_ATTRIBUTE, ORGANIZATION_NODE_ID, PASSWORD, PERMISSION_DELEGATE, PERMISSION_MODIFY, PERMISSION_READ, PG_SESSION_INIT_PAGETRAIL, PLATFORM_SERVICE, POLICY_SELECTED_RESPONSE_PROVIDER, POLICY_SERVICE, PREVIOUS_ORGANIZATION, PREVIOUS_REALM, PREVIOUS_TAB_ID, PW_RESET_SERVICE, REALM_NODE_ID, REQUIRED_ATTRIBUTE, REST_STS_SERVICE, ROLE_DISPLAY_OPTION_ATTRIBUTE_NAME, SAML_SERVICE, SAVE_VB_NAME, SERVICE_NAME, SESSION_SERVICE, SESSIONS_NODE_ID, SOAP_STS_SERVICE, SSO_TOKEN_LOCALE_ATTRIBUTE_NAME, SSO_TOKEN_ORGANIZATION_ATTRIBUTE_NAME, STRING_ACTIVE, STRING_FALSE, STRING_INACTIVE, SUBJECTS_NODE_ID, TAB_AGENT_PREFIX, TAB_AGENT_PREFIX_INT, URL_LOGIN, URL_LOGOUT, USER_SERVICE, USER_SERVICE_PREFERRED_LOCALE, VALUES
-
Fields inherited from interface com.sun.identity.console.base.model.AMModel
CONSOLE_PAGING_SIZE_ATTR, CONSOLE_SEARCH_RESULT_LIMIT_ATTR, CONSOLE_SEARCH_TIME_LIMIT_ATTR, DEFAULT_PAGE_SIZE, DEFAULT_SEARCH_RESULT_LIMIT, DEFAULT_SEARCH_TIME_LIMIT
-
Fields inherited from interface com.sun.identity.console.idm.model.EntitiesModel
AGENT_ROOT_URL, ATTR_NAME_DEVICE_KEY_VALUE, TF_NAME, TF_TYPE
-
-
Constructor Summary
Constructors Constructor Description EntitiesModelImpl(jakarta.servlet.http.HttpServletRequest req, Map map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMembers(String universalId, Set names)Adds an entities to a membership.voidaddMemberships(String universalId, Set membership)Adds an entity to a set of membership.voidassignService(String universalId, String serviceName, Map values)Assigns service to an entity.booleancanAddMember(String realmName, String idType, String containerIDType)Returns true of members can be added to a type.booleancanAssignService(String realmName, String idType)Returns true if services can be assigned to this entity type.voidcreateEntity(String realmName, String entityName, String idType, Map values)Creates an entity.voiddeleteEntities(String realmName, Set names)Deletes entities.MapgetAssignableServiceNames(String universalId)Returns assignable services.SetgetAssignedMembers(String universalId, Set members)Returns assigned members.SetgetAssignedMemberships(String universalId, Set memberships)Returns assigned memberships.MapgetAssignedServiceNames(String universalId)Returns assigned services.MapgetAttributeValues(String universalId, boolean bCreate)Returns attribute values of an entity object.SetgetAuthenticationChains(String realm)Returns all the authentication chains in a realm.MapgetDefaultAttributeValues(String idType, String agentType, boolean bCreate)Returns defauls values for an Entity Type.MapgetDefaultValues(String idType, String serviceName)Returns defaults values for an Entity Type.IdSearchResultsgetEntityNames(String realmName, String strType, String pattern)Returns entity names.StringgetEntityType()Returns the type ofentityobject for which the model was constructed.SetgetIdTypeBeMemberOf(String realmName, String idType)Returns a set of entity types that can be member of a given type.SetgetIdTypeMemberOf(String realmName, String idType)Returns a set of entity types of which a given type can have member of.SetgetMembers(String realmName, String universalId, String type)Returns members of an entity.SetgetMembership(String realmName, String universalId, String type)Returns membership of an entity.StringgetPropertiesViewBean(String name)Returns properties view bean URL for an attribute schema.StringgetPropertyXMLString(String realmName, String idType, String agentType, boolean bCreate, String viewbeanClassName)Returns property sheet XML for Entity Profile.MapgetServiceAttributeValues(String universalId, String serviceName)Returns service attribute values of an entity.StringgetServiceNameForIdType(String idType, String agentType)Returns service name of a given ID type.StringgetServicePropertySheetXML(String realmName, String serviceName, IdType idType, boolean bCreate, String viewbeanClassName)Returns the XML for property sheet view component.booleanhasDisplayableAttributes(String serviceName)This is a convenience method to check if there is displayable attributes for a given service.booleanhasUserAttributeSchema(String serviceName)Returns true if service has displayable user attributes.booleanisServicesSupported()Returnstrueif services is supported for the identity.voidmodifyEntity(String realmName, String universalId, Map values)Modifies profile of entity.voidremoveMembers(String universalId, Set names)Removes a set of entities from a membership.voidremoveMemberships(String universalId, Set membership)Removes an entity from a set of memberships.booleanrepoExists(String realmName)voidsetEndUser(boolean endUser)Set end user flag.voidsetServiceAttributeValues(String universalId, String serviceName, Map values)Set service attribute values to an entity.voidunassignServices(String universalId, Set serviceNames)Unassigns services from an entity.-
Methods inherited from class com.sun.identity.console.base.model.AMModelBase
encryptString, getAttributesToDisplay, getAuthenticatedOrgDN, getClientType, getConsoleAttributes, getConsoleDirectory, getErrorString, getGlobalPageSize, getGlobalSearchResultLimit, getGlobalSearchTimeOutLimit, getLocalizedServiceName, getLocalizedServiceName, getLocalizedString, getLocationDN, getLogoutURL, getPageSize, getRandomString, getRealmNames, getResourceBundle, getSearchResultLimit, getSearchTimeOutLimit, getServerInstanceForLogMsg, getServicePropertiesViewBeanURL, getServiceResourceBundle, getServiceSchemaManager, getSpecialUsers, getStartDN, getStartDN, getStartDSDN, getSupportedAgentTypes, getSupportedEntityTypes, getUniversalID, getUserAdditionalSearchAttributes, getUserDisplayAttribute, getUserDisplayName, getUserDN, getUserInfo, getUserLocale, getUserName, getUserOrganization, getUserSearchAttribute, getUserSSOToken, ignoreUserProfile, initialize, isAmadminUser, isAMSDKEnabled, isDisplayed, logEvent, setLocationDN, validateUserStatusEntry
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.identity.console.base.model.AMModel
getClientType, getConsoleDirectory, getErrorString, getLocalizedServiceName, getLocalizedString, getLocationDN, getPageSize, getRandomString, getRealmNames, getServicePropertiesViewBeanURL, getSpecialUsers, getStartDN, getStartDSDN, getSupportedAgentTypes, getSupportedEntityTypes, getUniversalID, getUserDisplayName, getUserDN, getUserLocale, getUserName, getUserSSOToken, ignoreUserProfile, isAmadminUser, isAMSDKEnabled, logEvent, setLocationDN
-
-
-
-
Constructor Detail
-
EntitiesModelImpl
public EntitiesModelImpl(jakarta.servlet.http.HttpServletRequest req, Map map)
-
-
Method Detail
-
getEntityType
public String getEntityType()
Returns the type ofentityobject for which the model was constructed.- Specified by:
getEntityTypein interfaceEntitiesModel- Returns:
- type of
entityobject being used.
-
setEndUser
public void setEndUser(boolean endUser)
Set end user flag.- Specified by:
setEndUserin interfaceEntitiesModel- Parameters:
endUser- end user flag.
-
getEntityNames
public IdSearchResults getEntityNames(String realmName, String strType, String pattern) throws AMConsoleException
Returns entity names.- Specified by:
getEntityNamesin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.pattern- Search Pattern.strType- Entity Type.- Throws:
AMConsoleException
-
getAttributeValues
public Map getAttributeValues(String universalId, boolean bCreate) throws AMConsoleException
Returns attribute values of an entity object.- Specified by:
getAttributeValuesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.bCreate- true for creation page- Returns:
- attribute values of an entity object.
- Throws:
AMConsoleException- if object cannot located.
-
getPropertyXMLString
public String getPropertyXMLString(String realmName, String idType, String agentType, boolean bCreate, String viewbeanClassName) throws AMConsoleException
Returns property sheet XML for Entity Profile.- Specified by:
getPropertyXMLStringin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.idType- Type of Entity.agentType- agent type.bCreate-truefor creation operation.viewbeanClassName- Class Name of View Bean.- Returns:
- property sheet XML for Entity Profile.
- Throws:
AMConsoleException- if XML cannot be obtained.
-
getDefaultAttributeValues
public Map getDefaultAttributeValues(String idType, String agentType, boolean bCreate) throws AMConsoleException
Returns defauls values for an Entity Type.- Specified by:
getDefaultAttributeValuesin interfaceEntitiesModel- Parameters:
idType- Type of Entity.agentType- mainly for agent typebCreate- true for creation page.- Throws:
AMConsoleException- if default values cannot be obtained.
-
createEntity
public void createEntity(String realmName, String entityName, String idType, Map values) throws AMConsoleException
Creates an entity.- Specified by:
createEntityin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.entityName- Name of Entity.idType- Type of Entity.values- Map of attribute name to Set of attribute values.- Throws:
AMConsoleException- if entity cannot be created.
-
modifyEntity
public void modifyEntity(String realmName, String universalId, Map values) throws AMConsoleException
Modifies profile of entity.- Specified by:
modifyEntityin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.universalId- Universal ID of the entity.values- Map of attribute name to set of attribute values.- Throws:
AMConsoleException- if entity cannot be located or modified.
-
deleteEntities
public void deleteEntities(String realmName, Set names) throws AMConsoleException
Deletes entities.- Specified by:
deleteEntitiesin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.names- Name of Entities to be deleted.- Throws:
AMConsoleException- if entity cannot be deleted.
-
canAssignService
public boolean canAssignService(String realmName, String idType)
Returns true if services can be assigned to this entity type.- Specified by:
canAssignServicein interfaceEntitiesModel- Parameters:
realmName- Name of Realm.idType- Type of Entity.- Returns:
- true if services can be assigned to this entity type.
-
getIdTypeMemberOf
public Set getIdTypeMemberOf(String realmName, String idType) throws AMConsoleException
Returns a set of entity types of which a given type can have member of.- Specified by:
getIdTypeMemberOfin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.idType- Type of Entity.- Returns:
- a set of entity types of which a given type can have member of.
- Throws:
AMConsoleException- ifidTypeis not supported.
-
getIdTypeBeMemberOf
public Set getIdTypeBeMemberOf(String realmName, String idType) throws AMConsoleException
Returns a set of entity types that can be member of a given type.- Specified by:
getIdTypeBeMemberOfin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.idType- Type of Entity.- Returns:
- a set of entity types that can be member of a given type.
- Throws:
AMConsoleException- ifidTypeis not supported.
-
canAddMember
public boolean canAddMember(String realmName, String idType, String containerIDType) throws AMConsoleException
Returns true of members can be added to a type.- Specified by:
canAddMemberin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.idType- Type of Entity.containerIDType- Type of Entity of Container.- Returns:
- true of members can be added to a type.
- Throws:
AMConsoleException
-
getServiceNameForIdType
public String getServiceNameForIdType(String idType, String agentType)
Returns service name of a given ID type.- Specified by:
getServiceNameForIdTypein interfaceEntitiesModel- Parameters:
idType- ID Type.agentType- Agent Type.- Returns:
- service name of a given ID type.
-
getMembership
public Set getMembership(String realmName, String universalId, String type) throws AMConsoleException
Returns membership of an entity.- Specified by:
getMembershipin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.universalId- Universal ID of the entity.type- Type of membership.- Returns:
- membership of an entity.
- Throws:
AMConsoleException- if members cannot be returned.
-
getMembers
public Set getMembers(String realmName, String universalId, String type) throws AMConsoleException
Returns members of an entity.- Specified by:
getMembersin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.universalId- Universal ID of the entity.type- Type of membership.- Returns:
- members of an entity.
- Throws:
AMConsoleException- if members cannot be returned.
-
addMemberships
public void addMemberships(String universalId, Set membership) throws AMConsoleException
Adds an entity to a set of membership.- Specified by:
addMembershipsin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.membership- Set of Universal ID of membership.- Throws:
AMConsoleException- if membership addition fails.
-
addMembers
public void addMembers(String universalId, Set names) throws AMConsoleException
Adds an entities to a membership.- Specified by:
addMembersin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the membership.names- Set of Universal ID of entities.- Throws:
AMConsoleException- if membership addition fails.
-
removeMemberships
public void removeMemberships(String universalId, Set membership) throws AMConsoleException
Removes an entity from a set of memberships.- Specified by:
removeMembershipsin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.membership- Set of Universal ID of membership.- Throws:
AMConsoleException- if membership removal fails.
-
removeMembers
public void removeMembers(String universalId, Set names) throws AMConsoleException
Removes a set of entities from a membership.- Specified by:
removeMembersin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the membership.names- Set of Universal ID of entities.- Throws:
AMConsoleException- if membership removal fails.
-
getAssignedMemberships
public Set getAssignedMemberships(String universalId, Set memberships) throws AMConsoleException
Returns assigned memberships.- Specified by:
getAssignedMembershipsin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.memberships- Set of assignable memberships.- Throws:
AMConsoleException- if memberships information cannot be determined.
-
getAssignedMembers
public Set getAssignedMembers(String universalId, Set members) throws AMConsoleException
Returns assigned members.- Specified by:
getAssignedMembersin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.members- Set of assignable members.- Throws:
AMConsoleException- if members information cannot be determined.
-
getAssignedServiceNames
public Map getAssignedServiceNames(String universalId) throws AMConsoleException
Returns assigned services. Map of service name to its display name.- Specified by:
getAssignedServiceNamesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.- Returns:
- assigned services.
- Throws:
AMConsoleException- if service information cannot be determined.
-
getAssignableServiceNames
public Map getAssignableServiceNames(String universalId) throws AMConsoleException
Returns assignable services. Map of service name to its display name.- Specified by:
getAssignableServiceNamesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.- Returns:
- assignable services.
- Throws:
AMConsoleException- if service information cannot be determined.
-
getServicePropertySheetXML
public String getServicePropertySheetXML(String realmName, String serviceName, IdType idType, boolean bCreate, String viewbeanClassName) throws AMConsoleException
Returns the XML for property sheet view component.- Specified by:
getServicePropertySheetXMLin interfaceEntitiesModel- Parameters:
realmName- Name of Realm.serviceName- Name of service.idType- type of Identity.bCreate- true if the property sheet is for identity creation.viewbeanClassName- Class Name of View Bean.- Returns:
- the XML for property sheet view component.
- Throws:
AMConsoleException- if XML cannot be created.
-
assignService
public void assignService(String universalId, String serviceName, Map values) throws AMConsoleException
Assigns service to an entity.- Specified by:
assignServicein interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.serviceName- Name of service names.values- Attribute Values of the service.- Throws:
AMConsoleException- if service cannot be assigned.
-
getDefaultValues
public Map getDefaultValues(String idType, String serviceName) throws AMConsoleException
Returns defaults values for an Entity Type.- Specified by:
getDefaultValuesin interfaceEntitiesModel- Parameters:
idType- ID Type.serviceName- Name of service name.- Throws:
AMConsoleException- if default values cannot be obtained.
-
unassignServices
public void unassignServices(String universalId, Set serviceNames) throws AMConsoleException
Unassigns services from an entity.- Specified by:
unassignServicesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.serviceNames- Set of service names to be unassigned.- Throws:
AMConsoleException- if services cannot be unassigned.
-
getPropertiesViewBean
public String getPropertiesViewBean(String name)
Returns properties view bean URL for an attribute schema.- Specified by:
getPropertiesViewBeanin interfaceEntitiesModel- Parameters:
name- Name of attribute schema.- Returns:
- properties view bean URL for an attribute schema.
-
getServiceAttributeValues
public Map getServiceAttributeValues(String universalId, String serviceName) throws AMConsoleException
Returns service attribute values of an entity.- Specified by:
getServiceAttributeValuesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.serviceName- Name of service name.- Returns:
- service attribute values of entity.
- Throws:
AMConsoleException- if values cannot be returned.
-
setServiceAttributeValues
public void setServiceAttributeValues(String universalId, String serviceName, Map values) throws AMConsoleException
Set service attribute values to an entity.- Specified by:
setServiceAttributeValuesin interfaceEntitiesModel- Parameters:
universalId- Universal ID of the entity.serviceName- Name of service name.values- Attribute values.- Throws:
AMConsoleException- if values cannot be set.
-
hasUserAttributeSchema
public boolean hasUserAttributeSchema(String serviceName)
Returns true if service has displayable user attributes.- Specified by:
hasUserAttributeSchemain interfaceEntitiesModel- Parameters:
serviceName- Name of service.- Returns:
- true if service has user attribute schema.
-
hasDisplayableAttributes
public boolean hasDisplayableAttributes(String serviceName)
This is a convenience method to check if there is displayable attributes for a given service.- Specified by:
hasDisplayableAttributesin interfaceEntitiesModel- Parameters:
serviceName- name of service being displayed.- Returns:
- true if the service schema has at least one attribute to display.
-
getAuthenticationChains
public Set getAuthenticationChains(String realm) throws AMConsoleException
Returns all the authentication chains in a realm.- Specified by:
getAuthenticationChainsin interfaceEntitiesModel- Parameters:
realm- Name of realm.- Returns:
- all the authentication chains in a realm.
- Throws:
AMConsoleException- if authentication chains cannot be returned.+
-
isServicesSupported
public boolean isServicesSupported()
Returnstrueif services is supported for the identity.- Specified by:
isServicesSupportedin interfaceEntitiesModel- Returns:
trueif services is supported for the identity.
-
repoExists
public boolean repoExists(String realmName)
- Specified by:
repoExistsin interfaceEntitiesModel
-
-