本文整理汇总了Java中javax.naming.directory.InvalidAttributesException类的典型用法代码示例。如果您正苦于以下问题:Java InvalidAttributesException类的具体用法?Java InvalidAttributesException怎么用?Java InvalidAttributesException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InvalidAttributesException类属于javax.naming.directory包,在下文中一共展示了InvalidAttributesException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newInstance
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public static SelectionPolicy newInstance(JUniformObject configObject) throws InvalidAttributesException {
if (configObject == null) {
throw new InvalidAttributesException("EnvironmentSelectionPolicy is null");
}
String policyType = configObject.getProperty("Type").toStringDefault("");
if (policyType == null) {
throw new InvalidAttributesException("EnvironmentSelectionPolicy.Type is null");
}
switch(policyType) {
default:
throw new InvalidAttributesException("Unknown environment selection policy type: "+policyType);
case "random":
return new SelectionPolicyRandom(configObject);
}
}
示例2: Officer
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
/**
* Instantiates a new object of this class
*
* @param station The station name identifier (such as SPVM, etc)
*/
public Officer(ORB orb, StationType.StationServerName stationName) throws IOException, InvalidAttributesException
{
this.stationName = stationName;
ior = IORLogger.getReference(stationName);
if(ior == null || ior.isEmpty()) {
throw new InvalidAttributesException("There was an error with the IOR for this client");
}
synchronized(this) {
officerId = officerCount++;
}
log = new Logger(System.getProperty("user.dir") + "/", stationName.name() + officerId);
org.omg.CORBA.Object obj = orb.string_to_object(ior);
IRecordManager myManager = IRecordManagerHelper.narrow(obj);
this.manager = myManager;
}
示例3: build
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public DistributedServerGroup build() throws InvalidAttributesException {
if (code == null || code.isEmpty()) {
throw new InvalidAttributesException("DistributedServerGroup.code is empty or null");
}
if (servers == null || servers.isEmpty()) {
throw new InvalidAttributesException("DistributedServerGroup.servers is empty or null");
}
if (selectionPolicy == null) {
throw new InvalidAttributesException("DistributedServerGroup.selectionPolicy is empty or null");
}
return new DistributedServerGroup(this);
}
示例4: findDataStoreWriter
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
private void findDataStoreWriter() throws InvalidAttributesException {
if (getDataStoreType().equals(DataStoreType.MONGO)) {
writer = new MongoWriter();
} else if (getDataStoreType().equals(DataStoreType.ES)) {
writer = new ESWriter();
} else if(getDataStoreType().equals(DataStoreType.COUCH)) {
writer = new CouchWriter();
} else {
throw new InvalidAttributesException("The requested datastore support is not available !.");
}
}
示例5: main
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public static void main(String[] args) throws MongoException, IOException, InvalidAttributesException {
ResourceBundle rb = ResourceBundle.getBundle("import", Locale.US);
DataImporter importer = new DataImporter(rb);
importer.setAutoCommitSize(Integer.valueOf(rb.getString("autoCommitSize")));
importer.doDataImport(rb.getString("sql-data-config-file"));
}
示例6: home
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "/get", method = RequestMethod.GET, produces = "application/json; charset=UTF-8")
public @ResponseBody
String home(@RequestParam(value = "feed", required = false, defaultValue = "") String key,
@RequestParam(value = "limit", required = false, defaultValue = "5") int limit,
@RequestParam(value = "offset", required = false, defaultValue = "0") int offset) throws InvalidAttributesException {
return new Gson().toJson(repo.getNewsFeed(key, limit, offset));
}
示例7: getSemGroups
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "/{semester}", method = RequestMethod.GET, produces = { "application/json; charset=UTF-8" })
public @ResponseBody
ResponseEntity getSemGroups(@PathVariable(value = "semester") String semester) throws IOException,
URISyntaxException, InvalidAttributesException {
List<Faculty> faculties = repo.getSemGroups(semester);
if (faculties.isEmpty()) {
if(semester.equalsIgnoreCase("cal")){
return new ResponseEntity(getCalendar(), HttpStatus.OK);
}
throw new InvalidAttributesException();
}
return new ResponseEntity(faculties, HttpStatus.OK);
}
示例8: getSemGroupByFaculty
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "/{semester}/{fak}", method = RequestMethod.GET, produces = { "application/json; charset=UTF-8" })
public @ResponseBody
Faculty getSemGroupByFaculty(@PathVariable(value = "semester") String semester,
@PathVariable(value = "fak") String fak) throws IOException, URISyntaxException, InvalidAttributesException {
Faculty factulty = repo.getSemGroups(semester, fak);
if (factulty == null) {
throw new InvalidAttributesException();
}
return factulty;
}
示例9: getCourse
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "/{semester}/{fak}/courses/{id}", method = RequestMethod.GET, produces = { "application/json; charset=UTF-8" })
public @ResponseBody
Subject getCourse(@PathVariable(value = "semester") String semester, @PathVariable(value = "fak") String fak,
@RequestParam(value = "semgroup") String semgroup, @PathVariable(value = "id") String id)
throws InvalidAttributesException, IOException {
return repo.getCourse(semester, semgroup, id);
}
示例10: getNews
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public List<News> getNews() throws UnsupportedEncodingException, InvalidAttributesException {
Map<String, String> rssMap = getNewsCategories();
List<News> news = new ArrayList<News>();
for (Entry<String, String> entry : rssMap.entrySet()) {
JsonObject response = getNewsFeed(entry.getKey(), 1, 0);
int status = response.get("responseStatus").getAsInt();
if (response != null && response.has("responseData")) {
response = response.get("responseData").getAsJsonObject();
}
News newsFeed = new News();
newsFeed.setId(entry.getKey());
newsFeed.setLink(entry.getValue());
String title = null;
if (status == 200 && response != null && response.has("feed")) {
title = response.get("feed").getAsJsonObject().get("title").getAsString();
title =
(!title.isEmpty()) ? title : response.get("feed").getAsJsonObject().get("description")
.getAsString();
}
newsFeed.setTitle("" + title);
news.add(newsFeed);
}
return news;
}
示例11: getNewsFeed
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public JsonObject getNewsFeed(String key, int limit, int offset)
throws InvalidAttributesException {
limit = limit + offset;
JsonObject response = parser.parse(getFeed(key, limit, offset)).getAsJsonObject();
JsonObject responseData = null;
int status = response.get("responseStatus").getAsInt();
if (status == 200 && response != null && response.has("responseData")
&& response.get("responseData") != null) {
responseData = response.get("responseData").getAsJsonObject();
} else {
throw new InvalidAttributesException("the given feed-key was not found");
}
if (offset > 0) {
if (status == 200 && responseData != null && responseData.has("feed")) {
JsonObject feed = responseData.get("feed").getAsJsonObject();
JsonArray entries = feed.get("entries").getAsJsonArray();
JsonArray responseEntries = new JsonArray();
for (int i = 0; i < entries.size(); i++) {
if (i >= offset) {
responseEntries.add(entries.get(i));
}
}
feed.add("entries", responseEntries);
}
}
response.add("responseData", responseData);
return response;
}
示例12: SelectionPolicyRandom
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public SelectionPolicyRandom(JUniformObject configObject) throws InvalidAttributesException {
// no attributes required
}
示例13: DataImporter
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
public DataImporter(ResourceBundle rb) throws MongoException, InvalidAttributesException, MalformedURLException, IOException {
dataStoreType = DataStoreType.valueOf(rb.getString("dataStoreType").toUpperCase());
findDataStoreWriter();
getWriter().initConnection(rb);
}
示例14: home
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "", method = RequestMethod.GET, produces = { "application/json; charset=UTF-8" })
public @ResponseBody
String home() throws InvalidAttributesException, IOException {
return "";
}
示例15: getCalendar
import javax.naming.directory.InvalidAttributesException; //导入依赖的package包/类
@RequestMapping(value = "/cal", method = RequestMethod.GET, produces = { "application/json; charset=UTF-8" })
public @ResponseBody
Map<String, String> getCalendar() throws InvalidAttributesException, IOException {
return repo.getCalendar();
}