All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.internet2.middleware.grouper.ws.soap_v2_3.WsAttributeDefSaveLiteResult Maven / Gradle / Ivy

There is a newer version: 5.13.5
Show newest version
/*******************************************************************************
 * Copyright 2012 Internet2
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 ******************************************************************************/
package edu.internet2.middleware.grouper.ws.soap_v2_3;

import edu.internet2.middleware.grouper.misc.GrouperVersion;
import edu.internet2.middleware.grouper.ws.WsResultCode;

/**
 * 
 * results for the AttributeDefs save call.
 * 
 * result code:
 * code of the result for this AttributeDef overall
 * SUCCESS: means everything ok
 * ATTRIBUTE_DEF_NOT_FOUND: cant find the AttributeDef
 * ATTRIBUTE_DEF_DUPLICATE: found multiple AttributeDefs
 * 
* @author mchyzer */ public class WsAttributeDefSaveLiteResult { /** * result code of a request */ public static enum WsAttributeDefSaveLiteResultCode implements WsResultCode { /** didnt find the attribute defs, inserted them (lite http status code 201) (success: T) */ SUCCESS_INSERTED(201), /** found the attribute defs, saved them (lite http status code 201) (success: T) */ SUCCESS_UPDATED(201), /** found the attribute defs, no changes needed (lite http status code 201) (success: T) */ SUCCESS_NO_CHANGES_NEEDED(201), /** either overall exception, or one or more attribute defs had exceptions (lite http status code 500) (success: F) */ EXCEPTION(500), /** invalid query (e.g. if everything blank) (lite http status code 400) (success: F) */ INVALID_QUERY(400), /** the attribute def was not found (lite http status code 404) (success: F) */ ATTRIBUTE_DEF_NOT_FOUND(404), /** user not allowed (lite http status code 403) (success: F) */ INSUFFICIENT_PRIVILEGES(403), /** the stem was not found (lite http status code 404) (success: F) */ STEM_NOT_FOUND(404); /** get the name label for a certain version of client * @param clientVersion * @return name */ @Override public String nameForVersion(GrouperVersion clientVersion) { return this.name(); } /** * if this is a successful result * @return true if success */ @Override public boolean isSuccess() { return this.name().startsWith("SUCCESS"); } /** http status code for rest/lite e.g. 200 */ private int httpStatusCode; /** * status code for rest/lite e.g. 200 * @param statusCode */ private WsAttributeDefSaveLiteResultCode(int statusCode) { this.httpStatusCode = statusCode; } /** * @see edu.internet2.middleware.grouper.ws.WsResultCode#getHttpStatusCode() */ @Override public int getHttpStatusCode() { return this.httpStatusCode; } } /** * metadata about the result */ private WsResultMeta resultMetadata = new WsResultMeta(); /** * metadata about the result */ private WsResponseMeta responseMetadata = new WsResponseMeta(); /** * AttributeDef saved */ private WsAttributeDef wsAttributeDef; /** * @return the resultMetadata */ public WsResultMeta getResultMetadata() { return this.resultMetadata; } /** * @see edu.internet2.middleware.grouper.ws.rest.WsResponseBean#getResponseMetadata() * @return the response metadata */ public WsResponseMeta getResponseMetadata() { return this.responseMetadata; } /** * @param responseMetadata1 the responseMetadata to set */ public void setResponseMetadata(WsResponseMeta responseMetadata1) { this.responseMetadata = responseMetadata1; } /** * @param resultMetadata1 the resultMetadata to set */ public void setResultMetadata(WsResultMeta resultMetadata1) { this.resultMetadata = resultMetadata1; } /** * @return the wsAttributeDef */ public WsAttributeDef getWsAttributeDef() { return this.wsAttributeDef; } /** * @param wsAttributeDef1 the wsAttributeDef to set */ public void setWsAttributeDef(WsAttributeDef wsAttributeDef1) { this.wsAttributeDef = wsAttributeDef1; } /** * empty */ public WsAttributeDefSaveLiteResult() { //empty } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy