| | |
| | | import org.forgerock.opendj.config.client.ManagementContext; |
| | | import org.forgerock.opendj.ldap.AuthorizationException; |
| | | import org.forgerock.opendj.ldap.ErrorResultException; |
| | | import org.opends.server.admin.client.CommunicationException; |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | | import com.forgerock.opendj.cli.Argument; |
| | |
| | | |
| | | private AuthorizationException authze; |
| | | |
| | | private CommunicationException ce; |
| | | |
| | | private ErrorResultException ere; |
| | | |
| | | /** |
| | |
| | | } catch (ErrorResultException e) { |
| | | ere = e; |
| | | result = MenuResult.quit(); |
| | | } catch (CommunicationException e) { |
| | | ce = e; |
| | | result = MenuResult.quit(); |
| | | } |
| | | } |
| | | } |
| | |
| | | String typeUsage = getSubTypesUsage(d); |
| | | LocalizableMessage msg = ERR_DSCFG_ERROR_SUB_TYPE_UNRECOGNIZED.get( |
| | | name, r.getUserFriendlyName(), typeUsage); |
| | | clie = new ClientException(ReturnCode.TODO, msg); |
| | | clie = new ClientException(ReturnCode.APPLICATION_ERROR, msg); |
| | | result = MenuResult.quit(); |
| | | return; |
| | | } else { |
| | |
| | | } catch (ErrorResultException e) { |
| | | ere = e; |
| | | result = MenuResult.quit(); |
| | | } catch (CommunicationException e) { |
| | | ce = e; |
| | | result = MenuResult.quit(); |
| | | } |
| | | } |
| | | } |
| | |
| | | * If the server refuses to retrieve the managed object |
| | | * because the client does not have the correct |
| | | * privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an |
| | | * underlying communication problem. |
| | | */ |
| | | public MenuResult<ManagedObject<?>> find(ConsoleApplication app, |
| | | ManagementContext context, ManagedObjectPath<?, ?> path, |
| | | List<String> args) throws ClientException, CommunicationException, |
| | | List<String> args) throws ClientException, |
| | | AuthorizationException, ConcurrentModificationException, |
| | | DefinitionDecodingException, ManagedObjectDecodingException, |
| | | ManagedObjectNotFoundException { |
| | |
| | | |
| | | this.clie = null; |
| | | this.authze = null; |
| | | this.ce = null; |
| | | this.cme = null; |
| | | this.dde = null; |
| | | this.mode = null; |
| | |
| | | throw clie; |
| | | } else if (authze != null) { |
| | | throw authze; |
| | | } else if (ce != null) { |
| | | throw ce; |
| | | } else if (cme != null) { |
| | | throw cme; |
| | | } else if (dde != null) { |
| | |
| | | * If the server refuses to retrieve the managed object |
| | | * because the client does not have the correct |
| | | * privileges. |
| | | * @throws CommunicationException |
| | | * If the client cannot contact the server due to an |
| | | * underlying communication problem. |
| | | * @throws ClientException |
| | | * If one of the naming arguments referenced a managed |
| | | * object of the wrong type. |
| | |
| | | ConsoleApplication app, ManagementContext context, |
| | | ManagedObjectPath<?, ?> path, List<String> args) throws ClientException, |
| | | AuthorizationException, DefinitionDecodingException, |
| | | ManagedObjectDecodingException, CommunicationException, |
| | | ConcurrentModificationException, ManagedObjectNotFoundException |
| | | ManagedObjectDecodingException, ConcurrentModificationException, |
| | | ManagedObjectNotFoundException |
| | | { |
| | | ManagedObjectFinder finder = new ManagedObjectFinder(); |
| | | return finder.find(app, context, path, args); |
| | |
| | | * {@link MenuResult#quit()}, or {@link MenuResult#cancel()}, |
| | | * if the sub-command was run interactive and the user chose |
| | | * to quit or cancel. |
| | | * @throws CommunicationException |
| | | * If the server cannot be contacted. |
| | | * @throws ConcurrentModificationException |
| | | * If the parent managed object has been deleted. |
| | | * @throws AuthorizationException |
| | |
| | | RelationDefinition<C, S> r, |
| | | AbstractManagedObjectDefinition<? extends C, ? extends S> d) |
| | | throws AuthorizationException, ConcurrentModificationException, |
| | | CommunicationException, ClientException { |
| | | ClientException |
| | | { |
| | | if (d == null) { |
| | | d = r.getChildDefinition(); |
| | | } |