Skip to content

Commit

Permalink
White noise: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Oct 4, 2017
1 parent 969395b commit 1a634ca
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -710,8 +710,7 @@ public String handleResult(final Directory.Users.List request, final Users value
} while (!paged && StringUtil.isNotBlank(nextPageToken));

if (paged && StringUtil.isNotBlank(nextPageToken)) {
LOG.info("Paged Search was requested and next token is:{0}",
nextPageToken);
LOG.info("Paged Search was requested and next token is:{0}", nextPageToken);
((SearchResultsHandler) handler).handleResult(new SearchResult(nextPageToken, 0));
}
} catch (IOException e) {
Expand Down Expand Up @@ -1290,8 +1289,12 @@ public void test() {
}

@Override
public Uid update(ObjectClass objectClass, Uid uid, Set<Attribute> replaceAttributes,
OperationOptions options) {
public Uid update(
final ObjectClass objectClass,
final Uid uid,
final Set<Attribute> replaceAttributes,
final OperationOptions options) {

final AttributesAccessor attributesAccessor = new AttributesAccessor(replaceAttributes);

Uid uidAfterUpdate = uid;
Expand Down Expand Up @@ -1398,15 +1401,14 @@ public Object handleNotFound(IOException e) {
final Directory.Groups.Patch patch = GroupHandler.updateGroup(
configuration.getDirectory().groups(), uid.getUidValue(), attributesAccessor);
if (null != patch) {
uidAfterUpdate =
execute(patch, new RequestResultHandler<Directory.Groups.Patch, Group, Uid>() {
uidAfterUpdate = execute(patch, new RequestResultHandler<Directory.Groups.Patch, Group, Uid>() {

@Override
public Uid handleResult(Directory.Groups.Patch request, Group value) {
LOG.ok("Group is Updated:{0}", value.getId());
return new Uid(value.getId(), value.getEtag());
}
});
@Override
public Uid handleResult(Directory.Groups.Patch request, Group value) {
LOG.ok("Group is Updated:{0}", value.getId());
return new Uid(value.getId(), value.getEtag());
}
});
}
Attribute members = attributesAccessor.find(MEMBERS_ATTR);
if (null != members && null != members.getValue()) {
Expand Down Expand Up @@ -1533,18 +1535,16 @@ public Object handleNotFound(IOException e) {
if (StringUtil.isNotBlank(role)) {
String[] ids = uid.getUidValue().split("/");
if (ids.length == 2) {
final Directory.Members.Patch patch =
GroupHandler.updateMembers(
configuration.getDirectory().members(), ids[0], ids[1], role).setFields(EMAIL_ETAG);
uidAfterUpdate =
execute(patch, new RequestResultHandler<Directory.Members.Patch, Member, Uid>() {
final Directory.Members.Patch patch = GroupHandler.updateMembers(
configuration.getDirectory().members(), ids[0], ids[1], role).setFields(EMAIL_ETAG);
uidAfterUpdate = execute(patch, new RequestResultHandler<Directory.Members.Patch, Member, Uid>() {

@Override
public Uid handleResult(Directory.Members.Patch request, Member value) {
LOG.ok("Member is updated:{0}/{1}", request.getGroupKey(), value.getEmail());
return GroupHandler.generateMemberId(request.getGroupKey(), value);
}
});
@Override
public Uid handleResult(Directory.Members.Patch request, Member value) {
LOG.ok("Member is updated:{0}/{1}", request.getGroupKey(), value.getEmail());
return GroupHandler.generateMemberId(request.getGroupKey(), value);
}
});
} else {
throw new UnknownUidException("Invalid ID format");
}
Expand All @@ -1553,15 +1553,14 @@ public Uid handleResult(Directory.Members.Patch request, Member value) {
final Directory.Orgunits.Patch patch = OrgunitsHandler.updateOrgunit(
configuration.getDirectory().orgunits(), uid.getUidValue(), attributesAccessor);
if (null != patch) {
uidAfterUpdate =
execute(patch, new RequestResultHandler<Directory.Orgunits.Patch, OrgUnit, Uid>() {
uidAfterUpdate = execute(patch, new RequestResultHandler<Directory.Orgunits.Patch, OrgUnit, Uid>() {

@Override
public Uid handleResult(Directory.Orgunits.Patch request, OrgUnit value) {
LOG.ok("OrgUnit is updated:{0}", value.getName());
return OrgunitsHandler.generateOrgUnitId(value);
}
});
@Override
public Uid handleResult(Directory.Orgunits.Patch request, OrgUnit value) {
LOG.ok("OrgUnit is updated:{0}", value.getName());
return OrgunitsHandler.generateOrgUnitId(value);
}
});
}
} else if (LICENSE_ASSIGNMENT.equals(objectClass)) {
final Licensing.LicenseAssignments.Patch patch =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public static Directory.Members.Patch updateMembers(
try {
return service.patch(groupKey, memberKey, content).setFields(GoogleAppsConnector.EMAIL_ETAG);
} catch (IOException e) {
LOG.warn(e, "Failed to initialize Members#Insert");
LOG.warn(e, "Failed to initialize Members#Update");
throw ConnectorException.wrap(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ public static Directory.Users.Insert createUser(Directory.Users users, Attribute
}

public static Directory.Users.Patch updateUser(
Directory.Users users, String groupKey, AttributesAccessor attributes) {
Directory.Users users, String userKey, AttributesAccessor attributes) {

User content = null;

Expand Down Expand Up @@ -714,10 +714,10 @@ public static Directory.Users.Patch updateUser(
return null;
}
try {
return users.patch(groupKey, content).setFields(GoogleAppsConnector.ID_ETAG);
return users.patch(userKey, content).setFields(GoogleAppsConnector.ID_ETAG);
// } catch (HttpResponseException e){
} catch (IOException e) {
LOG.warn(e, "Failed to initialize Groups#Patch");
LOG.warn(e, "Failed to initialize Users#Patch");
throw ConnectorException.wrap(e);
}
}
Expand Down

0 comments on commit 1a634ca

Please sign in to comment.